All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Types | Public Member Functions | List of all members
ModulatorSampler Class Reference
Inheritance diagram for ModulatorSampler:
ModulatorSynth ExternalFileProcessor LookupTableProcessor Processor RoutableProcessor SafeChangeBroadcaster RestorableObject ControlledObject

Public Types

enum  Parameters
enum  RepeatMode
enum  InternalChains
- Public Types inherited from ModulatorSynth
enum  InternalChains
- Public Types inherited from Processor
enum  SpecialParameters
enum  InternalChains

Public Member Functions

 ModulatorSampler (MainController *mc, const String &id, int numVoices)
var getPropertyForSound (int soundIndex, ModulatorSamplerSound::Property p)
AudioThumbnailCache & getCache () const noexcept
void refreshStreamingBuffers ()
void deleteSound (ModulatorSamplerSound *s)
void deleteAllSounds ()
void refreshPreloadSizes ()
double getDiskUsage ()
void refreshMemoryUsage ()
void setVoiceAmount (int newVoiceAmount)
void setPreloadSizeAsync (int newPreloadSize)
void setCurrentPlayingPosition (double normalizedPosition)
void addSamplerSound (const ValueTree &description, int index, bool forceReuse=false)
void noteOff (const HiseEvent &m) override
void setUseRoundRobinLogic (bool shouldUseRoundRobinLogic) noexcept
bool setCurrentGroupIndex (int currentIndex)
- Public Member Functions inherited from ModulatorSynth
void renderVoice (int startSample, int numThisTime)
virtual void postVoiceRendering (int startSample, int numThisTime)
void handleHiseEvent (const HiseEvent &e)
void killAllVoicesWithNoteNumber (int noteNumber)
void killLastVoice ()
void noteOn (const HiseEvent &m)
int getVoiceIndex (const SynthesiserVoice *v) const
virtual void addProcessorsWhenEmpty ()
virtual void initRenderCallback ()
void setGain (float newGain)
void setBalance (float newBalance)
float getBalance (bool getRightChannelGain) const
float getGain () const
void setGroup (ModulatorSynthGroup *parent)
ModulatorSynthGroupgetGroup () const
bool isInGroup () const
int getIndexInGroup () const
void setClockSpeed (ClockSpeed newClockSpeed)
const float * getConstantPitchValues () const
const CriticalSection & getSynthLock () const
const float * calculateGainValuesForVoice (int voiceIndex, float scriptGainValue, int startSample, int numSamples)
void calculatePitchValuesForVoice (int voiceIndex, float scriptPitchValue, int startSample, int numSamples)
const float * getPitchValuesForVoice (int voiceIndex) const
float * getPitchValuesForVoice (int voiceIndex)
- Public Member Functions inherited from Processor
 Processor (MainController *m, const String &id_)
virtual ~Processor ()
virtual const Identifier getType () const =0
const Path getSymbol () const
void setSymbol (Path newSymbol)
void setAttribute (int parameterIndex, float newValue, juce::NotificationType notifyEditor)
void enableConsoleOutput (bool shouldBeEnabled)
const String & getId () const
virtual const String getName () const
bool isBypassed () const noexcept
double getSampleRate () const
int getBlockSize () const
float getOutputValue () const
float getInputValue () const
void setEditorState (int state, bool isOn, NotificationType notifyView=sendNotification)
bool getEditorState (int state) const
void restoreCompleteEditorState (const XmlElement *storedState)
const Identifier getIdentifierForParameterIndex (int parameterIndex) const
int getNumParameters () const
void setIsOnAir (bool isBeingProcessedInAudioThread)
const CriticalSection & getDummyLockWhenNotOnAir () const
- Public Member Functions inherited from SafeChangeBroadcaster
void sendSynchronousChangeMessage ()
void addChangeListener (SafeChangeListener *listener)
void removeChangeListener (SafeChangeListener *listener)
void removeAllChangeListeners ()
void sendChangeMessage (const String &=String())
void sendAllocationFreeChangeMessage ()
- Public Member Functions inherited from ControlledObject
 ControlledObject (MainController *m)
