mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Pink noise
This commit is contained in:
parent
bc20b38624
commit
95aac485c7
6 changed files with 20 additions and 5 deletions
|
|
@ -182,6 +182,7 @@ public:
|
|||
|
||||
addEnable (noise.enable);
|
||||
|
||||
addControl (new gin::Select (noise.type), 0, 0);
|
||||
addControl (new gin::Knob (noise.level, true), 0, 0);
|
||||
addControl (new gin::Knob (noise.pan, true), 0, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,18 @@ static juce::String subTextFunction (const gin::Parameter&, float v)
|
|||
}
|
||||
}
|
||||
|
||||
static juce::String noiseTextFunction (const gin::Parameter&, float v)
|
||||
{
|
||||
switch (int (v))
|
||||
{
|
||||
case 0: return "White";
|
||||
case 1: return "Pink";
|
||||
default:
|
||||
jassertfalse;
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
static juce::String lfoTextFunction (const gin::Parameter&, float v)
|
||||
{
|
||||
switch ((gin::LFO::WaveShape)int (v))
|
||||
|
|
@ -138,6 +150,7 @@ void WavetableAudioProcessor::NoiseParams::setup (WavetableAudioProcessor& p)
|
|||
juce::String nm = "Noise ";
|
||||
|
||||
enable = p.addIntParam (id + "enable", nm + "Enable", "Enable", "", { 0.0, 1.0, 1.0, 1.0 }, 0.0f, 0.0f);
|
||||
type = p.addIntParam (id + "type", nm + "Type", "Type", "", { 0.0, 1.0, 1.0, 1.0 }, 0.0, 0.0f, noiseTextFunction);
|
||||
level = p.addExtParam (id + "level", nm + "Level", "Level", "db", { -100.0, 0.0, 1.0, 4.0 }, 0.0, 0.0f);
|
||||
pan = p.addExtParam (id + "pan", nm + "Pan", "Pan", "", { -1.0, 1.0, 0.0, 1.0 }, 0.0, 0.0f);
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public:
|
|||
{
|
||||
NoiseParams() = default;
|
||||
|
||||
gin::Parameter::Ptr enable, level, pan;
|
||||
gin::Parameter::Ptr enable, type, level, pan;
|
||||
|
||||
void setup (WavetableAudioProcessor& p);
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ void WavetableVoice::updateParams (int blockSize)
|
|||
|
||||
if (proc.noiseParams.enable->isOn())
|
||||
{
|
||||
noiseParams.wave = gin::Wave::noise;
|
||||
noiseParams.wave = gin::Wave::whiteNoise;
|
||||
|
||||
noiseParams.leftGain = getValue (proc.noiseParams.level) * (1.0f - getValue (proc.noiseParams.pan));
|
||||
noiseParams.rightGain = getValue (proc.noiseParams.level) * (1.0f + getValue (proc.noiseParams.pan));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue