Skip to content

Fix barPhase output and add Bars/2 division option#918

Open
caiomarinello wants to merge 3 commits intoDISTRHO:mainfrom
caiomarinello:main
Open

Fix barPhase output and add Bars/2 division option#918
caiomarinello wants to merge 3 commits intoDISTRHO:mainfrom
caiomarinello:main

Conversation

@caiomarinello
Copy link

@caiomarinello caiomarinello commented Mar 19, 2026

The previous barPhase formula was incorrect for Bars/4 and Bars/8 modes. Instead of sweeping smoothly from 0 to 10V across the full bar division, it would produce an inconsistent sawtooth that reset at different voltages each bar cycle.

The fix normalizes the beat and sub-beat positions into a fractional bar count before applying fmod, producing a correct 0 10V phasor across the selected number of bars.

Also adds a Bars/2 division option to complement the existing Bars/1, Bars/4 and Bars/8 options.

Fixes #919

The previous barPhase formula was incorrect for Bars/4 and Bars/8 modes. Instead of sweeping smoothly from 0 to 10V across the full bar division, it would produce an inconsistent sawtooth that reset at different voltages each bar cycle.

The fix normalizes the beat and sub-beat positions into a fractional bar count before applying fmod, producing a correct 0 10V phasor across the selected number of bars.

Also adds a Bars/2 division option to complement the existing Bars/1, Bars/4 and Bars/8 options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HostTime: barPhase output incorrect for Bars/4 and Bars/8 divisions

1 participant