mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 21:15:11 +00:00
partially fix .dmp arp macro saving
This commit is contained in:
parent
c19357e7a4
commit
76f0cceb55
1 changed files with 28 additions and 3 deletions
|
@ -1502,11 +1502,36 @@ bool DivInstrument::saveDMP(const char* path) {
|
|||
}
|
||||
|
||||
w->writeC(std.arpMacro.len);
|
||||
bool arpMacroMode=false;
|
||||
int arpMacroHowManyFixed=0;
|
||||
int realArpMacroLen=std.arpMacro.len;
|
||||
for (int i=0; i<std.arpMacro.len; i++) {
|
||||
w->writeI(std.arpMacro.val[i]+12);
|
||||
if ((std.arpMacro.val[i]&0xc0000000)==0x40000000 || (std.arpMacro.val[i]&0xc0000000)==0x80000000) {
|
||||
arpMacroHowManyFixed++;
|
||||
}
|
||||
}
|
||||
if (std.arpMacro.len>0) w->writeC(std.arpMacro.loop);
|
||||
w->writeC(std.arpMacro.mode);
|
||||
if (arpMacroHowManyFixed>=std.arpMacro.len-1) {
|
||||
arpMacroMode=true;
|
||||
}
|
||||
if (std.arpMacro.len>0) {
|
||||
if (arpMacroMode && std.arpMacro.val[std.arpMacro.len-1]==0 && std.arpMacro.loop>=std.arpMacro.len) {
|
||||
realArpMacroLen--;
|
||||
}
|
||||
}
|
||||
|
||||
if (arpMacroMode) {
|
||||
for (int i=0; i<realArpMacroLen; i++) {
|
||||
w->writeI(std.arpMacro.val[i]);
|
||||
}
|
||||
} else {
|
||||
for (int i=0; i<realArpMacroLen; i++) {
|
||||
w->writeI(std.arpMacro.val[i]+12);
|
||||
}
|
||||
}
|
||||
if (realArpMacroLen>0) {
|
||||
w->writeC(std.arpMacro.loop);
|
||||
}
|
||||
w->writeC(arpMacroMode);
|
||||
|
||||
w->writeC(std.dutyMacro.len);
|
||||
for (int i=0; i<std.dutyMacro.len; i++) {
|
||||
|
|
Loading…
Reference in a new issue