diff options
author | rekado <rekado@elephly.net> | 2013-01-14 21:35:09 +0800 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2013-01-14 21:41:34 +0800 |
commit | a5c1fa43261a7ce246a92c6ffd1c339b4cb1b613 (patch) | |
tree | 5df938e4893f5d7c43e1ea523f7433d6267c04da /src/mdaPiano.cpp | |
parent | f4e5570ed047b2975321786cb3093bcad8a3224f (diff) |
implement volume setter
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 |