49 ~SynthesiserSound()
override;
72 JUCE_LEAK_DETECTOR (SynthesiserSound)
125 int currentPitchWheelPosition) = 0;
142 virtual void stopNote (
float velocity,
bool allowTailOff) = 0;
226 void setKeyDown (
bool isNowDown)
noexcept { keyIsDown = isNowDown; }
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;
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;
633 template <typename floatType>
636 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
Synthesiser)
ReferenceCountedObject()=default
ReferenceCountedObjectPtr< SynthesiserSound > Ptr
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
virtual void channelPressureChanged(int newChannelPressureValue)
void setSostenutoPedalDown(bool isNowDown) noexcept
virtual void renderNextBlock(AudioBuffer< float > &outputBuffer, int startSample, int numSamples)=0
virtual bool isPlayingChannel(int midiChannel) const
bool isKeyDown() const noexcept
void setKeyDown(bool isNowDown) noexcept
virtual void setCurrentPlaybackSampleRate(double newRate)
virtual void aftertouchChanged(int newAftertouchValue)
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
virtual bool isVoiceActive() const
virtual SynthesiserVoice * findFreeVoice(SynthesiserSound *soundToPlay, int midiChannel, int midiNoteNumber, bool stealIfNoneAvailable) const
void startVoice(SynthesiserVoice *voice, SynthesiserSound *sound, int midiChannel, int midiNoteNumber, float velocity)
virtual SynthesiserVoice * findVoiceToSteal(SynthesiserSound *soundToPlay, int midiChannel, int midiNoteNumber) const
void stopVoice(SynthesiserVoice *, float velocity, bool allowTailOff)
int getNumSounds() const noexcept
double getSampleRate() const noexcept
virtual void renderVoices(AudioBuffer< float > &outputAudio, int startSample, int numSamples)
virtual void handleMidiEvent(const MidiMessage &)
int getNumVoices() const noexcept
bool isNoteStealingEnabled() const noexcept
SynthesiserSound::Ptr getSound(int index) const noexcept
int lastPitchWheelValues[16]