[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] more dumb stream questions




Op 30-dec-03 om 21:00 heeft sc-users-request@xxxxxxxxxxxxxxx het volgende geschreven:

Message: 5
Date: Tue, 30 Dec 2003 21:26:08 +1100
From: ccos <ccos@xxxxxxxxxxxxxxxx>
Subject: Re: [sc-users] More dumb stream questions
To: SuperCollider users mailing list <sc-users@xxxxxxxxxxxxxxx>
Message-ID: <950AEB2E-3AB2-11D8-8499-000393722276@xxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"


I'm making some progress with my little In C Xmas project, but
questions keep popping up.

I want to iterate over an array of patterns, but I can't figure out
how to construct a do loop that's doesn't make everyrhing happen at
once:

(
var inC;

inC= Array.newClear(54);


just in case you don't know, arrays in sc are indexed beginning with 0
not 1.

Yes. So I skip 0 and start with 1 for clarity. In fact, there are 53 patterns.


inC[1] =  Pbind( // pattern1
	\instrument, "fmgen_a_" ++ 35.rand,
	[\midinote,\dur], Pseq([Pseq([[60, 0.1],[64, 0.4]], 3)], {1 +
10.rand})
	);
	
inC[2] = Pbind( // pattern2
	\instrument, "fmgen_a_" ++ 35.rand,
	[\midinote,\dur], Pseq([Pseq([[60, 0.05],[64, 0.245], [65, 0.25],
[64, 0.5]])], {1 + 10.rand})
	);
	
inC[3]= Pbind(
	\instrument, "fmgen_a_" ++ 35.rand,
	[\midinote,\dur], Pseq([Pseq([[\, 0.25],[64, 0.25], [65, 0.25], [64,
0.25]])], {1 + 10.rand})	);  // any symbol is a rest, like \ or
whatever

	

// Pseq([inC[1], inC[2], inC[3]]).play; // This works OK, p[1]1 is
played, finishes, p[2] plays etc.

	inC.do{arg item; item.play} // but how do I do this? The 54 patterns
happen at once,
)


you need to embed your do loop in a Task or Routine.

Task({
	inC.do({ arg item;
		...
		t.wait;
	})	
}).play;

Hm. This means a new approach. The lenght of patterns is decided in the Pbind(...{+10.rand}). the t.wait thing might actually be a good alternative, I have to think this over.

I tried inserting Pseq somewhere in the do loop, to no avail.

Help much appreciated. I promise I will make a proper microtonal
version in return...


Cheers,

Zip