Exemple #1
0
 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");
     }
 }
Exemple #2
0
 public static MidiMessage ChangeControl(int controller, int value, int channel)
 {
     MidiMessage.ValidateChannel(channel);
     return(new MidiMessage(176 + channel - 1, controller, value));
 }
Exemple #3
0
 public static MidiMessage ChangePatch(int patch, int channel)
 {
     MidiMessage.ValidateChannel(channel);
     return(new MidiMessage(192 + channel - 1, patch, 0));
 }