Expand description
General conversion functions and utilities.
Modules
- Windowing functions, useful in conjunction with
StftHelper
.
Structs
- Process the input buffer in equal sized blocks, running a callback on each block to transform the block and then writing back the results from the previous block to the buffer. This introduces latency equal to the size of the block.
Constants
Functions
- Convert decibels to a voltage gain ratio, treating anything below -100 dB as minus infinity.
- An approximation of
db_to_gain()
usingexp()
. Does not treat values belowMINUS_INFINITY_DB
as 0.0 gain to avoid branching. As a result this function will thus also never return 0.0 for normal input values. Will run faster on most architectures, but the result may be slightly different. db_to_gain_fast()
, but this version does truncate values belowMINUS_INFINITY_DB
to 0.0. Bikeshedding over a better name is welcome.- The same as
midi_note_to_freq()
, but for arbitrary note numbers including those outside of the MIDI range. This also supports fractional note numbers, which is useful when working with cents. - The inverse of
f32_midi_note_to_freq()
. This returns a fractional note number. Round to a whole number, subtract that from the result, and multiply the fractional part by 100 to get the number of cents. - Convert a voltage gain ratio to decibels. Gain ratios that aren’t positive will be treated as
MINUS_INFINITY_DB
. - An approximation of
gain_to_db()
usingln()
. Will run faster on most architectures, but the result may be slightly different. db_to_gain_fast()
, but the minimum gain value is set tof32::EPSILON
instead ofMINUS_INFINITY_GAIN
. Useful in conjunction withdb_to_gain_fast()
.- Convert a MIDI note ID to a frequency at A4 = 440 Hz equal temperament and middle C = note 60 = C4.
- permit_allocNot (debug-assertions enabled and
assert_process_allocs
)Temporarily allow allocations withinfunc
if NIH-plug was configured with theassert_process_allocs
feature.