125 int currentPitchWheelPosition) = 0;
142 virtual void stopNote (
float velocity,
bool allowTailOff) = 0;
148 virtual bool isVoiceActive()
const;
163 virtual void aftertouchChanged (
int newAftertouchValue);
168 virtual void channelPressureChanged (
int newChannelPressureValue);
203 virtual void setCurrentPlaybackSampleRate (
double newRate);
210 virtual bool isPlayingChannel (
int midiChannel)
const;
226 void setKeyDown (
bool isNowDown) noexcept { keyIsDown = isNowDown; }
243 return isVoiceActive() && ! (isKeyDown() || isSostenutoPedalDown() || isSustainPedalDown());
262 void clearCurrentNote();
269 double currentSampleRate = 44100.0;
270 int currentlyPlayingNote = -1, currentPlayingMidiChannel = 0;
271 uint32 noteOnTime = 0;
273 bool keyIsDown =
false, sustainPedalDown =
false, sostenutoPedalDown =
false;
340 void removeVoice (
int index);
360 void removeSound (
int index);
369 void setNoteStealingEnabled (
bool shouldStealNotes);
390 virtual void noteOn (
int midiChannel,
406 virtual void noteOff (
int midiChannel,
425 virtual void allNotesOff (
int midiChannel,
439 virtual void handlePitchWheel (
int midiChannel,
454 virtual void handleController (
int midiChannel,
455 int controllerNumber,
456 int controllerValue);
471 virtual void handleAftertouch (
int midiChannel,
int midiNoteNumber,
int aftertouchValue);
485 virtual void handleChannelPressure (
int midiChannel,
int channelPressureValue);
488 virtual void handleSustainPedal (
int midiChannel,
bool isDown);
491 virtual void handleSostenutoPedal (
int midiChannel,
bool isDown);
494 virtual void handleSoftPedal (
int midiChannel,
bool isDown);
500 virtual void handleProgramChange (
int midiChannel,
509 virtual void setCurrentPlaybackSampleRate (
double sampleRate);
558 void setMinimumRenderingSubdivisionSize (
int numSamples,
bool shouldBeStrict =
false) noexcept;
569 int lastPitchWheelValues [16];
575 virtual
void renderVoices (
AudioBuffer<
float>& outputAudio,
576 int startSample,
int numSamples);
577 virtual
void renderVoices (
AudioBuffer<
double>& outputAudio,
578 int startSample,
int numSamples);
591 bool stealIfNoneAvailable) const;
600 int midiNoteNumber) const;
624 double sampleRate = 0;
625 uint32 lastNoteOnCounter = 0;
626 int minimumSubBlockSize = 32;
627 bool subBlockSubdivisionIsStrict = false;
628 bool shouldStealNotes = true;
631 template <typename floatType>
634 #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
636 virtual int findFreeVoice (
const bool)
const {
return 0; }
637 virtual int noteOff (
int,
int,
int) {
return 0; }
638 virtual int findFreeVoice (SynthesiserSound*,
const bool) {
return 0; }
639 virtual int findVoiceToSteal (SynthesiserSound*)
const {
return 0; }
642 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Synthesiser)
virtual bool appliesToNote(int midiNoteNumber)=0
virtual bool appliesToChannel(int midiChannel)=0
bool isSostenutoPedalDown() const noexcept
double getSampleRate() const noexcept
virtual void stopNote(float velocity, bool allowTailOff)=0
bool isSustainPedalDown() const noexcept
void setSustainPedalDown(bool isNowDown) noexcept
void setSostenutoPedalDown(bool isNowDown) noexcept
virtual void renderNextBlock(AudioBuffer< float > &outputBuffer, int startSample, int numSamples)=0
bool isKeyDown() const noexcept
void setKeyDown(bool isNowDown) noexcept
virtual void controllerMoved(int controllerNumber, int newControllerValue)=0
int getCurrentlyPlayingNote() const noexcept
virtual void startNote(int midiNoteNumber, float velocity, SynthesiserSound *sound, int currentPitchWheelPosition)=0
virtual bool canPlaySound(SynthesiserSound *)=0
virtual void pitchWheelMoved(int newPitchWheelValue)=0
bool isPlayingButReleased() const noexcept
SynthesiserSound::Ptr getCurrentlyPlayingSound() const noexcept
int getNumSounds() const noexcept
double getSampleRate() const noexcept
int getNumVoices() const noexcept
bool isNoteStealingEnabled() const noexcept
SynthesiserSound::Ptr getSound(int index) const noexcept