const MainControllergetMainController () const noexcept
MainControllergetMainController () noexcept
- Public Member Functions inherited from RoutableProcessor
void editRouting (Component *childComponent)
int getLeftSourceChannel () const
int getRightSourceChannel () const
int getLeftDestinationChannel () const
int getRightDestinationChannel () const
- Public Member Functions inherited from ExternalFileProcessor
File getFile (const String &fileNameOrReference, PresetPlayerHandler::FolderType type=PresetPlayerHandler::GlobalSampleDirectory)
String getGlobalReferenceForFile (const String &file, PresetPlayerHandler::FolderType type=PresetPlayerHandler::GlobalSampleDirectory)
- Public Member Functions inherited from LookupTableProcessor
virtual int getNumTables () const
void addTableChangeListener (SafeChangeListener *listener)
void removeTableChangeListener (SafeChangeListener *listener)
void sendTableIndexChangeMessage (bool sendSynchronous, Table *table, float tableIndex)

Additional Inherited Members

- Protected Member Functions inherited from Processor
virtual Path getSpecialSymbol () const
void setOutputValue (float newValue)
void setInputValue (float newValue, NotificationType notify=sendNotification)

Detailed Description

The main sampler class.

A ModulatorSampler is a synthesiser which allows playback of samples.


Current limitations:

Member Enumeration Documentation

Additional modulator chains.


allows modification of the sample start if the sound allows this.

enum Parameters

Special Parameters for the ModulatorSampler.


-1 ... 11000 ... | The preload size in samples for all samples that are loaded into the sampler. If the preload size is -1, then the whole sample will be loaded into memory.


0 ... 4096 ... | The buffer size of the streaming buffers (2 per voice) in samples. The sampler uses two buffers which are swapped (one is used for reading from disk and one is used to supply the sampler with the audio data)


0 ... 64 | The amount of voices that the sampler can play. This is not the same as voice limit.


0 ... x | The number of groups that are cycled in a round robin manier.


Kill Note, Note off, Do nothing | determines how the sampler treats repeated notes.


On, Off | Enables pitch ratio modification for different notes than the root note. Disable this for drum samples.


On, Off | plays the whole sample (ignores the note off) if set to enabled.


On, Off | if enabled, the groups are played simultanously and can be crossfaded with the X-Fade Modulation Chain.


If this is true, all samples of this sampler won't be loaded into memory. Turning this on will load them.


If this is true, the samples will be fully loaded into preload buffer and reversed.

enum RepeatMode

Different behaviour for retriggered notes.


kills the note (using the supplied fade time)


triggers a note off event before starting the note


do nothin (a new voice is started and the old keeps ringing).

Constructor & Destructor Documentation

ModulatorSampler ( MainController mc,
const String &  id,
int  numVoices 

Creates a new ModulatorSampler.

Member Function Documentation

void addSamplerSound ( const ValueTree &  description,
int  index,
bool  forceReuse = false 

Adds a sound to the sampler.

void deleteAllSounds ( )

Deletes all sounds. Call this instead of clearSounds().

void deleteSound ( ModulatorSamplerSound s)

Deletes the sound from the sampler.

It removes the sound from the sampler and if no reference is left in the global sample pool deletes the sample and frees the storage.

AudioThumbnailCache& getCache ( ) const

returns the thumbnailCache for the sampler.

double getDiskUsage ( )

Returns the time spent reading samples from disk.

var getPropertyForSound ( int  soundIndex,
ModulatorSamplerSound::Property  p 

returns the ModulatorSamplerSound::Property for the given index.

void noteOff ( const HiseEvent m)

Overwrites the base class method and ignores the note off event if Parameters::OneShot is enabled.

Reimplemented from ModulatorSynth.

void refreshMemoryUsage ( )

Scans all sounds and voices and adds their memory usage.

void refreshPreloadSizes ( )

Refreshes the preload sizes for all samples.

This is the actual loading process, so it is put into a seperate thread with a progress window.

void refreshStreamingBuffers ( )

This resets the streaming buffer size of the voices. Call this whenever you change the voice amount.

bool setCurrentGroupIndex ( int  currentIndex)

Sets the current index to the group.

void setCurrentPlayingPosition ( double  normalizedPosition)

this sets the current playing position that will be displayed in the editor.

void setPreloadSizeAsync ( int  newPreloadSize)

Sets the streaming buffer and preload buffer sizes asynchronously.

void setUseRoundRobinLogic ( bool  shouldUseRoundRobinLogic)

Disables the automatic cycling and allows custom setting of the used round robin group.

void setVoiceAmount ( int  newVoiceAmount)

Allows dynamically changing the voice amount.

This is a ModulatorSampler specific function, because all other synths can have the full voice amount with almost no overhead, but since every ModulatorSamplerVoice has two streaming buffers, it could add up wasting unnecessary memory.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.