Deluge Firmware 1.3.0
Build date: 2025.07.09
Loading...
Searching...
No Matches
VoiceSample Class Referencefinal
Inheritance diagram for VoiceSample:
Collaboration diagram for VoiceSample:

Public Member Functions

 VoiceSample (VoiceSample &other)=default
 VoiceSample (SampleLowLevelReader &&other)
VoiceSampleoperator= (const VoiceSample &other)=delete
VoiceSampleoperator= (VoiceSample &&other)=default
void noteOn (SamplePlaybackGuide *guide, uint32_t samplesLate, int32_t priorityRating)
bool noteOffWhenLoopEndPointExists (Voice *voice, VoiceSamplePlaybackGuide *voiceSource)
void setupCacheLoopPoints (SamplePlaybackGuide *voiceSource, Sample *sample, LoopType loopingType)
LateStartAttemptStatus attemptLateSampleStart (SamplePlaybackGuide *voiceSource, Sample *sample, int64_t rawSamplesLate, int32_t numSamples=0)
void endTimeStretching ()
bool render (SamplePlaybackGuide *guide, int32_t *oscBuffer, int32_t numSamples, Sample *sample, int32_t numChannels, LoopType loopingType, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t amplitude, int32_t amplitudeIncrement, int32_t bufferSize, InterpolationMode desiredInterpolationMode, int32_t priorityRating)
void beenUnassigned (bool wontBeUsedAgain)
bool shouldObeyMarkers () const override
void readSamplesResampledPossiblyCaching (int32_t **oscBufferPos, int32_t **oscBufferRPos, int32_t numSamples, Sample *sample, int32_t jumpAmount, int32_t numChannels, int32_t numChannelsAfterCondensing, int32_t phaseIncrement, int32_t *sourceAmplitudeNow, int32_t amplitudeIncrement, int32_t bufferSize, int32_t reduceMagnitudeBy=1)
bool sampleZoneChanged (SamplePlaybackGuide *voiceSource, Sample *sample, bool reversed, MarkerType markerType, LoopType loopingType, int32_t priorityRating, bool forAudioClip=false)
int32_t getPlaySample (Sample *sample, SamplePlaybackGuide *guide)
bool stopUsingCache (SamplePlaybackGuide *guide, Sample *sample, int32_t priorityRating, bool loopingAtLowLevel)
bool possiblySetUpCache (SampleControls *sampleControls, SamplePlaybackGuide *guide, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t priorityRating, LoopType loopingType)
bool fudgeTimeStretchingToAvoidClick (Sample *sample, SamplePlaybackGuide *guide, int32_t phaseIncrement, int32_t numSamplesTilLoop, int32_t playDirection, int32_t priorityRating)
Public Member Functions inherited from SampleLowLevelReader
 SampleLowLevelReader (SampleLowLevelReader &, bool stealReasons=false)
 SampleLowLevelReader (SampleLowLevelReader &&other) noexcept
