MathGroup Archive 2009

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

Search the Archive

Re: Play Command Error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105577] Re: Play Command Error
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Thu, 10 Dec 2009 04:54:48 -0500 (EST)
  • References: <hfnutl$g9e$1@smc.vnet.net>
  • Reply-to: "Nasser M. Abbasi" <nma at 12000.org>

----- Original Message ----- 
From: "BenT" <brtubb at pdmusic.org>
Newsgroups: comp.soft-sys.math.mathematica
Sent: Wednesday, December 09, 2009 4:41 AM
Subject: [mg105577] Play Command Error


> I'm using v7. Please try this code:
>
> ClearAll["Global`*"]
>
> notes=Table[N[(440/64)*2^((n+3)/12)],{n,60,72,1}];
>
> Play[Sin[# 2 Pi t]&/@notes ,{t,0,.5}]
>
> Sound::ssnm: A good PlayRange could not be found since most of the
> samples are not evaluating to machine-size real numbers. >>
>
> I cannot understand why this error message is produced. Can anyone
> help? The values for the "notes" are certainly machine-sized! What's
> causing the Sin[# # Pi t] expression to NOT produce valid resuls?
>
> --- Benjamin Tubb
>

I never used Play before. But I was wondering if you meant to add the tones 
before playing them? like this

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

--Nasser 



  • Prev by Date: Possible bug in Opacity[] with plotting function that uses UnitStep?
  • Next by Date: Re: Problem with FramedStyle when using inside Framed[]
  • Previous by thread: Re: Play Command Error
  • Next by thread: Re: Play Command Error