aboutsummaryrefslogtreecommitdiffstats
path: root/maximilian.cpp
diff options
context:
space:
mode:
authorChris Kiefer <chrisk13fer@gmail.com>2012-01-18 14:11:55 +0000
committerChris Kiefer <chrisk13fer@gmail.com>2012-01-18 14:11:55 +0000
commit044dd2e4569fc844eb9af8b6d1c1f4edc6c3af75 (patch)
tree5e69b8f3d6b5d3df60b71ed90136f8cccf924770 /maximilian.cpp
parent78c44f13463966c1bf3c2f7f86e65ba8d7efdfbc (diff)
Fixed string header + g++ warnings
Diffstat (limited to 'maximilian.cpp')
-rw-r--r--maximilian.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/maximilian.cpp b/maximilian.cpp
index 538e3fb..0fe14d4 100644
--- a/maximilian.cpp
+++ b/maximilian.cpp
@@ -445,10 +445,9 @@ double maxiSample::play() {
double maxiSample::playOnce() {
// long length=myDataSize*(0.5/myChannels);
- double remainder;
short* buffer = (short *)myData;
position=(position+1);
- remainder = position - (long) position;
+ double remainder = position - (long) position;
if ((long) position<length)
output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation
else
@@ -458,11 +457,11 @@ double maxiSample::playOnce() {
}
double maxiSample::playOnce(double speed) {
- double remainder;
//long a,b;
// long length=myDataSize*0.5;
short* buffer = (short *)myData;
position=position+((speed*chandiv*myChannels)/(maxiSettings::sampleRate/mySampleRate));
+ double remainder = position - (long) position;
if ((long) position<length)
output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation
else
@@ -1024,4 +1023,4 @@ double maxiEnv::adsr(double input, double attack, double decay, double sustain,
double convert::mtof(int midinote) {
return mtofarray[midinote];
-} \ No newline at end of file
+}