Csound Csound-dev Csound-tekno Search About

Re: Floats to Ints

Date1999-02-12 02:22
FromTobiah
SubjectRe: Floats to Ints
> 1. [output stream] = [stream of floats] * (32767/maxfloat)
> 
> 2. [output stream] = [stream of floats] * (32767.5/maxfloat)-0.5


Do #1.  You don't get to decide about the offset, because 
everyone else on the planet already recognizes zero as silence.

You know, it would be nice if the ADC would use -32768 to
indicate a clip!  That way, we could get nice instant 
feedback about exceeding levels.  Actually, I have at least
one program that looks for this already.  If the value -32768 is
encountered, it cries clip.  This is not as accurate as if
the ADC had explicitly set it to indicate a clip in either
direction, but it is pretty close in practice.

Toby