Skip to content

Fix timing of dotted notes #33

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

Merged
merged 1 commit into from
Sep 12, 2022
Merged

Conversation

duckythescientist
Copy link
Contributor

Dotting a note lengthens it by 1/2. In the code, the duration parameter is
actually a divisor of the length of the note (e.g. 1 is a whole note but 4
is a quarter note (1/4 the length)), so dotting should divide the duration
by 1.5 instead of multiplying.

Dotting a note lengthens it by 1/2. In the code, the `duration` parameter is
actually a divisor of the length of the note (e.g. 1 is a whole note but 4
is a quarter note (1/4 the length)), so dotting should divide the `duration`
by 1.5 instead of multiplying.
@tekktrik tekktrik requested a review from a team September 6, 2022 15:09
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @duckythescientist.

The change looks good to me. I wasn't familiar with the spec, but confirmed the dotting syntax here: https://en.wikipedia.org/wiki/Ring_Tone_Text_Transfer_Language

Tested the fix successfully with:

adafruit_rtttl.play(board.SPEAKER,
                    "TestSong: d=4,o=5,b=148: 1c, 1e, 1f., 1c")

@FoamyGuy FoamyGuy merged commit 665778c into adafruit:main Sep 12, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 13, 2022
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