dithering audio, bit depth, sound quality.

yerpzs's icon

Hi

This is regards the way max records audio into a buffer or when exporting/writing to file.
There are many bit depth options such as 8, 16 ,24 , 32float that can be selected for the buffer~.

From what I understand max 6 processes audio at 32 bit float and so if the user wishes to record or export audio at perhaps 24bit , this requires bit depth reduction conversion.

Across the internet almost everyone states that dithering should take place at the last stage before bit depth conversion, particularly when planning to mix multiple channels , otherwise quantisation noise correlated to the signal remains if no dither is used.

So when mixing many processed tracks that aren't dithered, errors mount up and can contribute to a poorer sound quality.

Can anyone offer any advice on bit depth reduction recording and/or export within max using buffer~?

Thank you


Roman Thilenius's icon

export in 32 bit, then use another app for bit depth conversion.

and dont forget that bit depth conversion with dithering isnt lossless either. it should always be the last step to leave float.

yerpzs's icon

hi thanks for your reply.

I hoped to export at 24bit from within max so everything is done in the max patch and to keep file sizes low.

Max buffer~ default is 16bit, so it seems cycling74 suggests it is o.k to record at a lower rate.

So I wonder, is it o.k to record directly into a buffer at a lower bit depth ( like the help file suggests) in the picture (1)

Is it only bad to reduce bit depth when something is inserted like a gain, pan or summing? (2)

Thanks for your help.

Floating Point's icon

here's a dither generator you could use, just patched it together, so you'd need to experiment with it first, maybe try 8-bit reduction with a decaying sine-tone to see how it sounds

Max Patch
Copy patch and select New From Clipboard in Max.

yerpzs's icon

hi floating point I think your patch has not uploaded correctly. sounds interesting.

Should there be a dither in this help file example? Or is it o.k to record direct to the buffer with no processing at 0db gain? (Default is 16bit for the buffer).

Thanks for your reply.

Floating Point's icon

I guess so, just add the dither to the signal you want to down-sample, at the correct level, determined by the umenu, but if your sound card for the source input has an equivalent bit depth to the output format then there's not much point.

Remember that dither is only used as a final stage to all processing-- it's not normally used to record raw audio to file, unless that's all you're going to do, and the sound card and various other devices such as microphones etc are of a quality (s-n ratio) greater than the recording format allows to be reproduced.

yerpzs's icon

Your dither patch did not work, I can't download it.

You mention dither is "...not normally used to record raw audio to file," Do you mean when no processing is taking place, when it is going straight to file, like in the help file example?

Floating Point's icon

There seems to be something wrong with my internet connection, can't upload the file, will try later. Sorry.

In the mean time, you probably should read up on dither; here's something I just googled:
https://theproaudiofiles.com/dither/

But normally you wouldn't record directly to a low bit-depth. Common practice is to:

  • Record to the highest practical quality, which is normally limited by the quality of your sound input device (sound-card/audio-interface).

  • Then do your audio processing using the highest bit depth, which in Max is 64-bit . Processing might include mixing, eq, reverb, granulation, spatialization using a flocking algorithm in conjunction with head-related-transfer-functions, whatever.

  • Then once everything is completed, the very last step is to re-render to the final bit-depth using dither if you choose to do so.

Floating Point's icon

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon

Default is 16bit for the buffer

are you sure?

volker böhm's icon

Should there be a dither in this help file example? Or is it o.k to record direct to the buffer with no processing at 0db gain? (Default is 16bit for the buffer).

no, buffer~ always stores samples in 32-bit floating point, and no, you don't need to dither for going from 64-bit to 32-bit float. The format message to buffer~ only applies for exporting to file and doesn't change its internal bit depth.
Buffer~'s default format for export is indeed 16bit int, and in this case (going from 32-float to 16-bit int), dithering is a good idea, but alas, buffer doesn't support automatic dither when exporting.
But as your desired final bit depth is 24-bit int, just set the format to 'int24' and export. I wouldn't worry too much about dithering from 32-bit float to 24-bit int.

