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

Re: [sc-users] wooh-kiki-woohwooh - Sequencing from text, using BufRd and Phasor



Thanks ccos, that was very helpful.


By "your arguments to BufRd are wrong", I assume you mean I should have

BufRd.ar(numChannels, bufnum, phase, loop)

retval = BufRd.ar(1,buf, Phasor.ar(0, BufRateScale.kr(0), start, end),0);

instead of just

retval = BufRd.ar(1,buf, Phasor.ar(0, BufRateScale.kr(0), start, end));

Am I right, or is it something else?

With the change above, I still have the looping problem.


I would like to understand how Phasor works too though.
My usage of it is just pasted straight from the BufRd helpfile.

Apple J on Phasor shows me:

Phasor : UGen {
*ar { arg trig = 0.0, rate = 1.0, start = 0.0, end = 1.0, resetPos = 0.0;
^'audio', trig, rate, start, end, resetPos)
}
*kr { arg trig = 0.0, rate = 1.0, start = 0.0, end = 1.0, resetPos = 0.0;
^'control', trig, rate, start, end, resetPos)
}
}

I can trace this to

Ugen.SC, and *multiNewList

Where to from there though?
At what point do things become objective C?
Where would I look to see the code for that? On Sourceforge?


Thanks,

Andrew


{
var foo, time, argDict;
s=Server.local; if(not(s.serverRunning), {s.boot});
s.sendMsg("/b_allocRead", 0, "sounds/a11wlk01.wav");

SynthDef("playWord", { arg buf, start, end;
var retval;
retval = BufRd.ar(1,buf, Phasor.ar(0, BufRateScale.kr(0), start, end),0);
Out.ar(0, retval); // send output to audio bus zero.
}).load(s);

argDict = Dictionary.new(10);

argDict = (
\beep : [ \buf, 0, \start, 0, \end, 4800 ],
\columbia : [ \buf, 0, \start, 4800, \end, 8900 ],
\this : [ \buf, 0, \start, 8900, \end, 11000 ],
\is : [ \buf, 0, \start, 11000, \end, 13000 ],
\houston : [ \buf, 0, \start, 13000, \end, 17000 ],
\over : [ \buf, 0, \start, 17000, \end, 20000 ]
);

foo = "over beep this is beep this is houston columbia".split($ ); // note the space after $

//foo = "beep".split($ );
//Synth("playWord", argDict["columbia".asSymbol] );

Task({
foo.do({ arg word;
word.postln;
Synth("playWord", a[word.asSymbol] );
time = 1;
time.wait
})
}).play;

}