From the CottleSC3 document, I want to try this example:
(
{
var bufNum = ~b_med1.bufnum, srate = 44100, start = 0, end = 3, duration, rate = 1;
// Use these lines for proportional lengths
// var bufNum = 0, srate = 44100, start = 0.21, end = 0.74,
// rate = 1, duration, total;
// total = BufFrames.kr(bufNum)/44100;
// end = end*total; start = start*total;
duration = abs(end - start);
BufRd.ar(2, bufNum, // Buffer 0
LinLin.ar(
LFSaw.ar(rate/duration, 1), -1, 1, start, end)*srate)*EnvGen.kr(Env.linen(0.01, 0.98, 0.01),
timeScale: duration, gate: Impulse.kr(1/duration));
}.play
)
But I get this error and can’t find the problem:
ERROR: syntax error, unexpected $end, expecting ')'
in file 'selected text'
line 1 char 3:
(
-----------------------------------
ERROR: Command line parse failed
-> nil