#include #include #include #include "midi.h" #include "main.h" int midi_init() { return 0; } void midi_playnote( int channel, int note, int octave_offset, int velocity ) { char out[32]; int b = sprintf(out,"M%02X0020\nM%02X%02X%02X\n", 0xe0 | channel, 0x90 | channel, note + 12 * octave_offset, velocity&127); if (g_harfe_connected && (g_harfe_fd != -1)) write(g_harfe_fd, out, b); } void midi_silencenote( int channel, int note, int octave_offset ) { char out[10]; int b = sprintf(out,"M%02X%02X%02X\n", 0x80 | channel, note + 12 * octave_offset, 0); if (g_harfe_connected && (g_harfe_fd != -1)) write(g_harfe_fd, out, b); } void midi_pitchbend( int channel, int pitch ) { char out[10]; pitch += 8192; if (pitch < 0) pitch = 0; if (pitch > 16383) pitch = 16383; int b = sprintf(out,"M%02X%02X%02X\n", 0xe0 | channel, 0x7f & pitch, 0x7f & (pitch>>7)); if (g_harfe_connected && (g_harfe_fd != -1)) write(g_harfe_fd, out, b); } //void midi_controller_event( int saite, int value );