summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mdaPiano.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index 837626c..c9e2545 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -108,13 +108,9 @@ void mdaPiano::handle_midi(uint32_t size, unsigned char* data) {
break;
case 0x90: //note on
- {
- unsigned int v = find_free_voice(data[1], data[2]);
- if (v < NVOICES) {
- voices[v]->on(data[1], data[2]);
- }
- break;
- }
+ voices[ find_free_voice(data[1], data[2]) ]->on(data[1], data[2]);
+ break;
+
case 0xB0: //controller
switch(data[1])