private static void ValidateNoteParameters(int note, int volume, int channel) { MidiMessage.ValidateChannel(channel); if (note < 0 || note > 127) { throw new ArgumentOutOfRangeException("note", "Note number must be in the range 0-127"); } if (volume < 0 || volume > 127) { throw new ArgumentOutOfRangeException("volume", "Velocity must be in the range 0-127"); } }
public static MidiMessage ChangeControl(int controller, int value, int channel) { MidiMessage.ValidateChannel(channel); return(new MidiMessage(176 + channel - 1, controller, value)); }
public static MidiMessage ChangePatch(int patch, int channel) { MidiMessage.ValidateChannel(channel); return(new MidiMessage(192 + channel - 1, patch, 0)); }