[PD] bit crusher abstraction

Mathieu Bouchard matju at artengine.ca
Thu Apr 29 17:17:28 CEST 2010

On Thu, 29 Apr 2010, Roman Haefeli wrote:

> Reduced bit depth (which is what I think 'bit-crushing' means)  can be 
> achieved by dividing the signal by x, pass it through something like 
> [int~], multiply it by x again. An [int~] can be implemented by using 
> [wrap~] and [-~], which are both vanilla.

It is also worth considering adding a DC offset. Your [wrap~] solution 
implements a floor-function, that is, rounding downwards. You can make it 
round to closest, by adding x/2 before rounding downwards.

[expr int($v1)] is rounding zerowards (thus output zero corresponds to a 
twice bigger input range as any other input). Thus it will behave in a 
weird unequal way.

When the volume gets low, the _effective_ bits-per-sample gets very low, 
because the relative precision of integers is proportional to amplitude 
(which is not the case with floats). Therefore, even with 16-bit audio, if 
your amplitude is 0.0001 times the max, it will feel as if it were 3-bit 
audio. In such circumstances, the differences between the possible 
roundings will become quite audible.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801

More information about the Pd-list mailing list