LFO Phase Control - Now shifts phase in realtime
-
I've successfully used Claude to change the behaviour of the stock HISE LFO's phase control, which would shift the phase only when the LFO was next triggered. Now it changes it in realtime. @Christoph-Hart if this is of interest I'll submit a pull request, if I can figure out how to

Here are the lines - probably better to check first

Line 356 in
LFOModulator.cpp, change:case Parameters::PhaseOffset: phaseOffset = (double)newValue; triggerWaveformUpdate(); break;to
case Parameters::PhaseOffset: { // Calculate the change in phase offset double phaseChange = (double)newValue - phaseOffset; // Update the stored phase offset phaseOffset = (double)newValue; // Apply the phase change to the current position uptime += phaseChange * (double)SAMPLE_LOOKUP_TABLE_SIZE; // Wrap uptime to stay within bounds while (uptime >= (double)SAMPLE_LOOKUP_TABLE_SIZE) uptime -= (double)SAMPLE_LOOKUP_TABLE_SIZE; while (uptime < 0.0) uptime += (double)SAMPLE_LOOKUP_TABLE_SIZE; lastCycleIndex = (int)floor(uptime * (1.0 / (double)SAMPLE_LOOKUP_TABLE_SIZE)); triggerWaveformUpdate(); break; } -
@DanH said in LFO Phase Control - Now shifts phase in realtime:
while (uptime < 0.0)
Will this ever be true?
-
But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?
-
sbb's phase control is also unsmoothed I think

But anyway, regarding this Hise realtime phase control, shouldn't smoothing should happen at the parameter level anyway rather than lower down?
-
@Christoph-Hart said in LFO Phase Control - Now shifts phase in realtime:
But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?
It's not terrible. But I'll ask about smoothing

-
haha! I wrote a custom LFO late last year for a project, and this was precisely one of the reasons!
-
Me as well, I've got a few.
I used fixed point math for all LFOs now.
You can get really cheap phase manipulation and implicit wrapping -
@griffinboy Yeah I've been waiting on yours basically and getting impatient

-
Mines done apart from the saving and loading and creating more of them.
I've not done that before in Hise.But a single one exists and works completely. Envelope too.
-
@David-Healey said in LFO Phase Control - Now shifts phase in realtime:
@DanH said in LFO Phase Control - Now shifts phase in realtime:
while (uptime < 0.0)
Will this ever be true?
Yes apparently.
@Christoph-Hart said in LFO Phase Control - Now shifts phase in realtime:
But if you don‘t smooth the phase you‘ll get really nasty zipper noises, no?
Smoothing tricky apparently
But doesn't sound bad without.... so far