Upload files to "Source"

This commit is contained in:
ed
2025-10-22 17:15:31 +00:00
parent 187e9f36a4
commit 20b53a8780
2 changed files with 17 additions and 39 deletions

View File

@@ -1,13 +1,12 @@
#pragma once
#include <JuceHeader.h>
#include <functional>
#include <functional> // <-- for std::function used by WaveShaper
#include "NeuralSharedParams.h"
#include "BlepOsc.h"
#include "WavetableOsc.h" // <-- new
//==============================================================================
// A single voice with BLEP osc + optional Wavetable osc (morph + anti-aliasing),
// per-voice ADSR, filter ADSR, flanger/delay/chorus/reverb/distortion/EQ/master.
// A single polyBLEP oscillator voice with per-voice ADSR, filter ADSR,
// flanger (delayline), simple delay, chorus, reverb, distortion, EQ, master.
class NeuralSynthVoice : public juce::MPESynthesiserVoice
{
public:
@@ -32,12 +31,12 @@ public:
private:
void setWaveform (int waveformType);
//=== Processing chain (without oscillator) =================================
//=== Processing chain (without oscillator) ===============================
using DelayLine = juce::dsp::DelayLine<float,
juce::dsp::DelayLineInterpolationTypes::Linear>;
using IIR = juce::dsp::IIR::Filter<float>;
using Gain = juce::dsp::Gain<float>;
using WaveShaper = juce::dsp::WaveShaper<float, std::function<float(float)>>;
using WaveShaper = juce::dsp::WaveShaper<float, std::function<float(float)>>; // <-- fix
using Chorus = juce::dsp::Chorus<float>;
using Reverb = juce::dsp::Reverb;
using Limiter = juce::dsp::Limiter<float>;
@@ -75,24 +74,22 @@ private:
private:
NeuralSharedParams& shared;
juce::dsp::ProcessSpec spec {};
// ==== Oscillators ========================================================
BlepOsc osc; // polyBLEP (existing)
std::atomic<int> pendingWaveform { -1 };
// ==== Oscillator (polyBLEP) ============================================
BlepOsc osc;
std::atomic<int> pendingWaveform {-1}; // set by changeWaveform()
WT::Osc wtOsc; // wavetable oscillator (new)
static std::shared_ptr<WT::Bank> wtBank; // shared bank across voices
// ==== Envelopes & Filter =================================================
// ==== Envelopes & Filter ===============================================
juce::ADSR adsr;
juce::ADSR filterAdsr;
juce::dsp::StateVariableTPTFilter<float> svf;
// ==== FX chain ===========================================================
// ==== Chain (FX, EQ, master, limiter) ==================================
Chain chain;
// ==== Scratch buffer =====================================================
// ==== Scratch buffer (properly allocated) ===============================
juce::AudioBuffer<float> tempBuffer;
juce::dsp::AudioBlock<float> tempBlock;