Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autovibrato that is kept on after instrument change. #26

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

rasky
Copy link
Contributor

@rasky rasky commented Apr 20, 2021

Nobody was resetting autovibrato_note_offset after instrument change.
The fact that xm_autovibrato doesn't update it each tick is not
sufficient: all future xm_update_frequency() in this channel will still
take into account the current autovibrato offset.

Instead of trying to reset autovibrato_note_offset when the instrument
does change (considering that we might even have to rework instrument
changing logic -- see #22), I made xm_autovibrato reset it when it is
not needed anymore. This keeps the logic updating
autovibrato_note_offset all in the same function.

Co-developed with @bryc who also prepared the testcase.

Nobody was resetting autovibrato_note_offset after instrument change.
The fact that xm_autovibrato doesn't update it each tick is not
sufficient: all future xm_update_frequency() in this channel will still
take into account the current autovibrato offset.

Instead of trying to reset autovibrato_note_offset when the instrument
does change (considering that we might even have to rework instrument
changing logic -- see Artefact2#22), I made xm_autovibrato reset it when it is
not needed anymore. This keeps the logic updating
autovibrato_note_offset all in the same function.

Co-developed with @bryc who also prepared the testcase.
@Artefact2 Artefact2 merged commit 9e36212 into Artefact2:master Apr 20, 2021
@Artefact2
Copy link
Owner

This is a great fix. This bug caused the phasing in colond.xm (see #1), thanks for investigating the issue. Merged in 9e36212

By the way, if you add a test module, could you also add the matching line in the README ? (See 815691d)

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.

2 participants