I am making this emulation of the MakeNoise Maths. I am using onOff to
trigger the process on and off. It all works if in lf_sawposTrig I use
onOff where it now says onOffB. But this will end the oscillation in the
middle of a cycle. What I want to do is end the oscillation only at the end
of the cycle even if onOff has already been set to 0. So I am trying to use
a sample and hold to grab the value of onOff only when it gets the next
trigger. I know what I am doing is some tomfoolery (I see the feedback
loop), but I feel like it should technically work. However, I get a
"endless evaluation cycle” error on compile. Any idea of another way to
grab this value or do I need a different approach?

Thanks,

Sam

FMaths(freq, peakPoint, logExp, onOff) = 1-sigOutInv:calcLogExp, endTrig,
topTrig, onOffB: _,_,_,_
with {
  sigOutInv = selectIt(lf_sawposTrig-peakPoint);
  endTrig = 1-sigOutInv:ba.impulsify;
  topTrig = 1-endTrig;

  onOffB = ba.if(onOff>0, 1, onOff:ba.sAndH(lf_sawposTrig>=1));

  lf_sawposTrig = ma.frac*(onOffB) ~ +(freq'/ma.SR);
  selectIt(val) = ba.if(val<0, (val/peakPoint):abs, val/(1-peakPoint));
  calcLogExp(x) = ba.if(logExp<0.5,
(ma.cbrt(x),x:si.interpolate(min(1,logExp*2))),
(x,x*x*x*x:si.interpolate(max(0,logExp*2-1))));
};

process (freq, peakPoint, logExp, onOff) = FMaths(freq, peakPoint, logExp,
onOff);
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to