samedi 28 février 2015

Basic Monophonic synthesiser error Xcode


int main ()
{
int note, velocity;
int playingNote = -1;
float frequency;
printf("play the Axiom\n");

while(true)
{
note = aserveGetNote();
velocity = aserveGetVelocity();

if(velocity > 0)
{
frequency = 440 * pow(2, (note-69) / 12.0);
aserveOscillator(0, frequency, 1.0, 0);
playingNote = note;
}
else if(note == playingNote)
{
aserveOscillator(0, 0, 0, 0);
}

}
return 0;
}

if(velocity > 0)
{
frequency = 440 * pow(2,(note-69)/12.0);

printf("note = %d\n", note);
printf("frequency = %f\n", frequency);

aserveOscillator(0, frequency, 1.0, 0);

}

else if(note == playingNote)
{
aserveOscillator(0, 0, 0, 0);
}


This is supposed to run a simple monophonic synth. I get error messages on if(velocity >0) saying "expected unqualified - id" and on else if(note == playingNote) I get these error messages a lot in coding, can anyone help me out?


Aucun commentaire:

Enregistrer un commentaire