else if(choice == 'p')
{
textFilePointer = fopen("/Users/jonnymaguire/Documents/Uni Work/Audio Programming /iap/iapProj/Builds/MacOSX/build/Debug/textp15.txt", "r");
if(textFilePointer == NULL)
{
printf("!Error Opening File!");
}
while(!feof(textFilePointer))
{
float frequency;
fscanf(textFilePointer, " %d\n", ¬e);
printf(" %d\n\n", note);
frequency = 440 * pow(2, (note-69) /12.0);
aserveOscillator(0, frequency, 1, 0);
aserveSleep(500);
}
This part of my program reads 16 numbers from a txt file, adds them into the 'note' part of the equation to convert them into a pitch, and then sends it to the serveOscillator which plays 16 notes at the set pitch. Aserve sleep dictates how long each note plays for (500ms) but the 16th does not stop ringing out and i need it to stop after 500ms!