We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am in a beginning computer science class where they give us starter codes to do assignments on. In the past, I've run into the problem where, because they created the starter codes with a previous version of Processing, the new codes do not work. I've only been working with this program for a month and a half, so I really have no idea where to start. Can someone help me fix this or get it to work? I already imported the Minim library on my computer, but I am getting an error that states:
"This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h."
/****************************************************
* *
* Processiano (Processing Piano) Starter Code *
* for Thriving in our Digital World *
* *
* v.20131122 Bradley Beth *
* *
***************************************************/
import ddf.minim.*;
import ddf.minim.signals.*;
Minim minim;
AudioOutput out;
Oscillator sound;
float A, B, C, D, E, F, G;
char currentNote;
void setup()
{
C = 261.625565300598634; //Middle C
D = 293.664767917407560;
E = 329.627556912869929;
frameRate(120);
textSize(32);
fill(0);
currentNote = ' ';
minim = new Minim(this);
out = minim.getLineOut(Minim.MONO, 2048);
sound = new SineWave(0,1.0,out.sampleRate());
sound.portamento(10);
out.addSignal(sound);
}
void draw()
{
background(255);
text(currentNote, width/2-10, height/2+5);
}
void keyPressed()
{
if (key != CODED) //change display
currentNote = key; //only if necessary
if (key == 'c')
sound.setFreq(C);
if (key == 'd')
sound.setFreq(D);
if (key == 'e')
sound.setFreq(E);
}
void keyReleased()
{
if (key == currentNote)
{
currentNote = ' ';
sound.setFreq(0);
}
}
void stop()
{
out.close();
minim.stop();
super.stop();
}
Answers
Just copied & pasted your code above in my 64-bit Processing v3.0.2 running under Win 7, and it's worked correctly and haven't seen neither error nor warning messages!
Tip: No need for the whole stop() block! O:-)
OH! I had just downloaded 3.0.2 before I started playing with it, but 3.0.1 was still open. Thank you!