Fix line endings and some cleanup

This commit is contained in:
Roboboffin
2025-10-23 04:00:21 +01:00
parent 24eb354ace
commit 3ac2cc15b1
66 changed files with 3029 additions and 0 deletions

145
Source/NeuralSharedParams.h Normal file
View File

@@ -0,0 +1,145 @@
#pragma once
#include <atomic>
#include <unordered_map>
#include <string>
struct SliderDetail {
std::string label;
float min, max, interval, defValue;
};
using ParamMap = std::unordered_map<std::string, SliderDetail>;
// Each SliderDetail: { label, min, max, step, defaultValue }
const std::unordered_map<std::string, ParamMap> PARAM_SETTINGS = {
{ "chorus", {
{ "rate", { "Rate", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "depth", { "Depth", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "centre", { "Centre", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "feedback", { "Feedback", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "mix", { "Mix", 0.0f, 1.0f, 0.1f, 0.1f } }
}},
{ "delay", {
{ "delay", { "Delay", 0.0f, 1.0f, 0.1f, 0.1f } }
}},
{ "reverb", {
{ "roomSize", { "Room Size", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "damping", { "Damping", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "wetLevel", { "Wet Level", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "dryLevel", { "Dry Level", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "width", { "Width", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "freezeMode", { "Freeze Mode", 0.0f, 1.0f, 0.1f, 0.1f } }
}},
{ "adsr", {
{ "attack", { "Attack", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "decay", { "Decay", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "sustain", { "Sustain", 0.0f, 1.0f, 0.1f, 0.1f } },
{ "release", { "Release", 0.0f, 1.0f, 0.1f, 0.1f } }
}},
// Filter envelope group (short key: "fenv")
{ "fenv", {
{ "attack", { "Attack", 0.0f, 2.0f, 0.001f, 0.01f } },
{ "decay", { "Decay", 0.0f, 2.0f, 0.001f, 0.10f } },
{ "sustain", { "Sustain", 0.0f, 1.0f, 0.001f, 0.80f } },
{ "release", { "Release", 0.0f, 4.0f, 0.001f, 0.40f } },
{ "amount", { "Amount", -1.0f, 1.0f, 0.001f, 0.50f } }
}},
{ "flanger", {
{ "rate", { "Rate", 0.1f, 5.0f, 0.1f, 0.1f } },
{ "depth", { "Depth", 0.1f, 10.0f, 0.1f, 0.1f } }, // ms
{ "feedback", { "Feedback", 0.0f, 0.95f, 0.01f, 0.1f } },
{ "dryMix", { "Dry/Wet", 0.0f, 1.0f, 0.01f, 0.0f } },
{ "phase", { "Phase", 0.0f, 1.0f, 0.1f, 0.0f } },
{ "delay", { "Delay", 0.0f, 3.0f, 0.1f, 0.25f } } // ms base
}},
{ "filter", {
{ "cutoff", { "Cutoff", 20.0f, 20000.0f, 1.0f, 1000.0f } },
{ "resonance", { "Resonance", 0.1f, 10.0f, 0.1f, 0.7f } },
{ "type", { "L/H/B", 0.0f, 2.0f, 1.0f, 0.0f } },
{ "drive", { "Drive", 0.0f, 1.0f, 0.01f, 0.0f } },
{ "mod", { "Mod", -1.0f, 1.0f, 0.1f, 0.0f } },
{ "key", { "Key", 0.0f, 1.0f, 0.1f, 0.0f } }
}},
{ "distortion", {
{ "drive", { "Drive", 0.0f, 30.0f, 0.1f, 10.0f } },
{ "mix", { "Mix", 0.0f, 1.0f, 0.01f, 0.0f } },
{ "bias", { "Bias", -1.0f, 1.0f, 0.01f, 0.0f } },
{ "tone", { "Tone", 100.0f, 8000.0f, 10.0f, 3000.0f } },
{ "shape", { "Shape", 0.0f, 2.0f, 1.0f, 0.0f } }
}}
};
struct NeuralSharedParams
{
std::atomic<int> waveform{ -1 };
// Amp ADSR
std::atomic<float>* adsrAttack{};
std::atomic<float>* adsrDecay{};
std::atomic<float>* adsrSustain{};
std::atomic<float>* adsrRelease{};
// Delay
std::atomic<float>* delayTime{};
// Chorus
std::atomic<float>* chorusRate{};
std::atomic<float>* chorusDepth{};
std::atomic<float>* chorusCentre{};
std::atomic<float>* chorusFeedback{};
std::atomic<float>* chorusMix{};
// Reverb
std::atomic<float>* reverbRoomSize{};
std::atomic<float>* reverbDamping{};
std::atomic<float>* reverbWetLevel{};
std::atomic<float>* reverbDryLevel{};
std::atomic<float>* reverbWidth{};
std::atomic<float>* reverbFreezeMode{};
// Flanger
std::atomic<float>* flangerRate{};
std::atomic<float>* flangerDepth{};
std::atomic<float>* flangerFeedback{};
std::atomic<float>* flangerDryMix{};
std::atomic<float>* flangerPhase{};
std::atomic<float>* flangerDelay{};
// Filter (base)
std::atomic<float>* filterCutoff{};
std::atomic<float>* filterResonance{};
std::atomic<float>* filterType{};
std::atomic<float>* filterDrive{};
std::atomic<float>* filterMod{};
std::atomic<float>* filterKey{};
// Filter Env (polyphonic)
std::atomic<float>* fenvAttack{};
std::atomic<float>* fenvDecay{};
std::atomic<float>* fenvSustain{};
std::atomic<float>* fenvRelease{};
std::atomic<float>* fenvAmount{}; // +/- octaves
// Distortion
std::atomic<float>* distortionDrive{};
std::atomic<float>* distortionMix{};
std::atomic<float>* distortionBias{};
std::atomic<float>* distortionTone{};
std::atomic<float>* distortionShape{};
// Per-panel bypass (AudioParameterBool, exposed as float 0/1 via getRawParameterValue)
std::atomic<float>* chorusOn{};
std::atomic<float>* delayOn{};
std::atomic<float>* reverbOn{};
std::atomic<float>* flangerOn{};
std::atomic<float>* distortionOn{};
std::atomic<float>* filterOn{};
std::atomic<float>* eqOn{};
// EQ + Master
std::atomic<float>* lowGainDbls{};
std::atomic<float>* midGainDbls{};
std::atomic<float>* highGainDbls{};
std::atomic<float>* masterDbls{};
};