diff options
Diffstat (limited to 'src/mdaPiano.cpp')
-rw-r--r-- | src/mdaPiano.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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; v<NVOICES; ++v) + voices[v]->set_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 |