24#include "AmbisonicEncoder.h"
25#include "Distortion.h"
27#include "Oscillator.h"
29#include <juce_audio_basics/juce_audio_basics.h>
73 void noteOn(uint8_t noteVal, uint8_t velocity);
76 void noteOff(uint8_t noteVal, uint8_t velocity);
85 void render(juce::AudioBuffer<float>& audio,
size_t numSamples,
size_t bufferOffset);
97 auto nextSample() ->
float;
101 double _bendValSemitones;
105 fx::AmbisonicEncoder _encoder;
110 fx::Distortion _drive;
ADSR envelope.
Definition ADSR.h:40
Represents a single band-limited oscillator with multiple waveforms.
Definition Oscillator.h:42
Represents a single voice of a polyphonic synthesizer.
Definition Voice.h:47
void reset()
Reset the voice's state.
Definition Voice.cpp:69
void setSampleRate(double sampleRate)
Set the sample rate in Hz.
Definition Voice.cpp:158
auto getNoteVal() const -> uint8_t
Returns the MIDI value of the currently playing note, or 0 if no note is playing.
Definition Voice.cpp:195
void noteOn(uint8_t noteVal, uint8_t velocity)
Start a note with the given note value and velocity.
Definition Voice.cpp:82
void render(juce::AudioBuffer< float > &audio, size_t numSamples, size_t bufferOffset)
Compute the next block of audio samples.
Definition Voice.cpp:111
void setParams(const Params &)
Set the voice's parameters.
Definition Voice.cpp:169
auto isActive() const -> bool
Returns true if a note is currently being played.
Definition Voice.cpp:200
void pitchBend(uint16_t bendVal)
Set the pitch bend value using MIDI pitchbend data (14 bytes)
Definition Voice.cpp:104
void noteOff(uint8_t noteVal, uint8_t velocity)
Stop a note with the given note value. (Velocity is ignored for now.)
Definition Voice.cpp:94
Envelope parameters.
Definition ADSR.h:44
Oscillator parameters.
Definition Oscillator.h:60
Voice parameters.
Definition Voice.h:51
Oscillator::Params oscA
Oscillator A parameters.
Definition Voice.h:53
double aziRange
Spread MIDI range around aziCenter +/- aziRange/2.
Definition Voice.h:60
float filtModAmt
How much the filter env should modulate the filter.
Definition Voice.h:58
float filterCutoff
Filter cutoff as a multiplier of oscillator frequency.
Definition Voice.h:61
double aziCenter
Anchor middle of MIDI note range to this azimuth in degrees.
Definition Voice.h:59
float drive
Distortion drive (dB)
Definition Voice.h:63
ADSR::Params filtEnv
Amplitude envelope parameters.
Definition Voice.h:57
Oscillator::Params oscB
Oscillator A parameters.
Definition Voice.h:54
float masterLevel
Master level.
Definition Voice.h:52
Oscillator::Params oscC
Oscillator A parameters.
Definition Voice.h:55
float filterResonance
Filter resonance.
Definition Voice.h:62
ADSR::Params ampEnv
Amplitude envelope parameters.
Definition Voice.h:56