‹ Tweets2 Max Ports ›

Klee

2010-12-06 03:45 supercollider

clean-up #21:

Attached is a Klee step-sequencer as a SuperCollider list-pattern class. The included help file should explain how it works.

There are a couple of ways to make a Klee sequencer on the server-side as well. In the below examples I used argument lists, but one can also do it using buffers together with the Index UGen.

(
SynthDef(\klee8, {|freq= 400, rate= 0.5,
    list= #[0, 0, 0, 0, 0, 0, 0, 0],
    mul= #[0, 0, 0, 0, 0, 0, 0, 0]|
    var i= LFSaw.kr(rate, 1, 0.5, 0.5)*list.size;
    var sum= (mul*Select.kr(i+(0..list.size-1)%list.size, list)).sum;
    var src= SinOsc.ar(freq+sum, 0, Decay2.kr(Impulse.kr(list.size*rate), 0.01, 0.1, 0.5));
    Out.ar(0, Pan2.ar(Mix(src)));
}).add;
)
a= Synth(\klee8)
a.set(\list, #[4, 0, 0, 2, 0, 0, 0, 0]*100)  //set the values
a.set(\mul, #[1, 0, 0, 0, 0, 0, 0, 0])  //activate 1 read head
a.set(\mul, #[1, 1, 0, 0, 0, 0, 0, 0])  //activate 2 read heads
a.set(\mul, #[1, 1, 1, 0, 0, 0, 0, 0])
a.set(\mul, #[1, 1, 1, 1, 0, 0, 0, 0])
a.set(\mul, #[1, 0.5, 0.25, 0, 0, 0, 0, 0])
a.set(\list, #[4, 0, -4, 2, 0, 0, 0, 0]*100)
a.set(\freq, 500)
a.set(\rate, 1.5)
a.free

And similar but with 16 steps. It is only to change the number of zeros in list and mul arguments.

(
SynthDef(\klee16, {|freq= 400, rate= 0.5,
    list= #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    mul= #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]|
    var i= LFSaw.kr(rate, 1, 0.5, 0.5)*list.size;
    var sum= (mul*Select.kr(i+(0..list.size-1)%list.size, list)).sum;
    var src= SinOsc.ar(freq+sum, 0, Decay2.kr(Impulse.kr(list.size*rate), 0.01, 0.1, 0.5));
    Out.ar(0, Pan2.ar(Mix(src)));
}).add;
)
a= Synth(\klee16)
a.set(\list, #[4, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0, 0]*100)  //set the values
a.set(\mul, #[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])  //activate 1 read head
a.set(\mul, #[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0])  //activate 2 read heads
a.set(\mul, #[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.25, 0, 0, 0, 0, 0])
a.set(\list, #[4, 0, -4, 2, 0, 0, 0, 0, 3, 0, -3, 2, 0, 0, 0, 0]*100)
a.set(\freq, 500)
a.set(\rate, 1.5)
a.free

Updates:

  • 180101: added new help file
Attachments:
Pklee.zip
‹ Tweets2 Max Ports ›