diff options
author | rekado <rekado@elephly.net> | 2013-01-14 21:55:19 +0800 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2013-01-14 21:55:41 +0800 |
commit | 4ef1f4938d535899fea142eaa84e4f2d36ce56dc (patch) | |
tree | c26bd22013146976f88d3b77b8004350e15bfac9 | |
parent | a05e7ee521b3273f67bfea530cbaadf1f1b0fa3d (diff) |
move voice parameters to mdaPianoVoice
-rw-r--r-- | src/mdaPiano.cpp | 3 | ||||
-rw-r--r-- | src/mdaPiano.h | 7 | ||||
-rw-r--r-- | src/mdaPianoVoice.cpp | 2 | ||||
-rw-r--r-- | src/mdaPianoVoice.h | 5 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp index a015439..a3c0311 100644 --- a/src/mdaPiano.cpp +++ b/src/mdaPiano.cpp @@ -38,8 +38,7 @@ mdaPiano::mdaPiano(double rate) } notes[0] = EVENTS_DONE; - cpos = sustain = activevoices = 0; - comb = new float[256]; + sustain = activevoices = 0; update(); } diff --git a/src/mdaPiano.h b/src/mdaPiano.h index 723041a..3697e5d 100644 --- a/src/mdaPiano.h +++ b/src/mdaPiano.h @@ -38,13 +38,10 @@ private: ///global internal variables KGRP kgrp[16]; mdaPianoVoice *voices[NVOICES]; - uint32_t activevoices, poly, cpos; + uint32_t activevoices; short *waves; uint32_t cmax; - float *comb, cdep, width, trim; - uint32_t size, sustain; - float tune, fine, random, stretch; - float muff, muffvel, sizevel, velsens, volume; + uint32_t sustain; }; #endif diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp index e23dc78..1417056 100644 --- a/src/mdaPianoVoice.cpp +++ b/src/mdaPianoVoice.cpp @@ -21,6 +21,7 @@ mdaPianoVoice::mdaPianoVoice(double rate, short * samples, KGRP * master_kgrp) { default_preset[p_offset(p_random_detuning)] = 0.246f; default_preset[p_offset(p_stretch_tuning)] = 0.500f; + comb = new float[256]; reset(); } @@ -31,6 +32,7 @@ void mdaPianoVoice::reset() { muff = 160.0f; volume = 0.2f; sustain = 0; + cpos = 0; m_key = LV2::INVALID_KEY; } diff --git a/src/mdaPianoVoice.h b/src/mdaPianoVoice.h index e38e7bc..ab37dc5 100644 --- a/src/mdaPianoVoice.h +++ b/src/mdaPianoVoice.h @@ -21,7 +21,10 @@ class mdaPianoVoice : public LV2::Voice { short *waves; float default_preset[NPARAMS]; // contains the default preset short sustain; - float volume, muff; + float *comb, cdep, width, trim; + float fine, random, stretch; + float volume, muff, muffvel, sizevel, velsens; + uint32_t cpos, size, poly; // voice state uint32_t delta; //sample playback |