Interface for PCM sample sources.
More...
#include <synthbase.h>
|
virtual double | selectSample (double oscFrequency)=0 |
| Selects a PCM sample based on the current oscillation frequency (after all modulations have been applied) More...
|
|
virtual PCMSampleOutput | readSample (double &readIndex, double inc)=0 |
| Read a PCM sample at a fractional read index location (not normalized) More...
|
|
virtual void | setSampleLoopMode (SampleLoopMode _loopMode)=0 |
| Set the looping mode: More...
|
|
virtual void | deleteSamples ()=0 |
| Delete the samples, part of destruction process.
|
|
virtual uint32_t | getValidSampleCount ()=0 |
| query for valid sample count (not used in SynthLab but avialable)
|
|
virtual bool | haveValidSamples ()=0 |
| query for valid samples; needed if WAV parsing fails and we need to delete the entry
|
|
Interface for PCM sample sources.
- A PCM sample database stores a set of PCM sample sources
- each source represents one waveform generator, or one set of PCM samples that make a patch
- each PCM sample source has a uniqe name string, that is usually the name of the waveform or the sample which itself must be unique otherwise the user would be confused
- the source may consist of a PCM sample but most implement an array of PCM samples, for example to implement bandlimited multi-samples across a set of keys
- The source interface functions allow:
- selection of a table (this should mark the table in some way as being the currently selected item)
- read the selected wavetable
- set the sample looping mode
- delete the samples (for low level destruction)
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2021 / 04 / 26
◆ readSample()
virtual PCMSampleOutput SynthLab::IPCMSampleSource::readSample |
( |
double & |
readIndex, |
|
|
double |
inc |
|
) |
| |
|
pure virtual |
Read a PCM sample at a fractional read index location (not normalized)
- modifies the readIndex that is passed-by-reference depending on the number of samples read
- Parameters
-
readIndex | unnormalized read location within the sample |
inc | sample incrememter value (called phaseInc for the oscillator objects) |
- Returns
- a PCMSampleOutput structure that contians the audio sample(s)
Implemented in SynthLab::SynthLabPCMSource.
◆ selectSample()
virtual double SynthLab::IPCMSampleSource::selectSample |
( |
double |
oscFrequency | ) |
|
|
pure virtual |
Selects a PCM sample based on the current oscillation frequency (after all modulations have been applied)
- Parameters
-
oscFrequency | the frequency in Hz of the currently rendered pitch |
Implemented in SynthLab::SynthLabPCMSource.
◆ setSampleLoopMode()
virtual void SynthLab::IPCMSampleSource::setSampleLoopMode |
( |
SampleLoopMode |
_loopMode | ) |
|
|
pure virtual |
Set the looping mode:
- SampleLoopMode::loop: loop from start to end of sample
- SampleLoopMode::sustain: loop over a pre-set range of sustain samples (steady state section of sample)
- SampleLoopMode::oneShot: play the sample once and never again
- Parameters
-
_loopMode | the SampleLoopMode |
Implemented in SynthLab::SynthLabPCMSource.
The documentation for this class was generated from the following file: