Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 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;
- }
Add Comment
Please, Sign In to add comment