Why does my sine wave projects frequency go up over time?

Snap! 6.6.0 Build Your Own Blocks (berkeley.edu)

Is there something wrong with my graph script, it seems that the closer to the right, the less it gets 'pushed'?

Offtopic but I remixed your project to build up a cool graph (https://snap.berkeley.edu/snap/snap.html#present:Username=hm100&ProjectName=Sine%20wave)

Yeah, you're using TIMER to control the frequency, so going up over time is exactly what one would expect!

I thought that the sin of timer would produce a static sine wave.
But when I record the microphone samples appended over an amount of time, it doesn't use the timer at all, and yet the frequency seems to go up towards the end:
This project
When you click the green flag, say something, then when the mouse is down, it'll stop recording, but it will play it and it will sound higher towards the end.
There is also already a recording that you can listen to.

Your project has a variable sample rate.
The more samples are present in the "a" list the longer it takes to render the graph and take the next sample, so frequency shift is perceived.
You may try to measure the loop duration to see what's going on.
Or make a sine wave based on sample count, not absolute time.
Sine wave script pic (1)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.