Prev: unreadable text in Demonstration projects
Next: Problem with FramedStyle when using inside Framed[]
From: BenT on 9 Dec 2009 05:41 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
From: Nasser M. Abbasi on 10 Dec 2009 04:54 ----- Original Message ----- From: "BenT" <brtubb(a)pdmusic.org> Newsgroups: comp.soft-sys.math.mathematica Sent: Wednesday, December 09, 2009 4:41 AM Subject: 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
From: Bob Hanlon on 10 Dec 2009 04:54 notes = Table[N[(440/64)*2^((n + 3)/12)], {n, 60, 72, 1}]; Attributes[Play] {HoldAll,Protected} Since Play has attribute HoldAll you should use Evaluate. Play[Evaluate[Sin[# 2 Pi t] & /@ notes], {t, 0, .5}] Bob Hanlon ---- BenT <brtubb(a)pdmusic.org> 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
From: DrMajorBob on 10 Dec 2009 04:55 Here are the "notes" you're trying to play: ClearAll["Global`*"] notes = Table[N[(440/64)*2^((n + 3)/12)], {n, 60, 72, 1}]; Table[Sin[# 2 Pi t] & /@ notes, {t, 0, .5}] {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} The entries are not real, the amplitudes are (Integer) zero, you're playing 13 channels at once, and there's only one note. I don't have a clue what the frequency or frequencies might be. Bobby On Wed, 09 Dec 2009 04:42:05 -0600, BenT <brtubb(a)pdmusic.org> 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 > -- DrMajorBob(a)yahoo.com
From: David Park on 10 Dec 2009 04:56 Do you mean this? notes = Table[N[(440/64)*2^((n + 3)/12)], {n, 60, 72, 1}]; Show[Play[Sin[# 2 Pi t], {t, 0, .5}] & /@ notes] David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: BenT [mailto:brtubb(a)pdmusic.org] 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
|
Next
|
Last
Pages: 1 2 Prev: unreadable text in Demonstration projects Next: Problem with FramedStyle when using inside Framed[] |