create mdaPianoVoice objects
authorrekado <rekado@elephly.net>
Mon, 14 Jan 2013 10:17:44 +0000 (18:17 +0800)
committerrekado <rekado@elephly.net>
Mon, 14 Jan 2013 10:17:44 +0000 (18:17 +0800)
src/mdaPiano.cpp
src/mdaPiano.h

index 7c1a3a0..903bce7 100644 (file)
@@ -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];
index ee94240..59a2a56 100644 (file)
@@ -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;