Forums > MaxMSP

Unusual CPU peaks — Cascade~???



pm
June 25, 2008 | 7:00 pm

I’m having a weird problem… I read a buffer~ with a wave~ object using a phasor~. I can stop the audio playback by setting the frequency of the phasor to 0 (quite normal stuff).
This goes through some effects, a transposer, a distortion and a cascade~.
When I set the phasor speed to 0, my audio signal goes to 0, and it seems that my CPU gets to 55 percents, quite higher than the 6 percents I get when the phasor is running. I tried everything and I was about to give up when I realized that when I mute the cascade~, the CPU get back to its normal.
So… is it possible that the cascade~ gets mad when it has no audio getting in? Does anybody has got any problem like that one?
Thanks a lot!

June 25, 2008 | 7:24 pm

Sounds like the filters in cascade~ are "blowing up" when the frequency drops to DC – i.e, 0Hz – when the phasor~ is set to 0Hz. This may be generating numerical errors when the filter blows up causing more CPU usage. You could try setting the amplitude of the signal out of wave~ to 0 if the phasor~ frequency is 0, cascade~ should not be as bothered about a DC signal that is also 0 amplitude. You might still get problems if the phasor~ freq. is very very small close to 0.

You could also try setting the cascade~ coefficients to the defaults (i.e., a newly initialised object) to see if it’s OK when the phasor~ is at 0Hz.


pm
June 25, 2008 | 9:46 pm

Thanks for your help Martin.
I tried to set the amplitude to 0 before setting the phasor~ to 0 but it didn’t solved my problem.

Cascade~ seemed to get stuck with DC, like if its internal delay had made a feedback that makes the CPU peaks.

Solution : trigger clear message to Cascade after each audio sample pass. I thought it would be very CPU expensive but it doesn’t seem to be. Everything runs much smoothly now.

By the way, should the cascade~ object be cleared on each audio sample in any situation?

Thanks

June 26, 2008 | 6:35 am

The fact that ‘clear’-ing cascade~ fixes you problem I think confirms it’s numerical errors in the filter causing the problem. i.e., it’s blowing up (values in the filter’s algorithm are going to +-INF and possibly and ultimately NaNs)

It would be ideal to prevent it blowing up but you’f have to figure out how to prevent it. It’s curious that setting the amplitude to 0 didn’t do it..

Do you mean you’re clearing cascade~ every buffer? If you tried to clear it every sample (which I don’t think is possible) it wouldn’t be able to do it’s job. Don’t you get clicks in the output doing this?

June 26, 2008 | 7:19 am

On 25 juin 08, at 21:00, Pm B wrote:
>
> he phasor is running. I tried everything and I was about to give up
> when I realized that when I mute the cascade~, the CPU get back to
> its normal.
> So… is it possible that the cascade~ gets mad when it has no audio
> getting in? Does anybody has got any problem like that one?

I had the same problem with cnmat’s [smooth-biquad~], but only on
intel (Kasper, here is one more intel problem ;-). It’s most probably
caused by a denormaled number. The only solution I found was to use
[biquad~] which works correclty, so i’d be surprised if [cascade~] has
the same problem…

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl
http://www.crfmw.be/max

January 29, 2009 | 3:25 am

The problem still persists (try -cascade~ help- to reduce to 0. the noise gain).

Any news about a fix?

matteo

January 29, 2009 | 3:36 am

On 29 janv. 09, at 04:25, matpe wrote:

> The problem still persists (try -cascade~ help- to reduce to 0. the
> noise gain).
>
> Any news about a fix?

It’s already fixed for the next incremental. Thanks for your patiente
in the meantime.

ej

Viewing 7 posts - 1 through 7 (of 7 total)

Forums > MaxMSP