ryohey / signal

Online MIDI Editor: signal
https://signal.vercel.app
MIT License
1.27k stars 142 forks source link

Invalid channels over 16 #313

Closed robertnhart closed 7 months ago

robertnhart commented 8 months ago

MIDI only has channels from 1 to 16. But in Signal, if you keep adding tracks, Signal will eventually make tracks that use an invalid channel 17 or higher.

Here is a way to force the channels to always be from 1 to 16:

Go to the file src/common/track/trackFactory.ts In the function emptyTrack, find the following line:

track.channel = channel

and change it to:

track.channel = channel & 15

...

Related discussion on Discord: When Signal saves to a MIDI file, the invalid channel numbers cause Signal to create corrupted MIDI messages in the file.