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

Don't auto-create quantization/velocity bytes around loops #352

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme_files/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ <h2>Version 1.0.10 Alpha - 2023-12-19</h2>
<li>Historical Addmusic Adaptations
<ul>
<li>"Added a warning for using non-standard FIR coefficient table IDs, mostly because they won't sound consistent due to an out-of-bounds read situation. Addmusic405 songs already output an error." - KungFuFurby</li>
<li>"Corrected a bug where quantization/velocity bytes were being auto-created at the start of a loop where they shouldn't be in Addmusic405 and AddmusicM songs." - KungFuFurby</li>
</ul>
</li>
</ul>
Expand Down
29 changes: 19 additions & 10 deletions src/AddmusicK/Music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,10 @@ void Music::parseLabelLoopCommand()

pos++;

updateQ[channel] = true;
updateQ[8] = true;
if (songTargetProgram == 0 && targetAMKVersion != 0) {
updateQ[channel] = true;
updateQ[8] = true;
}
prevNoteLength = -1;

if (text[pos] == '[') // If this is a loop definition...
Expand Down Expand Up @@ -1200,9 +1202,12 @@ void Music::parseLabelLoopCommand()
void Music::parseLoopCommand()
{
pos++;
if (channel < 8)
updateQ[channel] = true;
updateQ[8] = true;
if (songTargetProgram == 0 && targetAMKVersion != 0) {
if (channel < 8) {
updateQ[channel] = true;
}
updateQ[8] = true;
}
prevNoteLength = -1;

if (text[pos] == '[') // This is an $E6 loop.
Expand Down Expand Up @@ -1257,10 +1262,12 @@ void Music::parseLoopCommand()
void Music::parseLoopEndCommand()
{
pos++;
if (channel < 8)
updateQ[channel] = true;

updateQ[8] = true;
if (songTargetProgram == 0 && targetAMKVersion != 0) {
if (channel < 8) {
updateQ[channel] = true;
}
updateQ[8] = true;
}
prevNoteLength = -1;
if (text[pos] == ']')
{
Expand Down Expand Up @@ -1320,8 +1327,10 @@ void Music::parseStarLoopCommand()

if (channel == 8) error("Nested loops are not allowed.")

if (songTargetProgram == 0 && targetAMKVersion != 0) {
updateQ[channel] = true;
updateQ[8] = true;
updateQ[8] = true;
}
prevNoteLength = -1;

i = getInt();
Expand Down