Sample-based oscillator with pitch tracking and looping capabilities.
More...
#include <gin_sampleoscillator.h>
Sample-based oscillator with pitch tracking and looping capabilities.
SampleOscillator plays back audio samples at different pitches, similar to a sampler. It supports looping, bidirectional playback, sample range selection, and automatic resampling to match the target pitch.
Key Features:
- Pitch-shifted sample playback (follows MIDI note input)
- Loop modes: forward, backward, ping-pong
- Configurable loop points and sample range
- Automatic high-quality resampling
- Crossfade support for smooth loop transitions
- Note on/off triggering
Direction Modes:
- forwards: Normal forward playback
- backwards: Reverse playback
- pingpong: Alternates between forward and backward
Usage:
bool isStillPlaying = osc.
read(60.0, audioBuffer);
void setSampleRateAndBlockSize(double sr, int bs)
@ forwards
Definition gin_sampleoscillator.h:60
void setLooping(bool l, int s=0, int e=-1)
SampleOscillator()=default
bool read(double note, juce::AudioSampleBuffer &buffer, int start=0, int length=-1)
void setDirection(Direction d)
- See also
- Sample, ResamplingFifo
◆ Direction
| Enumerator |
|---|
| forwards | |
| backwards | |
| pingpong | |
◆ SampleOscillator()
| SampleOscillator::SampleOscillator |
( |
| ) |
|
|
default |
◆ setSampleRateAndBlockSize()
| void SampleOscillator::setSampleRateAndBlockSize |
( |
double | sr, |
|
|
int | bs ) |
◆ setSample()
| void SampleOscillator::setSample |
( |
Sample * | | ) |
|
◆ setRange()
| void SampleOscillator::setRange |
( |
int | s, |
|
|
int | e ) |
◆ setLooping()
| void SampleOscillator::setLooping |
( |
bool | l, |
|
|
int | s = 0, |
|
|
int | e = -1 ) |
◆ setDirection()
| void SampleOscillator::setDirection |
( |
Direction | d | ) |
|
◆ setCrossfadeDuration()
| void SampleOscillator::setCrossfadeDuration |
( |
double | s | ) |
|
◆ noteOn()
| void SampleOscillator::noteOn |
( |
| ) |
|
◆ noteOff()
| void SampleOscillator::noteOff |
( |
| ) |
|
◆ read()
| bool SampleOscillator::read |
( |
double | note, |
|
|
juce::AudioSampleBuffer & | buffer, |
|
|
int | start = 0, |
|
|
int | length = -1 ) |
The documentation for this class was generated from the following file: