move cmax constant to where it is used
authorrekado <rekado@elephly.net>
Wed, 16 Jan 2013 00:18:35 +0000 (08:18 +0800)
committerrekado <rekado@elephly.net>
Wed, 16 Jan 2013 00:18:35 +0000 (08:18 +0800)
src/mdaPiano.cpp
src/mdaPiano.h
src/mdaPianoVoice.cpp

index fbd0665..a47e912 100644 (file)
@@ -27,8 +27,6 @@ static const char* sample_file = "samples.raw";
 mdaPiano::mdaPiano(double rate)
   : LV2::Synth<mdaPianoVoice, mdaPiano>(p_n_ports, p_midi) {
 
-  cmax = 0x7F;  //just in case...
-
   load_samples(&waves);
   load_kgrp(kgrp);
 
index cebb777..42fe736 100644 (file)
@@ -41,7 +41,6 @@ private:
   mdaPianoVoice *voices[NVOICES];
   uint32_t activevoices;
   short *waves;
-  uint32_t cmax;
   uint32_t sustain;
 };
 
index 19e944f..b2fba28 100644 (file)
@@ -191,7 +191,7 @@ if(!(r > -2.0f) || !(r < 2.0f))
       /////////////////////
     }
     comb[cpos] = l + r;
-    ++cpos &= cmax;
+    ++cpos &= 0x7F;
     x = cdep * comb[cpos];  //stereo simulator
 
     // TODO: processReplacing simply assigned instead of adding