From a5c1fa43261a7ce246a92c6ffd1c339b4cb1b613 Mon Sep 17 00:00:00 2001 From: rekado Date: Mon, 14 Jan 2013 21:35:09 +0800 Subject: implement volume setter --- src/mdaPiano.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mdaPiano.cpp') diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp index 1110c56..9912c75 100644 --- a/src/mdaPiano.cpp +++ b/src/mdaPiano.cpp @@ -52,6 +52,13 @@ void mdaPiano::update() { } +void mdaPiano::setVolume(float value) +{ + for (uint32_t v=0; vset_volume(value); +} + + void mdaPiano::setParameter(unsigned char id, float value) { if(id>=NPARAMS) @@ -95,7 +102,7 @@ void mdaPiano::handle_midi(uint32_t size, unsigned char* data) { break; case 0x07: //volume - volume = 0.00002f * (float)(data[2] * data[2]); + setVolume(0.00002f * (float)(data[2] * data[2])); break; case 0x40: //sustain pedal -- cgit v1.2.3