npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

transmidi

v1.0.0

Published

Translate midi messages

Downloads

6

Readme

 _                                 _     _ _
| |_ _ __ __ _ _ __  ___ _ __ ___ (_) __| (_)
| __| '__/ _` | '_ \/ __| '_ ` _ \| |/ _` | |
| |_| | | (_| | | | \__ \ | | | | | | (_| | |
 \__|_|  \__,_|_| |_|___/_| |_| |_|_|\__,_|_|
 

Translate midi messages

Motivation

I have a Roland FC-100 MKII pedal board I wanted to use with Bias FX 2 and I didn't find any tool to translate program changes to the control changes required to command Bias FX 2.

Install

npm i -g transmidi

Usage without installation

npx transmidi [translations-file]

Usage

transmidi [translations-file]

Input selection

First, you'll select your midi input:

screenshot

Output selection

Then, the midi output where translated messages will go to:

screenshot

And after that you can start having fun!

screenshot

On the left you'll see the input messages and on the right you'll see your translations.

Print help / usage

transmidi --help

Monitor mode

Start in monitor mode (will print all messages on the selected input):

transmidi

screenshot

Sample translations file

const translations = {
  192: {
    0: [176, 81, 0],
    1: [176, 82, 0],
    2: [176, 83, 0],
    3: [176, 84, 0],
    4: [176, 85, 0],
    5: [176, 86, 0],
    6: [176, 87, 0],
    7: [176, 88, 0]
  },
  176: {
    80: {
      127: [176, 81, 0],
      0: [176, 82, 0]
    }
  }
}

module.exports = translations

Translations file

The translations file is what you need to tell transmidi how to translate a given input into the desired input.

Midi messages are composed of: [status, data1, data2]. You can read more in midi, the core midi package used by transmidi to work its magic.

Message can have one or two data elements.

Let's say you want to translate [192, 0] into [176, 81, 0], that's:

{
  192: {
    0: [176, 81, 0]
  }
}

If you have a message with two data elements, for example, [176, 80, 0], and you want to translate it into [176, 81, 0], you'll need:

{
  176: {
    81: {
      0: [176, 81, 0]
    } 
  }
}

Simple right?! 😁

If you know some JavaScript, you'll notice you match input messages with an object and translations are always arrays.

And you don't need to know the input midi messages beforehand, transmidi got you covered there too! Just run transmidi and you'll get into monitor mode, where you'll be able to see all the midi messages generated by your device.

Enjoy!