We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › two examples, nearly identical, one gets error?
Page Index Toggle Pages: 1
two examples, nearly identical, one gets error?? (Read 1742 times)
two examples, nearly identical, one gets error??
Jun 6th, 2010, 12:00am
 
hey ive been following two examples using the Ess audio library
two of the examples are nearly identical, except that one works and runs correctly, where as the other complains that the Amplify(float) constructor is undefined... I have put the library in the sketchbook libraries folder. im new to this stuff so im sure it is a simple mistake, but i cannot find for the life of me what the difference is that makes one work and the other not. here are the two examples:

first one (works):
Code:
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
Amplify myAmplify;

void setup() {
 size(256,200);

 // start up Ess
 Ess.start(this);

 // load "cell.aif" into a new AudioChannel
 myChannel=new AudioChannel("cell.aif");

 // amplify first 2 seconds 25%
 myAmplify=new Amplify(.25);
 
 myAmplify.filter(myChannel,0,myChannel.frames(2000));

 // amplify next 2 seconds 300%
 myAmplify.percent=3;
 
 myAmplify.filter(myChannel,myChannel.frames(2000),myChannel.frames(2000));  

 // play
 myChannel.play();
}

void draw() {
}

// we are done, clean up Ess

public void stop() {
 Ess.stop();
 super.stop();
}


second one (error: The constructor Amplify(float) is undefined)
Code:
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
Amplify myAmplify;

void setup() {
 size(256,200);

 // start up Ess
 Ess.start(this);

 // load "cell.aif" into a new AudioChannel
 myChannel=new AudioChannel("cell.aif");

 // amplify first 2 seconds 25%
 myAmplify=new Amplify(.25); /* <-- THIS IS THE LINE GIVING THE ERROR */
 
 myAmplify.filter(myChannel,0,myChannel.frames(2000));

 // play
 myChannel.play();
}

void draw() {
}

// we are done, clean up Ess

public void stop() {
 Ess.stop();
 super.stop();
}


i have tried closing processing completely, and starting again and opening the two examples again, but the same problem keeps occuring!
thanks for your help in advance, sorry if its a trivial problem but it really has stumped me and i want to know why it occurs...
Page Index Toggle Pages: 1