Re: Play Command Error
- To: mathgroup at smc.vnet.net
- Subject: [mg105610] Re: Play Command Error
- From: BenT <brtubb at pdmusic.org>
- Date: Fri, 11 Dec 2009 04:18:02 -0500 (EST)
- References: <hfnutl$g9e$1@smc.vnet.net> <hfqgpb$oo7$1@smc.vnet.net>
Thanks to all that replied. Here is the finale "solution" to what I
wanted.
ClearAll["Global`*"]
notes = Table[N[ (440 / 64) * 2^((n + 3) / 12)], {n, 60, 72, 1}];
Sound[
Play[
Evaluate[Sin[# 2 Pi t]] & /@ notes, {t,0,.5}]
]
I've since been able to do something much more practical and
convenient.
(* 7-Note Tuning Systems *)
Manipulate[
scale = {0, s2, s3, s4, s5, s6, s7, 1200};
freq = cents[#] & /@ scale;
Sound[
Play[
Evaluate[Sin[# 2 Pi t]], {t, 0, .5}] & /@ freq],
{{bf, 440, "Base Frequency"}, 27.5, 6017, Appearance -> "Labeled"},
{{s2, 200}, 2, s3 - 2, Appearance -> "Labeled"},
{{s3, 400}, s2 + 2, s4 - 2, Appearance -> "Labeled"},
{{s4, 500}, s3 + 2, s5 - 2, Appearance -> "Labeled"},
{{s5, 700}, s4 + 2, s6 - 2, Appearance -> "Labeled"},
{{s6, 900}, s5 + 2, s7 - 2, Appearance -> "Labeled"},
{{s7, 1100}, s6 + 2, 1198, Appearance -> "Labeled"},
Initialization :>
{SetOptions[Play, SampleDepth -> 16, SampleRate -> 44100],
SetOptions[Sound, SoundVolume -> .5],
cents[x_] := N[bf 2^(x/1200)]
}]
--- Benjamin Tubb