yerpzs's icon

Hi Thanks everyone.

The dither patch works now,Floating Point. thank you.

That is interesting volker böhm that buffer~ stores at 32-bit floating point. Thank you. And that the format (default 16bit) is only default for exporting. I see, this starts to make sense.

You mention its o.k to not dither from 32 float to 24 int, is that just for single channel or multichannel?

As I read that when mixing many processed tracks that aren't dithered, errors mount up accumulatively and can contribute to a poorer sound quality in multitrack mixes..

Would it be wise to dither before exporting 24bit files if planing to mix them in multi-track later in a daw?

Thank you again.


Floating Point's icon

Would it be wise to dither before exporting 24bit files if planing to mix them in multi-track later in a daw?

I'm no expert, but I think not, because when you have a number of individually dithered tracks and add them together, that noise will accumulate by an rms factor of, I think (might be wrong here) of 1.4, so for example mixing 8 pre-dithered tracks will give 4-bits of accumulated dither resulting in an effective 20-bit sn ratio for a 24-bit file. But you might want to ask these kinds of questions on a pro-audio forum for a more informed opinion.

Roman Thilenius's icon

this is exactly what you shoud not do. dithering is the last step. last step as in ... very last step.

as long as you plan to process audio (or to be exact: as you long as you are not 100% sure you will never again need to process it), you dont change the resolution (not to speak of dithering)

whenever you have the chance you should stay in 32 bit float and you should normally also export your personal premaster in 32 bit float. and then, later, go down to whatever you need (like 24 for DVD or 16 for compressed formats.)

you can ignore issues between 64 and 32 in practice. that is why buffer still is 32 per default also in 64-bit max audio enviroment - and i think tapout, too. (and, like volker says, dithering for 64->32 is also not required.)

64 bits has some 1000db headroom more than 24 bits, where 32 bits has 250db more than 24 (which has 0db). this value is never reached in music production, and not even when programming special effects.

you might need it when calculating astronomy stuff in matlab. :)

yerpzs's icon

Hi, Roman, thanks,I understand what you say by suggesting to remain in 32float and then at the last stage reduce bit depth (dither if going to 24 or 16)

But if one wants to export multiple files from max at 24bit to keep the file size low and also at a later date mix these multi files in a DAW. Dither should not be used in Max on the individual files. Dither should only be used once in the final export from a master insert in the DAW?

As floating point said " 8 pre-dithered tracks will give 4-bits of accumulated dither resulting in an effective 20-bit sn ratio for a 24-bit file"

hopefully that is correct.

Floating Point's icon

Just to clarify my previous post on this thread is not quite right --
if you add (mix) 8 tracks of single-bit-dithered audio sources together, you'll get 3 bits of accumulated dither (not 4) (so don't do it!). It's an extra bit of noise for every doubling of single-bit noise-sources

Roman Thilenius's icon

no, what i meant is never go from 32 to 24 if you have the chance to. :)

simply put:

- when you downsize from float, that causes unwanted noise.

- if you downsize two times (export 24 from max, mix these files in protools, export as 24 again) you would add noise two times.

- dithering only moves that noise a bit around in the spectrum to make it more bearable. it kinda only works one time.

and you might call that an opinion, but: i dont see the need to save 25% space by leaving 32 bit float until you are sure the material is ready.
i.e. if you produce music, you export your premaster as 32 and keep that for all times. then you make all other types of files from that.

yerpzs's icon


Thank you all for your input.

It is strange max has 16bit as default export with no dither option.

When looking at a sine wav exported from max at 16bit, it certainly has allot of distortion. I can see why dither is needed.

24bit has very little distortion in comparison.

Also it is good to know the buffer records at 32 float. And the bit depth setting is for export only.

Thanks again.



Floating Point's icon

Probably should put in a feature request for dithering option for exporting to integer format audio from a buffer