diff --git a/src/AudioGeneratorRTTTL.cpp b/src/AudioGeneratorRTTTL.cpp index 5eb1848..91d07e6 100644 --- a/src/AudioGeneratorRTTTL.cpp +++ b/src/AudioGeneratorRTTTL.cpp @@ -236,13 +236,13 @@ bool AudioGeneratorRTTTL::GetNextNote() ptr++; note++; } + if (!ReadInt(&scale)) { + scale = defaultOctave; + } if ((ptr < len) && (buff[ptr] == '.')) { ptr++; dur += dur / 2; } - if (!ReadInt(&scale)) { - scale = defaultOctave; - } // Eat any trailing whitespace and comma SkipWhitespace(); if ((ptr < len) && (buff[ptr]==',')) {