diff options
| author | Ralf Kistner <ralf@embarkmobile.com> | 2014-09-16 10:20:12 +0200 |
|---|---|---|
| committer | Ralf Kistner <ralf@embarkmobile.com> | 2014-09-16 10:20:12 +0200 |
| commit | 4221b24b041dbaaf58d0e3bcfc7a5c202cc31260 (patch) | |
| tree | 06372e9584280a69c7d03a6d82c34af5b4ea9322 /README.md | |
| parent | 2b8d8a707df119125d2f78fc6c707274a2888886 (diff) | |
Add example to change controller value
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -49,6 +49,16 @@ void noteOff(byte channel, byte pitch, byte velocity) { MIDIUSB.write(noteOff); } +// First parameter is the event type (0x0B = control change). +// Second parameter is the event type, combined with the channel. +// Third parameter is the control number number (0-119). +// Fourth parameter is the control value (0-127). + +void controlChange(byte channel, byte control, byte value) { + MIDIEvent event = {0x0B, 0xB0 | channel, pitch, velocity}; + MIDIUSB.write(event); +} + void loop() { noteOn(0, 48, 64); // Channel 0, middle C, normal velocity MIDIUSB.flush(); @@ -57,6 +67,8 @@ void loop() { noteOff(0, 48, 64); // Channel 0, middle C, normal velocity MIDIUSB.flush(); delay(1500); + + // controlChange(0, 10, 65); // Set the value of controller 10 on channel 0 to 65 } void setup() { |
