SynthLab SDK
SynthLab::Lane Class Reference

Public Member Functions

 Lane ()
 
 ~Lane ()
 empty destructor
 
void resetJumpTable ()
 
void shuffleJumpTable ()
 for randomizing the sequence in the table
 
void updateLaneLoopPoints ()
 for update to next set of points (forward or backwards)
 
void initStepTiming (uint32_t stepIndex)
 Initialize timing of a lane step.
 
void initCurrentStep (uint32_t jumpIndex)
 Initialize timing of the FIRST lane step; needed only at startup.
 
void initNextStep (uint32_t jumpIndex, uint32_t loopDirectionIndex, bool applyProbability=false)
 Initialize timing of the NEXT step; needed only at startup.
 
void setCurrentStepFromNextStep ()
 Next step becomes the current step.
 
bool loadNextStep (uint32_t loopDirectionIndex, bool applyProbability=false)
 Load next step;. More...
 
uint32_t getNextStepIndex (uint32_t &jumpTableIndex, bool forwardBackward, bool &hitLoopPoint)
 Find index of next step. More...
 
void updateLEDMeterWithCurrentStep ()
 Update the LED meter index with current stap index. More...
 
void updateLEDMeterWithNextStep ()
 Update the LED meter index with next stap index. More...
 
void updateStepValues ()
 Update values of current step and next step as long as they are non-null.
 
void setRandomizeSteps (bool _randomizeSteps)
 Enable re-shuffling of jump table.
 
int32_t getCurrentStepIndex ()
 
int32_t getNextStepIndex ()
 
double getCurrentStepValue ()
 
double getNextStepValue ()
 
int32_t getJumpTableValue (uint32_t index)
 

Public Attributes

uint32_t startPoint = 0
 start loop point
 
uint32_t endPoint = MAX_SEQ_STEPS
 end loop point
 
bool forwardDirection = true
 forward flag
 
LaneStep laneStep [MAX_SEQ_STEPS]
 array of lane steps for this lane
 
LaneStep currentStep
 current
 
LaneStep nextStep
 
uint32_t currentLEDStep = 0
 

next in sequence

More...
 
uint32_t currentLEDStepDuration = 0
 on-time of current LED
 

Protected Member Functions

uint32_t calcNextIndex (uint32_t baseIndex)
 
uint32_t calcPreviousIndex (uint32_t baseIndex)
 

Protected Attributes

int32_t jumpTable [MAX_SEQ_STEPS]
 table of lane step index values
 
int32_t currentStepIndex = 0
 always know current step index
 
int32_t nextStepIndex = 0
 always know next step index
 
uint32_t jumpTableIndex = 0
 current index in jump table
 
double currentStepValue = 0.0
 always know current step value
 
double nextStepValue = 0.0
 always know next step value
 
bool randomizeSteps = false
 flag to randomize steps
 

Constructor & Destructor Documentation

◆ Lane()

SynthLab::Lane::Lane ( )
inline

< construction resets table

Member Function Documentation

◆ calcNextIndex()

uint32_t SynthLab::Lane::calcNextIndex ( uint32_t  baseIndex)
inlineprotected

< find next step, wrap if needed (should not need to, but this is backup)

◆ calcPreviousIndex()

uint32_t SynthLab::Lane::calcPreviousIndex ( uint32_t  baseIndex)
inlineprotected

< find next step, wrap if needed (should not need to, but this is backup)

◆ getJumpTableValue()

int32_t SynthLab::Lane::getJumpTableValue ( uint32_t  index)
inline
Parameters
indexget a jump table value (0 to 7)

◆ getNextStepIndex()

uint32_t SynthLab::Lane::getNextStepIndex ( uint32_t &  jumpTableIndex,
bool  forwardBackward,
bool &  hitLoopPoint 
)
inline

Find index of next step.

  • always need to know the next steap
  • checks forward/reverse operation
  • supports bi-directionality
  • returns true in hitLoopPoint if the next step is an endpoint (start or end)
Parameters
jumpTableIndexthe current index, the next index is calculated
forwardBackwardtrue if forward/backward mode enabled
hitLoopPointtrue if advancing to next step hits a loop point

◆ loadNextStep()

bool SynthLab::Lane::loadNextStep ( uint32_t  loopDirectionIndex,
bool  applyProbability = false 
)
inline

Load next step;.

  • update probabilities for next step
  • detect loop endpoints and re-shuffle if needed

◆ updateLEDMeterWithCurrentStep()

void SynthLab::Lane::updateLEDMeterWithCurrentStep ( )
inline

Update the LED meter index with current stap index.

  • update the LED on-duration with current step duration

◆ updateLEDMeterWithNextStep()

void SynthLab::Lane::updateLEDMeterWithNextStep ( )
inline

Update the LED meter index with next stap index.

  • update the LED on-duration with next step duration

Member Data Documentation

◆ currentLEDStep

uint32_t SynthLab::Lane::currentLEDStep = 0

next in sequence

index of current LED


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