Csound Csound-dev Csound-tekno Search About

Re: Re; Balance

Date1997-12-16 09:51
FromRichard Dobson
SubjectRe: Re; Balance
A. Archias wrote:
> 
>  Hello;
> 
>   I have been trying to experiment on and off for a little while and
>  got stumped on the 'balance' opcode. If someone could describe just
>  is going on inside this unit and/or what I have wrong.
> 
>   sr=36000
>   kr=100
>   ksmps=360
>   chan=1
> 
>  aw1 soundin "asound.wav"
> 
>  I then sent it thru a butterworth LP filter controlled
>  by 'linen' opcode and indexed by a 'table' opcode. Everything
>  had been scaled down or normalized to a max of 1.0. But
>  then I want to amplify it back to or close to the aw1 level
>  with the 'balance' but it gets distorted. Is it meant that the
>  balance opcode is 'not' for normalized (0-1) signals?
> 
> 

I remember hitting much the same problem a while back; by setting the
internal lowpass [ihp] parameter to 1 (instead of the default 10Hz) I
was able ~almost~ to clear the noise, but not entirely.  It seems to me
to be an innate dsp-level problem with the algorithm, but it would need
a dsp specialist to investigate.

Richard Dobson

Date1997-12-16 16:54
FromMike Berry
SubjectRe: Re; Balance
	I agree that there is something fishy in balance.  I have been
able to get a "pumping" sound out of it in some conditions.  Though I know
it doesn't apply to all platforms yet, I have gotten by the problem by
simply generating in floats and post-normalizing.
	You can also do it by making an accumulator yourself, though you
need to use the zak opcodes to save the values from pass to pass.

Mike Berry
mikeb@mills.edu


Date1997-12-16 17:30
FromErik Spjut
SubjectRe: Re; Balance
The biggest problem I find with balance is that it updates its multiplier
at k-rate. For rapidly varying signals you get large discontinuities (and
hence aliasing and distortion) at the k-frame boundaries. Running balance
with kr=sr fixes almost all of the problems. However, since balance works
essentially like a compressor-expander you can get it to make breathing
sounds if you try hard enough.

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967