summaryrefslogtreecommitdiff
path: root/drumgizmo/input
diff options
context:
space:
mode:
authorGoran Mekić <meka@tilda.center>2017-12-30 01:20:48 +0100
committerGoran Mekić <meka@tilda.center>2017-12-30 15:18:26 +0100
commitf0f2899bc811fcd2fcbb116198ac2eab241dc254 (patch)
tree8b6ec2f1182d9ec6b3d9c21f45abd283f86a816c /drumgizmo/input
parent17220d8e06998160ba0f8678649e62872fda9727 (diff)
Calculate instrument properly
Diffstat (limited to 'drumgizmo/input')
-rw-r--r--drumgizmo/input/ossmidi.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/drumgizmo/input/ossmidi.cc b/drumgizmo/input/ossmidi.cc
index 03e8481..c504781 100644
--- a/drumgizmo/input/ossmidi.cc
+++ b/drumgizmo/input/ossmidi.cc
@@ -107,8 +107,12 @@ void OSSInputEngine::run(size_t pos, size_t len, std::vector<event_t>& events)
event_t event;
event.type = 0;
event.offset = 0;
- event.velocity = velocity / 127.0;
- event.instrument = 12;
+ int i = mmap.lookup(note);
+ if(i != -1)
+ {
+ event.instrument = i;
+ event.velocity = velocity / 127.0;
+ }
events.push_back(event);
std::cout << "note = " << note << ", velocity = " << velocity << std::endl;
}