Expand description
General conversion functions and utilities.
Modules§
- window
- Windowing functions, useful in conjunction with
StftHelper.
Structs§
- Stft
Helper - 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§
- db_
to_ gain - Convert decibels to a voltage gain ratio, treating anything below -100 dB as minus infinity.
- db_
to_ gain_ fast - An approximation of
db_to_gain()usingexp(). Does not treat values belowMINUS_INFINITY_DBas 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_ branching db_to_gain_fast(), but this version does truncate values belowMINUS_INFINITY_DBto 0.0. Bikeshedding over a better name is welcome.- f32_
midi_ note_ to_ freq - 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. - freq_
to_ midi_ note - 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. - gain_
to_ db - Convert a voltage gain ratio to decibels. Gain ratios that aren’t positive will be treated as
MINUS_INFINITY_DB. - gain_
to_ db_ fast - An approximation of
gain_to_db()usingln(). Will run faster on most architectures, but the result may be slightly different. - gain_
to_ db_ fast_ epsilon db_to_gain_fast(), but the minimum gain value is set tof32::EPSILONinstead ofMINUS_INFINITY_GAIN. Useful in conjunction withdb_to_gain_fast().- midi_
note_ to_ freq - Convert a MIDI note ID to a frequency at A4 = 440 Hz equal temperament and middle C = note 60 = C4.
- permit_
alloc - Temporarily allow allocations within
funcif nice-plug was configured with theassert_process_allocsfeature.