Kyma Forum
  Kyma Sound Exchange
  Zillion Band Compressor?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Zillion Band Compressor?
David McClain
Member
posted 05 June 2001 10:40         Edit/Delete Message   Reply w/Quote
...any interest in a 512 band compressor/equalizer?

- DM

IP: Logged

preston
Member
posted 06 June 2001 09:19         Edit/Delete Message   Reply w/Quote
Very interested...are you saying you have created one?

IP: Logged

photonal
Member
posted 06 June 2001 13:14         Edit/Delete Message   Reply w/Quote
Sure David I would! How many DSPs does that monster need?

IP: Logged

David McClain
Member
posted 06 June 2001 15:28         Edit/Delete Message   Reply w/Quote
I have a system (a Sound) that does something like this, only a bit more complicated, in stereo. It takes 11 very lightly loaded (?) DSP's to run that beast. The (?) mark is because each of them is chugging along at something around 20% and less. This seems a peculiar loading, but hey, it runs...

I would expect the 1-channel version of a simple compressor/EQ to take about half that many for 512 bands. If you want only 128 bands then it should take about 2-3 DSP's. My stereo monster runs 128 bands with 4 DSP's running pretty close to max. Remember that one DSP is almost always max'd out for supporting the Kyma.

Before I upload this thing, I need to cut out the proprietary inner workings and turn it back into a simple multiband compressor/EQ.

- DM

[This message has been edited by David McClain (edited 06 June 2001).]

IP: Logged

David McClain
Member
posted 07 June 2001 19:19         Edit/Delete Message   Reply w/Quote

zillionBandCompressor.zip

 
Okay! Here is my stereo confrabulator, turned back into a 1 channel zillion band compressor/equalizer.

For stereo just apply two of these, though you might want to do something special with the compression sidechains to keep both channels working together... but maybe not...

Anyway, the attached zip contains a 1 channel compressor/equalizer that has been preset to 128 bands so that most people can enjoy using it out of the box. With 128 bands it runs comfortably on 2 DSP's here. To get more bands, simply change the line in the font script that specifies FFTLen: 256 to something else, like FFTLen: 1024 to get 512 bands.

The zip file contains several AIFF files used by the zillion bander, as well as all the program snippets used to generate these tables. Two of them Log2_138dB.AIF and ALog2_138dB.AIF are there for your use, but you shouldn't need to change them. They compute the log2 of signal amplitude divided by 23. Hence it can accommodate the range of values encountered by us. In other words, this system works on amplitudes from 2**-23 to 1. The ALog2 does the opposite, and works on input values of x/23, or for input ranging from -1 to 0.

The pipeline works by first converting real and imaginary components of the incoming spectrum into absolute amplitudes. Then it takes the log2 of these amplitudes and thresholds using a sneaky trick...

Since Kyma/Capy can only handle values in the range -1 to 1, I boost the output of the Log2 by a sufficient amount to cause values below the threshold to clip at -1. Then I rescale the values so obtained back to their original range. The result is a set of log2 amplitudes between your threshold and zero.

Next, I modify these amplitudes by your table of compression gains. The snippet entitled cmprgains.txt computes this wavetable for you. You need to modify the line defining cmprTbl in that Smalltalk script to reflect your desired compression ratios as a function of frequency.

The script converts your table into another which lists compression ratios as a function of log frequency, for better interpolation during the construction of the table. We hear logarithmically, not linearly, in frequency space.

Once built, you can save this table and then tell the Sound to use that new wavetable in the sound block oscillator labeled "Threshold Gains". Gains at threshold are computed as Thresh_dB * (1-1/R), where R is the compression ratio. R should always be 1 or greater.

Next, the gain corrections are offset by -6/23 to give you a differential threshold gain ratio of 2**6 = 64 = 36 dB. If you need more or less range, simply change the value of the 6/32 constant block.

There is a brief note in that block that describes what these values mean, but basically, the 23 is the scaling used by the Log2, ALog2 blocks, while the numerator is the power of 2 to attenuate all frequency components. Remember that we cannot exceed signal amplitudes of 1, so instead of boosting, we attenuate every place else.

After multiplying the incoming spectrum by these compression gains, we make up for the overall attenuation by using a post-compression gain block. You can adjust this upwards till you start saturating your output. You should be able to tell by ear or by watching the DSP meters when this happens. With the scaling shown here, you can go as high as 36 dB boost to get back to the original gain levels.

The compression gains generated by the ALog2 block are smoothed using an moving average filter. This helps to ameliorate the artifacts introduced by not doing a truly proper block convolution. The script at the front of zillion has a line stating NSmooth: 5. This is the number of adjacent frequency bands to smooth over. Change this as you like, or remove the smoothing filter altogether. Its effect is to reduce the actual number of frequency bands somewhat.

Go for max number of bands = FFTLen/2 with no smoothing and accept the artifacts, or accept a fewer number of bands due to smoothing with weaker artifacts.

The whole FFT processing chain is fed by a Bristow-Johnson window over 50% overlap data. This helps a lot with spectral artifact control.

There is a single global threshold control in this current version. You might want to build a frequency dependent threshold waveshaper instead. Just copy the ideas shown for the compression gains wavetable. Threshold values of -50 to -60 dB are commonplace before you see much action in the compressors. That's because the energy is spread so thinly over all the frequency bins of the FFT that no one cell has much energy, unless you are feeding in pure tones.

I have to say, myself, that having a 512 band compressor/equalizer running in real time is quite cool! Eat your heart out - TripleC!!

- DM

IP: Logged

David McClain
Member
posted 10 June 2001 05:31         Edit/Delete Message   Reply w/Quote

zillionBandCompressor.zip

 
It ocurred to be this evening that I provided a set of wavetables predicated on more accuracy than the waveshapers in Kyma/Capy can use.

Each of the Log2, ALog2 wavetables is only 4096 samples long, of which only half are used by the lookup in the waveshapers. Hence you only need 11 bits (= 2048) of granularity in these tables; not the 23 bits I originally provided.

The new tables make better use of the available working precision. They limit your useful thresholds to -66 dBFS or greater, but this is probably closer to what is needed anyway -- not 138 dB of useless total dynamic range. Hence the Sound has been rescaled to 11 bits as well.

Both versions are here, along with the generating code for all the wavetables. Feel free to modify these to better suit your own needs. I find that 11 bits is plenty accurate. Gain calculations for compression do not need to be very accurate.

- DM

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c