From Foo Development Product Wiki
Jump to: navigation, search


This source is an expanded version of rbd2midi by gigadude from

[github link]


js2midi - convert any number of joystick event streams to a single midi event stream

The purpose being to make it support any number of drum sets and have 100% configurable output events as well as support analog axes as well as buttons. with zero lag.


on first run, a .js2midirc will be created in your $HOME directory. midi event numbers are listed at the top for convenience. The format should be pretty self-explanatory.




lines are ignored after the first # symbol. DEVICE is the joystick device in /dev a#, b# there # is and integer that maps to axis or button number from the most recently defined device to a midi instrument event number EVENT.


> g++ -o js2midi js2midi.cpp -lasound -lpthread


run the script


> # start up js2midi

> js2midi &

Opened "js2midi" [129:0]

Connecting interfaces

> # find out the available ports:

> aconnect -iol

client 0: 'System' [type=kernel]

0 'Timer '

1 'Announce '

Connecting To: 15:0

client 14: 'Midi Through' [type=kernel]

0 'Midi Through Port-0'

client 128: 'TiMidity' [type=user]

0 'TiMidity port 0 '

1 'TiMidity port 1 '

2 'TiMidity port 2 '

3 'TiMidity port 3 '

client 129: 'js2midi' [type=user]

0 'js2midi'

client 130: 'Hydrogen' [type=user]

0 'Hydrogen Midi-In'

> # connect to hydrogen (

> aconnect 129:0 130:0

> # you can just as easily redirect to another midi device like a midi keyboard

> aconnect 129 14