Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
TimeStretcher Class Reference
Collaboration diagram for TimeStretcher:

Public Member Functions

bool init (Sample *sample, VoiceSample *voiceSample, SamplePlaybackGuide *guide, int64_t newSamplePosBig, int32_t numChannels, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t playDirection, int32_t priorityRating, int32_t fudgingNumSamplesTilLoop, LoopType loopingType)
 
void reInit (int64_t newSamplePosBig, SamplePlaybackGuide *guide, VoiceSample *voiceSample, Sample *sample, int32_t numChannels, int32_t timeStretchRatio, int32_t phaseIncrement, uint64_t combinedIncrement, int32_t playDirection, LoopType loopingType, int32_t priorityRating)
 
void beenUnassigned ()
 
void unassignAllReasonsForPercLookahead ()
 
void unassignAllReasonsForPercCacheClusters ()
 
bool hopEnd (SamplePlaybackGuide *guide, VoiceSample *voiceSample, Sample *sample, int32_t numChannels, int32_t timeStretchRatio, int32_t phaseIncrement, uint64_t combinedIncrement, int32_t playDirection, LoopType loopingType, int32_t priorityRating)
 
void rememberPercCacheCluster (Cluster *cluster)
 
void updateClustersForPercLookahead (Sample *sample, uint32_t sourceBytePos, int32_t playDirection)
 
int32_t getSamplePos (int32_t playDirection)
 
bool allocateBuffer (int32_t numChannels)
 
void readFromBuffer (int32_t *oscBufferPos, int32_t numSamples, int32_t numChannels, int32_t numChannelsAfterCondensing, int32_t sourceAmplitudeNow, int32_t amplitudeIncrementNow, int32_t *bufferReadPos)
 
void setupCrossfadeFromCache (SampleCache *cache, int32_t cacheBytePos, int32_t numChannels)
 

Public Attributes

int64_t samplePosBig
 
uint32_t crossfadeProgress
 
uint32_t crossfadeIncrement
 
int32_t samplesTilHopEnd
 
SampleLowLevelReader olderPartReader
 
int32_t * buffer
 
bool olderHeadReadingFromBuffer
 
bool hasLoopedBackIntoPreMargin
 
bool playHeadStillActive [2]
 
uint8_t numTimesMissedHop
 
int32_t olderBufferReadPos
 
ClusterclustersForPercLookahead [kNumClustersLoadedAhead]
 
ClusterpercCacheClustersNearby [2]
 

Private Member Functions

bool setupNewPlayHead (Sample *sample, VoiceSample *voiceSample, SamplePlaybackGuide *guide, int32_t newHeadBytePos, int32_t additionalOscPos, int32_t priorityRating, LoopType loopingType)
 

Member Function Documentation

◆ setupNewPlayHead()

bool TimeStretcher::setupNewPlayHead ( Sample * sample,
VoiceSample * voiceSample,
SamplePlaybackGuide * guide,
int32_t newHeadBytePos,
int32_t additionalOscPos,
int32_t priorityRating,
LoopType loopingType )
private

Unassign the remainder of the sample clusters and set the time back to the beginning Note - not perfectly thread safe for samples which are less than 64k in size. An allocation between unassigning reasons and setupClustersForPlayFromByte can lead to an incorrect steal and then re allocation as the sample may briefly have 0 reasons


The documentation for this class was generated from the following files: