Documented more stuff
This commit is contained in:
parent
bb052d0837
commit
7e743eae07
2 changed files with 39 additions and 19 deletions
|
@ -281,7 +281,19 @@ pub fn note_to_freq(note: f32) -> f32 {
|
||||||
// * DspEffectLibrary.h - library with template-based inline-effects
|
// * DspEffectLibrary.h - library with template-based inline-effects
|
||||||
// * Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
// * Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||||
//
|
//
|
||||||
/// Signal distortion
|
// Original source seems to be musicdsp.org, Author: Bram de Jong
|
||||||
|
// see also: https://www.musicdsp.org/en/latest/Effects/41-waveshaper.html
|
||||||
|
// Notes:
|
||||||
|
// where x (in [-1..1] will be distorted and a is a distortion parameter
|
||||||
|
// that goes from 1 to infinity. The equation is valid for positive and
|
||||||
|
// negativ values. If a is 1, it results in a slight distortion and with
|
||||||
|
// bigger a's the signal get's more funky.
|
||||||
|
// A good thing about the shaper is that feeding it with bigger-than-one
|
||||||
|
// values, doesn't create strange fx. The maximum this function will reach
|
||||||
|
// is 1.2 for a=1.
|
||||||
|
//
|
||||||
|
// f(x,a) = x*(abs(x) + a)/(x^2 + (a-1)*abs(x) + 1)
|
||||||
|
/// Signal distortion by Bram de Jong.
|
||||||
/// ```text
|
/// ```text
|
||||||
/// gain: 0.1 - 5.0 default = 1.0
|
/// gain: 0.1 - 5.0 default = 1.0
|
||||||
/// threshold: 0.0 - 100.0 default = 0.8
|
/// threshold: 0.0 - 100.0 default = 0.8
|
||||||
|
@ -1634,9 +1646,9 @@ macro_rules! fa_distort { ($formatter: expr, $v: expr, $denorm_v: expr) => { {
|
||||||
let s =
|
let s =
|
||||||
match ($v.round() as usize) {
|
match ($v.round() as usize) {
|
||||||
0 => "Off",
|
0 => "Off",
|
||||||
1 => "tanh",
|
1 => "TanH",
|
||||||
2 => "?!?",
|
2 => "B.D.Jong",
|
||||||
3 => "fold",
|
3 => "Fold",
|
||||||
_ => "?",
|
_ => "?",
|
||||||
};
|
};
|
||||||
write!($formatter, "{}", s)
|
write!($formatter, "{}", s)
|
||||||
|
|
|
@ -52,36 +52,44 @@ impl VOsc {
|
||||||
Note: The signal input allows detune +-10 octaves.\
|
Note: The signal input allows detune +-10 octaves.\
|
||||||
\nRange: (Knob -0.2 .. 0.2) / (Signal -1.0 .. 1.0)\n";
|
\nRange: (Knob -0.2 .. 0.2) / (Signal -1.0 .. 1.0)\n";
|
||||||
pub const d : &'static str =
|
pub const d : &'static str =
|
||||||
"VOsc d\n\nRange: (0..1)\n";
|
"VOsc d\nThis is the horzontal bending point of the waveform. \
|
||||||
|
It has a similar effect that pulse width settings have on other \
|
||||||
|
oscillators. Make sure to try modulating this parameter at audio rate!\
|
||||||
|
\nRange: (0..1)\n";
|
||||||
pub const v : &'static str =
|
pub const v : &'static str =
|
||||||
"VOsc v\n\nRange: (0..1)\n";
|
"VOsc v\nThis is the vertical bending point of the waveform. \
|
||||||
|
You can adjust the effect that 'd' has on the waveform with this \
|
||||||
|
parameter. Make sure to try to modulate this parameter at audio rate!\
|
||||||
|
\nRange: (0..1)\n";
|
||||||
pub const vs : &'static str =
|
pub const vs : &'static str =
|
||||||
"VOsc vs\nScaling factor for 'v'.\nRange: (0..1)\n";
|
"VOsc vs\nScaling factor for 'v'. If you increase this beyond 1.0, \
|
||||||
|
you will hear formant like sounds from the oscillator. Try adjusting \
|
||||||
|
'd' to move the formants around.\nRange: (0..1)\n";
|
||||||
pub const dist : &'static str =
|
pub const dist : &'static str =
|
||||||
"VOsc dist\nDistortion.";
|
"VOsc dist\nA collection of waveshaper/distortions to choose from.";
|
||||||
pub const damt : &'static str =
|
pub const damt : &'static str =
|
||||||
"VOsc damt\nDistortion amount.";
|
"VOsc damt\nDistortion amount.\nRange: (0..1)\n";
|
||||||
pub const ovrsmpl : &'static str =
|
pub const ovrsmpl : &'static str =
|
||||||
"VOsc ovrsmpl\nEnable/Disable oversampling.";
|
"VOsc ovrsmpl\nEnable/Disable oversampling.";
|
||||||
pub const wtype : &'static str =
|
|
||||||
"VOsc wtype\nWaveform type\nAvailable waveforms:\n\
|
|
||||||
Sin - Sine Waveform\n\
|
|
||||||
Tri - Triangle Waveform\n\
|
|
||||||
Saw - Sawtooth Waveform\n\
|
|
||||||
Pulse - Pulse Waveform with configurable pulse width";
|
|
||||||
pub const sig : &'static str =
|
pub const sig : &'static str =
|
||||||
"VOsc sig\nOscillator output\nRange: (-1..1)\n";
|
"VOsc sig\nOscillator output\nRange: (-1..1)\n";
|
||||||
pub const DESC : &'static str =
|
pub const DESC : &'static str =
|
||||||
r#"V Oscillator
|
r#"V Oscillator
|
||||||
|
|
||||||
A vector phase shaping oscillator, to create interesting waveforms and
|
A vector phase shaping oscillator, to create interesting waveforms and ways to
|
||||||
ways to manipulate them.
|
manipulate them. It has two parameters ('v' and 'd') to shape the phase of the
|
||||||
|
sinusoid wave, and a third parameter 'vs' to add extra spice.
|
||||||
|
With distortion you can beef up the oscillator output even more and to
|
||||||
|
make it more harmonic you can apply oversampling.
|
||||||
"#;
|
"#;
|
||||||
pub const HELP : &'static str =
|
pub const HELP : &'static str =
|
||||||
r#"VOsc - Vector Phase Shaping Oscillator
|
r#"VOsc - Vector Phase Shaping Oscillator
|
||||||
|
|
||||||
A vector phase shaping oscillator, to create interesting waveforms and
|
A vector phase shaping oscillator, to create interesting waveforms and ways to
|
||||||
ways to manipulate them.
|
manipulate them. It has two parameters ('v' and 'd') to shape the phase of the
|
||||||
|
sinusoid wave, and a third parameter 'vs' to add extra spice.
|
||||||
|
With distortion you can beef up the oscillator output even more and to
|
||||||
|
make it more harmonic you can apply oversampling.
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue