summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drumgizmo/input/ossmidi.cc7
1 files changed, 7 insertions, 0 deletions
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<event_t>& 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) {