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.
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
toBytesfunction. So, I am using this workaround:It would be much appreciated to add this function officially, since sometimes MIDI sysex is still need to be used.