aboutsummaryrefslogtreecommitdiffstats
path: root/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX
diff options
context:
space:
mode:
Diffstat (limited to 'ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX')
-rw-r--r--ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp b/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp
index 102ef15..63b9a34 100644
--- a/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp
+++ b/ofxMaxim/ofxMaximExamples007OSX/ofMaximExample007OSX/ofxMaxim/libs/maximilian.cpp
@@ -219,7 +219,7 @@ void maxiEnvelope::trigger(int index, double amp) {
//and this
maxiDelayline::maxiDelayline() {
- memory[88200]=NULL;
+ memset( memory, 0, 88200*sizeof (double) );
}
@@ -228,7 +228,7 @@ double maxiDelayline::dl(double input, int size, double feedback) {
if ( phase >=size ) {
phase = 0;
}
- output=memory[phase];
+ output=memory[phase];
memory[phase]=(memory[phase]*feedback)+(input*feedback)*0.5;
phase+=1;
return(output);
@@ -238,8 +238,8 @@ double maxiDelayline::dl(double input, int size, double feedback) {
double maxiDelayline::dl(double input, int size, double feedback, int position) {
if ( phase >=size ) phase = 0;
if ( position >=size ) position = 0;
- output=memory[position];
- memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv;
+ output=memory[position];
+ memory[phase]=(memory[phase]*feedback)+(input*feedback)*chandiv;
phase+=1;
return(output);
@@ -659,7 +659,7 @@ double maxiSample::play4(double frequency, double start, double end) {
double maxiSample::bufferPlay(unsigned char &bufferin,long length) {
double remainder;
- short* buffer = (short *)bufferin;
+ short* buffer = (short *)&bufferin;
position=(position+1);
remainder = position - (long) position;
if ((long) position>length) position=0;
@@ -670,7 +670,7 @@ double maxiSample::bufferPlay(unsigned char &bufferin,long length) {
double maxiSample::bufferPlay(unsigned char &bufferin,double speed,long length) {
double remainder;
long a,b;
- short* buffer = (short *)bufferin;
+ short* buffer = (short *)&bufferin;
position=position+((speed*chandiv*myChannels)/(maxiSettings::sampleRate/mySampleRate));
if (speed >=0) {
@@ -717,7 +717,7 @@ double maxiSample::bufferPlay(unsigned char &bufferin,double frequency, double s
double remainder;
length=end;
long a,b;
- short* buffer = (short *)bufferin;
+ short* buffer = (short *)&bufferin;
if (frequency >0.) {
if (position<start) {
position=start;
@@ -773,7 +773,7 @@ double maxiSample::bufferPlay(unsigned char &bufferin,double frequency, double s
double maxiSample::bufferPlay4(unsigned char &bufferin,double frequency, double start, double end) {
double remainder;
double a,b,c,d,a1,a2,a3;
- short* buffer = (short*)bufferin;
+ short* buffer = (short*)&bufferin;
if (frequency >0.) {
if (position<start) {
position=start;