summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoran Mekić <meka@tilda.center>2017-12-30 01:52:00 +0100
committerGoran Mekić <meka@tilda.center>2017-12-30 15:18:26 +0100
commit74f18e24e100b487184e3dd7a57fe1609f645654 (patch)
tree70cd659a85d49679debf49fe7da25ffa5908234a
parentf0f2899bc811fcd2fcbb116198ac2eab241dc254 (diff)
Remove extra codefeature/oss-midi
-rw-r--r--drumgizmo/input/ossmidi.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/drumgizmo/input/ossmidi.cc b/drumgizmo/input/ossmidi.cc
index c504781..325a83d 100644
--- a/drumgizmo/input/ossmidi.cc
+++ b/drumgizmo/input/ossmidi.cc
@@ -105,16 +105,14 @@ void OSSInputEngine::run(size_t pos, size_t len, std::vector<event_t>& events)
int note = buf[1];
int velocity = buf[2];
event_t event;
- event.type = 0;
- event.offset = 0;
- int i = mmap.lookup(note);
- if(i != -1)
+ event.instrument = mmap.lookup(note);
+ if(event.instrument != -1)
{
- event.instrument = i;
event.velocity = velocity / 127.0;
+ event.type = 0;
+ event.offset = 0;
+ events.push_back(event);
}
- events.push_back(event);
- std::cout << "note = " << note << ", velocity = " << velocity << std::endl;
}
} else if (errno != EAGAIN) {
std::cerr << "Error code: " << errno << std::endl;