Midi channel value changed automatically?

Hi !

Etonnant non ?

Hi there,

the MIDI spec only allows channels to have values from 1 to 16 inclusive. Channel 0 is therefore not a valid channel. Similarly, channel 17 would also not be a valid channel.

Rather than throw an error, Sonic Pi simply gives you the closest valid channel. Therefore, if you specify a channel of 0 or lower it will revert to 1 and on the flip side if you specify a channel of 17 or higher it will give you a channel of 16.

I hope that this makes sense :slight_smile:

ok it’s a choice. To me it would be better to send an error otherwise people can keep thinking 0 is a correct value :-).