midiout.cpp 538 B

12345678910111213141516171819202122232425262728
  1. #include <iostream>
  2. #include "Output.h"
  3. using namespace std;
  4. using namespace midi;
  5. int main()
  6. {
  7. Output out;
  8. out.openVirtualPort();
  9. cout << "press button to start... " << flush;
  10. cin.ignore();
  11. out.sendMessage(NoteOnMessage(3, 45, 127));
  12. cout << "press button to send... " << flush;
  13. cin.ignore();
  14. MessageList l;
  15. for(int i=10; i<120; i+=10) {
  16. std::shared_ptr<Message> msg = std::make_shared<NoteOnMessage>(1, i, 100);
  17. l.push_back(msg);
  18. }
  19. out.sendMessages(l);
  20. return 0;
  21. }