[PD] very compressed chip sounds

Mathieu Bouchard matju at artengine.ca
Wed Oct 19 07:56:57 CEST 2011

Le 2011-10-18 à 16:39:00, martin brinkmann a écrit :

> i got it a little closer to the original after applying & 0xff like in 
> the javascript on the site, and dividing by 256 (instead of scaling by 
> 256 to fit into short), maybe there is still a lsb/msb issue though.

& 0xff is what putchar() does automatically in the C version.

Let's call «y» the result of & 0xff :

y/256 makes the output range from 0 to almost 1.

(y-128)/128 makes the output range from -1 to almost 1, which is how pd 
wants it. Then you might not need a [hip~] anymore.

If the original track was made for signed 8-bit instead of unsigned 8-bit, 
you have further processing to do, to make it sound correct. Something 
like ((y^128)-128)/128.

| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC

More information about the Pd-list mailing list