Storage for a set of PCM samples that constitute a patch or instrument.
More...
#include <synthlabpcmsource.h>
|
| SynthLabPCMSource (const char *_sampleFolderPath, const char *_sampleFolderName, double _sampleRate, bool pitchlessLoops=false, bool aubioSlices=false) |
| Parses a folder full of wave files and extracts the PCM samples. More...
|
|
void | init (const char *_sampleFolderPath, const char *_sampleFolderName, double _sampleRate, bool pitchlessLoops=false, bool aubioSlices=false) |
| Separated initializer, parses a folder full of wave files and extracts the PCM samples. More...
|
|
virtual void | deleteSamples () |
| Delete all samples from memory.
|
|
virtual uint32_t | getValidSampleCount () |
| query for valid sample count (not used in SynthLab but avialable)
|
|
virtual bool | haveValidSamples () |
| Find all non-null sample pointers.
|
|
| ~SynthLabPCMSource () |
| Destructor nothing to do, samples were deleted prior to destruction here.
|
|
virtual double | selectSample (double oscFrequency) |
| Selects a PCM sample based on the target oscillator frequency. More...
|
|
virtual PCMSampleOutput | readSample (double &readIndex, double inc) |
| Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead. More...
|
|
virtual void | setSampleLoopMode (SampleLoopMode _loopMode) |
|
Storage for a set of PCM samples that constitute a patch or instrument.
- exposes the IPCMSampleSource interface
- initialized with folders full of wave files that are multi-samples
- the owning object (a wavetable core) selects the PCM sample based on pitch during the update() phase which is ignored since the source only has one table. Then, the owning object makes calls to read the sample during the render() phase
- see also PCMSample
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2021 / 04 / 26
◆ SynthLabPCMSource()
SynthLab::SynthLabPCMSource::SynthLabPCMSource |
( |
const char * |
_sampleFolderPath, |
|
|
const char * |
_sampleFolderName, |
|
|
double |
_sampleRate, |
|
|
bool |
pitchlessLoops = false , |
|
|
bool |
aubioSlices = false |
|
) |
| |
|
inline |
Parses a folder full of wave files and extracts the PCM samples.
- Parameters
-
_sampleFolderPath | the fully qualified path to the sample folder |
_sampleFolderName | the name of the sample folder; this will be the name of the bank of samples |
_sampleRate | fs |
pitchlessLoops | set true to make pitchless where phaseInc always equals 1.0 |
aubioSlices | set true if the folder holds wave files made with aubio |
◆ init()
void SynthLab::SynthLabPCMSource::init |
( |
const char * |
_sampleFolderPath, |
|
|
const char * |
_sampleFolderName, |
|
|
double |
_sampleRate, |
|
|
bool |
pitchlessLoops = false , |
|
|
bool |
aubioSlices = false |
|
) |
| |
|
inline |
Separated initializer, parses a folder full of wave files and extracts the PCM samples.
- Parameters
-
_sampleFolderPath | the fully qualified path to the sample folder |
_sampleFolderName | the name of the sample folder; this will be the name of the bank of samples |
_sampleRate | fs |
pitchlessLoops | set true to make pitchless where phaseInc always equals 1.0 |
aubioSlices | set true if the folder holds wave files made with aubio |
◆ readSample()
virtual PCMSampleOutput SynthLab::SynthLabPCMSource::readSample |
( |
double & |
readIndex, |
|
|
double |
inc |
|
) |
| |
|
inlinevirtual |
Read and interpolate the table; uses linear interpolation but could be changed to 4th order LaGrange interpolation instead.
- checks loop points and looping mode
- for one shot will set the flag once event is done
- Parameters
-
readIndex | the floating point index (may be fractional); this value will be changed during the function call |
inc | the phase increment for this read operation; the readIndex will be automatically bumped by this value |
Implements SynthLab::IPCMSampleSource.
◆ selectSample()
virtual double SynthLab::SynthLabPCMSource::selectSample |
( |
double |
oscFrequency | ) |
|
|
inlinevirtual |
Selects a PCM sample based on the target oscillator frequency.
- Parameters
-
oscFrequency | target frequency |
Implements SynthLab::IPCMSampleSource.
◆ setSampleLoopMode()
virtual void SynthLab::SynthLabPCMSource::setSampleLoopMode |
( |
SampleLoopMode |
_loopMode | ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file: