summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-07-27 22:40:49 +0800
committerrekado <rekado@elephly.net>2013-07-27 22:40:49 +0800
commitc45dc815ad13d10b9e3069d7e6bf43faea606c0f (patch)
treedaa662ebce36b69b042bb3047d7e04ca38c48b40
parent5af510e28fdd0c9ac730cf24d40fd87e8fef8e9f (diff)
merge mdaPianoVoice.h and mdaEPianoVoice.h
-rw-r--r--src/mdaPianoVoice.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/mdaPianoVoice.h b/src/mdaPianoVoice.h
index 34d7018..e7d9601 100644
--- a/src/mdaPianoVoice.h
+++ b/src/mdaPianoVoice.h
@@ -21,29 +21,53 @@ class mdaPianoVoice : public lvtk::Voice {
Sample *samples;
uint32_t sample_index;
short sustain;
+ float width;
+ float fine, random;
+ float sizevel, velsens, volume;
+
+#ifdef PIANO
float comb[256];
- float cdep, width, trim;
- float fine, random, stretch;
- float volume, muff, muffvel, sizevel, velsens;
+ float cdep, trim;
+ float stretch;
+ float muff, muffvel;
uint32_t cpos, size;
+#endif
+#ifdef EPIANO
+ long size;
+ float overdrive;
+ float lfo0, lfo1, dlfo, lmod, rmod;
+ float treb, tfrq, tl, tr;
+#endif
+// TODO: uint32_t or long?
+#ifdef PIANO
// voice state
uint32_t delta; // sample playback
uint32_t frac;
uint32_t pos;
uint32_t end;
uint32_t loop;
+#elif defined EPIANO
+ long delta; // sample playback
+ long frac;
+ long pos;
+ long end;
+ long loop;
+#endif
float env; // envelope
float dec;
+#ifdef PIANO
float f0; // first-order LPF
float f1;
float ff;
+#endif
float outl;
float outr;
// end of voice state
+
float default_preset[NPARAMS]; // contains the default preset
protected:
@@ -53,7 +77,9 @@ class mdaPianoVoice : public lvtk::Voice {
mdaPianoVoice(double, Sample*, KGRP*);
void set_sustain(unsigned short v) { sustain = v; }
void set_volume(float v) { volume = v; }
+#ifdef PIANO
void set_muff(float v) { muff = v; }
+#endif
float p_helper(unsigned short, Param);
void update(Param); // recalculates internal variables