diff options
Diffstat (limited to 'arduino/Laserharfe')
-rw-r--r-- | arduino/Laserharfe/Laserharfe.ino | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arduino/Laserharfe/Laserharfe.ino b/arduino/Laserharfe/Laserharfe.ino index 8ad5f56..9f0d025 100644 --- a/arduino/Laserharfe/Laserharfe.ino +++ b/arduino/Laserharfe/Laserharfe.ino | |||
@@ -200,6 +200,25 @@ void handle_midi(char *command) { | |||
200 | // MidiUSB.flush(); | 200 | // MidiUSB.flush(); |
201 | } | 201 | } |
202 | 202 | ||
203 | void midi_playnote(int channel, int note, int octave_offset ) { | ||
204 | midi_pitchbend(channel, 0); | ||
205 | midiEventPacket_t p = { 0x9, 0x90 | channel, note + 12 * octave_offset, 0x7f }; | ||
206 | MidiUSB.sendMIDI(p); | ||
207 | } | ||
208 | |||
209 | void midi_silencenote( int channel, int note, int octave_offset ) { | ||
210 | midiEventPacket_t p = { 0x8, 0x80 | channel, note + 12 * octave_offset, 0x7f }; | ||
211 | MidiUSB.sendMIDI(p); | ||
212 | } | ||
213 | |||
214 | void midi_pitchbend( int channel, int pitch ) { | ||
215 | pitch += 8192; | ||
216 | if (pitch < 0) pitch = 0; | ||
217 | if (pitch > 16383) pitch = 16383, | ||
218 | midiEventPacket_t p = { 0xe, 0xe0 | channel, 0x7f & pitch, 0x7f & (pitch>>7) }; | ||
219 | MidiUSB.sendMIDI(p); | ||
220 | } | ||
221 | |||
203 | void handle_configure(char *command) { | 222 | void handle_configure(char *command) { |
204 | 223 | ||
205 | } | 224 | } |