25 #ifndef JUCE_SYNTHESISER_H_INCLUDED
26 #define JUCE_SYNTHESISER_H_INCLUDED
58 virtual bool appliesToNote (
int midiNoteNumber) = 0;
65 virtual bool appliesToChannel (
int midiChannel) = 0;
121 virtual void startNote (
int midiNoteNumber,
124 int currentPitchWheelPosition) = 0;
141 virtual void stopNote (
float velocity,
bool allowTailOff) = 0;
147 virtual bool isVoiceActive()
const;
152 virtual void pitchWheelMoved (
int newPitchWheelValue) = 0;
157 virtual void controllerMoved (
int controllerNumber,
int newControllerValue) = 0;
162 virtual void aftertouchChanged (
int newAftertouchValue);
167 virtual void channelPressureChanged (
int newChannelPressureValue);
197 virtual void setCurrentPlaybackSampleRate (
double newRate);
204 virtual bool isPlayingChannel (
int midiChannel)
const;
226 return isVoiceActive() && ! (isKeyDown() || isSostenutoPedalDown() || isSustainPedalDown());
245 void clearCurrentNote();
252 double currentSampleRate;
253 int currentlyPlayingNote, currentPlayingMidiChannel;
256 bool keyIsDown, sustainPedalDown, sostenutoPedalDown;
258 #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
260 virtual int stopNote (
bool) {
return 0; }
324 void removeVoice (
int index);
344 void removeSound (
int index);
353 void setNoteStealingEnabled (
bool shouldStealNotes);
374 virtual void noteOn (
int midiChannel,
390 virtual void noteOff (
int midiChannel,
409 virtual void allNotesOff (
int midiChannel,
423 virtual void handlePitchWheel (
int midiChannel,
438 virtual void handleController (
int midiChannel,
439 int controllerNumber,
440 int controllerValue);
455 virtual void handleAftertouch (
int midiChannel,
int midiNoteNumber,
int aftertouchValue);
469 virtual void handleChannelPressure (
int midiChannel,
int channelPressureValue);
472 virtual void handleSustainPedal (
int midiChannel,
bool isDown);
475 virtual void handleSostenutoPedal (
int midiChannel,
bool isDown);
478 virtual void handleSoftPedal (
int midiChannel,
bool isDown);
484 virtual void handleProgramChange (
int midiChannel,
493 virtual void setCurrentPlaybackSampleRate (
double sampleRate);
531 void setMinimumRenderingSubdivisionSize (
int numSamples)
noexcept;
542 int lastPitchWheelValues [16];
549 int startSample,
int numSamples);
562 bool stealIfNoneAvailable)
const;
571 int midiNoteNumber)
const;
591 int minimumSubBlockSize;
592 bool shouldStealNotes;
597 #if JUCE_CATCH_DEPRECATED_CODE_MISUSE
599 virtual int findFreeVoice (
const bool)
const {
return 0; }
600 virtual int noteOff (
int,
int,
int) {
return 0; }
609 #endif // JUCE_SYNTHESISER_H_INCLUDED
Definition: juce_AudioSampleBuffer.h:34
Definition: juce_BigInteger.h:43
double getSampleRate() const noexcept
Definition: juce_Synthesiser.h:209
int getNumSounds() const noexcept
Definition: juce_Synthesiser.h:331
#define noexcept
Definition: juce_CompilerSupport.h:141
double getSampleRate() const noexcept
Definition: juce_Synthesiser.h:515
bool isNoteStealingEnabled() const noexcept
Definition: juce_Synthesiser.h:358
bool isKeyDown() const noexcept
Definition: juce_Synthesiser.h:215
#define JUCE_API
Definition: juce_StandardHeader.h:139
OwnedArray< SynthesiserVoice > voices
Definition: juce_Synthesiser.h:538
SynthesiserSound * getSound(int index) const noexcept
Definition: juce_Synthesiser.h:334
Definition: juce_Synthesiser.h:291
CriticalSection lock
Definition: juce_Synthesiser.h:536
Definition: juce_ReferenceCountedObject.h:65
Definition: juce_CriticalSection.h:47
ReferenceCountedArray< SynthesiserSound > sounds
Definition: juce_Synthesiser.h:539
int getNumVoices() const noexcept
Definition: juce_Synthesiser.h:308
bool isSostenutoPedalDown() const noexcept
Definition: juce_Synthesiser.h:221
unsigned int uint32
Definition: juce_MathsFunctions.h:51
int getCurrentlyPlayingNote() const noexcept
Definition: juce_Synthesiser.h:100
SynthesiserSound::Ptr getCurrentlyPlayingSound() const noexcept
Definition: juce_Synthesiser.h:105
bool isSustainPedalDown() const noexcept
Definition: juce_Synthesiser.h:218
Definition: juce_Synthesiser.h:42
Definition: juce_Synthesiser.h:86
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
Definition: juce_MidiBuffer.h:43
ReferenceCountedObjectPtr< SynthesiserSound > Ptr
Definition: juce_Synthesiser.h:68
Definition: juce_MidiMessage.h:35
bool isPlayingButReleased() const noexcept
Definition: juce_Synthesiser.h:224