Hi Bart,

As can be seen from its implementation:

// --- lf_sawpos ---
// simple sawtooth waveform oscillator between 0 and 1
lf_sawpos(freq) = lf_rawsaw(periodsamps) / periodsamps
with {
  periodsamps = float(ml.SR)/max(1.0e-7,abs(freq));
};

lf_sawpos takes the absolute value of its freq parameter.  If you need
negative frequencies to time-flip the sawtooth waveform, which I think is
reasonable, I would be happy to install your implementation.  I looked at
that myself a while back and decided not to go for the extra computation
needed (the switch-back logic has to be modified or extended).  Maybe you
can see a way to do it for no extra cost?

Regarding your other point(s), I don't have a scope handy, so I haven't
seen your example, but I would be happy to look at anything that is easy to
see using faust2octave et al.  Ideal would be a few lines of code proving
the problem in a faust2plot output.

Thanks,
Julius


On Mon, May 30, 2016 at 6:22 AM Bart Brouns <[email protected]> wrote:

> Hi,
>
> I think I found a bug in lf_sawpos.
> Run this code trough a scope, and you'll see what I mean.
>
>
> import("oscillator.lib");
> import("music.lib"); // for decimal, which should be in math.lib imho
>
> process =
>   lf_sawpos(fr)
>   ,
>   lf_sawpos( index2freq(lf_sawpos(fr) ))
>   ,
>   my_lf_sawpos(fr)
>   ,
>   my_lf_sawpos( index2freq(my_lf_sawpos(fr)) )
> with {
>   my_lf_sawpos(freq) = decimal ~ +((freq/SR));
>   frequency = hslider("frequency", 55, -55, 440, 1);
>   depth = hslider("lfo depth", 1, 0, 2, 0.001);
>   lfo = oscrs(2);
>   fr = frequency+(lfo*depth*frequency);
>   index2freq(index) = ((index-index')*SR) :
> sampleAndHold((index-index')!=-1);
>   sampleAndHold(sample) = select2((sample!=0):int) ~ _;
> };
>
> -With the default settings, lf_sawpos regularly goes down, even though
> there are no negative frequencies.
>
> -With 0 lfo depth, and a negative frequency, lf_sawpos still ramps up
>
> -When you calculate the frequency from the saw, and use that to drive
> another saw, the problem becomes even more clear.
>
>
> Cheers,
> Bart.
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
>
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to