Generates sounds by decimating and reconstructing audio samples.
More...
#include <ReformerOscillator.h>
|
| enum | GranularParam {
Start = 0
, PuckX
, PuckY
, Nearest
,
StartRand
, Size
, SizeRand
, Rate
,
RateRand
, Width
, WidthRand
, Pan
,
PanRand
, Detune
, DetuneMod
, DetuneRand
,
Level
, GranularLevel
, LevelMod
, LevelRand
,
Popcorn
, Quench
, Robin
, SALoop
,
Autoplay
, Shape
, GrainLim
, Tracking
,
Normalise
, Mute
, Solo
, Proximity
,
Radius
, NUM_PARAMS
} |
| |
|
| | ReformerOscillator () |
| |
| | ~ReformerOscillator () override |
| |
| void | setSampleRate (double sampleRate) override |
| | Sets the sample rate which the granular oscillator uses to calculate its output.
|
| |
| void | setBlockSize (size_t blockSize) |
| |
| double | getSampleRate () override |
| | Returns the sample rate which which you set with the setSampleRate method.
|
| |
| void | setFrequency (float frequency) override |
| | Sets the target frequency which you want the oscillator to output.
|
| |
| float | getFrequency () override |
| | Gets the target frequency which you set with the setFrequency method.
|
| |
| void | setPhaseOffset (float) override |
| |
| void | reset () override |
| |
| void | setPhase (double) override |
| |
| double | getPhase () override |
| |
| int | getNumActiveGrains () override |
| | Returns the number of grains currently active for this instance of the oscillator.
|
| |
| StereoSample | getNextStereoSample (size_t sampleIndex) override |
| | Updates the granular engine and returns the next audio value.
|
| |
| void | setGranularParameter (size_t paramIndex, const float *newValue) |
| | Updates the granular engine and returns the next audio value.
|
| |
| void | setGranularParameters (std::vector< const float * > &newParams) |
| | Sets multiple internal parameter to new values.
|
| |
| void | setSampleData (SampleEngine *sampleEngine) |
| | Sets the oscillator's internal reference to the SampleEngine structure it is to use.
|
| |
| void | startNote (int midiNote, float velocity, int voiceIndex) |
| | Starts the oscillator playing, usually called by key down event.
|
| |
| const float | getVelocity () |
| | Returns the value of the velocity as a float in [0...1].
|
| |
| void | stopNote () |
| | Signals the oscillator to begin key up behaviour, usually called by key up event The oscillator may continue playing if it is generating a tail.
|
| |
| void | clearNote () |
| | Signals the oscillator to stop immediately, and return any grains to pool.
|
| |
| int | getVoiceIndex () const |
| |
| bool | isAutoplayEnabled () const |
| |
| bool | isDrone () const |
| |
| bool | isStopped () const |
| |
| bool | isKeyDown () const |
| |
| virtual | ~Oscillator ()=default |
| |
Generates sounds by decimating and reconstructing audio samples.
◆ GranularParam
Enumerates the parameters which are used to control generation of grains
| Enumerator |
|---|
| Start | |
| PuckX | |
| PuckY | |
| Nearest | |
| StartRand | |
| Size | |
| SizeRand | |
| Rate | |
| RateRand | |
| Width | |
| WidthRand | |
| Pan | |
| PanRand | |
| Detune | |
| DetuneMod | |
| DetuneRand | |
| Level | |
| GranularLevel | |
| LevelMod | |
| LevelRand | |
| Popcorn | |
| Quench | |
| Robin | |
| SALoop | |
| Autoplay | |
| Shape | |
| GrainLim | |
| Tracking | |
| Normalise | |
| Mute | |
| Solo | |
| Proximity | |
| Radius | |
| NUM_PARAMS | |
◆ ReformerOscillator()
| krotos::ReformerOscillator::ReformerOscillator |
( |
| ) |
|
◆ ~ReformerOscillator()
| krotos::ReformerOscillator::~ReformerOscillator |
( |
| ) |
|
|
inlineoverride |
◆ calculatePlayheadPosition()
| double krotos::ReformerOscillator::calculatePlayheadPosition |
( |
double | startPosition, |
|
|
float | halfSpray, |
|
|
float | referenceGrainsize ) |
|
private |
◆ clearNote()
| void krotos::ReformerOscillator::clearNote |
( |
| ) |
|
Signals the oscillator to stop immediately, and return any grains to pool.
◆ cube()
| float krotos::ReformerOscillator::cube |
( |
float | val | ) |
|
|
inlineprivate |
◆ flushGranular()
| void krotos::ReformerOscillator::flushGranular |
( |
| ) |
|
|
private |
◆ generateGrains()
| void krotos::ReformerOscillator::generateGrains |
( |
StereoSample & | sampleAccumulator | ) |
|
|
private |
Accumulates audio from all the playing grains
◆ getFrequency()
| float krotos::ReformerOscillator::getFrequency |
( |
| ) |
|
|
inlineoverridevirtual |
Gets the target frequency which you set with the setFrequency method.
- Returns
- frequency Frequency in Hz
Implements krotos::Oscillator.
◆ getNextStereoGranularSample()
| StereoSample krotos::ReformerOscillator::getNextStereoGranularSample |
( |
| ) |
|
|
inlineprivate |
◆ getNextStereoSample()
| StereoSample krotos::ReformerOscillator::getNextStereoSample |
( |
size_t | sampleIndex | ) |
|
|
inlineoverridevirtual |
Updates the granular engine and returns the next audio value.
- Returns
- A stereo pair of samples
Implements krotos::Oscillator.
◆ getNumActiveGrains()
| int krotos::ReformerOscillator::getNumActiveGrains |
( |
| ) |
|
|
inlineoverridevirtual |
Returns the number of grains currently active for this instance of the oscillator.
- Returns
- frequency Frequency in Hz
Reimplemented from krotos::Oscillator.
◆ getPhase()
| double krotos::ReformerOscillator::getPhase |
( |
| ) |
|
|
inlineoverridevirtual |
◆ getRateRandFactor()
| float krotos::ReformerOscillator::getRateRandFactor |
( |
| ) |
|
|
inlineprivate |
◆ getSampleRate()
| double krotos::ReformerOscillator::getSampleRate |
( |
| ) |
|
|
inlineoverridevirtual |
Returns the sample rate which which you set with the setSampleRate method.
- Returns
- Sample rate in Hz
Implements krotos::Oscillator.
◆ getVelocity()
| const float krotos::ReformerOscillator::getVelocity |
( |
| ) |
|
Returns the value of the velocity as a float in [0...1].
◆ getVoiceIndex()
| int krotos::ReformerOscillator::getVoiceIndex |
( |
| ) |
const |
|
inline |
◆ isAutoplayEnabled()
| bool krotos::ReformerOscillator::isAutoplayEnabled |
( |
| ) |
const |
|
inline |
◆ isDrone()
| bool krotos::ReformerOscillator::isDrone |
( |
| ) |
const |
|
inline |
◆ isKeyDown()
| bool krotos::ReformerOscillator::isKeyDown |
( |
| ) |
const |
|
inline |
◆ isStopped()
| bool krotos::ReformerOscillator::isStopped |
( |
| ) |
const |
|
inline |
◆ killNANs()
| void krotos::ReformerOscillator::killNANs |
( |
StereoSample & | sample | ) |
|
|
inlineprivate |
◆ launchGrain()
| Grain * krotos::ReformerOscillator::launchGrain |
( |
float | paramSize, |
|
|
float | paramStart, |
|
|
float | paramSpray, |
|
|
Grain::Flavour | flavour, |
|
|
float | gain = -1.f ) |
|
private |
◆ reset()
| void krotos::ReformerOscillator::reset |
( |
| ) |
|
|
inlineoverridevirtual |
◆ setBlockSize()
| void krotos::ReformerOscillator::setBlockSize |
( |
size_t | blockSize | ) |
|
|
inline |
◆ setFrequency()
| void krotos::ReformerOscillator::setFrequency |
( |
float | frequency | ) |
|
|
inlineoverridevirtual |
Sets the target frequency which you want the oscillator to output.
- Parameters
-
Implements krotos::Oscillator.
◆ setGranularParameter()
| void krotos::ReformerOscillator::setGranularParameter |
( |
size_t | paramIndex, |
|
|
const float * | newValue ) |
Updates the granular engine and returns the next audio value.
- Returns
- A mono sample
Sets an internal parameter to a new value
- Parameters
-
| paramIndex | The index of the parameter (enum GranularParam) |
| newValue | The new value to set the parameter with |
◆ setGranularParameters()
| void krotos::ReformerOscillator::setGranularParameters |
( |
std::vector< const float * > & | newParams | ) |
|
|
inline |
Sets multiple internal parameter to new values.
- Parameters
-
| newParams | A vector containing new parameters, must be ordered as in enum GranularParam |
◆ setHardLoopEnable()
| void krotos::ReformerOscillator::setHardLoopEnable |
( |
bool | isOn | ) |
|
|
inlineprivate |
◆ setPhase()
| void krotos::ReformerOscillator::setPhase |
( |
double | | ) |
|
|
inlineoverridevirtual |
◆ setPhaseOffset()
| void krotos::ReformerOscillator::setPhaseOffset |
( |
float | | ) |
|
|
inlineoverridevirtual |
The following overridden methods are interface methods which are not used in the granular oscillator at present
Implements krotos::Oscillator.
◆ setSampleData()
| void krotos::ReformerOscillator::setSampleData |
( |
SampleEngine * | sampleEngine | ) |
|
Sets the oscillator's internal reference to the SampleEngine structure it is to use.
- Parameters
-
◆ setSampleRate()
| void krotos::ReformerOscillator::setSampleRate |
( |
double | sampleRate | ) |
|
|
inlineoverridevirtual |
Sets the sample rate which the granular oscillator uses to calculate its output.
The following overridden methods implement the Oscillator interface
- Parameters
-
| sampleRate | Sample rate in Hz |
Implements krotos::Oscillator.
◆ setTaggingType()
| void krotos::ReformerOscillator::setTaggingType |
( |
bool | isOn | ) |
|
|
inlineprivate |
◆ setTrackingEnable()
| void krotos::ReformerOscillator::setTrackingEnable |
( |
bool | isOn | ) |
|
|
inlineprivate |
◆ startNote()
| void krotos::ReformerOscillator::startNote |
( |
int | midiNote, |
|
|
float | velocity, |
|
|
int | voiceIndex ) |
Starts the oscillator playing, usually called by key down event.
- Parameters
-
| velocity | Value of velocity in [0...1] |
◆ stopNote()
| void krotos::ReformerOscillator::stopNote |
( |
| ) |
|
Signals the oscillator to begin key up behaviour, usually called by key up event The oscillator may continue playing if it is generating a tail.
◆ AMPLITUDE_FIDDLE_FACTOR
| const float krotos::ReformerOscillator::AMPLITUDE_FIDDLE_FACTOR {0.6f} |
|
private |
◆ FADE_POINT_MIN
| const float krotos::ReformerOscillator::FADE_POINT_MIN {0.000001f} |
|
private |
◆ m_activeGrains
| std::vector<Grain*> krotos::ReformerOscillator::m_activeGrains |
|
private |
◆ m_autoplayEnabled
| bool krotos::ReformerOscillator::m_autoplayEnabled {false} |
|
private |
◆ m_blockSize
| size_t krotos::ReformerOscillator::m_blockSize {128} |
|
private |
◆ m_channelCrossfade
| SlewLimiter krotos::ReformerOscillator::m_channelCrossfade |
|
private |
◆ m_closestDescriptor
◆ m_detuneModVal
| float krotos::ReformerOscillator::m_detuneModVal {0.0f} |
|
private |
◆ m_g
| std::mt19937 krotos::ReformerOscillator::m_g |
|
private |
◆ m_grainHistory
| std::deque<size_t> krotos::ReformerOscillator::m_grainHistory |
|
private |
◆ m_grainRate
| float krotos::ReformerOscillator::m_grainRate {0.0f} |
|
private |
◆ m_isDrone
| bool krotos::ReformerOscillator::m_isDrone {false} |
|
private |
◆ m_k
| std::size_t krotos::ReformerOscillator::m_k {1} |
|
private |
◆ m_keyDown
| bool krotos::ReformerOscillator::m_keyDown {false} |
|
private |
◆ m_length
| int krotos::ReformerOscillator::m_length {0} |
|
private |
◆ m_loopingEnable
| bool krotos::ReformerOscillator::m_loopingEnable {false} |
|
private |
◆ m_nearestGrainIndex
| size_t krotos::ReformerOscillator::m_nearestGrainIndex {0} |
|
private |
◆ m_nearestPopGrainIndex
| size_t krotos::ReformerOscillator::m_nearestPopGrainIndex {0} |
|
private |
◆ m_normalisationEnable
| bool krotos::ReformerOscillator::m_normalisationEnable {false} |
|
private |
◆ m_parameters
| std::vector<const float*> krotos::ReformerOscillator::m_parameters |
|
private |
◆ m_playbackHz
| float krotos::ReformerOscillator::m_playbackHz {0.0f} |
|
private |
◆ m_playbackHzDetuned
| float krotos::ReformerOscillator::m_playbackHzDetuned {0.0f} |
|
private |
◆ m_popcornTimer
◆ m_proximityMode
| bool krotos::ReformerOscillator::m_proximityMode = false |
|
private |
◆ m_proximityTrigger
| bool krotos::ReformerOscillator::m_proximityTrigger = false |
|
private |
◆ m_puckPosition
| Point<float> krotos::ReformerOscillator::m_puckPosition {0.f, 0.f} |
|
private |
◆ m_rand
| juce::Random krotos::ReformerOscillator::m_rand {1234} |
|
private |
◆ m_sampleEngine
| SampleEngine* krotos::ReformerOscillator::m_sampleEngine {nullptr} |
|
private |
◆ m_sampleIndex
| size_t krotos::ReformerOscillator::m_sampleIndex {0} |
|
private |
◆ m_samplerate
| double krotos::ReformerOscillator::m_samplerate {48000.0} |
|
private |
◆ m_StartIndex
| float krotos::ReformerOscillator::m_StartIndex {0.0f} |
|
private |
◆ m_stopped
| bool krotos::ReformerOscillator::m_stopped {false} |
|
private |
◆ m_taggingType
| bool krotos::ReformerOscillator::m_taggingType {false} |
|
private |
◆ m_trackingEnable
| bool krotos::ReformerOscillator::m_trackingEnable {false} |
|
private |
◆ m_velocity
| float krotos::ReformerOscillator::m_velocity {1.0f} |
|
private |
◆ m_voiceIndex
| int krotos::ReformerOscillator::m_voiceIndex {-1} |
|
private |
◆ m_voicePhase
The documentation for this class was generated from the following files: