Hmmm, it looks to me like it should be working.
I adapted your test program for use with faust2plot, and it's working for
me:

import("stdfaust.lib");

saw1_phase(freq, phase) = 2.0 * os.lf_sawpos_phase(freq, phase) - 1.0;
lf_trianglepos_phase(freq, phase) = 1.0 - abs(saw1_phase(freq, phase));
lf_triangle_phase(freq, phase) = 2.0 * lf_trianglepos_phase(freq, phase)
   - 1.0;

//lfo_freq = hslider("Freq", 30, 0.001, 50, 0.01);
lfo_freq = ma.SR/16;

//lfo1 = os.lf_triangle(lfo_freq);
lfo1 = lf_triangle_phase(lfo_freq,0);

//lfo_phase = hslider("Phase", 180, 0, 360, 1) / 360;
lfo_phase = 8.0/16.0;
lfo2 = lf_triangle_phase(lfo_freq, lfo_phase);

process =  lfo1 * 0.2, lfo2 * 0.2;

On Fri, Feb 24, 2023 at 9:34 AM Christopher Arndt <ch...@chrisarndt.de>
wrote:

> Hi all,
>
> I want to modulate two delays with two LFOs, which have a phase offset.
>
> Using os.oscp works, but the library does not contain a triangle osc
> with phase control. So tried to make one by copy-pasting from the
> oscillator.lib:
>
> import("stdfaust.lib");
>
> saw1_phase(freq, phase) = 2.0 * os.lf_sawpos_phase(freq, phase) - 1.0;
> lf_trianglepos_phase(freq, phase) = 1.0 - abs(saw1_phase(freq, phase));
> lf_triangle_phase(freq, phase) = 2.0 * lf_trianglepos_phase(freq, phase)
>    - 1.0;
>
> However, when I try to use this with a parameter controlling the phase
> like this:
>
> lfo_freq = hslider("Freq", 30, 0.001, 50, 0.01);
> lfo_phase = hslider("Phase", 0, 0, 360, 1) / 360;
> lfo1 = os.lf_triangle(lfo_freq);
> lfo2 = lf_triangle_phase(lfo_freq, lfo_phase);
> process =  lfo1 * 0.2, lfo2 * 0.2;
>
> the lfo_phase param does have any effect, the phase of both LFOs is
> always the same.
>
> What am I missing?
>
> Chris
>
>
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>


-- 
"Anything that can be automated should be"
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to