|
Krotos Modules 3
|
#include <KrotosAudioBuffer.h>
Public Types | |
| enum | BufferType { Samples = 0 , Spectral } |
| enum | InterpolationType { Linear = 0 , Cubic , Cosine , Cubic3d , NUM_TYPES } |
Public Member Functions | |
| KrotosAudioBuffer () | |
| KrotosAudioBuffer (int channels, int size) | |
| KrotosAudioBuffer (const AudioBuffer< float > &buffer) | |
| Creates a krotos buffer from a juce buffer. | |
| KrotosAudioBuffer (const AudioBuffer< float > &buffer, int numOfChannels) | |
| Creates a krotos buffer from a juce buffer but with a new number of channels, this constructor tries to be as efficient as possible by not reallocating or clearing the extra space. | |
| ~KrotosAudioBuffer () | |
| float | getPeak (int channel) const |
| float | getRMS (int channel) const |
| void | setSize (int newNumChannels, int numSamples, bool keepExistingContent=true, bool clearExtraSpace=true, bool avoidReallocating=true) |
| void | setSize (KrotosAudioBuffer &prototypeBuffer) |
| void | copyFrom (int destChannel, const float *source, int numSamples) |
| void | copyFrom (KrotosAudioBuffer &sourceBuffer) |
| void | addFrom (int destChannel, const float *source, int numSamples) |
| void | addFrom (KrotosAudioBuffer &srcBuffer) |
| void | processWetDry (KrotosAudioBuffer &wetBuffer, SmoothedFloat &wetDryValue) |
| void | processGain (SmoothedFloat &gainFactor) |
| void | processGain (float gainFactor) |
| void | processPan (SmoothedFloat &panValue) |
| bool | processClamp (float clampValue) |
| void | fillWithNoise () |
| void | processMute (MuteStateMachine &state) |
| void | setDataValid (bool state) |
| bool | isDataValid () const |
| void | setSampleRate (float sampleRate) |
| float | getSampleRate (void) |
| void | setSourceSampleRate (float sampleRate) |
| float | getSourceSampleRate (void) |
| float | getNativeNoteFrequency (void) |
| void | setInterpolationType (InterpolationType newInterpolationType) |
| StereoSample | makeRamp (StereoSample startValue, int samples) |
| Create a ramp in the buffer. | |
| StereoSample | getLastSample () |
| Get the last stereo sample from the audio buffer. | |
| StereoSample | getInterpolatedSample (double index) |
| Get a stereo sample from the audio buffer. | |
| float | getInterpolatedSampleMono (float playHead) |
| KrotosAudioBuffer | getMonoBuffer () |
| void | reverse (int channel, int startSample, int numSamples) |
| void | reverse (int startSample, int numSamples) |
| juce::AudioBuffer< float > & | getJuceAudioBuffer () |
| void | equalPowerCrossFadeFrom (const KrotosAudioBuffer &previousBuffer) |
| float | findAbsMax () |
| void | normaliseTo (float scale) |
Static Public Member Functions | |
| static KrotosAudioBuffer | mixToMono (KrotosAudioBuffer &multiChannelBuffer) |
Private Member Functions | |
| float | getCubic3dInterpolationSample (double playhead, const float *buffer) |
| float | getCosineInterpolationSample (double playhead, const float *buffer) |
| float | getCubicInterpolationSample (double playhead, const float *buffer) |
Private Attributes | |
| bool | m_isDataValid {true} |
| InterpolationType | m_interpoltationType {InterpolationType::Cubic3d} |
| float | m_sampleRate {48000.0f} |
| float | m_sourceSampleRate {48000.0f} |
Static Private Attributes | |
| static const float | FREQ_Hz_NOTE_C3 {130.813705f} |
| static const float | FREQ_Hz_NOTE_D3 {146.83f} |
| static const float | FREQ_Hz_NOTE_C4 {261.63f} |
| krotos::KrotosAudioBuffer::KrotosAudioBuffer | ( | ) |
| krotos::KrotosAudioBuffer::KrotosAudioBuffer | ( | int | channels, |
| int | size ) |
|
inlineexplicit |
Creates a krotos buffer from a juce buffer.
| buffer |
|
explicit |
Creates a krotos buffer from a juce buffer but with a new number of channels, this constructor tries to be as efficient as possible by not reallocating or clearing the extra space.
| buffer | the juce audio buffer |
| numOfChannels | the number of channels you want the krotos buffer to have |
| krotos::KrotosAudioBuffer::~KrotosAudioBuffer | ( | ) |
| void krotos::KrotosAudioBuffer::addFrom | ( | int | destChannel, |
| const float * | source, | ||
| int | numSamples ) |
| void krotos::KrotosAudioBuffer::addFrom | ( | KrotosAudioBuffer & | srcBuffer | ) |
| void krotos::KrotosAudioBuffer::copyFrom | ( | int | destChannel, |
| const float * | source, | ||
| int | numSamples ) |
| void krotos::KrotosAudioBuffer::copyFrom | ( | KrotosAudioBuffer & | sourceBuffer | ) |
| void krotos::KrotosAudioBuffer::equalPowerCrossFadeFrom | ( | const KrotosAudioBuffer & | previousBuffer | ) |
| void krotos::KrotosAudioBuffer::fillWithNoise | ( | ) |
|
inline |
Find the absolute maximum value of the data in the buffer.
|
private |
|
private |
|
private |
|
inline |
Get a stereo sample from the audio buffer.
| index | The integer part indexes the sample and the fractional part interpolates between the sample and the next sample |
|
inline |
| juce::AudioBuffer< float > & krotos::KrotosAudioBuffer::getJuceAudioBuffer | ( | ) |
| StereoSample krotos::krotos::KrotosAudioBuffer::getLastSample | ( | ) |
Get the last stereo sample from the audio buffer.
| KrotosAudioBuffer krotos::KrotosAudioBuffer::getMonoBuffer | ( | ) |
| float krotos::KrotosAudioBuffer::getNativeNoteFrequency | ( | void | ) |
| float krotos::KrotosAudioBuffer::getPeak | ( | int | channel | ) | const |
| float krotos::KrotosAudioBuffer::getRMS | ( | int | channel | ) | const |
| float krotos::KrotosAudioBuffer::getSampleRate | ( | void | ) |
| float krotos::KrotosAudioBuffer::getSourceSampleRate | ( | void | ) |
| bool krotos::krotos::KrotosAudioBuffer::isDataValid | ( | ) | const |
| StereoSample krotos::krotos::KrotosAudioBuffer::makeRamp | ( | StereoSample | startValue, |
| int | samples ) |
Create a ramp in the buffer.
| startValue | Ramp starts at startValue and heads towards 0 |
| samples | Number of samples to get from startValue to 0 |
|
static |
| void krotos::KrotosAudioBuffer::normaliseTo | ( | float | scale | ) |
Normalise the buffer to +- scale.
| bool krotos::KrotosAudioBuffer::processClamp | ( | float | clampValue | ) |
| void krotos::KrotosAudioBuffer::processGain | ( | float | gainFactor | ) |
| void krotos::krotos::KrotosAudioBuffer::processGain | ( | SmoothedFloat & | gainFactor | ) |
| void krotos::KrotosAudioBuffer::processMute | ( | MuteStateMachine & | state | ) |
| void krotos::krotos::KrotosAudioBuffer::processPan | ( | SmoothedFloat & | panValue | ) |
| void krotos::KrotosAudioBuffer::processWetDry | ( | KrotosAudioBuffer & | wetBuffer, |
| SmoothedFloat & | wetDryValue ) |
| void krotos::KrotosAudioBuffer::reverse | ( | int | channel, |
| int | startSample, | ||
| int | numSamples ) |
| void krotos::krotos::KrotosAudioBuffer::reverse | ( | int | startSample, |
| int | numSamples ) |
Reverses a part of the buffer.
| void krotos::KrotosAudioBuffer::setDataValid | ( | bool | state | ) |
|
inline |
| void krotos::KrotosAudioBuffer::setSampleRate | ( | float | sampleRate | ) |
| void krotos::KrotosAudioBuffer::setSize | ( | int | newNumChannels, |
| int | numSamples, | ||
| bool | keepExistingContent = true, | ||
| bool | clearExtraSpace = true, | ||
| bool | avoidReallocating = true ) |
| void krotos::KrotosAudioBuffer::setSize | ( | KrotosAudioBuffer & | prototypeBuffer | ) |
| void krotos::KrotosAudioBuffer::setSourceSampleRate | ( | float | sampleRate | ) |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |