User-Defined Opcode Database

ampdbN

Normalized conversion from db to amplitude.

Download UDO File

Description

Converts a normalized (0 -1) db value to a normalized (0-1) amplitude value.

Syntax

kamp ampdbN kdb

Initialization

kdb -- a normalized db value to be converted to a normaized amplitude value, where 0 will be converted to 0 amp and 1 will be converted to 0dbfs.

Performance

This opcode is useful in many situations involving amplitude scaling like envelopes.

Code

opcode ampdbN, k, k

	kdb xin
	kamp = (kdb <= 0 ? 0 : ampdb(dbamp(0dbfs) * kdb)/0dbfs )
	xout kamp

endop

Examples

instr 2

	kdb linen	1, p3*.5, p3, p3*.5
	kamp ampdbN kdb
	asig rand 	kamp*0dbfs
	out asig

endin

Credits

ma++, jan 2005


Previous Home Next
RandomWalkK   ampSlider