FahlGrahn Audio v1.0.0
Loading...
Searching...
No Matches
SynthVoice.h
1#pragma once
2#include <juce_audio_basics/juce_audio_basics.h>
3
4#include "Oscillator.h"
5#include "SynthSound.h"
6
7class SynthVoice : public juce::SynthesiserVoice
8{
9 public:
10 SynthVoice();
11 bool canPlaySound(juce::SynthesiserSound *) override;
12 void startNote(int midiNoteNumber, float velocity, juce::SynthesiserSound *sound,
13 int currentPitchWheelPosition) override;
14 void stopNote(float velocity, bool allowTailOff) override;
15 void controllerMoved(int controllerNumber, int newControllerValue) override;
16 void pitchWheelMoved(int newPitchWheelValue) override;
17 void renderNextBlock(juce::AudioBuffer<float> &outputBuffer, int startSample, int numSamples) override;
18 void setOscillatorType(Oscillator::OscType oscType)
19 {
20 oscillator.setType(oscType);
21 }
22
23 // Bring base class method into scope to avoid hiding it
24 using juce::SynthesiserVoice::renderNextBlock;
25
26 private:
27 Oscillator oscillator;
28};
Definition Oscillator.h:6
Definition SynthVoice.h:8