A ModulatorSamplerSound is a wrapper around a StreamingSamplerSound that allows modulation of parameters. More...
Public Types | |
enum | Property { ID = 1, FileName, RootNote, HiKey, LoKey, LoVel, HiVel, RRGroup, Volume , Normalized, Pitch, SampleStart, SampleEnd, SampleStartMod, LoopStart, LoopEnd, LoopXFade, LoopEnabled, LowerVelocityXFade, UpperVelocityXFade, SampleState } |
The extended properties of the ModulatorSamplerSound. More... | |
Public Member Functions | |
void | calculateNormalizedPeak () |
Calculates the gain value that must be applied to normalize the volume of the sample ( 1.0 / peakValue ). More... | |
void | closeFileHandle () |
Opens the file handle for all samples of this sound. More... | |
void | endPropertyChange (const Identifier &id, int startValue, int endValue) |
Call this whenever you finish a series of property modifications. More... | |
float | getBalance (bool getRightChannelGain) const |
Returns the calculated (equal power) pan value for either the left or the right channel. More... | |
int | getId () const |
Returns the id. More... | |
float | getNormalizedPeak () const |
Returns the gain value that must be applied to normalize the volume of the sample ( 1.0 / peakValue ). More... | |
String | getPropertyAsString (const Identifier &id) const |
Returns a string version of the Property. More... | |
double | getPropertyPitch () const noexcept |
Returns the pitch value of the sound. More... | |
Range< int > | getPropertyRange (const Identifier &p) const |
Returns the min and max values for the Property. More... | |
float | getPropertyVolume () const noexcept |
Returns the gain value of the sound. More... | |
int | getRootNote () const noexcept |
returns the root note. More... | |
double | getSampleRate () const |
returns the sample rate of the sound (!= the sample rate of the current audio settings) | |
bool | isNormalizedEnabled () const noexcept |
Checks if the normalization gain should be applied to the sample. More... | |
void | openFileHandle () |
Closes the file handle for all samples of this sound. More... | |
void | setMappingData (MappingData newData) |
This sets the MIDI related properties without undo / range checks. More... | |
void | startPropertyChange (const Identifier &id, int newValue) |
Call this whenever you want to start a new series of property modifications. More... | |
void | toggleBoolProperty (const Identifier &id) |
Toggles the boolean properties. More... | |
Public Member Functions inherited from ControlledObject | |
ControlledObject (MainController *m) | |
Creates a new ControlledObject. More... | |
const MainController * | getMainController () const noexcept |
Provides read-only access to the main controller. More... | |
MainController * | getMainController () noexcept |
Provides write access to the main controller. More... | |
Static Public Member Functions | |
static bool | isAsyncProperty (const Identifier &id) |
Returns the name of the Property. More... | |
A ModulatorSamplerSound is a wrapper around a StreamingSamplerSound that allows modulation of parameters.
It also contains methods that extend the properties of a StreamingSamplerSound.
enum Property |
The extended properties of the ModulatorSamplerSound.
void calculateNormalizedPeak | ( | ) |
Calculates the gain value that must be applied to normalize the volume of the sample ( 1.0 / peakValue ).
It should save calculated value along with the other properties, but if a new sound is added, it will call StreamingSamplerSound::getPeakValue(), which scans the whole file.
void closeFileHandle | ( | ) |
Opens the file handle for all samples of this sound.
void endPropertyChange | ( | const Identifier & | id, |
int | startValue, | ||
int | endValue | ||
) |
Call this whenever you finish a series of property modifications.
It will group all actions since startPropertyChange and saves it to the UndoManager list with a description "CHANGING PROPERTY FROM X TO Y"
float getBalance | ( | bool | getRightChannelGain | ) | const |
Returns the calculated (equal power) pan value for either the left or the right channel.
|
inline |
Returns the id.
Can also be achieved by getProperty(ID), but this is more convenient.
float getNormalizedPeak | ( | ) | const |
Returns the gain value that must be applied to normalize the volume of the sample ( 1.0 / peakValue ).
juce::String getPropertyAsString | ( | const Identifier & | id | ) | const |
Returns a string version of the Property.
This is used for displaying a nicer value than the raw data value (eg. note names, or milliseconds). Do not use the return value for further processing, use getProperty() instead.
|
noexcept |
Returns the pitch value of the sound.
Unlike getProperty(Pitch), it returns the pitch factor (from 0.5 to 2.0)
juce::Range< int > getPropertyRange | ( | const Identifier & | p | ) | const |
Returns the min and max values for the Property.
This method is non-static because you can change the range dynamically eg. depending on other properties.
It returns the following ranges:
|
noexcept |
Returns the gain value of the sound.
Unlike getProperty(Volume), it returns a value from 0.0 to 1.0, so use this for internal stuff
|
inlinenoexcept |
returns the root note.
|
static |
Returns the name of the Property.
This is used to display the name in the user interface and for the tag name within the XML samplemap, so you must return a valid tag name here. Returns true if the property should be changed asynchronously when all voices are killed.
|
inlinenoexcept |
Checks if the normalization gain should be applied to the sample.
void openFileHandle | ( | ) |
Closes the file handle for all samples of this sound.
void setMappingData | ( | MappingData | newData | ) |
This sets the MIDI related properties without undo / range checks.
void startPropertyChange | ( | const Identifier & | id, |
int | newValue | ||
) |
Call this whenever you want to start a new series of property modifications.
void toggleBoolProperty | ( | const Identifier & | id | ) |
Toggles the boolean properties.
Currently supported Properties: