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.

<CsoundSynthesizer>
<CsInstruments>

instr 1
asig oscili ampdb(84), 440, 1
out asig
endin

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.

instr 2
iamp = ampdb(84)
print iamp
idbspl = dbamp(iamp)
print idbspl
endin

</CsInstruments>
<CsScore>

f 1 0 1024 10 1

i 1 0 2
i 2 2 2.1

</CsScore>
</CsoundSynthesizer>

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.

Read more

Unbalanced Connection 57

Feb 19, 2016

The Unbalanced Connection is a semiannual series of concerts hosted by the University of Florida and dedicated to electroacoustic music.

Read more

Society of Composers, Inc.

Mar 15, 2014

Read more

O Guri Takes Over Portugal!

Oct 8, 2012

Read more

Première of O Guri in Bagé

Jul 7, 2011

O Guri is a feature film directed by Zeca Brito whose original music was written by me.

Read more