raygunvirus
Newbie
Karma: 0
Posts: 9
|
 |
« on: January 20, 2007, 05:45:02 PM » |
|
What I'm trying to do is simply to loop the very short sound file on every second. My aim is to create independent tempi in 2 channels, but with the same sound file. But I can't even get one sound file to loop!!! my initial attempt :
s.boot; b = Buffer.read(s, "sounds/cospuls.wav");
( SynthDef("Pulsar", {arg out, bufnum = 2, trig = 1; Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum)))}; Trig.ar("Pulsar", 1).loop).play (s, [\out, 0, \bufnum, b.bufnum]); )
//This threw back "DoesNotUnderstandError, bla, bla" (neither did I..). another method I tried was:
t = TempoClock; ( SynthDef.new("Pulsar", {arg out, bufnum = 1; Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum)))}; (s, [\out, 0, \bufnum, b.bufnum, \t, 2.0])); )
//also to no avail... thanks for any help!
Ray
|
|
|
|
|
Logged
|
|
|
|
raygunvirus
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #1 on: January 21, 2007, 03:50:35 PM » |
|
OK, I have the simple loop i was initially looking for: SynthDef("help_PlayBuf", {arg out = 0, bufnum = 0, Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum)))}; (s, [/out, 0, /bufnum, b.bufnum]); )
Only, I can't yet articulate soundfile to a Tempo of my choosing. The step afterwards being : two separate tempi in two different channels... much obliged for any help!
Ray
|
|
|
|
|
Logged
|
|
|
|
joshp
AdminGroup
Full Member
Karma: 5
Posts: 121
|
 |
« Reply #2 on: January 21, 2007, 06:20:49 PM » |
|
i think you want something like this? a = Buffer.read(s, "sounds/a11wlk01.wav");
SynthDef(\playBuf, {arg out = 0, bufnum = 0, rate1 = 1, rate2 = 1; Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum) * [rate1, rate2]))}).load(s); Synth(\playBuf, [\out, 0, \bufnum, a.bufnum, \rate1, 0.9, \rate2, 1.1], target: s); best, Josh
|
|
|
|
|
Logged
|
|
|
|
raygunvirus
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #3 on: January 22, 2007, 09:24:39 AM » |
|
Hi Josh, thanks a lot for looking at that. I tried your patch, but unfortunaltely it gave me the following message: Buffer(0, nil, nil, nil, sounds/cospuls.wav)
WARNING: keyword arg 'target' not found in call to Meta_SynthDef:new ERROR: Message 'def' not understood. RECEIVER: Instance of Array { (06F13090, gc=48, fmt=01, flg=00, set=03) indexed slots [8] 0 : Symbol 'out' 1 : Integer 0 2 : Symbol 'bufnum' 3 : Integer 0 4 : Symbol 'rate1' 5 : Float 0.9 3FECCCCC CCCCCCCD 6 : Symbol 'rate2' 7 : Float 1.1 3FF19999 9999999A } ARGS: CALL STACK: DoesNotUnderstandError:reportError 06E9D310 arg this = <instance of DoesNotUnderstandError> Nil:handleError 06EA0850 arg this = nil arg error = <instance of DoesNotUnderstandError> Object:throw 06EA2650 arg this = <instance of DoesNotUnderstandError> Object:doesNotUnderstand 06EE4D90 arg this = [*8] arg selector = 'def' arg args = [*0] SynthDef:addControlsFromArgsOfFunc 069C54B0 arg this = <instance of SynthDef> arg func = [*8] arg rates = nil arg skipArgs = 0 var def = nil var names = nil var values = nil var argNames = nil SynthDef:buildUgenGraph 069D0DF0 arg this = <instance of SynthDef> arg func = [*8] arg rates = nil arg prependArgs = [*0] var result = nil var saveControlNames = nil SynthDef:build 06F17C90 arg this = <instance of SynthDef> arg ugenGraphFunc = [*8] arg rates = nil arg prependArgs = nil Interpreter:interpretPrintCmdLine 06EE76B0 arg this = <instance of Interpreter> var res = nil var func = <instance of Function> Process:interpretPrintCmdLine 06EE88F0 arg this = <instance of Main>
...so I don't quite know yet what went wrong there... best, R
|
|
|
|
|
Logged
|
|
|
|
joshp
AdminGroup
Full Member
Karma: 5
Posts: 121
|
 |
« Reply #4 on: January 22, 2007, 10:24:46 AM » |
|
hmm... try this... boot the server, then select all, and hit enter: a = Buffer.read(s, "sounds/cospuls.wav");
SynthDef(\playBuf, {arg out = 0, bufnum = 0, rate1 = 1, rate2 = 1; Out.ar(out, PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum) * [rate1, rate2]))}).load(s); Synth(\playBuf, [\out, 0, \bufnum, a.bufnum, \rate1, 0.9, \rate2, 1.1], target: s);
Josh
|
|
|
|
|
Logged
|
|
|
|
raygunvirus
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #5 on: January 22, 2007, 12:30:46 PM » |
|
Great, it works now. Thanks a lot!
|
|
|
|
|
Logged
|
|
|
|
|