Another commonly used decibel scale is the dBSPL, or the sound pressure level decibel scale. This scale is primarily used in acoustic applications. In it, 0 dB corresponds to the human threshold of hearing, and anything above 85 dB can potentially damage your ears. In Csound, we can use the ‘ampdb’ opcode to convert dBSPL values into raw amplitudes. Similarly to ampdbfs, we pass values to ampdb that range from zero to about positive 90. Unlike ampdbfs, however, we do not set 0dbfs to 1 when using ampdb, rather, we set it to the current bit. Since we are not changing the default bit depth of 16 bits for this example, we will leave 0dbfs at its default value by doing nothing.
Just like ampdbfs had a sibling that did the backward conversion, so does ampdb. Instrument 2 below exemplifies the use of the opcode ‘dbamp’, which converts from dBSPL values to raw amplitudes depending on the bit depth. After compiling this excerpt, check the log output to see the conversion values.
News & Events
Subscribe at the bottom of the page to be informed of news as they arrive.
RunloopSound Released on the App Store
Aug 12, 2016
RunloopSound brings the world of Csound to iOS devices. With a gorgeous user interface and complete integration to all major cloud providers, RunloopSound allows you to keep designing incredible sounds wherever you go.