Sequencing events in supercollider - routine breaks at third or fourth step
greetings
i am running supercollider 3.10 in ubuntu linux 20.04 lts in an acer predator helios 300 with core i7 8gb ddr4 ram, 500 gb sata disk 250 gb ssd drive with an nvidia gtx 1050. i built a sequenced piece with small samples i grabbed from microsounds music by other people, and i am currently trying to see whether i can get the code fully functional and with nice syntax. i am getting an error on third or fourth step of this routine.
can someone help me to possibly fix this, and improve syntax a little bit?
thank you so much
(
~bufPaths = [
thisProcess.nowExecutingPath.dirname +/+ "3_1.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_2.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_3.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_4.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_5.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_6.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_7.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_8.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_9.wav",
thisProcess.nowExecutingPath.dirname +/+ "3_10.wav",
thisProcess.nowExecutingPath.dirname +/+ "4_1.wav",
thisProcess.nowExecutingPath.dirname +/+ "5.wav",
thisProcess.nowExecutingPath.dirname +/+ "6.wav",
thisProcess.nowExecutingPath.dirname +/+ "7.wav",
thisProcess.nowExecutingPath.dirname +/+ "8.wav",
thisProcess.nowExecutingPath.dirname +/+ "9.wav",
thisProcess.nowExecutingPath.dirname +/+ "10.wav",
thisProcess.nowExecutingPath.dirname +/+ "11.wav"
];
)
~buffers = ~bufPaths.collect(Buffer.read(s,_));
//~buffers = "/media/tmm467/2ED5-246E/electroacousticSampling/*.wav".pathMatch.collect(Buffer.read(_))
(
SynthDef(\playBuf2) { |out=0, buf=0, amp=12, loop=1|
Out.ar(out, PlayBuf.ar(2, buf, loop:1, doneAction: Done.freeSelf) * amp)
}.add;
)
(
~score = [
(buf: 0, dur: 30),
(buf: 1, dur: 30),
s.freeAll,
(buf: 1, dur: 30),
(buf: 2, dur: 30),
{s.freeAll},
(buf: 3, dur: 30),
(buf: 4, dur: 30),
{s.freeAll; 5.wait},
(buf: 6, dur: 30),
(buf: 7, dur: 30),
{s.freeAll},
(buf: 7, dur: 30),
(buf: 8, dur: 30),
{s.freeAll},
(buf: 9, dur: 30),
(buf: 10, dur: 30),
{s.freeAll; 5.wait},
(buf: 11, dur: 30),
(buf: 12, dur: 30),
{s.freeAll},
(buf: 13, dur: 30),
(buf: 14, dur: 30),
{s.freeAll},
(buf: 15, dur: 30),
(buf: 16, dur: 30),
(buf: 17, dur: 30),
{s.freeAll; 5.wait},
(buf: 0, dur: 30),
(buf: 1, dur: 30),
{s.freeAll},
];
)
(
r = Routine {
~score.do {|ev|
var event = ev.value.postln;
if(event.respondsTo(\play)) { ((instrument: \playBuf2) ++ event).postln.play };
(event.dur ? 0).wait;
}
}
)
r.play;
r.stop; Server.freeAll;