add duty macro

This commit is contained in:
LTVA1 2024-08-02 19:08:25 +03:00
parent 8cd045b04a
commit 4235167416
2 changed files with 16 additions and 0 deletions

View file

@ -185,6 +185,16 @@ void DivPlatformSID3::tick(bool sysTick)
}
chan[i].freqChanged=true;
}
if (chan[i].std.duty.had) {
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SID3);
if (ins->c64.dutyIsAbs) {
chan[i].duty=chan[i].std.duty.val;
} else {
chan[i].duty-=chan[i].std.duty.val;
}
chan[i].duty&=65535;
updateDuty(i);
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff)
{

View file

@ -5821,6 +5821,11 @@ void FurnaceGUI::drawInsSID3(DivInstrument* ins)
ImGui::EndTable();
}
if (ImGui::Checkbox(_("Absolute Duty Macro"),&ins->c64.dutyIsAbs)) {
ins->std.dutyMacro.vZoom=-1;
PARAMETER;
}
ImGui::EndTabItem();
}
@ -5831,6 +5836,7 @@ void FurnaceGUI::drawInsSID3(DivInstrument* ins)
macroList.push_back(FurnaceGUIMacroDesc(_("Volume"),&ins->std.volMacro,0,255,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
macroList.push_back(FurnaceGUIMacroDesc(_("Arpeggio"),&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.arpMacro.val));
macroList.push_back(FurnaceGUIMacroDesc(_("Pitch"),&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode));
macroList.push_back(FurnaceGUIMacroDesc(_("Duty"),&ins->std.dutyMacro,ins->c64.dutyIsAbs?0:-65535,65535,160,uiColors[GUI_COLOR_MACRO_OTHER]));
macroList.push_back(FurnaceGUIMacroDesc(_("Panning (left)"),&ins->std.panLMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL));
macroList.push_back(FurnaceGUIMacroDesc(_("Panning (right)"),&ins->std.panRMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER]));
macroList.push_back(FurnaceGUIMacroDesc(_("Phase Reset"),&ins->std.phaseResetMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));