From 17220d8e06998160ba0f8678649e62872fda9727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Meki=C4=87?= Date: Sat, 30 Dec 2017 01:14:35 +0100 Subject: Hardcode instrument, otherwise play notes --- drumgizmo/input/ossmidi.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drumgizmo/input') diff --git a/drumgizmo/input/ossmidi.cc b/drumgizmo/input/ossmidi.cc index 4473557..03e8481 100644 --- a/drumgizmo/input/ossmidi.cc +++ b/drumgizmo/input/ossmidi.cc @@ -90,6 +90,7 @@ void OSSInputEngine::stop() void OSSInputEngine::pre() { + events.clear(); } @@ -103,6 +104,12 @@ void OSSInputEngine::run(size_t pos, size_t len, std::vector& events) if (masked_note == NOTE_ON) { int note = buf[1]; int velocity = buf[2]; + event_t event; + event.type = 0; + event.offset = 0; + event.velocity = velocity / 127.0; + event.instrument = 12; + events.push_back(event); std::cout << "note = " << note << ", velocity = " << velocity << std::endl; } } else if (errno != EAGAIN) { -- cgit v1.2.3