Hi Julius,
Here is a screenshot of the output with default slider values, so the
frequency modulates between 0 and 110.
https://i.imgsafe.org/d635e0c8e8.png
I looked at the CPU usage too, and it turns out that on my system at
least, my saw is cheaper:
(par(i, 1000, my_lf_sawpos(i+10 ) ):>_)/1000
takes 30%, and:
(par(i, 1000, lf_sawpos(i+10 ) ):>_)/1000
takes 45%.
Cheers,
Bart.
On Mon, May 30, 2016 at 07:49:28PM +0000, Julius Smith wrote:
>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