|
Gin
|
Audio sample container for loading and playing back sample data. More...
#include <gin_sample.h>
Public Member Functions | |
| int | getLength () |
| int | getRootNote () |
| double | getSampleRate () |
| juce::AudioSampleBuffer & | getSamples () |
| void | read (juce::AudioSampleBuffer &buffer, int samplePos, int bufferPos=0, int length=-1) |
| void | readSamplesAt (int pos, float &lOut, float &rOut) |
Static Public Member Functions | |
| static std::unique_ptr< Sample > | fromFile (const juce::File &f) |
Audio sample container for loading and playing back sample data.
Sample holds audio data loaded from files and provides methods for reading the sample data. It's designed to work with SampleOscillator for pitch-shifted playback and supports storing sample metadata like root note and sample rate.
Key Features:
The root note is used by SampleOscillator to determine pitch shift amounts when playing the sample at different MIDI notes.
Usage:
| int Sample::getLength | ( | ) |
| int Sample::getRootNote | ( | ) |
| double Sample::getSampleRate | ( | ) |
| juce::AudioSampleBuffer & Sample::getSamples | ( | ) |
| void Sample::read | ( | juce::AudioSampleBuffer & | buffer, |
| int | samplePos, | ||
| int | bufferPos = 0, |
||
| int | length = -1 |
||
| ) |