I am trying to get Mathematica to output a vibrato; a tone which has a frequency that slightly varies. To get a tone with a non-changing frequency, I use this command:
Play[Sin[440*2*Pi*t], {t, 0, 4}]
That works as expected.
Now, I would expect to be able to express the varying frequency like this:
$$440 + \sin(5\times 2\pi t)$$
This should result in the frequency varying between 439 Hz and 441 Hz, 5 times per second. If I replace the static 440 Hz in the previous Mathematica function, I get the following command:
Play[Sin[(440 + Sin[5*2*Pi*t])*2*Pi*t], {t, 0, 4}]
This sounds right in the beginning, but the variation in pitch (thus frequency seems to increase, if you listen to the output between 10 s and 20 s instead you can clearly hear that something is wrong.
The Mathematica documentation for the Play command mentions the following for to "Make a vibrato-like effect":
Play[(2 + Cos[40 t]) Sin[2000 t], {t, 0, 1}]
But from what I can tell that will vary the amplitude, not the frequency.
What am I doing wrong here? I'd be interested in both a solution for this specific mathematical problem as well as a more general answer to how to express a vibrato using a general mathematical function.
Most Google searches on this topic give you instructions for how to create a vibrato when singing.
Play[Sin[(Sin[5*2*Pi*t]) + 440*2*Pi*t], {t, 0, 4}]does what you want – Stelios Oct 18 '15 at 18:53440*2*Pi*t+Sin[5*2*Pi*t]*t(where the last t is wrong). I should've written it out on paper. Feel free to answer and I'll accept it (a bit more explanation would be nice, but not necessarily needed). – Jan Oct 19 '15 at 05:46