Re: Using Lists with Mapping
- To: mathgroup at smc.vnet.net
- Subject: [mg101437] Re: [mg101422] Using Lists with Mapping
- From: "Jacob A. Siehler" <siehlerj at wlu.edu>
- Date: Tue, 7 Jul 2009 07:46:43 -0400 (EDT)
- References: <200907070904.FAA22006@smc.vnet.net>
Besides the question you're asking, I don't think you're constructing your a and b lists quite the way you want. Try this: a = RealDigits[Pi, 7, 32][[1]]; b = RealDigits[E, 3, 32][[1]]; rule1 = {1 -> 2, 2 -> 4, 3 -> 5, 4 -> 7, 5 -> 9, 6 -> 11} rule2 = {0 -> 1/4, 1 -> 1/8, 2 -> 1/16} a = a /. rule1; b = b /. rule2; Sound[Thread[SoundNote[a, b]], {0, 8}] js On Tue, 7 Jul 2009, BenT wrote: > > (* Given: *) > > a = RealDigits[Pi,7,32]; b = RealDigits[E,3,32]; > > rule1 = {1 -> 2, 2 -> 4, 3 -> 5, 4 -> 7, 5 -> 9, > 6 -> 11} (* apply C Major scale to the chromatic scale *) > > rule2 = {0->1/4,1->1/8,2->1/16} (* apply 3 duration values *) > > a /. rule1; > b /. rule2; > > (* How can the below function(s) be modified to allow another list (b) > to by mapped for substitution for the "1/8" duration parameter of the > function? *) > > Sound[SoundNote[#,1/8] & /@ a, {0,8}] > > Any help would be greatly apprecated. > > Benjamin Tubb > brtubb at pdmusic.org > Mathematica 7 Home Edition User > > !SIG:4a5312f5280391812871034! > >
- References:
- Using Lists with Mapping
- From: BenT <brtubb@pdmusic.org>
- Using Lists with Mapping