> How about a pulse train gate?:
> 
> period = attT60+relT60;
> freqHz = 1.0/period;
> duty = attT60/period;
> gate = os.lf_pulsetrainpos(freqHz,duty);
> process = en.arfe(attT60,relT60,0,gate);

Thanks Julius, this works too, but as far as i can tell, its more like an LFO 
which is continuously running, not triggered/reset by any user-controllable 
gate, which i need.

I ended up with this:

arrt(attT60,relT60,gate,maxRetriggers) = envelope with {
  upfront = gate > gate';
  period1 = attT60+relT60;
  freqHz = 1.0/period1;
  duty = attT60/period1;
  loopingGate = select2(lf_sawpos_reset(freqHz, upfront) < duty, 0, 1);   
  countedRetriggers = loopingGate > loopingGate' : pulse_countup(gate);
  loopingConstrainedGate = select2(countedRetriggers > maxRetriggers, 
loopingGate, 0);
  t60 = select2(loopingGate, relT60, attT60);
  pole = si.smooth(ba.tau2pole(t60/6.91));
  envelope = gate & loopingConstrainedGate : pole;
};

This env starts when the gate transitions from 0 to 1, and it loops while gate 
is high, but only until maxRetriggers is exceeded.

Thanks for helping!





> 
> On Thu, Jan 7, 2021 at 1:55 PM Thomas Züblin <i...@teletek.ch 
> <mailto:i...@teletek.ch>> wrote:
> Thanks for the suggestion, it sounds very reasonable. I managed to get a step 
> closer to what i want using this code:
> 
> arrt(attT60,relT60,fv,gate) = envelope with {
>   ugate = pulsen(200,sec2samp(attT60 + relT60)); // gate > 0 ;
>   target = select2(ugate, fv, float(gate));
>   t60 = select2(ugate, relT60, attT60);
>   pole = si.smooth(ba.tau2pole(t60/6.91));
>   envelope = target : pole;
> };
> 
> The pulsen repeatedly triggers the env, the interval depends on Attack / 
> Release. It sounds close to what i want, the only problem i have is that i 
> would need a way to restart the pulsen at every gate upfront. I think I first 
> need to take a good look at all the available library objects.
> 
> 
> 
> 
>> Am 07.01.2021 um 22:05 schrieb Mouldy Soul <richo...@gmail.com 
>> <mailto:richo...@gmail.com>>:
>> 
>> This may sound dumb, but do you even need to check? 
>> 
>> Can't you just add the time for A + D together and trigger based on that 
>> interval?
>> 
>> On Thu, 7 Jan 2021 at 20:59, Thomas Züblin <i...@teletek.ch 
>> <mailto:i...@teletek.ch>> wrote:
>> Hi all,
>> 
>> I’m very new to Faust and for the last two evenings i was trying to add some 
>> kind of retrigger functionality to the existing AR envelope. By that i mean, 
>> that the envelope should retrigger itself, as soon as the release phase is 
>> finished, ideally with some option to toggle between single cycle and 
>> retrigger behaviour. I tried to add some check that detects the end of the 
>> release phase (that worked) and combine this with the gate that triggers the 
>> envelope but ran into some recursion problems.
>> 
>> Any ideas or tips how to achieve this? Thanks for your time,
>> 
>> Tom
>> 
>> _______________________________________________
>> Faudiostream-users mailing list
>> Faudiostream-users@lists.sourceforge.net 
>> <mailto:Faudiostream-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users 
>> <https://lists.sourceforge.net/lists/listinfo/faudiostream-users>
> 
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net 
> <mailto:Faudiostream-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users 
> <https://lists.sourceforge.net/lists/listinfo/faudiostream-users>
> 
> 
> -- 
> "Anybody who knows all about nothing knows everything" -- Leonard Susskind

_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to