Created
April 9, 2018 09:55
-
-
Save jpcima/6e1a3132bc640f66ff15805d90daadff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
g++ -o miditest miditest.cc -lrtmidi && ./miditest | |
*/ | |
#include <rtmidi/RtMidi.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() | |
{ | |
RtMidiOut midiout(RtMidi::LINUX_ALSA, "midiout test case"); | |
midiout.openVirtualPort(); | |
printf("Press enter for NoteOn\n"); | |
while (fgetc(stdin) != '\n'); | |
unsigned char noteon[] = {0x90, 36, 127}; | |
midiout.sendMessage(noteon, 3); | |
printf("Press enter for NoteOff\n"); | |
while (fgetc(stdin) != '\n'); | |
unsigned char noteoff[] = {0x80, 36, 127}; | |
midiout.sendMessage(noteoff, 3); | |
if (0) { | |
// temporize | |
sleep(1); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment