LMMS
Loading...
Searching...
No Matches
sfzero::Synth Class Reference

#include <SFZSynth.h>

Inheritance diagram for sfzero::Synth:
water::Synthesiser

Public Member Functions

 Synth ()
virtual ~Synth ()
void noteOn (int midiChannel, int midiNoteNumber, float velocity) override
void noteOff (int midiChannel, int midiNoteNumber, float velocity, bool allowTailOff) override
int numVoicesUsed ()
water::String voiceInfoString ()
Public Member Functions inherited from water::Synthesiser
 Synthesiser ()
virtual ~Synthesiser ()
void clearVoices ()
size_t getNumVoices () const noexcept
SynthesiserVoicegetVoice (int index) const
SynthesiserVoiceaddVoice (SynthesiserVoice *newVoice)
void removeVoice (int index)
void clearSounds ()
int getNumSounds () const noexcept
SynthesiserSoundgetSound (int index) const noexcept
SynthesiserSoundaddSound (const SynthesiserSound::Ptr &newSound)
void removeSound (int index)
void setNoteStealingEnabled (bool shouldStealNotes)
bool isNoteStealingEnabled () const noexcept
virtual void allNotesOff (int midiChannel, bool allowTailOff)
virtual void handlePitchWheel (int midiChannel, int wheelValue)
virtual void handleController (int midiChannel, int controllerNumber, int controllerValue)
virtual void handleAftertouch (int midiChannel, int midiNoteNumber, int aftertouchValue)
virtual void handleChannelPressure (int midiChannel, int channelPressureValue)
virtual void handleSustainPedal (int midiChannel, bool isDown)
virtual void handleSostenutoPedal (int midiChannel, bool isDown)
virtual void handleSoftPedal (int midiChannel, bool isDown)
virtual void handleProgramChange (int midiChannel, int programNumber)
virtual void setCurrentPlaybackSampleRate (double sampleRate)
void renderNextBlock (AudioSampleBuffer &outputAudio, const MidiBuffer &inputMidi, int startSample, int numSamples)
double getSampleRate () const noexcept
void setMinimumRenderingSubdivisionSize (int numSamples, bool shouldBeStrict=false) noexcept
virtual void renderVoices (AudioSampleBuffer &outputAudio, int startSample, int numSamples)
virtual void handleMidiEvent (const MidiMessage &)

Private Attributes

int noteVelocities_ [128]

Additional Inherited Members

Protected Member Functions inherited from water::Synthesiser
virtual SynthesiserVoicefindFreeVoice (SynthesiserSound *soundToPlay, int midiChannel, int midiNoteNumber, bool stealIfNoneAvailable) const
virtual SynthesiserVoicefindVoiceToSteal (SynthesiserSound *soundToPlay, int midiChannel, int midiNoteNumber) const
void startVoice (SynthesiserVoice *voice, SynthesiserSound *sound, int midiChannel, int midiNoteNumber, float velocity)
void stopVoice (SynthesiserVoice *, float velocity, bool allowTailOff)
Protected Attributes inherited from water::Synthesiser
OwnedArray< SynthesiserVoicevoices
ReferenceCountedArray< SynthesiserSoundsounds
int lastPitchWheelValues [16]

Constructor & Destructor Documentation

◆ Synth()

sfzero::Synth::Synth ( )

◆ ~Synth()

virtual sfzero::Synth::~Synth ( )
inlinevirtual

Member Function Documentation

◆ noteOff()

void sfzero::Synth::noteOff ( int midiChannel,
int midiNoteNumber,
float velocity,
bool allowTailOff )
overridevirtual

Triggers a note-off event.

This will turn off any voices that are playing a sound for the given note/channel.

If allowTailOff is true, the voices will be allowed to fade out the notes gracefully (if they can do). If this is false, the notes will all be cut off immediately.

This method will be called automatically according to the midi data passed into renderNextBlock(), but may be called explicitly too.

The midiChannel parameter is the channel, between 1 and 16 inclusive.

Reimplemented from water::Synthesiser.

◆ noteOn()

void sfzero::Synth::noteOn ( int midiChannel,
int midiNoteNumber,
float velocity )
overridevirtual

Triggers a note-on event.

The default method here will find all the sounds that want to be triggered by this note/channel. For each sound, it'll try to find a free voice, and use the voice to start playing the sound.

Subclasses might want to override this if they need a more complex algorithm.

This method will be called automatically according to the midi data passed into renderNextBlock(), but may be called explicitly too.

The midiChannel parameter is the channel, between 1 and 16 inclusive.

Reimplemented from water::Synthesiser.

◆ numVoicesUsed()

int sfzero::Synth::numVoicesUsed ( )

◆ voiceInfoString()

water::String sfzero::Synth::voiceInfoString ( )

Member Data Documentation

◆ noteVelocities_

int sfzero::Synth::noteVelocities_[128]
private

The documentation for this class was generated from the following files: