From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #52 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Thursday, July 29 1999 Volume 01 : Number 052 ---------------------------------------------------------------------- Date: Tue, 27 Jul 1999 15:27:29 +0200 From: Staffan Liljegren <---@---.---> Subject: SC examples (as text) // file: Oh no more fibs! // Fibonacci and Overtone scale (see e.g. Jay Kappraff, "Connections - the // Geometric Bridge between Art and Science"). I keep returning to this for // some reason. Maybe I should stop listening to Bela B? Anyway it is about // Fibonacci numbers, ie // f(0) = 1, f(1) = 1, f(n) = f(n-1)+f(n-2) // which gives the series 1,1,2,3,5,8,13, 21... // It approximates the 1+Golden Ratio if You divide f(n)/f(n-1) // Bela Bartok used this and constructed a (fibonacci) scale from this, // with C as fundamental (0), skipping 1's and going upto 13: // C, D, Eb, F, Ab, C#. // He also used the overtone scale, built on fundamental plus harmonics and // made into a scale with frequency ratios 1:1, 2:1, 3:1 etc. This gives fundamental, // octave, fifth+octave etc. Starting on C, we get (a well-tempered approximation) : // C, D, E, F#, G, A, Bb, B, C. // These scales decomposes the chromatic scale into to two complementary in terms // of emotion and this duality can be used to create great contrast, ie Fibonacci // "inferno" and overtone "paradisio". // Staffan Liljegren, 990712, staffan@medialab.ericsson.se // First both in contrasting sequence: ( var ot, fib, p; fib = #[60, 62, 63, 65, 68, 73]; ot = #[60, 62, 64, 66, 67, 69, 70, 71]; Pbind( \dur, 0.25, \midinote, Pseq([ Pseq(fib), Pseq([\rest],2), Pseq(ot)], 2) // play message supplies the Event.protoEvent as default ).play ) // Let us use the Fibonacci series for duration and legato values also and // uses these values for duration and legato: // 1,1, 1/2, 1/3, 1/5, ... // This is a series 1/fib(n). // In this particular example, which is only here to demonstrate the components, // we just play the fib scale up with random legato and a rythm which goes: // 1,1, 1/2, 1/2, 1/3, 1/3, 1/3, 1/5, 1/5, 1/5, 1/5,1/5 // 1 2 3 4 5 // Or "taa-taa-tantan-tateti-dallapicola" in 5/4. Don't ask me about these // rythm mnemonics! The fib scale contains 6 notes and this rythm pattern has // 12 events, so we play the fib scale twice over the rythm. Finally we add // a random fib bass on each beat and then play a sequence of // bass only, 2*bass+mel, 2*bass+mel transposed up and then down a 5th and // finally the melody alone and a simple ending ( var fib, bass, mel, ending,tune; fib = #[60, 62, 63, 65, 68, 73]; bass = Pbind( \tempo, 1.3, \legato, 0.1, \dur, Pseq([1], 5), \midinote, Pxrand(fib - 24, 5) ); mel = Pbind( \tempo, 1.3, \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf), \dur, Pseq([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1), \midinote, Pseq( fib , 2) ); ending = Pbind( \dur, Pgeom(0.05, 1.1, 20), \midinote,Pseq([68,72],10) ); tune = Pseq([ bass, Ppar([ bass, mel ],2), Padd(\ctranspose, 7, Ppar([ bass, mel ],2)), Padd(\ctranspose, -7, Ppar([ bass, mel ],2)), mel, ending ], 1); tune.play ) // Let us now shuffle notes and durations a bit in the melody. We also // add some rests to the melody line and play two separate melody lines ( var fib, bass, mel, ending,tune; fib = #[60, 62, 63, 65, 68, 73]; bass = Pbind( \tempo, 1.4, \legato, 0.1, \dur, Pseq([1], 5), \midinote, Pxrand(fib - 24, 5) ); mel = Pbind( \tempo, 1.4, \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf), \dur, Pshuf([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1), \midinote, Prand( fib ++ [\rest, \rest] , 10) ); tune = Pseq([ Ppar([ bass, mel, mel ],2), Padd(\ctranspose, 7, Ppar([ bass, mel, mel ],2)), Padd(\ctranspose, -7, Ppar([ bass, mel, mel ],2)) ], 2); tune.play ) // Back to the overtone scale now. Here is a simple example, using // a randomly "pulsating" ot scale and shuffled long bass notes with even // durations in 5/4. This is then chromatically transposed upto a 5th and // in steps following the ot scale ( var ot,c, b, m; ot = #[60, 62, 64, 66, 67, 69, 70, 71]; c = Pbind(\dur, 0.1, \amp, Pseq([ Pgeom(0.2,0.95,50)],2), \midinote, Prand( ot-12, inf), \legato, 0.2, \pan, Pfunc({1.0.rand2}) ); b = Pbind( \dur, Prand([5,Pseq([1,1,1,1,1]), Pseq([3,2]) ], 2), \amp, Pfunc( {XLine.kr(0.001,0.1, 0.5)} ), \midinote, Pshuf( ot-24) ); Paddp(\ctranspose, Pseq([0,2,4,6,7], inf), Ppar([b,c])).play ) // Now write Your own piece with the fib and ot scales! // Or just play around with these simple ones ------------------------------ Date: Tue, 27 Jul 1999 15:29:48 +0200 From: Staffan Liljegren <---@---.---> Subject: 2nd file - bells - as text // File: bells // Additive synthesis of bells - partial values from Risset (beating bell) and // Rossing (tubular bells) // Staffan Liljegren, 990712, staffan@medialab.ericsson.se. "Optimized" by JMc ( var bell, pattern1, pattern2, pattern3, pamps, pdurs, pfreqs, pdetune, cpfreqs; //non-harmonic partials pfreqs = #[0.56, 0.56, 0.92, 0.92, 1.25, 1.7, 2, 2.74, 3, 3.76, 4.07]; // add slow beating on lower partials pdetune = #[0, 1, 0, 1.7, 0, 0, 0, 0, 0, 0, 0]; pamps = #[1, 0.67, 1, 1.8, 2.67, 1.67, 1.46, 1.33, 1.33, 1, 1.33]; pdurs = #[1, 0.9, 0.65, 0.55, 0.325, 0.35, 0.25, 0.2, 0.15, 0.1, 0.075]; // Try these for a tubular bells (chimes)! cpfreqs = #[0.24, 0.64, 1.23, 2, 2.91, 3.96, 5.12, 6.37]; bell = {arg freq=440, amp=0.1, dur=4.0, pan=0.0; var out; // 1st try: "cheat" with same duration envelope for all partials // out = Klang.ar(`[ freq*pfreqs ,(amp/11)*pamps, 0],1,0, // EnvGen.kr(Env.perc(0.01, dur, 1, -4))); // 2nd try: individual duration envelopes per partial out = Mix.arFill(pfreqs.size, { arg i; FSinOsc.ar( pfreqs.at(i) * freq + pdetune.at(i), EnvGen.kr( Env.perc(0.01, pdurs.at(i) * dur, 1,-4), pamps.at(i) * (amp/11) ) ) }); Pan2.ar(out, pan); }; pattern1 = Pbind( \ugenFunc, bell, \scale, [0, 2, 4, 6, 7, 9, 11], \octave, 6, \dur, Prand([ Pseq(#[2],4), Pseq(#[4],2), 8], inf), \degree, Pseq([Pshuf(#[0, 4, 7, 4], 2), Pshuf(#[7,3,3,0], 2)], inf), \amp, Prand([0.2,0.4,0.6], inf), \pan, -1 ); pattern2 = Pbind( \ugenFunc, bell, \scale, [0, 2, 4, 6, 7, 9, 11], \octave, 5, \dur, Prand([ Pseq(#[8],2), 16], inf), \degree, Pseq(#[0, 0, 5 , 7, -3,4,3,2], inf), \amp, Prand([0.3,0.4, 0.5], inf), \pan, 1 ); pattern3 = Ptpar([0.0,pattern2, 1.0, pattern2, 2.0, pattern1, 3.0, pattern1]); // play message supplies Event.protoEvent as default value pattern3.play ) ------------------------------ Date: Tue, 27 Jul 1999 15:47:53 +0200 From: Staffan Liljegren <---@---.---> Subject: Re: SC examples (as text) You might consider this change of the 3rd example: - -Staffan // You might also consider removing the 1/5 in the melody duration // if fast "dallapiccolas" upset You! Here I changed it to 3 1/3 notes ( var fib, bass, mel, ending,tune; fib = #[60, 62, 63, 65, 68, 73]; bass = Pbind( \tempo, 1.5, \legato, 0.1, \dur, Pseq([1], 5), \midinote, Pxrand(fib - 24, 5) ); mel = Pbind( \tempo, 1.5, \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf), \dur, Pshuf([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/3], 3)], 1), \midinote, Prand( fib ++ [\rest, \rest] , 10) ); tune = Pseq([ Ppar([ bass, mel, mel ],2), Padd(\ctranspose, 7, Ppar([ bass, mel, mel ],2)), Padd(\ctranspose, -7, Ppar([ bass, mel, mel ],2)) ], inf); tune.play ) Staffan Liljegren wrote: > // file: Oh no more fibs! > // Fibonacci and Overtone scale (see e.g. Jay Kappraff, "Connections - the > // Geometric Bridge between Art and Science"). I keep returning to this for > // some reason. Maybe I should stop listening to Bela B? Anyway it is about > // Fibonacci numbers, ie > // f(0) = 1, f(1) = 1, f(n) = f(n-1)+f(n-2) > // which gives the series 1,1,2,3,5,8,13, 21... > // It approximates the 1+Golden Ratio if You divide f(n)/f(n-1) > // Bela Bartok used this and constructed a (fibonacci) scale from this, > // with C as fundamental (0), skipping 1's and going upto 13: > // C, D, Eb, F, Ab, C#. > // He also used the overtone scale, built on fundamental plus harmonics and > // made into a scale with frequency ratios 1:1, 2:1, 3:1 etc. This gives fundamental, > // octave, fifth+octave etc. Starting on C, we get (a well-tempered approximation) : > // C, D, E, F#, G, A, Bb, B, C. > // These scales decomposes the chromatic scale into to two complementary in terms > // of emotion and this duality can be used to create great contrast, ie Fibonacci > // "inferno" and overtone "paradisio". > // Staffan Liljegren, 990712, staffan@medialab.ericsson.se > > // First both in contrasting sequence: > > ( > var ot, fib, p; > fib = #[60, 62, 63, 65, 68, 73]; > ot = #[60, 62, 64, 66, 67, 69, 70, 71]; > Pbind( > \dur, 0.25, > \midinote, Pseq([ Pseq(fib), Pseq([\rest],2), Pseq(ot)], 2) > // play message supplies the Event.protoEvent as default > ).play > ) > > // Let us use the Fibonacci series for duration and legato values also and > // uses these values for duration and legato: > // 1,1, 1/2, 1/3, 1/5, ... > // This is a series 1/fib(n). > // In this particular example, which is only here to demonstrate the components, > // we just play the fib scale up with random legato and a rythm which goes: > // 1,1, 1/2, 1/2, 1/3, 1/3, 1/3, 1/5, 1/5, 1/5, 1/5,1/5 > // 1 2 3 4 5 > // Or "taa-taa-tantan-tateti-dallapicola" in 5/4. Don't ask me about these > // rythm mnemonics! The fib scale contains 6 notes and this rythm pattern has > // 12 events, so we play the fib scale twice over the rythm. Finally we add > // a random fib bass on each beat and then play a sequence of > // bass only, 2*bass+mel, 2*bass+mel transposed up and then down a 5th and > // finally the melody alone and a simple ending > ( > var fib, bass, mel, ending,tune; > > fib = #[60, 62, 63, 65, 68, 73]; > > bass = Pbind( > \tempo, 1.3, > \legato, 0.1, > \dur, Pseq([1], 5), > \midinote, Pxrand(fib - 24, 5) > ); > mel = Pbind( > \tempo, 1.3, > \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf), > \dur, Pseq([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1), > \midinote, Pseq( fib , 2) > ); > ending = Pbind( \dur, Pgeom(0.05, 1.1, 20), \midinote,Pseq([68,72],10) ); > tune = Pseq([ > bass, > Ppar([ bass, mel ],2), > Padd(\ctranspose, 7, Ppar([ bass, mel ],2)), > Padd(\ctranspose, -7, Ppar([ bass, mel ],2)), > mel, > ending > ], 1); > > tune.play > > ) > > // Let us now shuffle notes and durations a bit in the melody. We also > // add some rests to the melody line and play two separate melody lines > > ( > var fib, bass, mel, ending,tune; > > fib = #[60, 62, 63, 65, 68, 73]; > > bass = Pbind( > \tempo, 1.4, > \legato, 0.1, > \dur, Pseq([1], 5), > \midinote, Pxrand(fib - 24, 5) > ); > mel = Pbind( > \tempo, 1.4, > \legato, Prand([1,1,1/2,1/3, 1/5, 1/8], inf), > \dur, Pshuf([1,1,Pseq([1/2],2),Pseq([1/3],3), Pseq([1/5], 5)], 1), > \midinote, Prand( fib ++ [\rest, \rest] , 10) > ); > > tune = Pseq([ > Ppar([ bass, mel, mel ],2), > Padd(\ctranspose, 7, Ppar([ bass, mel, mel ],2)), > Padd(\ctranspose, -7, Ppar([ bass, mel, mel ],2)) > ], 2); > > tune.play > > ) > > // Back to the overtone scale now. Here is a simple example, using > // a randomly "pulsating" ot scale and shuffled long bass notes with even > // durations in 5/4. This is then chromatically transposed upto a 5th and > // in steps following the ot scale > > ( > var ot,c, b, m; > > ot = #[60, 62, 64, 66, 67, 69, 70, 71]; > > c = Pbind(\dur, 0.1, > \amp, Pseq([ Pgeom(0.2,0.95,50)],2), > \midinote, Prand( ot-12, inf), > \legato, 0.2, > \pan, Pfunc({1.0.rand2}) > ); > > b = Pbind( \dur, Prand([5,Pseq([1,1,1,1,1]), Pseq([3,2]) ], 2), > \amp, Pfunc( {XLine.kr(0.001,0.1, 0.5)} ), > \midinote, Pshuf( ot-24) > ); > > Paddp(\ctranspose, > Pseq([0,2,4,6,7], inf), Ppar([b,c])).play > > ) > > // Now write Your own piece with the fib and ot scales! > // Or just play around with these simple ones ------------------------------ Date: Tue, 27 Jul 1999 16:31:41 +0200 From: Staffan Liljegren <---@---.---> Subject: Update - SC example "Oh no more fibs!" Here is a slight change to the last example in "Oh no more fibs!" (I just it over two octaves and added some reverb) - -Staffan // Back to the overtone scale now. Here is a simple example, using // a randomly "pulsating" two octave ot scale and shuffled long bass notes with even // durations in 5/4. This is then chromatically transposed upto a 5th and // in steps following the ot scale ( var ot,c, b, m; ot = #[60, 62, 64, 66, 67, 69, 70, 71]; c = Pbind(\dur, 0.1, \amp, Pseq([ Pgeom(0.2,0.95,50)],2), \midinote, Prand( ot ++ (ot-12), inf), \legato, 0.2, \pan, Pfunc({1.0.rand2}) ); b = Pbind( \dur, Prand([5,Pseq([1,1,1,1,1]), Pseq([3,2]) ], 2), \amp, Pfunc( {XLine.kr(0.001,0.1, 0.5)} ), \midinote, Pshuf( ot-24) ); Paddp(\ctranspose, Pseq([0,2,4,6,7], 2), Ppar([b,c])).play ( effects: { arg out; 5.do({ out = AllpassN.ar(out, 0.05, [0.03.rand, 0.03.rand], 3) }); out }) ) ------------------------------ Date: Mon, 26 Jul 1999 22:35:48 -0600 From: "David Cottle" <---@---.---> Subject: Re: version 2.1.8 available Hi, >>> A syntax coloring menu item was added to the Color menu. Choosing this >>> menu item will colorize the syntax. Class names, primitive names and >> >>Cool! > > Note that this is not the same as automatic syntax coloring, it is an Still cool! ------------------------------ Date: Tue, 27 Jul 1999 16:56:56 -0600 From: "David Cottle" <---@---.---> Subject: Silence in patterns Hi, How would I put together two patterns which use two duration sets, including rests, but using a single pitch set? I can figure out everything but the rests and couldn't see any examples in the documentation. How do you designate duration with silence in a protoEvent? e.g. voice one: \dur, Pseq([1, 0.5, "1.25.rest?", 0.5, 1], inf); voice two: \dur, Pseq([0.25, 0.25, 1, "0.5.rest?", 0.5], inf); and the pitch set: \degree, Pseq([0, 5, 2, 7, 3, 2], inf); (I'm thinking about putting together a file that has all of the durations and attack times of an existing work by Webern, but the tone row is selected at random. I think the Parallel Patterns would be the way to go (a pattern for each voice), but I couldn't see how to designate a duration with silence. I see that I could use a 0.0 amplitude, but then I would have to be careful to match the amplitude stream with the duration stream. Is there an easier way?) - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Tue, 27 Jul 1999 17:47:54 -0600 From: "David Cottle" <---@---.---> Subject: Silence (disregard previous) Hi, Figured it out from the Markov example: \degree, Pseq([0, \, 2, 7, 3, 2], inf); or \midinote, Pseq([45, 56, \, 65, 34], inf); right? or \degree, Pseq([0, \rest, 2, 7, 3, 2], inf); or \midinote, Pseq([45, 56, \rest, 65, 34], inf); - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Tue, 27 Jul 1999 19:41:17 -0600 From: James McCartney <---@---.---> Subject: Re: Silence (disregard previous) At 5:47 PM -0600 7/27/99, David Cottle wrote: >Hi, > >Figured it out from the Markov example: > >\degree, Pseq([0, \, 2, 7, 3, 2], inf); > or >\midinote, Pseq([45, 56, \, 65, 34], inf); > >right? > >or > >\degree, Pseq([0, \rest, 2, 7, 3, 2], inf); > or >\midinote, Pseq([45, 56, \rest, 65, 34], inf); Correct. ANY Symbol is a rest. \ is the same as the Symbol ''. Also note that any math operation on a Symbol is the Symbol so that \rest + 4 equals \rest. This allows you to transpose sequences that have rests in them. \rest can be used in any pitch model parameter: \degree, \note, \midinote, \freq . --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 27 Jul 1999 22:50:57 -0600 From: "David Cottle" <---@---.---> Subject: Probability Hi, One more . . . I'm also trying to realize the Markov chain on page 287 in Dodge's book. It requires random choices with a probability. How can I do a random choice with skewed probabilities? I know you could do #[1, 1, 2, 3].choose for a 50% chance of 1 and 25% chance of the others, but how could I create a function that would give me finer tuned numbers, like .125 chance of choosing 1 .675 chance of choosing 2 etc. I can't see how to do it with coin or any of the Sequenceable Collection instances. - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ Date: Wed, 28 Jul 1999 00:34:41 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 10:50 PM -0600 7/27/99, David Cottle wrote: >Hi, > >One more . . . > >I'm also trying to realize the Markov chain on page 287 in Dodge's book. It >requires random choices with a probability. How can I do a random choice >with skewed probabilities? I know you could do >#[1, 1, 2, 3].choose >for a 50% chance of 1 and 25% chance of the others, but how could I create a >function that would give me finer tuned numbers, like >.125 chance of choosing 1 >.675 chance of choosing 2 >etc. > >I can't see how to do it with coin or any of the Sequenceable Collection >instances. This is not provided, but there is no reason you cannot implement it yourself for now. There are several ways you can do it. Filling a table with multiple copies of the same item to skew the results is less space efficient for fine granularities but it has the advantage of being a O(1) constant time algorithm for lookup. Using a list of probabilities and scanning across the list until the sum exceeds the value of a random number is space efficient, but takes O(n) time to do the look up. And you have to know the sum of the list or always make the list sum to a known value, e.g. 1. Preprocessing the list so that it has a list of summed probabilities in sorted order can use a O(log(n)) binary search algorithm, but requires a preprocessed list. Here is the O(n) method: var wchoose, h, p; // choose an index from a list of weights wchoose = { arg weights; // assumes weights sum to 1.0 var r, sum = 0.0, index=0; r = 1.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); index; }; // test p = [0.1, 0.6, 0.3]; // a list of probabilities h = [0, 0, 0]; // histogram 1000.do({ var j; j = wchoose.value(p); h.put(j, h.at(j) + 1); // inc histo }); h.postln; If you want to have a separate list of values to choose and their weights: [\a, \b, \c].at( wchoose.value([0.1, 0.6, 0.3]) ).postln; You could add this method to SequenceableCollection: wchoose { arg weights; var r, sum = 0.0, index=0; r = 1.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); ^this.at(index); } Then do: [\a, \b, \c].wchoose([0.1, 0.6, 0.3]).postln; This would be a good candidate for me to make into a primitive. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Wed, 28 Jul 1999 09:21:34 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, >>I'm also trying to realize the Markov chain on page 287 in Dodge's book. It >>requires random choices with a probability. How can I do a random choice [...] > This is not provided, but there is no reason you cannot implement it > yourself for now. There are several ways you can do it. Filling a table [...] Great. I'll try them. The way I was going to do it is with a tree of binary searches using coin. In the code below a is 40%, b is 50% of the remainder, c is 90% and d is 10% of the remainder: a = 40, b = 30, c = 27, d = 3. Would this be any more efficient? a = 0; b = 0; c = 0; d = 0; 100.do({ if(0.4.coin, {a = a + 1}, { if(0.5.coin, {b = b + 1}, { if(0.9.coin, {c = c + 1}, {d = d + 1} ) } ) } ) }); a.postln; b.postln; c.postln; d.postln; (a + b + c + d).postln; "----".postln; Here are the results: 31 33 31 5 100 - ---- 43 31 24 2 100 - ---- 42 32 24 2 100 - ---- 41 28 27 4 100 - ---- 40 25 32 3 100 - ---- 42 29 26 3 100 - ---- 53 15 30 2 100 - ---- 38 31 30 1 100 - ---- ------------------------------ Date: Wed, 28 Jul 1999 12:28:50 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 9:21 AM -0600 7/28/99, David Cottle wrote: >Hi, > >>>I'm also trying to realize the Markov chain on page 287 in Dodge's book. It >>>requires random choices with a probability. How can I do a random choice >[...] > >> This is not provided, but there is no reason you cannot implement it >> yourself for now. There are several ways you can do it. Filling a table >[...] > >Great. I'll try them. > >The way I was going to do it is with a tree of binary searches using coin. >In the code below a is 40%, b is 50% of the remainder, c is 90% and d is 10% >of the remainder: a = 40, b = 30, c = 27, d = 3. Would this be any more >efficient? No, and much harder to write. I coded up a couple of primitives to support this this morning which will be in the next release. So if you use the wchoose method I gave, then it will be more efficient once that release is out. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 28 Jul 1999 13:11:38 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, >>>>I'm also trying to realize the Markov chain on page 287 in Dodge's book. It >>>>requires random choices with a probability. How can I do a random choice >>[...] >> >>> This is not provided, but there is no reason you cannot implement it >>> yourself for now. There are several ways you can do it. Filling a table >>[...] >> >>Great. I'll try them. >> >>The way I was going to do it is with a tree of binary searches using coin. >>In the code below a is 40%, b is 50% of the remainder, c is 90% and d is 10% >>of the remainder: a = 40, b = 30, c = 27, d = 3. Would this be any more >>efficient? > > No, and much harder to write. > I coded up a couple of primitives to support this this morning which I used the wchoose and it works fine. You left off an "=" in one example, which threw me for a second, but I figured it out. Thanks. ------------------------------ Date: Wed, 28 Jul 1999 14:24:37 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 1:11 PM -0600 7/28/99, David Cottle wrote: >You left off an "=" in one example, Where? It looks ok to me.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 28 Jul 1999 14:34:56 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, One of the lower examples, which I looked at first: > If you want to have a separate list of values to choose and their weights: > > [\a, \b, \c].at( wchoose.value([0.1, 0.6, 0.3]) ).postln; > > > You could add this method to SequenceableCollection: > > wchoose { arg weights; ^^^^^^ > var r, sum = 0.0, index=0; > r = 1.0.rand; ------------------------------ Date: Wed, 28 Jul 1999 16:11:38 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 2:34 PM -0600 7/28/99, David Cottle wrote: >Hi, > >One of the lower examples, which I looked at first: > >> If you want to have a separate list of values to choose and their weights: >> >> [\a, \b, \c].at( wchoose.value([0.1, 0.6, 0.3]) ).postln; >> >> >> You could add this method to SequenceableCollection: >> >> wchoose { arg weights; > ^^^^^^ >> var r, sum = 0.0, index=0; >> r = 1.0.rand; No that is correct. It is a method definition for class SequenceableCollection. It is meant to be put into SequenceableCollection.sc . wchoose { arg weights; var r, sum = 0.0, index=0; r = 1.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); ^this.at(index); } Once you put that method into SequenceableCollection.sc and recompile, you can write: [\a, \b, \c].wchoose([0.1, 0.6, 0.3]).postln; --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 28 Jul 1999 17:23:50 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, > No that is correct. It is a method definition for class Got it. ------------------------------ Date: Wed, 28 Jul 1999 19:43:17 -0500 From: Kenneth N Babb <---@---.---> Subject: Re: Probability >wchoose { arg weights; > var r, sum = 0.0, index=0; > r = 1.0.rand; > weights.detect({ arg weight, i; > sum = sum + weight; > if (sum >= r, { > index = i; > true; > },{ false }); > }); > ^this.at(index); >} > > >Once you put that method into SequenceableCollection.sc and recompile, >you can write: > >[\a, \b, \c].wchoose([0.1, 0.6, 0.3]).postln; James, I "installed" this method definition into SequenceableCollection.sc ealier today. I've noticed that changing 0.3 a larger value, say 1.0, and leaving the other values unchanged doesn't result in a high number of c outputs. I would expect that doing this should result in a long string of c's with an occational a or b. If I change either 0.1 or 0.6 to larger values and leave the other two vaules unchanged, the result is pretty much what I expect; long strings of either a or b (i.e. if 0.1 is changed to 1.0 and 0.6 and 0.3 remain unchanged, then the result is a long string of a's with an occational b.) Is the position of a value within the list (if it is placed first or last) factored into the wieght? Regards, Kenneth Babb ------------------------------ Date: Wed, 28 Jul 1999 19:34:57 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 6:43 PM -0600 7/28/99, Kenneth N Babb wrote: >I "installed" this method definition into SequenceableCollection.sc ealier >today. >I've noticed that changing 0.3 a larger value, say 1.0, and leaving The values must sum to 1.0 : > Using a list of probabilities and scanning across >the list until the sum exceeds the value of a random number is space >efficient, but takes O(n) time to do the look up. And you have to >know the sum of the list or always make the list sum to a known >value, e.g. 1. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 28 Jul 1999 20:52:22 -0600 From: James McCartney <---@---.---> Subject: crashing bug.. Don't use syntax colorize while playing. After doing a syntax colorize during playback you can usually expect a crash. I am accidentally mucking with something I shouldn't there. This will be fixed in the next release.. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 28 Jul 1999 21:20:12 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, > I "installed" this method definition into SequenceableCollection.sc ealier > today. > I've noticed that changing 0.3 a larger value, say 1.0, and leaving [...] But this answers one of my questions, what if you screw up the values. The answer is it won't crash, but won't do what you want. I wondered this because I'm entering (was entering, see below), values like 0.625, 0.4375, etc. (600 or so) and was thinking of a way I could check to see that they all sum to 1.0 and worrying that it would lock up. Then I hit on an idea that has caused problems elsewhere. (Disclaimer: I'm very self conscious about my code. But it's the only way I'm going to learn. I try to do as much as I can on my own.) I realized that all the fractions given on page 287 of Dodge were in sixteenths (0.625 = 10/16, 0.4375 = 7/16). So I created an array with values from 0 to 16. This made it easy to check if all the values sum to 16 and it also helped me enter the values, since SC recognized 00, 01, and 12, etc. all as integers. The result is a tidy array. I adjusted the range of wchoose to 16. I tried this in a smaller version and it checked out: var wchoose, h, p, m; // choose an index from a list of weights wchoose = { arg weights; // assumes weights sum to 16 var r, sum = 0.0, index=0; r = 16.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); index; }; a = [1, 1]; 10.do( { [ [1, 1], [1, 2], [1, 3], [3, 1], [2, 1] ].do({arg index, i; if(index == a, {b = i; true;}, {false})}); b.postln; //just to check to see if I get the right value //these values always assure [1, n] and [n, 1] p = [ [00, 06, 10], //0 [16, 00, 00], //1 [16, 00, 00], //2 [00, 10, 06], //3 [00, 02, 14] //4 ]; // a list of probabilities m = [1, 2, 3]; p.at(b).postln; //likewise, just checking n = m.at(wchoose.value(p.at(b))); n.postln; //checking a = a.insert(2, n); a.postln; a = a.copyRange(1, 2); a.postln; }) But when I try it with the larger model, with all the values from Dodge, I get a complaint about the array (not an integer). Sorry for the lack of comments (I also realize there's probably a slicker way to get the previousPitch array to reflect the most recent change other than insert and copyRange--is there?). I also realize this will only play one pitch. I just wanted to see if it worked first. //Stephen Foster tunes: ( var wchoose, h, p, m, pitch, nextPitch, previousPair, previousPairIndex; previousPair = [1, 1]; // choose an index from a list of weights wchoose = { arg weights; // assumes weights sum to 16 var r, sum = 0.0, index=0; r = 16.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); index; }; [ [-2, 0], //B3 to D4 [-1, 0], //C#3 to D4 //D4 to etc. [0, -2], [0, -1], [0, 0], [0, 2], [0, 4], [0, 5], [0, 7], [0, 11], [0, 12], [2, -1], [2, 0], [2, 2], [2, 4], [2, 7], [2, 12], [4, 0], [4, 2], [4, 4], [4, 5], [4, 7], [4, 9], [5, 4], [5, 5], [5, 7], [5, 9], [6, 7], [7, 0], [7, 4], [7, 5], [7, 6], [7, 7], [7, 9], [7, 12], [9, 0], [9, 4], [9, 5], [9, 7], [9, 9], [9, 12], [11, 9], [11, 12], [12, 7], [12, 9], [12, 11], [12, 12], [12, 14], [14, 7], [14, 11] ].do({arg index, i; if(index == previousPair, {previousPairIndex = i;}) }); m = [-2, -1, 0, 2, 4, 5, 6, 7, 9, 11, 12, 14]; //In the book the percentages are given as floating points, but after entering //about 16 I realized they were repeating and discovered they are all multiples //of 1/16, or n/16. I thought giving the n here is clearer, easier to check (they //should total 16) and keep track. nextPitch = [ // [01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12] [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [-2, 0] [00, 00, 05, 06, 00, 00, 00, 05, 00, 00, 00, 00], // [-1, 0] [00, 00, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [0, -2] [00, 00, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [0, -1] [00, 02, 02, 09, 02, 10, 00, 00, 00, 00, 00, 00], // [0, 0] [00, 00, 03, 04, 08, 00, 00, 10, 00, 00, 00, 00], // [0, 2] [00, 00, 00, 07, 03, 02, 00, 04, 00, 00, 00, 00], // [0, 4] [00, 00, 00, 00, 11, 00, 00, 00, 05, 00, 00, 00], // [0, 5] [00, 00, 00, 00, 04, 00, 00, 12, 00, 00, 00, 00], // [0, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 01, 00], // [0, 11] [00, 00, 00, 00, 00, 00, 00, 02, 11, 03, 00, 00], // [0, 12], [00, 00, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [2, -1] [10, 00, 10, 04, 05, 00, 00, 10, 00, 10, 03, 00], // [2, 0] [00, 10, 12, 10, 02, 00, 00, 00, 00, 00, 00, 00], // [2, 2] [00, 00, 01, 03, 06, 04, 00, 01, 01, 00, 00, 00], // [2, 4] [00, 00, 00, 00, 00, 00, 00, 13, 03, 00, 00, 00], // [2, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 01, 00, 00], // [2, 12], [00, 00, 00, 12, 03, 01, 00, 00, 00, 00, 00, 00], // [4, 0] [00, 02, 07, 03, 02, 00, 00, 01, 00, 01, 00, 00], // [4, 2] [00, 00, 03, 04, 06, 02, 00, 01, 00, 00, 00, 00], // [4, 4] [00, 00, 00, 00, 04, 03, 00, 06, 03, 00, 00, 00], // [4, 5] [00, 00, 00, 00, 02, 00, 00, 10, 03, 00, 01, 00], // [4, 7] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [4, 9], [00, 00, 00, 08, 00, 08, 00, 00, 00, 00, 00, 00], // [5, 4] [00, 00, 00, 00, 00, 08, 00, 08, 00, 00, 00, 00], // [5, 5] [00, 00, 02, 00, 00, 00, 00, 10, 00, 00, 04, 00], // [5, 7] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [5, 9], [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [6, 7], [00, 00, 00, 11, 05, 00, 00, 00, 00, 00, 00, 00], // [7, 0] [00, 00, 05, 04, 03, 01, 00, 02, 01, 00, 00, 00], // [7, 4] [00, 00, 00, 00, 16, 00, 00, 00, 00, 00, 00, 00], // [7, 5] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [7, 6] [00, 00, 00, 00, 04, 01, 01, 05, 05, 00, 00, 00], // [7, 7] [00, 00, 01, 00, 01, 00, 00, 12, 01, 00, 01, 00], // [7, 9] [00, 00, 00, 00, 00, 00, 00, 06, 05, 03, 02, 00], // [7, 12], [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [9, 0] [00, 00, 00, 11, 05, 00, 00, 00, 00, 00, 00, 00], // [9, 4] [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [9, 5] [00, 00, 01, 00, 09, 01, 00, 02, 01, 00, 02, 00], // [9, 7] [00, 00, 00, 00, 02, 00, 00, 12, 00, 00, 02, 00], // [9, 9] [00, 00, 00, 00, 00, 00, 00, 09, 02, 05, 00, 00], // [9, 12], [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [11, 9] [00, 00, 00, 00, 00, 00, 00, 00, 06, 00, 00, 10], // [11, 12], [00, 00, 00, 00, 14, 00, 00, 02, 00, 00, 00, 00], // [12, 7] [00, 00, 00, 00, 00, 01, 00, 05, 06, 00, 04, 00], // [12, 9] [00, 00, 00, 00, 00, 00, 00, 00, 00, 12, 04, 00], // [12, 11] [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [12, 12] [00, 00, 00, 00, 00, 00, 00, 05, 00, 11, 00, 00], // [12, 14], [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [14, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 16, 00] // [14, 11] ]; pitch = m.at(wchoose.value(nextPitch.at(previousPairIndex))); previousPair = previousPair.insert(2, n); previousPair = previousPair.copyRange(1, 2); Pbind( \dur, Prand([ Pseq(#[1]), Pseq(#[0.5, 0.5]), Pseq(#[0.5, 0.5]), Pseq(#[0.25, 0.25, 0.25, 0.25]), Pseq(#[0.5, 0.25, 0.25]), Pseq(#[0.25, 0.25, 0.5]), Pseq(#[0.25, 0.5, 0.25]) ], inf), \midinote, pitch + 59 ).play(Event.protoEvent); ) ------------------------------ Date: Wed, 28 Jul 1999 23:00:13 -0600 From: James McCartney <---@---.---> Subject: Re: Probability At 9:20 PM -0600 7/28/99, David Cottle wrote: >previousPair = [1, 1]; >[ > [-2, 0], //B3 to D4 > [-1, 0], //C#3 to D4 > //D4 to etc. > [0, -2], [0, -1], [0, 0], [0, 2], [0, 4], [0, 5], [0, 7], [0, 11], [0, 12], > [2, -1], [2, 0], [2, 2], [2, 4], [2, 7], [2, 12], > [4, 0], [4, 2], [4, 4], [4, 5], [4, 7], [4, 9], > [5, 4], [5, 5], [5, 7], [5, 9], > [6, 7], > [7, 0], [7, 4], [7, 5], [7, 6], [7, 7], [7, 9], [7, 12], > [9, 0], [9, 4], [9, 5], [9, 7], [9, 9], [9, 12], > [11, 9], [11, 12], > [12, 7], [12, 9], [12, 11], [12, 12], [12, 14], > [14, 7], [14, 11] >].do({arg index, i; if(index == previousPair, > {previousPairIndex = i;}) > }); There is no [1, 1] in the table above, so index == previousPair never succeeds. That causes this to fail : >nextPitch.at(previousPairIndex) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 29 Jul 1999 12:28:37 +0800 From: Mark Ballora <---@---.---> Subject: Re: controlling synth duration I'm still working with this. I can see how changing this stopIt variable won't change the duration, since it was already set at run-time. But is there a way to stop Synth.play other than with the duration argument? That is, by something other than a time specification, but rather via some event? Something akin to Spawn.stop. Mark >I'm varying the synth.trepeatN rate with a controller a la the following. > >My question: how can I stop playback when the maxRepeats count has been >reached? I tried using the completion function to change a variable which >controlled duration, but the synth doesn't stop. > >( >var stopIt=5; >// repeat at random intervals by using a function for the period >Synth.play({ arg synth; > var freqCtl; > a=MouseX.kr(0.1, 3, 'exponential'); > freqCtl = Plug.kr(800, 0); > synth.trepeatN(0, { a.poll },10, > { freqCtl.source = 700.rand + 500; }, > { arg synth, now; stopIt=now} > ); > > SinOsc.ar(freqCtl, 0, 0.2); >},stopIt) >) ------------------------------ Date: Wed, 28 Jul 1999 23:50:09 -0600 From: James McCartney <---@---.---> Subject: Re: controlling synth duration At 10:28 PM -0600 7/28/99, Mark Ballora wrote: >I'm still working with this. >I can see how changing this stopIt variable won't change the duration, >since it was already set at run-time. > >But is there a way to stop Synth.play other than with the duration >argument? You can't. What is it that you really want to do? Stop a sound? Put it in a Pause controlled by a Plug.kr(1). Set the Plug's source to zero when you want the sound to stop. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Thu, 29 Jul 1999 00:01:17 -0600 From: "David Cottle" <---@---.---> Subject: Re: Probability Hi, >>previousPair = [1, 1]; > >>[ >> [-2, 0], //B3 to D4 [...] >>].do({arg index, i; if(index == previousPair, >> {previousPairIndex = i;}) >> }); > > > There is no [1, 1] in the table above, so index == previousPair > never succeeds. > > That causes this to fail : Duh . . . Thanks. ------------------------------ Date: Thu, 29 Jul 1999 01:36:22 -0600 From: "David Cottle" <---@---.---> Subject: Foster Song Hi, Got it to work. (Markov chain from second-order transition table as described in Dodge, page 286-7.) I'll clean it up a little more for the demo to our techno committee next week. Any comments on the code would be appreciated. Here is the rough draft: //Stephen Foster tunes: ( var wchoose, h, p, m, pitch, nextPitch, pchoose, previousPair, previousPairIndex; previousPair = [0, 0]; // choose an index from a list of weights wchoose = { arg weights; // assumes weights sum to 16 var r, sum = 0.0, index=0; r = 16.0.rand; weights.detect({ arg weight, i; sum = sum + weight; if (sum >= r, { index = i; true; },{ false }); }); index; }; pchoose = { [ [-3, 0], //B3 to D4 [-1, 0], //C#3 to D4 //D4 to etc. [0, -3], [0, -1], [0, 0], [0, 2], [0, 4], [0, 5], [0, 7], [0, 11], [0, 12], [2, -1], [2, 0], [2, 2], [2, 4], [2, 7], [2, 12], [4, 0], [4, 2], [4, 4], [4, 5], [4, 7], [4, 9], [5, 4], [5, 5], [5, 7], [5, 9], [6, 7], [7, 0], [7, 4], [7, 5], [7, 6], [7, 7], [7, 9], [7, 12], [9, 0], [9, 4], [9, 5], [9, 7], [9, 9], [9, 12], [11, 9], [11, 12], [12, 7], [12, 9], [12, 11], [12, 12], [12, 14], [14, 7], [14, 11] ].do({arg index, i; if(index == previousPair, {previousPairIndex = i;}) }); m = [-3, -1, 0, 2, 4, 5, 6, 7, 9, 11, 12, 14]; //In the book the percentages are given as floating points, but after entering //about 16 I realized they were repeating and discovered they are all multiples //of 1/16, or n/16. I thought giving the n here is clearer, easier to check (they //should total 16) and keep track. nextPitch = [ // [01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12] [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [-3, 0] [00, 00, 05, 06, 00, 00, 00, 05, 00, 00, 00, 00], // [-1, 0] [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [0, -3] [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [0, -1] [00, 02, 02, 09, 02, 10, 00, 00, 00, 00, 00, 00], // [0, 0] [00, 00, 03, 04, 08, 00, 00, 01, 00, 00, 00, 00], // [0, 2] [00, 00, 00, 07, 03, 02, 00, 04, 00, 00, 00, 00], // [0, 4] [00, 00, 00, 00, 11, 00, 00, 00, 05, 00, 00, 00], // [0, 5] [00, 00, 00, 00, 04, 00, 00, 12, 00, 00, 00, 00], // [0, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 16, 00], // [0, 11] [00, 00, 00, 00, 00, 00, 00, 02, 11, 03, 00, 00], // [0, 12], [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [2, -1] [01, 00, 01, 04, 05, 00, 00, 01, 00, 01, 03, 00], // [2, 0] [00, 01, 12, 01, 02, 00, 00, 00, 00, 00, 00, 00], // [2, 2] [00, 00, 01, 03, 06, 04, 00, 01, 01, 00, 00, 00], // [2, 4] [00, 00, 00, 00, 00, 00, 00, 13, 03, 00, 00, 00], // [2, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00], // [2, 12], [00, 00, 00, 12, 03, 01, 00, 00, 00, 00, 00, 00], // [4, 0] [00, 02, 07, 03, 02, 00, 00, 01, 00, 01, 00, 00], // [4, 2] [00, 00, 03, 04, 06, 02, 00, 01, 00, 00, 00, 00], // [4, 4] [00, 00, 00, 00, 04, 03, 00, 06, 03, 00, 00, 00], // [4, 5] [00, 00, 00, 00, 02, 00, 00, 10, 03, 00, 01, 00], // [4, 7] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [4, 9], [00, 00, 00, 08, 00, 08, 00, 00, 00, 00, 00, 00], // [5, 4] [00, 00, 00, 00, 00, 08, 00, 08, 00, 00, 00, 00], // [5, 5] [00, 00, 02, 00, 00, 00, 00, 10, 00, 00, 04, 00], // [5, 7] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [5, 9], [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [6, 7], [00, 00, 00, 11, 05, 00, 00, 00, 00, 00, 00, 00], // [7, 0] [00, 00, 05, 04, 03, 01, 00, 02, 01, 00, 00, 00], // [7, 4] [00, 00, 00, 00, 16, 00, 00, 00, 00, 00, 00, 00], // [7, 5] [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [7, 6] [00, 00, 00, 00, 04, 01, 01, 05, 05, 00, 00, 00], // [7, 7] [00, 00, 01, 00, 01, 00, 00, 12, 01, 00, 01, 00], // [7, 9] [00, 00, 00, 00, 00, 00, 00, 06, 05, 03, 02, 00], // [7, 12], [00, 00, 16, 00, 00, 00, 00, 00, 00, 00, 00, 00], // [9, 0] [00, 00, 00, 11, 05, 00, 00, 00, 00, 00, 00, 00], // [9, 4] [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [9, 5] [00, 00, 01, 00, 09, 01, 00, 02, 01, 00, 02, 00], // [9, 7] [00, 00, 00, 00, 02, 00, 00, 12, 00, 00, 02, 00], // [9, 9] [00, 00, 00, 00, 00, 00, 00, 09, 02, 05, 00, 00], // [9, 12], [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [11, 9] [00, 00, 00, 00, 00, 00, 00, 00, 06, 00, 00, 10], // [11, 12], [00, 00, 00, 00, 14, 00, 00, 02, 00, 00, 00, 00], // [12, 7] [00, 00, 00, 00, 00, 01, 00, 05, 06, 00, 04, 00], // [12, 9] [00, 00, 00, 00, 00, 00, 00, 00, 12, 00, 04, 00], // [12, 11] [00, 00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00], // [12, 12] [00, 00, 00, 00, 00, 00, 00, 05, 00, 11, 00, 00], // [12, 14], [00, 00, 00, 00, 00, 00, 00, 16, 00, 00, 00, 00], // [14, 7] [00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 16, 00] // [14, 11] ]; pitch = m.at(wchoose.value(nextPitch.at(previousPairIndex))); previousPair = previousPair.insert(2, pitch); previousPair = previousPair.copyRange(1, 2); pitch = pitch + 59; }; Pbind( \dur, Prand([ Pseq(#[1]), Pseq(#[0.5, 0.5]), Pseq(#[0.5, 0.5]), Pseq(#[0.25, 0.25, 0.25, 0.25]), Pseq(#[0.5, 0.25, 0.25]), Pseq(#[0.25, 0.25, 0.5]), Pseq(#[0.25, 0.5, 0.25]) ], inf), \midinote, pchoose ).play(Event.protoEvent); ) - -- ><><><><><><><><><><><> David Cottle composition, notation, contra lime@uiuc.edu ------------------------------ End of sc-users-digest V1 #52 *****************************