feat(dsp): add core synthesizer oscillators, wavetable and voice engine
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "Params.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// Per-voice white/pink noise generator.
|
||||
// ===========================================================================
|
||||
class NoiseOscillator
|
||||
{
|
||||
public:
|
||||
void prepare (double sampleRate) { sr = sampleRate; reset(); }
|
||||
void reset();
|
||||
|
||||
void noteOn (juce::uint32 seed);
|
||||
|
||||
// Accumulate into out.
|
||||
void processAdd (int type, float level, float& out) noexcept;
|
||||
|
||||
private:
|
||||
double sr = 44100.0;
|
||||
juce::Random rng;
|
||||
float pinkB0 = 0.0f, pinkB1 = 0.0f, pinkB2 = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user