summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-14 18:17:44 +0800
committerrekado <rekado@elephly.net>2013-01-14 18:17:44 +0800
commitef39638b45cc3dd0a3196c05f89417d0ea4604db (patch)
tree26e2c1bb49755f2f6cf17a4f021a9f10240b8460
parentd577482b1d594cd811d731ce320926801b7a34fa (diff)
create mdaPianoVoice objects
-rw-r--r--src/mdaPiano.cpp5
-rw-r--r--src/mdaPiano.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index 7c1a3a0..903bce7 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -31,6 +31,11 @@ mdaPiano::mdaPiano(double rate)
load_samples(&waves);
load_kgrp(kgrp);
+ for(uint32_t i=0; i<NVOICES; ++i) {
+ voices[i] = new mdaPianoVoice(rate, waves, kgrp);
+ add_voices(voices[i]);
+ }
+
notes[0] = EVENTS_DONE;
cpos = sustain = activevoices = 0;
comb = new float[256];
diff --git a/src/mdaPiano.h b/src/mdaPiano.h
index ee94240..59a2a56 100644
--- a/src/mdaPiano.h
+++ b/src/mdaPiano.h
@@ -40,7 +40,7 @@ private:
///global internal variables
KGRP kgrp[16];
- VOICE voice[NVOICES];
+ mdaPianoVoice *voices[NVOICES];
uint32_t activevoices, poly, cpos;
short *waves;
uint32_t cmax;