We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If the rtttl note, octave or bmp values are not in a specific order, the parseDefaultValues function cannot extract the values.
Funky Town:o=4,b=125,d=8: will not work
Funky Town:o=4,b=125,d=8:
Funky Town:d=8,o=4,b=125: will work (the order is hardcoded because of the way the function was made)
Funky Town:d=8,o=4,b=125:
I have corrected it, so it works with any order.
In melody_factory_rtttl.cpp :
void MelodyFactoryClass::parseDefaultValues(String values) { for (int i=0 ;i <= strlen(values.c_str())-1; i++) { if (values.charAt(i) == 'd') { int x = i + 1; duration = parseDuration(values, x); if (duration == 0) { duration = defaultDuration; } } if (values.charAt(i) == 'o') { int x = i + 1; octave = parseOctave(values, x); if (octave == 0) { octave = defaultOctave; } } if (values.charAt(i) == 'b') { int x = i + 1; beat = parseBeat(values, x); if (beat == 0) { beat = defaultBeat; } } } //Serial.println(duration); //Serial.println(octave); //Serial.println(beat); // ORIGINAL CODE BELOW // if (values.charAt(i) == 'd') { i++; } // duration = parseDuration(values, i); // if (duration == 0) { duration = defaultDuration; } // if (values.charAt(i) == 'o') { i++; } // octave = parseOctave(values, i); // if (octave == 0) { octave = defaultOctave; } // if (values.charAt(i) == 'b') { // i++; // beat = parseBeat(values, i); // } // Serial.println(beat); // if (beat == 0) { beat = defaultBeat; } //Serial.println(beat); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If the rtttl note, octave or bmp values are not in a specific order, the parseDefaultValues function cannot extract the values.
Funky Town:o=4,b=125,d=8:
will not workFunky Town:d=8,o=4,b=125:
will work (the order is hardcoded because of the way the function was made)I have corrected it, so it works with any order.
In melody_factory_rtttl.cpp :
The text was updated successfully, but these errors were encountered: