SynthesiserSound Class Referenceabstract
juce_audio_basics » synthesisers

Describes one of the sounds that a Synthesiser can play. More...

Inheritance diagram for SynthesiserSound:

## Public Types

using | Ptr = ReferenceCountedObjectPtr< SynthesiserSound >
| The class is reference-counted, so this is a handy pointer class for it. More...

## Public Member Functions

| ~SynthesiserSound () override
| Destructor. More...
virtual bool | appliesToNote (int midiNoteNumber)=0
| Returns true if this sound should be played when a given midi note is pressed. More...
virtual bool | appliesToChannel (int midiChannel)=0
| Returns true if the sound should be triggered by midi events on a given channel. More...
Public Member Functions inherited from ReferenceCountedObject
void | incReferenceCount () noexcept
| Increments the object's reference count. More...
void | decReferenceCount () noexcept
| Decreases the object's reference count. More...
bool | decReferenceCountWithoutDeleting () noexcept
| Decreases the object's reference count. More...
int | getReferenceCount () const noexcept
| Returns the object's current reference count. More...

## Protected Member Functions

| SynthesiserSound ()
Protected Member Functions inherited from ReferenceCountedObject
| ReferenceCountedObject ()=default
| Creates the reference-counted object (with an initial ref count of zero). More...
| ReferenceCountedObject (const ReferenceCountedObject &) noexcept
| Copying from another object does not affect this one's reference-count. More...
| ReferenceCountedObject (ReferenceCountedObject &&) noexcept
| Copying from another object does not affect this one's reference-count. More...
ReferenceCountedObject & | operator= (const ReferenceCountedObject &) noexcept
| Copying from another object does not affect this one's reference-count. More...
ReferenceCountedObject & | operator= (ReferenceCountedObject &&) noexcept
| Copying from another object does not affect this one's reference-count. More...
virtual | ~ReferenceCountedObject ()
| Destructor. More...
void | resetReferenceCount () noexcept
| Resets the reference count to zero without deleting the object. More...

## Detailed Description

Describes one of the sounds that a Synthesiser can play.

A synthesiser can contain one or more sounds, and a sound can choose which midi notes and channels can trigger it.

The SynthesiserSound is a passive class that just describes what the sound is - the actual audio rendering for a sound is done by a SynthesiserVoice. This allows more than one SynthesiserVoice to play the same sound at the same time.

See also
  Synthesiser, SynthesiserVoice

## Member Typedef Documentation

## Ptr

using SynthesiserSound::Ptr = ReferenceCountedObjectPtr<SynthesiserSound>

The class is reference-counted, so this is a handy pointer class for it.

## Constructor & Destructor Documentation

## SynthesiserSound()

SynthesiserSound::SynthesiserSound | ( |  | ) |

protected

## ~SynthesiserSound()

SynthesiserSound::~SynthesiserSound | ( |  | ) |

override

Destructor.

## Member Function Documentation

## appliesToNote()

virtual bool SynthesiserSound::appliesToNote | ( | int | midiNoteNumber | ) |

pure virtual

Returns true if this sound should be played when a given midi note is pressed.

The Synthesiser will use this information when deciding which sounds to trigger for a given note.

Implemented in SamplerSound.

## appliesToChannel()

virtual bool SynthesiserSound::appliesToChannel | ( | int | midiChannel | ) |

pure virtual

Returns true if the sound should be triggered by midi events on a given channel.

The Synthesiser will use this information when deciding which sounds to trigger for a given note.

Implemented in SamplerSound.

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

- juce_Synthesiser.h