Re: Play Command Error
- To: mathgroup at smc.vnet.net
- Subject: [mg105601] Re: Play Command Error
- From: dh <dh at metrohm.com>
- Date: Thu, 10 Dec 2009 04:59:15 -0500 (EST)
- References: <hfnutl$g9e$1@smc.vnet.net>
Hi Ben, the error message is not too clear. The problem is that Play has the attribute HoldAll. Therefore Play gets the unevaluated expression and not a list of functions. You need "Evaluate"; Play[Evaluate[Sin[# 2 Pi t] & /@ notes], {t, 0, .5}] Daniel BenT wrote: > 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 >