0
$\begingroup$

I've an amplitude function (see below). I want to manipulate both a plot of this function and the sound it makes with the same sliders. Is this possible?

Manipulate[
  Play[Sin[a t + b t Sin[c t]], {t, 0, 12}], 
  {a, 700 , 40000}, 
  {b, 25, 1000}, 
  {c, 100, 10000}]  

enter image description here

$\endgroup$
0
$\begingroup$

Well, your attempt does have a picture of the graph embedded in Play.

If you want to do something fancier, say with both Play and Plot, perhaps something like this:

f[t_, a_, b_] := Sin[a t^2 + b t];
Manipulate[
  {Play[f[t, a, b], {t, 0, 12}], 
   Plot[f[t, a, b], {t, 0, .1}, PlotRange -> All]}, {a, 700, 40000}, {b, 25, 1000}]

I've only plotted form time t=0 to t=0.1 because beyond that, the frequency is too high to see,and it looks like noise.

WARNING: Please turn your speakers way down before listening to any of these.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.