mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 06:01:29 +00:00
Implement ES5506 instrument type
ES5506 has these features: - 16 bit independent volume register per left/right output (Logarithmic, 4 LSB is for envelope) - Programmable filter per each channels, 4 pole, 4 filter mode and 2 16 bit coefficient register (4 LSB is for envelope) - Hardware envelope Add more than 2 macro type support "Delta" macro type: Use delta from previous value
This commit is contained in:
parent
7c42453422
commit
5190c6daab
5 changed files with 219 additions and 49 deletions
|
@ -465,6 +465,43 @@ struct DivInstrumentSoundUnit {
|
|||
switchRoles(false) {}
|
||||
};
|
||||
|
||||
struct DivInstrumentES5506 {
|
||||
struct Filter {
|
||||
enum FilterMode: unsigned char { // filter mode for pole 4,3
|
||||
FILTER_MODE_HPK2_HPK2,
|
||||
FILTER_MODE_HPK2_LPK1,
|
||||
FILTER_MODE_LPK2_LPK2,
|
||||
FILTER_MODE_LPK2_LPK1,
|
||||
};
|
||||
FilterMode mode;
|
||||
unsigned short k1, k2;
|
||||
Filter():
|
||||
mode(FILTER_MODE_LPK2_LPK1),
|
||||
k1(0xffff),
|
||||
k2(0xffff) {}
|
||||
};
|
||||
struct Envelope {
|
||||
unsigned short ecount;
|
||||
signed char lVRamp, rVRamp;
|
||||
signed char k1Ramp, k2Ramp;
|
||||
bool k1Slow, k2Slow;
|
||||
Envelope():
|
||||
ecount(0),
|
||||
lVRamp(0),
|
||||
rVRamp(0),
|
||||
k1Ramp(0),
|
||||
k2Ramp(0),
|
||||
k1Slow(false),
|
||||
k2Slow(false) {}
|
||||
};
|
||||
signed int lVol, rVol;
|
||||
Filter filter;
|
||||
Envelope envelope;
|
||||
DivInstrumentES5506():
|
||||
lVol(0xffff),
|
||||
rVol(0xffff) {}
|
||||
};
|
||||
|
||||
struct DivInstrument {
|
||||
String name;
|
||||
bool mode;
|
||||
|
@ -479,6 +516,7 @@ struct DivInstrument {
|
|||
DivInstrumentMultiPCM multipcm;
|
||||
DivInstrumentWaveSynth ws;
|
||||
DivInstrumentSoundUnit su;
|
||||
DivInstrumentES5506 es5506;
|
||||
|
||||
/**
|
||||
* save the instrument to a SafeWriter.
|
||||
|
|
|
@ -864,13 +864,13 @@ struct FurnaceGUIMacroDesc {
|
|||
float height;
|
||||
const char* displayName;
|
||||
const char** bitfieldBits;
|
||||
const char* modeName;
|
||||
const char** modeName;
|
||||
ImVec4 color;
|
||||
unsigned int bitOffset;
|
||||
bool isBitfield, blockMode;
|
||||
bool isBitfield, blockMode, useMacroMode;
|
||||
String (*hoverFunc)(int,float);
|
||||
|
||||
FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, const char* mName=NULL, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0):
|
||||
FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, bool mMode=false, const char** mName={NULL}, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0):
|
||||
macro(m),
|
||||
height(macroHeight),
|
||||
displayName(name),
|
||||
|
@ -880,6 +880,7 @@ struct FurnaceGUIMacroDesc {
|
|||
bitOffset(bitOff),
|
||||
isBitfield(bitfield),
|
||||
blockMode(block),
|
||||
useMacroMode(mMode),
|
||||
hoverFunc(hf) {
|
||||
// MSVC -> hell
|
||||
this->min=macroMin;
|
||||
|
|
|
@ -250,6 +250,10 @@ const char* suControlBits[5]={
|
|||
"ring mod", "low pass", "high pass", "band pass", NULL
|
||||
};
|
||||
|
||||
const char* es5506FilterModes[4]={
|
||||
"HP/K2, HP/K2", "HP/K2, LP/K1", "LP/K2, LP/K2", "LP/K2, LP/K1",
|
||||
};
|
||||
|
||||
const char* panBits[3]={
|
||||
"right", "left", NULL
|
||||
};
|
||||
|
@ -258,6 +262,14 @@ const char* oneBit[2]={
|
|||
"on", NULL
|
||||
};
|
||||
|
||||
const char* es5506EnvelopeModes[3]={
|
||||
"k1 slowdown", "k2 slowdown", NULL
|
||||
};
|
||||
|
||||
const char* es5506ControlModes[2]={
|
||||
"pause", NULL
|
||||
};
|
||||
|
||||
const int orderedOps[4]={
|
||||
0, 2, 1, 3
|
||||
};
|
||||
|
@ -293,11 +305,34 @@ const char* gbHWSeqCmdTypes[6]={
|
|||
"Loop until Release"
|
||||
};
|
||||
|
||||
const char* macroAbsoluteMode="Fixed";
|
||||
const char* macroRelativeMode="Relative";
|
||||
const char* macroQSoundMode="QSound";
|
||||
const char* macroAbsoluteMode[3]={
|
||||
"Relative",
|
||||
"Absolute",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char* macroDummyMode="Bug";
|
||||
const char* macroRelativeMode[3]={
|
||||
"Absolute",
|
||||
"Relative",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char* macroQSoundMode[3]={
|
||||
"Independent",
|
||||
"QSound",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char* macroDummyMode[1]={
|
||||
NULL
|
||||
};
|
||||
|
||||
const char* macroFilterMode[4]={
|
||||
"Relative",
|
||||
"Absolute",
|
||||
"Delta",
|
||||
NULL
|
||||
};
|
||||
|
||||
String macroHoverNote(int id, float val) {
|
||||
if (val<-60 || val>=120) return "???";
|
||||
|
@ -314,6 +349,27 @@ String macroHoverLoop(int id, float val) {
|
|||
return "";
|
||||
}
|
||||
|
||||
String macroHoverES5506FilterMode(int id, float val) {
|
||||
String mode="???";
|
||||
switch (((int)val)&3) {
|
||||
case 0:
|
||||
mode="HP/K2, HP/K2";
|
||||
break;
|
||||
case 1:
|
||||
mode="HP/K2, LP/K1";
|
||||
break;
|
||||
case 2:
|
||||
mode="LP/K2, LP/K2";
|
||||
break;
|
||||
case 3:
|
||||
mode="LP/K2, LP/K1";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fmt::sprintf("%d: %s",id,mode);
|
||||
}
|
||||
|
||||
String macroLFOWaves(int id, float val) {
|
||||
switch (((int)val)&3) {
|
||||
case 0:
|
||||
|
@ -1203,11 +1259,12 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
|||
if (ImGui::InputScalar("##IMacroLen",ImGuiDataType_U8,&i.macro->len,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (i.macro->len>128) i.macro->len=128;
|
||||
}
|
||||
if (i.modeName!=NULL) {
|
||||
bool modeVal=i.macro->mode;
|
||||
String modeName=fmt::sprintf("%s##IMacroMode",i.modeName);
|
||||
if (ImGui::Checkbox(modeName.c_str(),&modeVal)) {
|
||||
i.macro->mode=modeVal;
|
||||
if (i.useMacroMode && i.modeName[0]!=NULL) {
|
||||
for (int m=0; i.modeName[m]!=NULL; m++) {
|
||||
String modeName=fmt::sprintf("%s##IMacroMode%d",i.modeName[m],m);
|
||||
if (ImGui::RadioButton(modeName.c_str(),(int)i.macro->mode==m)) {
|
||||
i.macro->mode=m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2862,10 +2919,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
if (ImGui::BeginTabItem("FM Macros")) {
|
||||
if (ins->type==DIV_INS_OPLL) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SUS),&ins->std.algMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SUS),&ins->std.algMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_FB),&ins->std.fbMacro,0,7,96,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DC),&ins->std.fmsMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DM),&ins->std.amsMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DC),&ins->std.fmsMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DM),&ins->std.amsMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_ALG),&ins->std.algMacro,0,7,96,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_FB),&ins->std.fbMacro,0,7,96,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
@ -2885,8 +2942,8 @@ void FurnaceGUI::drawInsEdit() {
|
|||
macroList.push_back(FurnaceGUIMacroDesc("AM Depth",&ins->std.ex1Macro,0,127,128,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("PM Depth",&ins->std.ex2Macro,0,127,128,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("LFO Speed",&ins->std.ex3Macro,0,255,128,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("LFO Shape",&ins->std.waveMacro,0,3,48,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroLFOWaves));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("OpMask",&ins->std.ex4Macro,0,4,128,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,fmOperatorBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("LFO Shape",&ins->std.waveMacro,0,3,48,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,macroLFOWaves));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("OpMask",&ins->std.ex4Macro,0,4,128,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,fmOperatorBits));
|
||||
}
|
||||
drawMacros(macroList);
|
||||
ImGui::EndTabItem();
|
||||
|
@ -2924,10 +2981,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_MULT),&ins->std.opMacros[ordi].multMacro,0,15,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_WS),&ins->std.opMacros[ordi].wsMacro,0,7,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_VIB),&ins->std.opMacros[ordi].vibMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_KSR),&ins->std.opMacros[ordi].ksrMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SUS),&ins->std.opMacros[ordi].susMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_VIB),&ins->std.opMacros[ordi].vibMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_KSR),&ins->std.opMacros[ordi].ksrMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SUS),&ins->std.opMacros[ordi].susMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
} else if (ins->type==DIV_INS_OPLL) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
@ -2937,10 +2994,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_KSL),&ins->std.opMacros[ordi].kslMacro,0,3,32,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_MULT),&ins->std.opMacros[ordi].multMacro,0,15,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_VIB),&ins->std.opMacros[ordi].vibMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_KSR),&ins->std.opMacros[ordi].ksrMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_EGS),&ins->std.opMacros[ordi].egtMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_VIB),&ins->std.opMacros[ordi].vibMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_KSR),&ins->std.opMacros[ordi].ksrMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_EGS),&ins->std.opMacros[ordi].egtMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
@ -2952,10 +3009,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_MULT),&ins->std.opMacros[ordi].multMacro,0,15,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT),&ins->std.opMacros[ordi].dtMacro,0,7,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT2),&ins->std.opMacros[ordi].dt2Macro,0,3,32,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AM),&ins->std.opMacros[ordi].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
|
||||
if (ins->type==DIV_INS_FM) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SSG),&ins->std.opMacros[ordi].ssgMacro,0,4,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,ssgEnvBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SSG),&ins->std.opMacros[ordi].ssgMacro,0,4,64,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,ssgEnvBits));
|
||||
}
|
||||
}
|
||||
drawMacros(macroList);
|
||||
|
@ -3331,7 +3388,9 @@ void FurnaceGUI::drawInsEdit() {
|
|||
P(ImGui::Checkbox("Don't test/gate before new note",&ins->c64.noTest));
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (ins->type==DIV_INS_AMIGA || ins->type==DIV_INS_SU) if (ImGui::BeginTabItem((ins->type==DIV_INS_SU)?"Sound Unit":"Sample")) {
|
||||
if (ins->type==DIV_INS_AMIGA ||
|
||||
ins->type==DIV_INS_SU ||
|
||||
ins->type==DIV_INS_ES5506) if (ImGui::BeginTabItem((ins->type==DIV_INS_SU)?"Sound Unit":"Sample")) {
|
||||
String sName;
|
||||
if (ins->amiga.initSample<0 || ins->amiga.initSample>=e->song.sampleLen) {
|
||||
sName="none selected";
|
||||
|
@ -3488,6 +3547,42 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (ins->type==DIV_INS_ES5506) if (ImGui::BeginTabItem("ES5506")) {
|
||||
if (ImGui::BeginTable("ESParams",2,ImGuiTableFlags_SizingStretchSame)) {
|
||||
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||
// filter
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Filter 4,3 Mode",ImGuiDataType_U8,&ins->es5506.filter.mode,&_ZERO,&_THREE,es5506FilterModes[ins->es5506.filter.mode&3])); rightClickable
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Filter K1",ImGuiDataType_U16,&ins->es5506.filter.k1,&_ZERO,&_SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE)); rightClickable
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Filter K2",ImGuiDataType_U16,&ins->es5506.filter.k2,&_ZERO,&_SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE)); rightClickable
|
||||
// envelope
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Envelope count",ImGuiDataType_U16,&ins->es5506.envelope.ecount,&_ZERO,&_FIVE_HUNDRED_ELEVEN)); rightClickable
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Left Volume Ramp",ImGuiDataType_S8,&ins->es5506.envelope.lVRamp,&_MINUS_ONE_HUNDRED_TWENTY_EIGHT,&_ONE_HUNDRED_TWENTY_SEVEN)); rightClickable
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Right Volume Ramp",ImGuiDataType_S8,&ins->es5506.envelope.rVRamp,&_MINUS_ONE_HUNDRED_TWENTY_EIGHT,&_ONE_HUNDRED_TWENTY_SEVEN)); rightClickable
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Filter K1 Ramp",ImGuiDataType_S8,&ins->es5506.envelope.k1Ramp,&_MINUS_ONE_HUNDRED_TWENTY_EIGHT,&_ONE_HUNDRED_TWENTY_SEVEN)); rightClickable
|
||||
ImGui::TableNextColumn();
|
||||
P(CWSliderScalar("Filter K2 Ramp",ImGuiDataType_S8,&ins->es5506.envelope.k2Ramp,&_MINUS_ONE_HUNDRED_TWENTY_EIGHT,&_ONE_HUNDRED_TWENTY_SEVEN)); rightClickable
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Checkbox("K1 Ramp Slowdown",&ins->es5506.envelope.k1Slow);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Checkbox("K2 Ramp Slowdown",&ins->es5506.envelope.k2Slow);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (ins->type==DIV_INS_MULTIPCM) {
|
||||
if (ImGui::BeginTabItem("MultiPCM")) {
|
||||
String sName;
|
||||
|
@ -3785,6 +3880,9 @@ void FurnaceGUI::drawInsEdit() {
|
|||
if (ins->type==DIV_INS_FDS) {
|
||||
volMax=32;
|
||||
}
|
||||
if (ins->type==DIV_INS_ES5506) {
|
||||
volMax=65535;
|
||||
}
|
||||
|
||||
const char* dutyLabel="Duty/Noise";
|
||||
int dutyMin=0;
|
||||
|
@ -3847,6 +3945,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
if (ins->type==DIV_INS_SU) {
|
||||
dutyMax=127;
|
||||
}
|
||||
if (ins->type==DIV_INS_ES5506) {
|
||||
dutyLabel="Filter Mode";
|
||||
dutyMax=3;
|
||||
}
|
||||
|
||||
const char* waveLabel="Waveform";
|
||||
int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_VERA)?3:255;
|
||||
|
@ -3902,6 +4004,10 @@ void FurnaceGUI::drawInsEdit() {
|
|||
ex2Max=255;
|
||||
}
|
||||
if (ins->type==DIV_INS_SAA1099) ex1Max=8;
|
||||
if (ins->type==DIV_INS_ES5506) {
|
||||
ex1Max=65535;
|
||||
ex2Max=65535;
|
||||
}
|
||||
|
||||
int panMin=0;
|
||||
int panMax=0;
|
||||
|
@ -3937,40 +4043,45 @@ void FurnaceGUI::drawInsEdit() {
|
|||
panMax=127;
|
||||
panSingleNoBit=true;
|
||||
}
|
||||
if (ins->type==DIV_INS_ES5506) {
|
||||
panMax=65535;
|
||||
}
|
||||
|
||||
if (volMax>0) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(volumeLabel,&ins->std.volMacro,volMin,volMax,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||
}
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Arpeggio",&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroAbsoluteMode,ins->std.arpMacro.mode?(¯oHoverNote):NULL));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Arpeggio",&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,true,macroAbsoluteMode,ins->std.arpMacro.mode?(¯oHoverNote):NULL));
|
||||
if (dutyMax>0) {
|
||||
if (ins->type==DIV_INS_MIKEY) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,0,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,mikeyFeedbackBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,0,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,mikeyFeedbackBits));
|
||||
} else if (ins->type==DIV_INS_ES5506) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,dutyMin,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,NULL,¯oHoverES5506FilterMode));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,dutyMin,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
}
|
||||
}
|
||||
if (waveMax>0) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc(waveLabel,&ins->std.waveMacro,0,waveMax,(bitMode && ins->type!=DIV_INS_PET)?64:160,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,bitMode,waveNames,((ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?1:0)));
|
||||
macroList.push_back(FurnaceGUIMacroDesc(waveLabel,&ins->std.waveMacro,0,waveMax,(bitMode && ins->type!=DIV_INS_PET)?64:160,uiColors[GUI_COLOR_MACRO_WAVE],false,false,macroDummyMode,NULL,bitMode,waveNames,((ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?1:0)));
|
||||
}
|
||||
if (panMax>0) {
|
||||
if (panSingle) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning",&ins->std.panLMacro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,panBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning",&ins->std.panLMacro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,panBits));
|
||||
} else {
|
||||
if (panSingleNoBit || (ins->type==DIV_INS_AMIGA && ins->std.panLMacro.mode)) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning",&ins->std.panLMacro,panMin,panMax,(31+panMax-panMin),uiColors[GUI_COLOR_MACRO_OTHER],false,(ins->type==DIV_INS_AMIGA)?macroQSoundMode:NULL));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning",&ins->std.panLMacro,panMin,panMax,(31+panMax-panMin),uiColors[GUI_COLOR_MACRO_OTHER],false,(ins->type==DIV_INS_AMIGA),macroQSoundMode));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning (left)",&ins->std.panLMacro,panMin,panMax,(31+panMax-panMin),uiColors[GUI_COLOR_MACRO_OTHER],false,(ins->type==DIV_INS_AMIGA)?macroQSoundMode:NULL));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning (left)",&ins->std.panLMacro,panMin,panMax,(31+panMax-panMin),uiColors[GUI_COLOR_MACRO_OTHER],false,(ins->type==DIV_INS_AMIGA),macroQSoundMode));
|
||||
}
|
||||
if (!panSingleNoBit) {
|
||||
if (ins->type==DIV_INS_AMIGA && ins->std.panLMacro.mode) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Surround",&ins->std.panRMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Surround",&ins->std.panRMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Panning (right)",&ins->std.panRMacro,panMin,panMax,(31+panMax-panMin),uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Pitch",&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Pitch",&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,true,macroRelativeMode));
|
||||
if (ins->type==DIV_INS_FM ||
|
||||
ins->type==DIV_INS_STD ||
|
||||
ins->type==DIV_INS_OPL ||
|
||||
|
@ -3985,22 +4096,25 @@ void FurnaceGUI::drawInsEdit() {
|
|||
ins->type==DIV_INS_SWAN ||
|
||||
ins->type==DIV_INS_MULTIPCM ||
|
||||
ins->type==DIV_INS_SU ||
|
||||
ins->type==DIV_INS_MIKEY) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Phase Reset",&ins->std.phaseResetMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
ins->type==DIV_INS_MIKEY ||
|
||||
ins->type==DIV_INS_ES5506) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Phase Reset",&ins->std.phaseResetMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
}
|
||||
if (ex1Max>0) {
|
||||
if (ins->type==DIV_INS_C64) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Filter Mode",&ins->std.ex1Macro,0,ex1Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,filtModeBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Filter Mode",&ins->std.ex1Macro,0,ex1Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,filtModeBits));
|
||||
} else if (ins->type==DIV_INS_SAA1099) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,saaEnvBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,saaEnvBits));
|
||||
} else if (ins->type==DIV_INS_X1_010) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope Mode",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,x1_010EnvBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope Mode",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,x1_010EnvBits));
|
||||
} else if (ins->type==DIV_INS_N163) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Wave Length",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_FDS) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Mod Depth",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_SU) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Cutoff",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_ES5506) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Filter K1",&ins->std.ex1Macro,((ins->std.ex1Macro.mode!=1)?(-ex1Max):0),ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,true,macroFilterMode));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Duty",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
}
|
||||
|
@ -4009,18 +4123,20 @@ void FurnaceGUI::drawInsEdit() {
|
|||
if (ins->type==DIV_INS_C64) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Resonance",&ins->std.ex2Macro,0,ex2Max,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_N163) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Wave Update",&ins->std.ex2Macro,0,ex2Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,n163UpdateBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Wave Update",&ins->std.ex2Macro,0,ex2Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,n163UpdateBits));
|
||||
} else if (ins->type==DIV_INS_FDS) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Mod Speed",&ins->std.ex2Macro,0,ex2Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_SU) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Resonance",&ins->std.ex2Macro,0,ex2Max,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
} else if (ins->type==DIV_INS_ES5506) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Filter K2",&ins->std.ex2Macro,((ins->std.ex2Macro.mode!=1)?(-ex2Max):0),ex2Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,true,macroFilterMode));
|
||||
} else {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex2Macro,0,ex2Max,ex2Bit?64:160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,ex2Bit,ayEnvBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex2Macro,0,ex2Max,ex2Bit?64:160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,ex2Bit,ayEnvBits));
|
||||
}
|
||||
}
|
||||
if (ins->type==DIV_INS_C64) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Special",&ins->std.ex3Macro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,c64SpecialBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Test/Gate",&ins->std.ex4Macro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Special",&ins->std.ex3Macro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,c64SpecialBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Test/Gate",&ins->std.ex4Macro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
}
|
||||
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_X1_010) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("AutoEnv Num",&ins->std.ex3Macro,0,15,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
|
@ -4028,22 +4144,31 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
if (ins->type==DIV_INS_AY8930) {
|
||||
// oh my i am running out of macros
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Noise AND Mask",&ins->std.fbMacro,0,8,96,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Noise OR Mask",&ins->std.fmsMacro,0,8,96,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Noise AND Mask",&ins->std.fbMacro,0,8,96,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Noise OR Mask",&ins->std.fmsMacro,0,8,96,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true));
|
||||
}
|
||||
if (ins->type==DIV_INS_N163) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("WaveLoad Wave",&ins->std.ex3Macro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("WaveLoad Pos",&ins->std.algMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("WaveLoad Len",&ins->std.fbMacro,0,252,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("WaveLoad Trigger",&ins->std.fmsMacro,0,2,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,n163UpdateBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("WaveLoad Trigger",&ins->std.fmsMacro,0,2,160,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,n163UpdateBits));
|
||||
}
|
||||
if (ins->type==DIV_INS_FDS) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Mod Position",&ins->std.ex3Macro,0,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
}
|
||||
if (ins->type==DIV_INS_SU) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Control",&ins->std.ex3Macro,0,4,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,suControlBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Control",&ins->std.ex3Macro,0,4,64,uiColors[GUI_COLOR_MACRO_OTHER],false,false,macroDummyMode,NULL,true,suControlBits));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Phase Reset Timer",&ins->std.ex4Macro,0,65535,160,uiColors[GUI_COLOR_MACRO_OTHER])); // again reuse code from resonance macro but use ex4 instead
|
||||
}
|
||||
if (ins->type==DIV_INS_ES5506) {
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope counter",&ins->std.ex3Macro,0,511,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope left volume ramp",&ins->std.ex4Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope right volume ramp",&ins->std.ex5Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope K1 ramp",&ins->std.ex6Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope K2 ramp",&ins->std.ex7Macro,-128,127,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope mode",&ins->std.ex8Macro,0,2,64,uiColors[GUI_COLOR_MACRO_OTHER],false,false,NULL,NULL,true,es5506EnvelopeModes));
|
||||
macroList.push_back(FurnaceGUIMacroDesc("Control",&ins->std.algMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,false,NULL,NULL,true,es5506ControlModes));
|
||||
}
|
||||
|
||||
drawMacros(macroList);
|
||||
ImGui::EndTabItem();
|
||||
|
|
|
@ -31,6 +31,9 @@ const int _SIXTY_FOUR=64;
|
|||
const int _ONE_HUNDRED=100;
|
||||
const int _ONE_HUNDRED_TWENTY_SEVEN=127;
|
||||
const int _TWO_HUNDRED_FIFTY_FIVE=255;
|
||||
const int _FIVE_HUNDRED_ELEVEN=511;
|
||||
const int _TWO_THOUSAND_FORTY_SEVEN=2047;
|
||||
const int _FOUR_THOUSAND_NINETY_FIVE=4095;
|
||||
const int _SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE=65535;
|
||||
const int _MINUS_ONE_HUNDRED_TWENTY_SEVEN=-127;
|
||||
const int _MINUS_ONE_HUNDRED_TWENTY_EIGHT=-128;
|
||||
|
|
|
@ -33,6 +33,9 @@ extern const int _SIXTY_FOUR;
|
|||
extern const int _ONE_HUNDRED;
|
||||
extern const int _ONE_HUNDRED_TWENTY_SEVEN;
|
||||
extern const int _TWO_HUNDRED_FIFTY_FIVE;
|
||||
extern const int _FIVE_HUNDRED_ELEVEN;
|
||||
extern const int _TWO_THOUSAND_FORTY_SEVEN;
|
||||
extern const int _FOUR_THOUSAND_NINETY_FIVE;
|
||||
extern const int _SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE;
|
||||
extern const int _MINUS_ONE_HUNDRED_TWENTY_SEVEN;
|
||||
extern const int _MINUS_ONE_HUNDRED_TWENTY_EIGHT;
|
||||
|
|
Loading…
Reference in a new issue