nngn
Loading...
Searching...
No Matches
anonymous_namespace{components.cpp} Namespace Reference

Variables

constexpr auto add_str = "audio.add {...}"sv
 
constexpr auto add_desc
 
constexpr auto cat_str = "audio.cat {...}"sv
 
constexpr auto cat_desc
 
constexpr auto chord_str = "audio.chord{n0, n1, ...}"sv
 
constexpr auto chord_desc
 
constexpr auto dur_str = "audio.dur(dur)"sv
 
constexpr auto dur_desc
 
constexpr auto env_str = "audio.env(a, d, s, r)"sv
 
constexpr auto env_desc
 
constexpr auto exp_fade_str = "audio.exp_fade(pos0, gain0, pos1, gain1, exp)"sv
 
constexpr auto exp_fade_desc
 
constexpr auto fade_str = "audio.fade(pos0, gain0, pos1, gain1)"sv
 
constexpr auto fade_desc
 
constexpr auto fn_str = "audio.fn(function() end)"sv
 
constexpr auto fn_desc
 
constexpr auto gain_str = "audio.gain(mul)"sv
 
constexpr auto gain_desc
 
constexpr auto harm_str
 
constexpr auto harm_desc
 
constexpr auto map_str = "audio.map(f, {...}, dur)"sv
 
constexpr auto map_desc
 
constexpr auto map2_str = "audio.map2(f, {...})"sv
 
constexpr auto map2_desc
 
constexpr auto mix_str = "audio.mix {...}"sv
 
constexpr auto mix_desc
 
constexpr auto noise_str = "audio.noise()"sv
 
constexpr auto noise_desc
 
constexpr auto nop_str = "audio.nop()"sv
 
constexpr auto nop_desc
 
constexpr auto over_str = "audio.over(mul, mix)"sv
 
constexpr auto over_desc
 
constexpr auto rep_str = "audio.rep(f)"sv
 
constexpr auto rep_desc
 
constexpr auto saw_str = "audio.saw(freq)"sv
 
constexpr auto saw_desc
 
constexpr auto seek_str = "audio.seek(n)"sv
 
constexpr auto seek_desc
 
constexpr auto seq_str
 
constexpr auto seq_desc
 
constexpr auto sine_str = "audio.sine(freq)"sv
 
constexpr auto sine_desc
 
constexpr auto sine_fm_str = "audio.sine_fm(freq, lfo_a, lfo_freq, lfo_d)"sv
 
constexpr auto sine_fm_desc
 
constexpr auto slide_str = "audio.slide(freq0, freq1, steps)"sv
 
constexpr auto slide_desc
 
constexpr auto square_str = "audio.square(freq)"sv
 
constexpr auto square_desc
 
constexpr auto trem_str = "audio.trem(a, f, mix)"sv
 
constexpr auto trem_desc
 

Variable Documentation

◆ add_desc

auto anonymous_namespace{components.cpp}::add_desc
constexpr
Initial value:
= R"(
Serially applies each item in the sequence over the entire contents of the
buffer.
Example:
audio.add {
audio.sine(440),
audio.gain(0.5),
audio.fade(0, 0, 0, 1),
}
)"sv

◆ add_str

auto anonymous_namespace{components.cpp}::add_str = "audio.add {...}"sv
constexpr

◆ cat_desc

auto anonymous_namespace{components.cpp}::cat_desc
constexpr
Initial value:
= R"(
Concatenates every item in the sequence.
Example:
audio.cat {
audio.dur(rate, audio.sine(440)),
audio.dur(rate, audio.sine(660)),
audio.dur(rate, audio.sine(880)),
}
)"sv

◆ cat_str

auto anonymous_namespace{components.cpp}::cat_str = "audio.cat {...}"sv
constexpr

◆ chord_desc

auto anonymous_namespace{components.cpp}::chord_desc
constexpr
Initial value:
= R"(
Applies a generator to all notes in the sequence.
Example:
audio.chord({440, 880, 1320, 1760}, audio.sine)
)"sv

◆ chord_str

auto anonymous_namespace{components.cpp}::chord_str = "audio.chord{n0, n1, ...}"sv
constexpr

◆ dur_desc

auto anonymous_namespace{components.cpp}::dur_desc
constexpr
Initial value:
= R"(
Limits the duration to `dur` samples.
Example:
audio.dur(rate, audio.sine(440))
)"sv

◆ dur_str

auto anonymous_namespace{components.cpp}::dur_str = "audio.dur(dur)"sv
constexpr

◆ env_desc

auto anonymous_namespace{components.cpp}::env_desc
constexpr
Initial value:
= R"(
Attack/delay/sustain/release envolope.
Example:
audio.env(rate, rate, 0.5, rate, audio.sine(440))
)"sv

◆ env_str

