Re: Animation with Sound in Mathematica?
- To: mathgroup at smc.vnet.net
- Subject: [mg105687] Re: Animation with Sound in Mathematica?
- From: BenT <brtubb at pdmusic.org>
- Date: Tue, 15 Dec 2009 07:28:02 -0500 (EST)
- References: <hg00cj$j8l$1@smc.vnet.net> <hg2d8t$j94$1@smc.vnet.net>
Thank you very much! That is an excellent educational "code" example
of how to integrate sound and video, although neither the music nor
video of your example are what I have in mind <G>.
--- Benjamin Tubb
> I'd like to know how to do that too. In previous versions of
> Mathematica, you could combine graphics and sounds with Show, but in
> Mathematica 7, Show seems only to like graphics objects.
>
> You can simply play the sounds at the same time the animation runs,
> however, like this.
>
> ding = SoundNote["F", 1, "Tinklebell"];
> soundeffects :=
> EmitSound[
> Sound[{Table[
> SoundNote[m, 1, "Goblins"], {m,
> RealDigits[N[\[Pi], 10], 10][[1]]}],
> SoundNote[RealDigits[N[\[Pi], 15], 15][[1]], 10, "Sweep"],
> ding}]];
> animation =
> Animate[Plot[{a Sin[b x], -a Sin[1/b x]}, {x, 0, 2 \[Pi]},
> PlotRange -> {-5, 5}, PlotStyle -> Thick,
> ColorFunction -> Function[{x, y}, ColorData["Rainbow"][y]],
> Axes -> False, PerformanceGoal -> "Quality"], {a, -5, 5}, {b, =
.1,
> 10}, AnimationDirection -> ForwardBackward,
> AnimationRepetitions -> 2];
> Evaluate[soundeffects];
> animation
>
> --
> Helen Read
> University of Vermont