Deluge Firmware
Loading...
Searching...
No Matches
Macros
renderWave.h File Reference
#include "VectorRenderingFunction.h"
Include dependency graph for renderWave.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define setupAmplitudeVector(i)
 
#define RENDER_OSC_SYNC(storageFunctionName, valueFunctionName, extraInstructionsForCrossoverSampleRedo, startRenderingASyncLabel)
 
#define RENDER_WAVETABLE_LOOP(dontCare)
 
#define RENDER_SINGLE_CYCLE_WAVEFORM_LOOP(dontCare)
 
#define WAVETABLE_EXTRA_INSTRUCTIONS_FOR_CROSSOVER_SAMPLE_REDO
 
#define STORE_VECTOR_WAVE_FOR_ONE_SYNC(vectorValueFunctionName)
 
#define SETUP_FOR_APPLYING_AMPLITUDE_WITH_VECTORS()
 
#define CREATE_WAVE_RENDER_FUNCTION_INSTANCE(thisFunctionInstanceName, vectorValueFunctionName)
 

Macro Definition Documentation

◆ CREATE_WAVE_RENDER_FUNCTION_INSTANCE

#define CREATE_WAVE_RENDER_FUNCTION_INSTANCE (   thisFunctionInstanceName,
  vectorValueFunctionName 
)
Value:
\
__attribute__((optimize("unroll-loops"))) \
void thisFunctionInstanceName(const int16_t* __restrict__ table, int tableSizeMagnitude, int32_t amplitude, int32_t* __restrict__ outputBuffer, int32_t* bufferEnd, \
uint32_t phaseIncrement, uint32_t phase, bool applyAmplitude, uint32_t phaseToAdd, int32_t amplitudeIncrement) { \
\
int16x4_t const32767 = vdup_n_s16(32767); \
int32_t* __restrict__ outputBufferPos = outputBuffer; \
SETUP_FOR_APPLYING_AMPLITUDE_WITH_VECTORS(); \
uint32_t phaseTemp = phase; \
\
do { \
int32x4_t valueVector; \
\
vectorValueFunctionName(); \
\
if (applyAmplitude) { \
int32x4_t existingDataInBuffer = vld1q_s32(outputBufferPos); \
valueVector = vqdmulhq_s32(amplitudeVector, valueVector); \
amplitudeVector = vaddq_s32(amplitudeVector, amplitudeIncrementVector); \
valueVector = vaddq_s32(valueVector, existingDataInBuffer); \
} \
\
vst1q_s32(outputBufferPos, valueVector); \
\
outputBufferPos += 4; \
} \
while (outputBufferPos < bufferEnd); \
};
__simd64_int16_t int16x4_t
Definition: LivePitchShifterPlayHead.h:23

◆ RENDER_OSC_SYNC

#define RENDER_OSC_SYNC (   storageFunctionName,
  valueFunctionName,
  extraInstructionsForCrossoverSampleRedo,
  startRenderingASyncLabel 
)

◆ RENDER_SINGLE_CYCLE_WAVEFORM_LOOP

#define RENDER_SINGLE_CYCLE_WAVEFORM_LOOP (   dontCare)
Value:
{ \
doRenderingLoopSingleCycle (bufferStartThisSync, bufferEndThisSyncRender, bandHere, phaseTemp, phaseIncrement, kernel); \
}

◆ RENDER_WAVETABLE_LOOP

#define RENDER_WAVETABLE_LOOP (   dontCare)
Value:
{ \
doRenderingLoop (bufferStartThisSync, bufferEndThisSyncRender, firstCycleNumber, bandHere, phaseTemp, phaseIncrement, crossCycleStrength2, crossCycleStrength2Increment, kernel); \
}

◆ SETUP_FOR_APPLYING_AMPLITUDE_WITH_VECTORS

#define SETUP_FOR_APPLYING_AMPLITUDE_WITH_VECTORS ( )
Value:
int32x4_t amplitudeVector; \
setupAmplitudeVector(0) \
setupAmplitudeVector(1) \
setupAmplitudeVector(2) \
setupAmplitudeVector(3) \
int32x4_t amplitudeIncrementVector = vdupq_n_s32(amplitudeIncrement << 1);

◆ setupAmplitudeVector

#define setupAmplitudeVector (   i)
Value:
{ \
amplitude += amplitudeIncrement; \
amplitudeVector = vsetq_lane_s32(amplitude >> 1, amplitudeVector, i); \
}

◆ STORE_VECTOR_WAVE_FOR_ONE_SYNC

#define STORE_VECTOR_WAVE_FOR_ONE_SYNC (   vectorValueFunctionName)
Value:
{ \
do { \
int32x4_t valueVector; \
vectorValueFunctionName(); \
vst1q_s32(writePos, valueVector); \
writePos += 4; \
} while (writePos < bufferEndThisSyncRender); \
}

◆ WAVETABLE_EXTRA_INSTRUCTIONS_FOR_CROSSOVER_SAMPLE_REDO

#define WAVETABLE_EXTRA_INSTRUCTIONS_FOR_CROSSOVER_SAMPLE_REDO
Value:
{ \
crossCycleStrength2 += crossCycleStrength2Increment * (samplesIncludingNextCrossoverSample - 1); \
}