MovingAverage and MovingSum broken at audio rate (.ar)?

Hi!

when plotting MovingSum and MovingAverage at control rate .kr everything seems to work well:

{a=LFDNoise3.ar(SinOsc.ar(1/4).range(0,20));[SinOsc.ar(1/4).range(0,20),a, MovingSum.kr(a,400)]}.plot(4)

However, when running it at audio rate .ar it seems that no calculation is being perfomed…

{a=LFDNoise3.ar(SinOsc.ar(1/4).range(0,20));[SinOsc.ar(1/4).range(0,20),a, MovingSum.ar(a,400)]}.plot(4)

Is this a bug or am I missing some detail here?

I think 400 samples is too short a window for the moving sum or average at audio rate, to be visible in a plot.

4 sec * 48000 samp/sec = 192000 samples. 400 samples comprise approx. 0.2% of the graph’s width. My screen is 1400 pix wide ~= 137 pix/sample, so those 400 samples span ~= 3 pix. There are differences in the data but too fine to be visible at this scale.

p = { a = LFDNoise3.ar(SinOsc.ar(1/4).range(0,20)); [a, MovingAverage.ar(a, 4000)] }.plot(4);

// this is not a flat 0 plot
(p.plots[0].value - p.plots[1].value).plot

(At kr, 400 kr blocks > 0.5 sec, but 400 audio samples < 0.01 sec.)

hjh

1 Like

Indeed! Thanks a lot!!!