jsmidgen icon indicating copy to clipboard operation
jsmidgen copied to clipboard

Allow Add System Exclusive Messages to Track

Open tcdw opened this issue 1 year ago • 5 comments

On one of projects I am working on, I want to add MIDI system exclusive messages for my custom need; however, there are no way of adding that (at least officially).

After reading the source code, I found it's able to pass a object with toBytes function. So, I am using this workaround:

// add GM reset
track.addEvent({
    toBytes() {
        // Channel 1 (1 byte), message start (1 byte), message length (1 byte), message (5 bytes)
        return [0x00, 0xF0, 0x05, 0x7E, 0x7F, 0x09, 0x01, 0xF7];
    },
}); // add `as any` before the right parentheses if you using TypeScript

It would be much appreciated to add this function officially, since sometimes MIDI sysex is still need to be used.

tcdw avatar Sep 09 '23 06:09 tcdw

I m curious to know how do you use this? Do you generate a midi file and play that in a DAW to transmit sysex?

walmik avatar Sep 09 '23 07:09 walmik

I m curious to know how do you use this? Do you generate a midi file and play that in a DAW to transmit sysex?

Because I want to generate MIDI that using some of Yamaha XG's exclusive features (for instance, echo and aftertouch) and being able play instantly on MIDI players.

I admit it sounds like a XY Problem, since I am making a purely hobby project.

tcdw avatar Sep 09 '23 07:09 tcdw

I too have a hobby project and it depends on jsmidgen. I d like sysex support too! In my usecase I want to send sysex to Disting Ex to manipulate it's settings. These are not musical setting such as aftertouch, instead they are settings of the various algorithms on it.

walmik avatar Sep 09 '23 18:09 walmik

Maybe I should pick the project up again 🤔

dingram avatar Sep 09 '23 18:09 dingram

Absolutely!

A TS rewrite that exports ES module would be a great next plan too!

walmik avatar Sep 10 '23 00:09 walmik