summaryrefslogtreecommitdiff
path: root/midi-sdl.c
diff options
context:
space:
mode:
authorerdgeist <erdgeist@bauklotz.fritz.box>2018-04-16 15:36:14 +0200
committererdgeist <erdgeist@bauklotz.fritz.box>2018-04-16 15:36:14 +0200
commit8c978328b0d69216a1e60c3330c07d83c1408e12 (patch)
treed15e231961a57e0b9a84bd500bab69fcfe56e625 /midi-sdl.c
parent1b07b4d2ea8f716bef832b84bd38a2d0cdabb9b4 (diff)
Add velocity code
Diffstat (limited to 'midi-sdl.c')
-rw-r--r--midi-sdl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/midi-sdl.c b/midi-sdl.c
index 7509859..a458528 100644
--- a/midi-sdl.c
+++ b/midi-sdl.c
@@ -9,9 +9,9 @@ int midi_init() {
9 return 0; 9 return 0;
10} 10}
11 11
12void midi_playnote( int channel, int note, int octave_offset ) { 12void midi_playnote( int channel, int note, int octave_offset, int velocity ) {
13 char out[32]; 13 char out[32];
14 int b = sprintf(out,"M%02X0020\nM%02X%02X%02X\n", 0xe0 | channel, 0x90 | channel, note + 12 * octave_offset, 0x7f); 14 int b = sprintf(out,"M%02X0020\nM%02X%02X%02X\n", 0xe0 | channel, 0x90 | channel, note + 12 * octave_offset, velocity&127);
15 if (g_harfe_connected && (g_harfe_fd != -1)) 15 if (g_harfe_connected && (g_harfe_fd != -1))
16 write(g_harfe_fd, out, b); 16 write(g_harfe_fd, out, b);
17} 17}