summaryrefslogtreecommitdiff
path: root/src/mdaPiano.cpp
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-14 08:33:29 +0800
committerrekado <rekado@elephly.net>2013-01-14 17:46:52 +0800
commit8952fd3bd059645228d2a096775261fca05bc60d (patch)
tree5f391b5466020f6bd5781af43bddddcc51ca0ecb /src/mdaPiano.cpp
parent772db9ce89841d0f2ecb377c76822241c6eb1fb7 (diff)
begin moving voice-related stuff to mdaPianoVoice
Diffstat (limited to 'src/mdaPiano.cpp')
-rw-r--r--src/mdaPiano.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index 11c6fa4..f88e062 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -21,55 +21,16 @@
#define STRING_BUF 2048
static const char* sample_file = "samples.raw";
-mdaPianoProgram::mdaPianoProgram()
-{
- param[0] = 0.50f; //Decay
- param[1] = 0.50f; //Release
- param[2] = 0.50f; //Hardness
-
- param[3] = 0.50f; //Vel>Hard
- param[4] = 1.00f; //Muffle
- param[5] = 0.50f; //Vel>Muff
-
- param[6] = 0.33f; //Vel Curve
- param[7] = 0.50f; //Stereo
- param[8] = 0.33f; //Max Poly
-
- param[9] = 0.50f; //Tune
- param[10] = 0.00f; //Random
- param[11] = 0.50f; //Stretch
-
- strcpy (name, "mda Piano");
-}
-
mdaPiano::mdaPiano(double rate)
: LV2::Synth<mdaPianoVoice, mdaPiano>(NPROGS, NPARAMS)
{
- Fs = 44100.0f; iFs = 1.0f/Fs; cmax = 0x7F; //just in case...
-
- programs = new mdaPianoProgram[NPROGS];
- if(programs)
- {
- //fill patches...
- uint32_t i=0;
- //TODO: load initial values from default preset
- fillpatch(i++, "mda Piano", 0.500f, 0.500f, 0.500f, 0.5f, 0.803f, 0.251f, 0.376f, 0.500f, 0.330f, 0.500f, 0.246f, 0.500f);
- setProgram(0);
- }
+ cmax = 0x7F; //just in case...
load_samples(&waves);
load_kgrp(kgrp);
- //initialise...
- for(uint32_t v=0; v<NVOICES; v++)
- {
- voice[v].env = 0.0f;
- voice[v].dec = 0.99f; //all notes off
- }
notes[0] = EVENTS_DONE;
- volume = 0.2f;
- muff = 160.0f;
cpos = sustain = activevoices = 0;
comb = new float[256];