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

Make Input Whitespace Independent #1

Open
AEFeinstein opened this issue Jan 10, 2020 · 1 comment
Open

Make Input Whitespace Independent #1

AEFeinstein opened this issue Jan 10, 2020 · 1 comment

Comments

@AEFeinstein
Copy link

The following to RTTTL strings are identical, except the first has spaces and the second does not. When playing on https://adamonsoon.github.io/rtttl-play/ the first will be too slow as it seems to ignore the eighth note default (d=8).

TitleScreen: d=8,o=5,b=376: c6, g4, p, g, e4, f, c, g4, c6, e4, p, g, g4, f, c, e4, c6, g4, p, g, e4, f, c, g4, c6, e4, p, g, g4, f, c, e4, a#, g#4, p, g, d#4, d#, d, g#4, a#, d#4, p, g, g#4, d#, d, d#4, a#, g#4, p, g, d#4, d#, d, g#4, a#, d#4, p, g, g#4, d#, d, d#4, g#, f4, p, g, c4, d#, c, f4, g#, c4, p, g, f4, d#, c, c4, g#, f4, p, g, c4, d#, c, f4, g#, c4, p, g, f4, d#, c, c4, a#, f4, p, g, d4, f, d, f4, a#, d4, p, g, f4, f, d, d4, a#, f4, p, g, d4, f, d, f4, a#, d4, p, g, f4, f, d, d4
TitleScreen:d=8,o=5,b=376:c6,g4,p,g,e4,f,c,g4,c6,e4,p,g,g4,f,c,e4,c6,g4,p,g,e4,f,c,g4,c6,e4,p,g,g4,f,c,e4,a#,g#4,p,g,d#4,d#,d,g#4,a#,d#4,p,g,g#4,d#,d,d#4,a#,g#4,p,g,d#4,d#,d,g#4,a#,d#4,p,g,g#4,d#,d,d#4,g#,f4,p,g,c4,d#,c,f4,g#,c4,p,g,f4,d#,c,c4,g#,f4,p,g,c4,d#,c,f4,g#,c4,p,g,f4,d#,c,c4,a#,f4,p,g,d4,f,d,f4,a#,d4,p,g,f4,f,d,d4,a#,f4,p,g,d4,f,d,f4,a#,d4,p,g,f4,f,d,d4

I don't think the RTTTL spec mentions whitespace, but I would expect these two inputs to play the same song. I believe the simple solution is to strip all whitespace from the input string before parsing. I can try to write that if you want, but I'm an embedded C programmer and have no JS experience.

@AEFeinstein
Copy link
Author

Maybe stripping all whitespace is naive, because it would be OK to have in the title. So I guess strip all whitespace after the first : before parsing?

AEFeinstein referenced this issue in AEFeinstein/Super-2020-Swadge-FW Jan 13, 2020
Fix for tiltrads music and flicker FX bugs.
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

No branches or pull requests

1 participant