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

Re: [sc-users] Guess the melody




28 jul 2009 kl. 00.12 skrev Lucas Samaruga:

Hi

The game is "guess the melody"
(old guessing game)

(
SynthDef(\diffalea, { arg freq = 220, gate = 1, amp = 1, lowFreq =
1000, hiFreq = 1500;
	var freq1 = Rand(lowFreq, hiFreq);
	var freq2 = freq1 - freq;
var env = EnvGen.kr(Env.asr(0.01, 1, 0.01, 1, 'linear'), gate, doneAction: 2);
	Out.ar(0, SinOsc.ar([freq1, freq2], 0.5pi.rand, mul:amp*env));
	//Out.ar(1, Mix(SinOsc.ar([freq1, freq2], 0.5pi.rand, mul:amp*env)));
}).memStore;

~freqs = [130.8127826503, 146.8323839587, 164.81377845643,
130.8127826503, 130.8127826503, 146.8323839587, 164.81377845643,
130.8127826503, 164.81377845643, 174.6141157165, 195.99771799087,
164.81377845643, 174.6141157165, 195.99771799087, 195.99771799087,
220, 195.99771799087, 174.6141157165, 164.81377845643, 130.8127826503,
195.99771799087, 220, 195.99771799087, 174.6141157165,
164.81377845643, 130.8127826503, 146.8323839587, 97.998858995437,
130.8127826503, 146.8323839587, 97.998858995437, 130.8127826503];

~duras = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 0.5, 0.5, 0.5,
0.5, 1, 1, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 1, 2, 1, 1, 2];
)

(
~tempo = TempoClock(80/60);

Task {
	Pbind(
		\instrument, \diffalea,
		\lowFreq, 4200, \hiFreq, 4400,
		\freq, Pseq(~freqs, 1),
		\dur, Pseq(~duras, 1)
	).play(~tempo);
	
	8.wait;
	
	Pbind(
		\instrument, \diffalea,
		\lowFreq, 1200, \hiFreq, 1400,
		\freq, Pseq(~freqs, 1),
		\dur, Pseq(~duras, 1)
	).play(~tempo);
	
	8.wait;
	
	Pbind(
		\instrument, \diffalea,
		\lowFreq, 2200, \hiFreq, 2400,
		\freq, Pseq(~freqs, 1),
		\dur, Pseq(~duras, 1)
	).play(~tempo);
}.play(~tempo);
)

Warning it's loud!
Is there other way to make a canon with Pbind?

you can misuse \strum...
Pbind(\dur, Pseq(#[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 0.5, 0.5, 0.5, 0.5, 1, 1, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 1, 2, 1, 1, 2], inf), \degree, Pseq(#[0, 1, 2, 0, 0, 1, 2, 0, 2, 3, 4, 2, 3, 4, 4, 5, 4, 3, 2, 0, 4, 5, 4, 3, 2, 0, 0, -3, 0, 0, -3, 0], inf)+#[0, 7, -7], \strum, 8).play(TempoClock(4))

_f


  #|
     fredrikolofsson.com     klippav.org     musicalfieldsforever.com
  |#


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/