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

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



Hi -

You need to know one of the secret tricks of supercollider ;)

Change the name of your trigger control from "trig" to "t_trig", and
you will find it works just like you want it to...

(Controls beginning with "t_" are assumed to be trigger-type controls
and treated slightly differently)

HTH
Dan

2009/7/27 jesus gollonet <listas@xxxxxxxxxxxxxxxxx>:
> 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/
>



-- 
http://www.mcld.co.uk

_______________________________________________
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/