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

[sc-users] reset playbuf trigger using Synth.set



Hi all.

I'm stuck with what I believe to be a shamefully simple problem.
I have this simple playbuf synthdef

SynthDef(\pbf, { |out = 0, bufnum = 0, rate = 1, amp = 0.5, trig=0|
       Out.ar(out,
           Pan2.ar(
               PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum) * rate, trig),
               level:amp
           )
       )
   }).memStore;

which I'm going to use for short percussive sounds, and I'd like to be able to trigger it using Synth.set instead of creating a new Synth every time, ie:


   a = Synth(\pbf, [\bufnum,~b4])
// each time I do this I should hear it. but only hear it the first time.
   a.set(\trig,1)
   a.set(\trig,1)
   a.set(\trig,1)
the problem is that trig is only triggered when I change from <=0 to >0 so I have to manually reset the trigger each time:

   a.set(\trig,1)
   a.set(\trig,0)
   a.set(\trig,1)

and I've been looking for a way to auto reset the trig, but no luck yet... any pointers?

Thanks a lot!
jesús.



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/