Are you setting 0dbfs to 1.0?

Csound’s default output range is +/- 32767. Setting amplitudes with these numbers is, more or less, the hard way. The easy way is to use a normalized range of +/- 1. You can alter Csound’s output range with the 0dbfs header statement by placing it beneath the standard orchestra header, like this:

sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
0dbfs = 1.0

The issue with the default 16-bit range is that it makes little sense to do so in a world of multiple bit depths (8, 16, 24, 32, 64, etc). If one is rendering a 16-bit file, the argument could be made in favor of the default range since there is a one-to-one mapping of input to output values. However, once one leaves the realm of 16-bit, values of +/- 32767 become arbitrary. On the other hand, a normalized range is not married to any single bit-depth, and translates well to other resolutions.

Besides being easier to compose and design instruments with, there are other practical reasons to adopt this good programming practice. The Csound manual says, “Using 0dbfs=1 is in accordance to industry practice, as ranges from -1 to 1 are used in most commercial plugin formats and in most other synthesis systems like Pure Data.” If you are ever to use Csound in conjunction with PD, MaxMSP, etc, this is the range you will use.

Make it habit. Start every new orchestra as if 0dbfs is every bit as important as sr, kr, ksmps and nchnls. And always set it to 1 (there are exceptions).

In case you are wondering why more orchestras out in the wild haven’t adopted this practice… 0dbfs first came into play in Csound version 4.10 in 2002. Most of existing knowledge base, such as books and tutorials, were written prior to this.