SampleLowLevelReaderoperator= (const SampleLowLevelReader &other)=delete
SampleLowLevelReaderoperator= (SampleLowLevelReader &&other) noexcept
void unassignAllReasons (bool wontBeUsedAgain)
void jumpForwardLinear (int32_t numChannels, int32_t byteDepth, uint32_t bitMask, int32_t jumpAmount, int32_t phaseIncrement)
void jumpForwardZeroes (int32_t bufferSize, int32_t numChannels, int32_t phaseIncrement)
void fillInterpolationBufferRetrospectively (Sample *sample, int32_t bufferSize, int32_t startI, int32_t playDirection)
void jumpBackSamples (Sample *sample, int32_t numToJumpBack, int32_t playDirection)
void setupForPlayPosMovedIntoNewCluster (SamplePlaybackGuide *guide, Sample *sample, int32_t bytePosWithinNewCluster, int32_t byteDepth)
bool setupClusersForInitialPlay (SamplePlaybackGuide *guide, Sample *sample, int32_t byteOvershoot=0, bool justLooped=false, int32_t priorityRating=1)
bool moveOnToNextCluster (SamplePlaybackGuide *guide, Sample *sample, int32_t priorityRating=1)
bool changeClusterIfNecessary (SamplePlaybackGuide *guide, Sample *sample, bool loopingAtLowLevel, int32_t priorityRating=1)
bool considerUpcomingWindow (SamplePlaybackGuide *guide, Sample *sample, int32_t *numSamples, int32_t phaseIncrement, bool loopingAtLowLevel, int32_t bufferSize, bool allowEndlessSilenceAtEnd=false, int32_t priorityRating=1)
void setupReassessmentLocation (SamplePlaybackGuide *guide, Sample *sample)
void misalignPlaybackParameters (Sample *sample)
void realignPlaybackParameters (Sample *sample)
bool reassessReassessmentLocation (SamplePlaybackGuide *guide, Sample *sample, int32_t priorityRating)
int32_t getPlayByteLowLevel (Sample *sample, SamplePlaybackGuide *guide, bool compensateForInterpolationBuffer=false)
bool setupClustersForPlayFromByte (SamplePlaybackGuide *guide, Sample *sample, int32_t startPlaybackAtByte, int32_t priorityRating)
void readSamplesNative (int32_t **__restrict__ oscBufferPos, int32_t numSamplesTotal, Sample *sample, int32_t jumpAmount, int32_t numChannels, int32_t numChannelsAfterCondensing, int32_t *amplitude, int32_t amplitudeIncrement, TimeStretcher *timeStretcher=nullptr, bool bufferingToTimeStretcher=false)
void readSamplesResampled (int32_t **__restrict__ oscBufferPos, int32_t numSamples, Sample *sample, int32_t jumpAmount, int32_t numChannels, int32_t numChannelsAfterCondensing, int32_t phaseIncrement, int32_t *amplitude, int32_t amplitudeIncrement, int32_t bufferSize, bool writingCache, char **__restrict__ cacheWritePos, bool *doneAnySamplesYet, TimeStretcher *timeStretcher, bool bufferingToTimeStretcher, int32_t whichKernel)
bool readSamplesForTimeStretching (int32_t *oscBufferPos, SamplePlaybackGuide *guide, Sample *sample, int32_t numSamples, int32_t numChannels, int32_t numChannelsAfterCondensing, int32_t phaseIncrement, int32_t amplitude, int32_t amplitudeIncrement, bool loopingAtLowLevel, int32_t jumpAmount, int32_t bufferSize, TimeStretcher *timeStretcher, bool bufferingToTimeStretcher, int32_t whichPlayHead, int32_t whichKernel, int32_t priorityRating)
void steal_clusters (SampleLowLevelReader &other, bool stealReasons)
void bufferIndividualSampleForInterpolation (int32_t numChannels, int32_t byteDepth, char *playPosNow)
void bufferZeroForInterpolation (int32_t numChannels)

Public Attributes

uint32_t pendingSamplesLate = 0
TimeStretchertimeStretcher = nullptr
SampleCachecache = nullptr
bool doneFirstRenderYet = false
bool fudging = false
bool forAudioClip = false
bool writingToCache = false
Public Attributes inherited from SampleLowLevelReader
uint32_t oscPos {}
char * currentPlayPos {}
char * reassessmentLocation {}
char * clusterStartLocation {}
uint8_t reassessmentAction {}
int8_t interpolationBufferSizeLastTime {}
deluge::dsp::Interpolator interpolator_ {}
std::array< Cluster *, kNumClustersLoadedAhead > clusters = {nullptr, nullptr}

Private Member Functions

bool weShouldBeTimeStretchingNow (Sample *sample, SamplePlaybackGuide *guide, int32_t numSamples, int32_t phaseIncrement, int32_t timeStretchRatio, int32_t playDirection, int32_t priorityRating, LoopType loopingType)
void switchToReadingCacheFromWriting ()
bool stopReadingFromCache ()

Private Attributes

int32_t cacheBytePos = 0
uint32_t cacheLoopLengthBytes = 0
int32_t cacheLoopEndPointBytes = 0
int32_t cacheEndPointBytes = 0

Member Function Documentation

◆ shouldObeyMarkers()

bool VoiceSample::shouldObeyMarkers ( ) const
inlinenodiscardoverridevirtual

Reimplemented from SampleLowLevelReader.


The documentation for this class was generated from the following files:
  • src/deluge/model/voice/voice_sample.h
  • src/deluge/model/voice/voice_sample.cpp