auto anonymous_namespace{components.cpp}::env_str = "audio.env(a, d, s, r)"sv
constexpr

◆ exp_fade_desc

auto anonymous_namespace{components.cpp}::exp_fade_desc
constexpr
Initial value:
= R"(
Exponential fade. Audio level is interpolated exponentially with exponent
`exp`. Other parameters are the same as `fade`.
Example:
audio.exp_fade(0, 0, 0, 1, 2) -- quadratic fade over the entire sample
-- from silence to normal
)"sv

◆ exp_fade_str

auto anonymous_namespace{components.cpp}::exp_fade_str = "audio.exp_fade(pos0, gain0, pos1, gain1, exp)"sv
constexpr

◆ fade_desc

auto anonymous_namespace{components.cpp}::fade_desc
constexpr
Initial value:
= R"(
Linear fade. Audio level is interpolated linearly from `gain0` to `gain1` in
the range `[pos0, pos1)`. Both `pos0` and `pos1` can be `-n`, meaning "`n`
samples before the end". `pos1 == 0` means "at the end".
Example:
audio.fade(0, 0, 0, 1) -- linear fade over the entire sample from silence to
-- normal
)"sv

◆ fade_str

auto anonymous_namespace{components.cpp}::fade_str = "audio.fade(pos0, gain0, pos1, gain1)"sv
constexpr

◆ fn_desc

auto anonymous_namespace{components.cpp}::fn_desc
constexpr
Initial value:
= R"(
Applies an arbitrary function. Arguments are the `Audio` object, destination
buffer, and sample range (`[b, e)`).
Example:
audio.fn(function(a, dst, b, e)
audio.sine(a, dst, b, e)
end)
)"sv

◆ fn_str

auto anonymous_namespace{components.cpp}::fn_str = "audio.fn(function() end)"sv
constexpr

◆ gain_desc

auto anonymous_namespace{components.cpp}::gain_desc
constexpr
Initial value:
= R"(
Multiplies the level of each sample by `mul`.
Example:
audio.gain(0.5, audio.sine(440))
audio.add { audio.sine(440), audio.gain(audio.db(-2)) }
)"sv

◆ gain_str

auto anonymous_namespace{components.cpp}::gain_str = "audio.gain(mul)"sv
constexpr

◆ harm_desc

auto anonymous_namespace{components.cpp}::harm_desc
constexpr
Initial value:
= R"(
Generates a harmonic sequence using the generator `gen`, duration `dur`, and
input frequency `freq`. Every group of three items in the sequence denotes the
gain, exponential fade factor, and frequency multiplier of one harmonic.
Example:
audio.harm(audio.sine, rate, 440 {
0x1p-1 rate, 1,
0x1p-2 rate, 2,
0x1p-3 rate, 3,
0x1p-4, rate, 4,
})
)"sv

◆ harm_str

auto anonymous_namespace{components.cpp}::harm_str
constexpr
Initial value:
=
"audio.harm"
"(gen, dur, freq, {gain0, fade0, mul0, gain1, fade1, mul1, ...})"sv

◆ map2_desc

auto anonymous_namespace{components.cpp}::map2_desc
constexpr
Initial value:
= R"(
Applies the function `f` to each group of frequency/duration in the sequence.
Example:
audio.map2(audio.sine, {440, rate, 880, rate, 1320, rate, 1760, rate})
)"sv

◆ map2_str

auto anonymous_namespace{components.cpp}::map2_str = "audio.map2(f, {...})"sv
constexpr

◆ map_desc

auto anonymous_namespace{components.cpp}::map_desc
constexpr
Initial value:
= R"(
Applies the function `f` to each frequency in the sequence, each with duration
`dur`.
Example:
audio.map(audio.sine, {440, 880, 1320, 1760}, rate)
)"sv

◆ map_str

auto anonymous_namespace{components.cpp}::map_str = "audio.map(f, {...}, dur)"sv
constexpr

◆ mix_desc

auto anonymous_namespace{components.cpp}::mix_desc
constexpr
Initial value:
= R"(
Similar to `add`, but each item in the sequence is generated in its own buffer,
independently of the others.
Example:
audio.dur(rate, audio.mix {
audio.gain(0.5, audio.sine(440)),
audio.gain(0.25, audio.sine(880)),
})
)"sv

◆ mix_str

auto anonymous_namespace{components.cpp}::mix_str = "audio.mix {...}"sv
constexpr

◆ noise_desc

auto anonymous_namespace{components.cpp}::noise_desc
constexpr
Initial value:
= R"(
Generates white noise (random).
Example:
audio.noise()
)"sv

◆ noise_str

auto anonymous_namespace{components.cpp}::noise_str = "audio.noise()"sv
constexpr

◆ nop_desc

auto anonymous_namespace{components.cpp}::nop_desc
constexpr
Initial value:
= R"(
Does nothing.
Example:
audio.nop()
)"sv

◆ nop_str

auto anonymous_namespace{components.cpp}::nop_str = "audio.nop()"sv
constexpr

◆ over_desc

auto anonymous_namespace{components.cpp}::over_desc
constexpr
Initial value:
= R"(
Exponential overdrive. `mul` is the input multiplier, `mix` is the linear
interpolation factor from the original signal (0) to the overddriven one (1).
Example:
audio.over(0.5, 0.2, audio.sine(440))
)"sv

◆ over_str

auto anonymous_namespace{components.cpp}::over_str = "audio.over(mul, mix)"sv
constexpr

◆ rep_desc

auto anonymous_namespace{components.cpp}::rep_desc
constexpr
Initial value:
= R"(
Repeats a generator indefinitely.
Example:
metronome = audio.rep(audio.dur(w/2, audio.dur(rate/20, audio.sine(880))))
)"sv

◆ rep_str

auto anonymous_namespace{components.cpp}::rep_str = "audio.rep(f)"sv
constexpr

◆ saw_desc

auto anonymous_namespace{components.cpp}::saw_desc
constexpr
Initial value:
= R"(
Produces a saw tooth wave.
Example:
audio.saw(440)
)"sv

◆ saw_str

auto anonymous_namespace{components.cpp}::saw_str = "audio.saw(freq)"sv
constexpr

◆ seek_desc

auto anonymous_namespace{components.cpp}::seek_desc
constexpr
Initial value:
= R"(
Moves `n` samples forward.
Example:
audio.dur(2 * rate, audio.add {
audio.sine(440),
audio.seek(rate, audio.sine(880)),
})
)"sv

◆ seek_str

auto anonymous_namespace{components.cpp}::seek_str = "audio.seek(n)"sv
constexpr

◆ seq_desc

auto anonymous_namespace{components.cpp}::seq_desc
constexpr
Initial value:
= R"(
Graphical (ASCII) sequencer. Each group of two items in the sequence denote a
generator and the sequence of notes/rests. For the latter, a space denotes a
rest and any other character indicates a note, both with duration `dur`.
Example:
audio.seq(rate, {
audio.sine(440), "o o ",
audio.square(440), " o o ",
audio.saw(440), "oooooooo",
}
)"sv

◆ seq_str

auto anonymous_namespace{components.cpp}::seq_str
constexpr
Initial value:
=
R"(audio.seq(dur, {gen0, "o o ", gen1, " o o", ...})"sv

◆ sine_desc

auto anonymous_namespace{components.cpp}::sine_desc
constexpr
Initial value:
= R"(
Produces a sine wave.
Example:
audio.sine(440)
)"sv

◆ sine_fm_desc

auto anonymous_namespace{components.cpp}::sine_fm_desc
constexpr
Initial value:
= R"(
Produces a sine wave with frequency modulation using another sine wave as a LFO.
The `lfo_*` parameters control the oscillator: `a` is the amplitude, `freq` is
the frequency, and `d` is the displacement.
Example:
audio.sine_fm(440, 1.5, 0.5, 2)
)"sv

◆ sine_fm_str

auto anonymous_namespace{components.cpp}::sine_fm_str = "audio.sine_fm(freq, lfo_a, lfo_freq, lfo_d)"sv
constexpr

◆ sine_str

auto anonymous_namespace{components.cpp}::sine_str = "audio.sine(freq)"sv
constexpr

◆ slide_desc

auto anonymous_namespace{components.cpp}::slide_desc
constexpr
Initial value:
= R"(
Example:
Divides the buffer into `steps` parts and applies the generator to each, using a
frequency linearly interpolated between `[freq0, freq1)` for each part.
)"sv

◆ slide_str

auto anonymous_namespace{components.cpp}::slide_str = "audio.slide(freq0, freq1, steps)"sv
constexpr

◆ square_desc

auto anonymous_namespace{components.cpp}::square_desc
constexpr
Initial value:
= R"(
Produces a square wave.
audio.square(440)
)"sv

◆ square_str

auto anonymous_namespace{components.cpp}::square_str = "audio.square(freq)"sv
constexpr

◆ trem_desc

auto anonymous_namespace{components.cpp}::trem_desc
constexpr
Initial value:
= R"(
Tremolo effect which applies a simple sine wave oscillator to the signal. `a`
is the amplitude, `f` is the frequency. `mix` is a linear interpolation factor
between the origin signal (0) and the one with the tremolo (1).
Example:
audio.trem(0.5, 3, 0.15, audio.sine(440))
)"sv

◆ trem_str

auto anonymous_namespace{components.cpp}::trem_str = "audio.trem(a, f, mix)"sv
constexpr