Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s.options.hardwareBufferSize = 256;
- s.recHeaderFormat = "wav";
- s.options.memSize = 65536*4;
- s.boot;
- (
- ~tempo.value();
- ~patches.value();
- ~synthdefs.value();
- ~buffers.value();
- ~patterns.value();
- )
- (
- (
- ~tempo = {(
- t = TempoClock.new(137/60, queueSize: 2048 * 128);
- t.tempo_(137/60);
- )};
- );
- ~tempo.value();
- )
- (
- (
- ~patches = {(
- ~sources = Group.head;
- ~mixer = Group.tail;
- ~patch1 = Bus.audio(s, 2);
- ~patch4 = Bus.audio(s, 2);
- ~channel1 = Group.tail(~mixer);
- ~master = Group.tail(~mixer);
- )};
- );
- ~patches.value();
- )
- (
- (
- ~synthdefs = {(
- ~s = Scale.minor.degrees.midiratio;
- ~d = Scale.major.degrees.midiratio;
- SynthDef.new(\mainbuf, {
- arg amp = 1, pan = 0, rate = 1, pos = 0, bank, atk = 0.01, rel = 1, loop = 1, gate = 1, fader = 1, patch = 22, bufrate = 44100, smoothing = 0.5;
- var sig, env, z;
- env = EnvGen.kr(Env.perc(atk, rel), gate, doneAction: 2);
- sig = PlayBuf.ar(1, bank, BufRateScale.kr(bank) * rate, 1, pos, loop) * env;
- sig = Pan2.ar(sig, pan);
- sig = Out.ar(patch, sig * amp);
- }).add;
- ~channel1 = (
- SynthDef(\ch1mix, {
- arg moogcut = 21000, gain = 0, highcut = 22, lowcut = 22, fader = 1, crossfader = 1, maxdelaytime = 0.2, delaytime = 0.2, decaytime = 1.0, mul = 1, pitchRatio = 1, pitchDispersion = 0, timeDispersion = 0;
- var sig;
- sig = In.ar(~patch1, 2);
- //sig = MoogFF.ar(sig, moogcut, gain);
- //sig = AllpassC.ar(sig, maxdelaytime, delaytime, decaytime, mul);
- //sig = HPF.ar(sig, highcut);
- //sig = PitchShift.ar(sig, delaytime, pitchRatio, pitchDispersion, timeDispersion);
- sig = Out.ar(~patch4, sig);
- }).play(~channel1);
- );
- ~master = (
- SynthDef(\mastermix, {
- arg moogcut = 29000, gain = 0, highcut = 22, mix = 0.33, room = 0.5, damp = 0.5;
- var sig;
- sig = In.ar(~patch4, 2);
- sig = FreeVerb.ar(sig, mix, room, damp);
- sig = Compander.ar(sig);
- sig = Limiter.ar(sig);
- sig = Out.ar(0, sig);
- }).play(~master);
- );
- )};
- );
- ~synthdefs.value();
- )
- (
- (
- ~buffers = {(
- Buffer.freeAll;
- ~bufbank = Array.newClear(30);
- 30.do({ arg i;
- ~bufbank[i] = Buffer.readChannel(s, "/Users/spyridonpallis/Documents/SuperCollider/Samples/D7X/untitled" ++ (i+1).asString ++ ".wav", channels: [0]);
- });
- 8.do({ arg i;
- ~bufbank.add(Buffer.alloc(s, s.sampleRate * 4.0, 1));
- });
- );
- };
- );
- ~buffers.value();
- )
- (
- (
- ~patterns = {(
- x = CSVFileReader.read("/Users/spyridonpallis/Desktop/CsvDemo.csv", true).postcs;
- (
- Routine {
- var i = 0;
- loop {
- ~csvdata = x[i];
- ~csvdata.postln;
- i = i + 1;
- 1.wait;
- };
- }.play;
- );
- (
- Pdef(\a1, Pbind(
- \instrument, \mainbuf, \group, ~sources,
- \patch, ~patch1,
- \amp, Pseq([
- 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,
- ] * 0.6, inf),
- \dur, 1/4,
- \atk, 0.1,
- \rel, 0.1,
- \rate, Pfunc({~csvdata.asInteger}),
- \pos, Pseq([0, 100], inf),
- \bank, Pseq([1, 2, 3].stutter(4), inf),
- )).quant_(4);
- );
- Pdef(\a1).play(t, quant:4);
- //Pdef(\a1).stop(t, quant:4);
- );
- };
- );
- ~patterns.value();
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement