More specifically where you can control the bit rate in dynamic fashion (ie, with a number box).

The idea is to use the loss of resolution as a sort of ‘digital tone knob’ of sorts.

My understanding of how mp3 analysis/encoding is not great, but I know it’s an FFT-based process, so I’m wondering if it’s possible to do something like that in Max, in realtime.

Or at the very least try to emulate the ‘sound’ of what’s happening.

I found this pseudo-code that sort of summarises what’s happening:

algorithm MP3 {

/*Input: An audio signal in the time domain

Output: The same audio signal, compressed

/*

Process the audio signal in frames

For each frame {

Use the Fourier transform to transform the time domain data to the frequency domain, sending

the results to the psychoacoustical analyzer {

Based on masking tones and masked frequencies, determine the signal-to-masking noise

ratios (SMR) in areas across the frequency spectrum

Analyze the presence and interactions of transients

}

Divide the frame into 32 frequency bands

For each frequency band {

Use the modified discrete cosine transform (MDCT) to divide each of the 32 frequency bands

into 18 subbands, for a total of 576 frequency subbands

Sort the subbands into 22 groups, called scale factor bands, and based on the SMR, determine

a scaling factor for each scale factor band

Use nonuniform quantization combined with scaling factors to quantize

Encode side information

Use Huffman encoding on the resulting 576 quantized MDCT coefficients

Put the encoded data into a properly formatted frame in the bit stream

}

}

I tweaked it a bit so you can select an arbitrary range that wraps around the spectrum (it makes sense if you look at it). I’ve also got a stereo 1-band version, and a stereo multi-band version kicking around.

]]>Bitcrush/sample rate reduce the phase/amplitude of a signal seperately from each other, as well as rounding the amplitude (but not the phase), and multiplying the phase (but not the amplitude). Try putting the phase at -1, it’s amusing. :D

It’s all pretty simple patching but it amuses me no less.

]]>I’ve got mine incorporated with the ‘lofi’ module of my patch, along with regular sample/bit reduction type stuff. It plays real nice with that stuff.

]]>