All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Member Functions | Static Public Member Functions | List of all members
StreamingSamplerVoice Class Reference

Inherits SynthesiserVoice.

Public Member Functions

bool canPlaySound (SynthesiserSound *)
 
void startNote (int midiNoteNumber, float velocity, SynthesiserSound *s, int) override
 
void stopNote (float, bool)
 
void renderNextBlock (AudioSampleBuffer &outputBuffer, int startSample, int numSamples) override
 
void setPitchValues (const float *pitchDataForBlock)
 
void setPitchFactor (int midiNote, int rootNote, StreamingSamplerSound *sound, double globalPitchFactor)
 
double getDiskUsage ()
 
void prepareToPlay (double sampleRate, int samplesPerBlock)
 
virtual void controllerMoved (int, int) override
 
virtual void pitchWheelMoved (int) override
 
void resetVoice ()
 
hlac::HiseSampleBuffer * getTemporaryVoiceBuffer ()
 
void setTemporaryVoiceBuffer (hlac::HiseSampleBuffer *buffer)
 

Static Public Member Functions

static void initTemporaryVoiceBuffer (hlac::HiseSampleBuffer *bufferToUse, int samplesPerBlock)
 

Detailed Description

A SamplerVoice that streams the data from a StreamingSamplerSound

It uses a SampleLoader object to fetch the data and copies the values into an internal buffer, so you don't have to bother with the SampleLoader's internals.

Member Function Documentation

bool canPlaySound ( SynthesiserSound *  )
inline

Always returns true.

virtual void controllerMoved ( int  ,
int   
)
inlineoverridevirtual

Not implemented

double getDiskUsage ( )
inline

Returns the disk usage of the voice.

To get the disk usage of all voices, simply iterate over the voice list and add all disk usages.

hlac::HiseSampleBuffer* getTemporaryVoiceBuffer ( )
inline

Returns the sampler's temp buffer.

static void initTemporaryVoiceBuffer ( hlac::HiseSampleBuffer *  bufferToUse,
int  samplesPerBlock 
)
inlinestatic

Call this once for every sampler.

virtual void pitchWheelMoved ( int  )
inlineoverridevirtual

Not implemented

void prepareToPlay ( double  sampleRate,
int  samplesPerBlock 
)
inline

Initializes its sampleBuffer. You have to call this manually, since there is no base class function.

void renderNextBlock ( AudioSampleBuffer &  outputBuffer,
int  startSample,
int  numSamples 
)
override

Adds it's output to the outputBuffer.

void resetVoice ( )
inline

resets everything.

void setPitchFactor ( int  midiNote,
int  rootNote,
StreamingSamplerSound sound,
double  globalPitchFactor 
)
inline

You have to call this before startNote() to calculate the pitch factor.

This is necessary because a StreamingSamplerSound can have multiple instances with different root notes.

void setPitchValues ( const float *  pitchDataForBlock)
inline

You can pass a pointer with float values containing pitch information for each sample.

The array size should be exactly the number of samples that are calculated in the current renderNextBlock method.

void setTemporaryVoiceBuffer ( hlac::HiseSampleBuffer *  buffer)
inline

Gives the voice a reference to the sampler temp buffer.

void startNote ( int  midiNoteNumber,
float  velocity,
SynthesiserSound *  s,
int   
)
override

starts the streaming of the sound.

void stopNote ( float  ,
bool   
)
inline

Clears the note data and resets the loader.

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