-
Notifications
You must be signed in to change notification settings - Fork 32
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
RTTTL fixed #18
base: stable
Are you sure you want to change the base?
RTTTL fixed #18
Conversation
Why did you reduce octaves? Original values are covering audible freqs by humans (despite the qualitiy of the speaker that usually is mounted on hardware). Flash memory is quite free at this version with the minimal required MCU (avr328p). New melodies are welcome, however the startup melody is not a RTTTL feature. It originally was a simple beep to indicate powering fact. Startup melody was discarded because it produced a crazy brownout effect when batteries are low. BPS were used instead BPM because it simplifies the operations at machine code (1 divisions against 3). The trade-off is a bit complex understanding of the RTTTL spec (admissible?). Thanks for your time contributing the Escornabot :-) |
Thanks for the comments 🙂
because of the RTTTL specification: https://www.mobilefish.com/tutorials/rtttl/rtttl_quickguide_specification.html (that is mentioned on the wikipedia itself)
lower frequencies than 440 Hz (the minimum value in the original code) are audible: nine notes (C4 to G#4) were missing (as per the specification). Also, depending on the literature (or who you ask to) the commonly accepted maximum frequency is 20 kHz, where the original code goes 4 additional values (21096, 22350, 23679, 25087).
In my experience, if the batteries are so low:
the code doesn't reflect this: there is a direct conversion from the "b" in the RTTTL string to the "bps" variable where the "b" represents BPM (as per the original spec). I haven't checked that optimization, but it doesn't seem to work: would you care to explain it?
When I patched this code, I did it for me, but also I did it following these criteria:
That being said, please tell me what corrections would you require to accept the pull-request and I'll do my best to fulfill them: the ultimate goal is to help contributing, not just discussing details 😅😅. In any case, again, thanks for the time and all the effort put into the project. |
any update on this? |
At first glance, reducing the octaves is not a good idea since some melodies could use them. A more exhaustive review should check limit of user values in order to become a more robust code. I'm waiting to find some moment to review and test the changes in deep. Please, be patient 😉 |
Adding a different startup sound to the Escornabot I discovered that the RTTTL implementation was faulty:
TODO: extend the RTTTL parsing routine to implement the missing tone and a half (".") duration.
Surprisingly, the parsing/playing functions worked well-enough to keep in hiding for all these years... 🤪
With this pull-request the biggest issues should be fixed, and now you can hear the real tones: yes, the Escornabot sounds different now!