57 virtual bool appliesToNote (
int midiNoteNumber) = 0;
64 virtual bool appliesToChannel (
int midiChannel) = 0;
122 virtual void startNote (
int midiNoteNumber,
125 int currentPitchWheelPosition) = 0;
142 virtual void stopNote (
float velocity,
bool allowTailOff) = 0;
148 virtual bool isVoiceActive()
const;
153 virtual void pitchWheelMoved (
int newPitchWheelValue) = 0;
158 virtual void controllerMoved (
int controllerNumber,
int newControllerValue) = 0;
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];
576 int startSample,
int numSamples);
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; }
642 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
Synthesiser)
bool isSustainPedalDown() const noexcept
bool isNoteStealingEnabled() const noexcept
int getNumVoices() const noexcept
void setSostenutoPedalDown(bool isNowDown) noexcept
SynthesiserSound::Ptr getCurrentlyPlayingSound() const noexcept
void setSustainPedalDown(bool isNowDown) noexcept
SynthesiserSound::Ptr getSound(int index) const noexcept
bool isKeyDown() const noexcept
int getNumSounds() const noexcept
bool isPlayingButReleased() const noexcept
int getCurrentlyPlayingNote() const noexcept
double getSampleRate() const noexcept
double getSampleRate() const noexcept
bool isSostenutoPedalDown() const noexcept
void setKeyDown(bool isNowDown) noexcept