Hello everyone,
i am going to create a small tune though i have no idea how to go about it. I currently have a sine wave that plays for one second using a loop similar to this
// loop to generate audio samples
for(int n = 0; n < num_samples; n++)
{
int fr = 500; //Frequency
data[n] = amp*sin(2*pi*fr*n/fs);
cout << n << "\t" << data <<"\n";
}
This generates a 500Hz tone. The next step is for me to play another tone, at a higher frequency straight after it. I am new to C++ and was wondering if anyone could guide me in figuring out how to do the 'next step'. I thought about just copying the loop down and changing the frequency but this did nothing for reasons i do not know