MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Play Command Error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105635] Re: [mg105610] Re: Play Command Error
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sat, 12 Dec 2009 06:57:05 -0500 (EST)
  • References: <hfnutl$g9e$1@smc.vnet.net> <hfqgpb$oo7$1@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

Your final solution yields no sound, throws an error message, AND hangs  
the kernel at my machine:

notes = Table[N[(440/64)*2^((n + 3)/12)], {n, 60, 72, 1}];
Sound[Play[Evaluate[Sin[# 2 Pi t]] & /@ notes, {t, 0, .5}]]

$Version

"7.0 for Mac OS X x86 (64-bit) (February 19, 2009)"

Your Manipulate DOES work, on the other hand. (As far as I can tell, since  
I don't know what it's supposed to sound like.)

Bobby

On Fri, 11 Dec 2009 03:18:02 -0600, BenT <brtubb at pdmusic.org> wrote:

> 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
>
>
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Return in function
  • Next by Date: Compute once question
  • Previous by thread: Re: Play Command Error
  • Next by thread: Re: Play Command Error