-
Math.sin going out of sync
I am trying to synchronize a pendulum rotated with the tempo of a song.
the tempo is 123 BPM which is 1.025 per second.
I have a slider set to time*1.025 and when I link the rotation of the pendulum directly to the slider (*360) it makes one full revolution exactly on beat for the duration of the song, so I know that 1.025 is the right beats per second.
However when I plug that same number into a typical swing equation:
\\\\\\\\\\\
tempo=(time*1.025)
amp=40;
freq=4;amp*Math.sin(tempo*freq);
\\\\\\\\\\\\\\It becomes un-synchronized. Is there something I am missing about the math behind Math.sin? I feel like it should be making one or two swings per beat depending on the value of “freq”.