Merge branch 'opz-improvements'
there also was an actual bug which may have hindered freq calc... I fixed it now by moving A-4/clock pitch compensation logic to chan[i].freq instead of baseFreq
This commit is contained in:
commit
32ca799bd3
|
|
@ -362,6 +362,7 @@ void DivPlatformArcade::tick(bool sysTick) {
|
||||||
chan[i].freq+=chan[i].arpOff<<7;
|
chan[i].freq+=chan[i].arpOff<<7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
chan[i].freq+=OFFSET_LINEAR;
|
||||||
if (chan[i].freq<0) chan[i].freq=0;
|
if (chan[i].freq<0) chan[i].freq=0;
|
||||||
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
||||||
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@
|
||||||
|
|
||||||
#include "fmsharedbase.h"
|
#include "fmsharedbase.h"
|
||||||
|
|
||||||
#define NOTE_LINEAR(x) (((x)<<7)+baseFreqOff+log2(parent->song.tuning/440.0)*12.0*128.0)
|
#define NOTE_LINEAR(x) ((x)<<7)
|
||||||
|
#define OFFSET_LINEAR (baseFreqOff+log2(parent->song.tuning/440.0)*12.0*128.0)
|
||||||
|
|
||||||
|
|
||||||
class DivPlatformOPM: public DivPlatformFMBase {
|
class DivPlatformOPM: public DivPlatformFMBase {
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,16 @@ inline int hScale(int note) {
|
||||||
return ((note/12)<<4)+(noteMap[note%12]);
|
return ((note/12)<<4)+(noteMap[note%12]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DivPlatformTX81Z::toFreq(int freq) {
|
||||||
|
int block=0;
|
||||||
|
while (freq>0xff) {
|
||||||
|
freq>>=1;
|
||||||
|
block++;
|
||||||
|
}
|
||||||
|
if (block>7) return 0x7ff;
|
||||||
|
return ((block&7)<<8)|(freq&0xff);
|
||||||
|
}
|
||||||
|
|
||||||
void DivPlatformTX81Z::tick(bool sysTick) {
|
void DivPlatformTX81Z::tick(bool sysTick) {
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
chan[i].std.next();
|
chan[i].std.next();
|
||||||
|
|
@ -289,6 +299,54 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
||||||
op.dt2=m.dt2.val;
|
op.dt2=m.dt2.val;
|
||||||
rWrite(baseAddr+ADDR_DT2_D2R,(op.d2r&31)|(op.dt2<<6));
|
rWrite(baseAddr+ADDR_DT2_D2R,(op.d2r&31)|(op.dt2<<6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fixed pitch
|
||||||
|
if (parent->song.linearPitch==2) {
|
||||||
|
bool freqChangeOp=false;
|
||||||
|
|
||||||
|
if (op.egt) {
|
||||||
|
if (op.sus) {
|
||||||
|
chan[i].handleArpFmOp(freqChangeOp,0,j); // arp and pitch macros
|
||||||
|
chan[i].handlePitchFmOp(freqChangeOp,j);
|
||||||
|
} else {
|
||||||
|
if (m.ssg.had) { // block and f-num macros
|
||||||
|
op.dt=m.ssg.val&7;
|
||||||
|
rWrite(baseAddr+ADDR_MULT_DT,(op.mult&15)|((op.egt?(op.dt&7):dtTable[op.dt&7])<<4));
|
||||||
|
}
|
||||||
|
if (m.sus.had) {
|
||||||
|
op.mult=(m.sus.val&0xff)>>4;
|
||||||
|
op.dvb=(m.sus.val&0xf);
|
||||||
|
rWrite(baseAddr+ADDR_MULT_DT,(op.mult&15)|((op.egt?(op.dt&7):dtTable[op.dt&7])<<4));
|
||||||
|
rWrite(baseAddr+ADDR_WS_FINE,(op.dvb&15)|(op.ws<<4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (freqChangeOp) {
|
||||||
|
int arp=chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff;
|
||||||
|
int pitch2=chan[i].pitch2;
|
||||||
|
int fixedArp=chan[i].fixedArp;
|
||||||
|
if (chan[i].opsState[j].hasOpArp) {
|
||||||
|
arp=chan[i].opsState[j].fixedArp?chan[i].opsState[j].baseNoteOverride:chan[i].opsState[j].arpOff;
|
||||||
|
fixedArp=chan[i].opsState[j].fixedArp;
|
||||||
|
}
|
||||||
|
if (chan[i].opsState[j].hasOpPitch) {
|
||||||
|
pitch2=chan[i].opsState[j].pitch2;
|
||||||
|
}
|
||||||
|
int opFreq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,arp,fixedArp,false,2, pitch2,32.0,COLOR_NTSC/chipClock,0);
|
||||||
|
if (opFreq<0) opFreq=0;
|
||||||
|
if (opFreq>65280) opFreq=65280;
|
||||||
|
int freqt=toFreq(opFreq);
|
||||||
|
|
||||||
|
op.dt=(freqt>>8)&7;
|
||||||
|
|
||||||
|
op.mult=(freqt&0xff)>>4;
|
||||||
|
op.dvb=(freqt&0xf);
|
||||||
|
|
||||||
|
rWrite(baseAddr+ADDR_MULT_DT,(op.mult&15)|((op.egt?(op.dt&7):dtTable[op.dt&7])<<4));
|
||||||
|
rWrite(baseAddr+ADDR_WS_FINE,(op.dvb&15)|(op.ws<<4));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -345,6 +403,7 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
||||||
chan[i].freq+=chan[i].arpOff<<7;
|
chan[i].freq+=chan[i].arpOff<<7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
chan[i].freq+=OFFSET_LINEAR;
|
||||||
if (chan[i].freq<0) chan[i].freq=0;
|
if (chan[i].freq<0) chan[i].freq=0;
|
||||||
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
||||||
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
||||||
|
|
@ -444,6 +503,7 @@ int DivPlatformTX81Z::dispatch(DivCommand c) {
|
||||||
case DIV_CMD_NOTE_ON: {
|
case DIV_CMD_NOTE_ON: {
|
||||||
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_OPZ);
|
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_OPZ);
|
||||||
|
|
||||||
|
memset(chan[c.chan].opsState,0,sizeof(chan[c.chan].opsState));
|
||||||
chan[c.chan].macroInit(ins);
|
chan[c.chan].macroInit(ins);
|
||||||
if (!chan[c.chan].std.vol.will) {
|
if (!chan[c.chan].std.vol.will) {
|
||||||
chan[c.chan].outVol=chan[c.chan].vol;
|
chan[c.chan].outVol=chan[c.chan].vol;
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,67 @@ class DivPlatformTX81Z: public DivPlatformOPM {
|
||||||
|
|
||||||
struct Channel: public FMChannel {
|
struct Channel: public FMChannel {
|
||||||
unsigned char chVolL, chVolR;
|
unsigned char chVolL, chVolR;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int baseNoteOverride;
|
||||||
|
bool fixedArp;
|
||||||
|
int arpOff;
|
||||||
|
int pitch2;
|
||||||
|
bool hasOpArp;
|
||||||
|
bool hasOpPitch;
|
||||||
|
} opsState[4];
|
||||||
|
|
||||||
|
void handleArpFmOp(bool& freqChange, int offset=0, int o=0) {
|
||||||
|
DivMacroInt::IntOp& m=this->std.op[o];
|
||||||
|
if (m.ssg.had) {
|
||||||
|
opsState[o].hasOpArp=true;
|
||||||
|
|
||||||
|
if (m.ssg.val<0) {
|
||||||
|
if (!(m.ssg.val&0x40000000)) {
|
||||||
|
opsState[o].baseNoteOverride=(m.ssg.val|0x40000000)+offset;
|
||||||
|
opsState[o].fixedArp=true;
|
||||||
|
} else {
|
||||||
|
opsState[o].arpOff=m.ssg.val;
|
||||||
|
opsState[o].fixedArp=false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (m.ssg.val&0x40000000) {
|
||||||
|
opsState[o].baseNoteOverride=(m.ssg.val&(~0x40000000))+offset;
|
||||||
|
opsState[o].fixedArp=true;
|
||||||
|
} else {
|
||||||
|
opsState[o].arpOff=m.ssg.val;
|
||||||
|
opsState[o].fixedArp=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
freqChange=true;
|
||||||
|
} else {
|
||||||
|
opsState[o].hasOpArp=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void handlePitchFmOp(bool& freqChange, int o) {
|
||||||
|
DivMacroInt::IntOp& m=this->std.op[o];
|
||||||
|
|
||||||
|
if (m.sus.had) {
|
||||||
|
opsState[o].hasOpPitch=true;
|
||||||
|
|
||||||
|
if (m.sus.mode) {
|
||||||
|
opsState[o].pitch2+=m.sus.val;
|
||||||
|
CLAMP_VAR(opsState[o].pitch2,-131071,131071);
|
||||||
|
} else {
|
||||||
|
opsState[o].pitch2=m.sus.val;
|
||||||
|
}
|
||||||
|
freqChange=true;
|
||||||
|
} else {
|
||||||
|
opsState[o].hasOpPitch=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Channel():
|
Channel():
|
||||||
FMChannel(),
|
FMChannel(),
|
||||||
chVolL(1),
|
chVolL(1),
|
||||||
chVolR(1) {}
|
chVolR(1) {
|
||||||
|
memset(opsState,0,sizeof(opsState));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Channel chan[8];
|
Channel chan[8];
|
||||||
DivDispatchOscBuffer* oscBuf[8];
|
DivDispatchOscBuffer* oscBuf[8];
|
||||||
|
|
|
||||||
|
|
@ -4431,7 +4431,10 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
if (ins->type==DIV_INS_OPZ) {
|
if (ins->type==DIV_INS_OPZ) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
CENTER_VSLIDER;
|
CENTER_VSLIDER;
|
||||||
P(CWVSliderScalar("##FINE",ImVec2(20.0f*dpiScale,sliderHeight),ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN)); rightClickable
|
bool egtOn=op.egt;
|
||||||
|
if (!egtOn) {
|
||||||
|
P(CWVSliderScalar("##FINE",ImVec2(20.0f*dpiScale,sliderHeight),ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN)); rightClickable
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ins->type==DIV_INS_ESFM) {
|
if (ins->type==DIV_INS_ESFM) {
|
||||||
|
|
@ -4460,8 +4463,9 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
bool amOn=op.am;
|
bool amOn=op.am;
|
||||||
if (ins->type==DIV_INS_OPZ) {
|
if (ins->type==DIV_INS_OPZ) {
|
||||||
bool egtOn=op.egt;
|
bool egtOn=op.egt;
|
||||||
|
bool susOn=op.sus;
|
||||||
if (egtOn) {
|
if (egtOn) {
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*4.0-ImGui::GetStyle().ItemSpacing.y*3.0));
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*4.0-ImGui::GetStyle().ItemSpacing.y*3.5));
|
||||||
} else {
|
} else {
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*2.0-ImGui::GetStyle().ItemSpacing.y*1.0));
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*2.0-ImGui::GetStyle().ItemSpacing.y*1.0));
|
||||||
}
|
}
|
||||||
|
|
@ -4472,6 +4476,23 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
op.egt=egtOn;
|
op.egt=egtOn;
|
||||||
}
|
}
|
||||||
if (egtOn) {
|
if (egtOn) {
|
||||||
|
pushWarningColor(susOn && e->song.linearPitch!=2);
|
||||||
|
if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER
|
||||||
|
op.sus=susOn;
|
||||||
|
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||||
|
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||||
|
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||||
|
}
|
||||||
|
popWarningColor();
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
if (susOn && e->song.linearPitch!=2) {
|
||||||
|
ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full."));
|
||||||
|
} else {
|
||||||
|
ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (egtOn && !susOn) {
|
||||||
int block=op.dt;
|
int block=op.dt;
|
||||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||||
if (ImGui::InputInt(_("Block"),&block,1,1)) {
|
if (ImGui::InputInt(_("Block"),&block,1,1)) {
|
||||||
|
|
@ -5076,27 +5097,29 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
// params
|
// params
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (egtOn) {
|
if (egtOn) {
|
||||||
int block=op.dt;
|
if (!op.sus) {
|
||||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
int block=op.dt;
|
||||||
ImGui::Text(_("Block"));
|
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||||
ImGui::SameLine();
|
ImGui::Text(_("Block"));
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SameLine();
|
||||||
ImVec2 cursorAlign=ImGui::GetCursorPos();
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
if (ImGui::InputInt("##Block",&block,1,1)) {
|
ImVec2 cursorAlign=ImGui::GetCursorPos();
|
||||||
if (block<0) block=0;
|
if (ImGui::InputInt("##Block",&block,1,1)) {
|
||||||
if (block>7) block=7;
|
if (block<0) block=0;
|
||||||
op.dt=block;
|
if (block>7) block=7;
|
||||||
}
|
op.dt=block;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Text(_("Freq"));
|
ImGui::Text(_("Freq"));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetCursorPos(ImVec2(cursorAlign.x,ImGui::GetCursorPosY()));
|
ImGui::SetCursorPos(ImVec2(cursorAlign.x,ImGui::GetCursorPosY()));
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
if (ImGui::InputInt("##FreqNum",&freqNum,1,16)) {
|
if (ImGui::InputInt("##FreqNum",&freqNum,1,16)) {
|
||||||
if (freqNum<0) freqNum=0;
|
if (freqNum<0) freqNum=0;
|
||||||
if (freqNum>255) freqNum=255;
|
if (freqNum>255) freqNum=255;
|
||||||
op.mult=freqNum>>4;
|
op.mult=freqNum>>4;
|
||||||
op.dvb=freqNum&15;
|
op.dvb=freqNum&15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
|
@ -5117,7 +5140,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
snprintf(tempID,1024,"%s: %%d",FM_NAME(FM_DT2));
|
snprintf(tempID,1024,"%s: %%d",FM_NAME(FM_DT2));
|
||||||
P(CWSliderScalar("##DT2",ImGuiDataType_U8,&op.dt2,&_ZERO,&_THREE,tempID)); rightClickable
|
P(CWSliderScalar("##DT2",ImGuiDataType_U8,&op.dt2,&_ZERO,&_THREE,tempID)); rightClickable
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip(_("Only on YM2151 (OPM)"));
|
ImGui::SetTooltip(_("Only on YM2151 and YM2414 (OPM and OPZ)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
|
@ -5220,6 +5243,23 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
snprintf(tempID,1024,"%s: %%d",FM_NAME(FM_FINE));
|
snprintf(tempID,1024,"%s: %%d",FM_NAME(FM_FINE));
|
||||||
P(CWSliderScalar("##FINE",ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN,tempID)); rightClickable
|
P(CWSliderScalar("##FINE",ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN,tempID)); rightClickable
|
||||||
|
} else {
|
||||||
|
bool susOn=op.sus;
|
||||||
|
pushWarningColor(susOn && e->song.linearPitch!=2);
|
||||||
|
if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER
|
||||||
|
op.sus=susOn;
|
||||||
|
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||||
|
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||||
|
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||||
|
}
|
||||||
|
popWarningColor();
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
if (susOn && e->song.linearPitch!=2) {
|
||||||
|
ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full."));
|
||||||
|
} else {
|
||||||
|
ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
@ -5525,6 +5565,25 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
if (ImGui::Checkbox(_("Fixed"),&fixedOn)) { PARAMETER
|
if (ImGui::Checkbox(_("Fixed"),&fixedOn)) { PARAMETER
|
||||||
op.egt=fixedOn;
|
op.egt=fixedOn;
|
||||||
}
|
}
|
||||||
|
bool susOn=op.sus;
|
||||||
|
if (fixedOn) {
|
||||||
|
ImGui::SameLine();
|
||||||
|
pushWarningColor(susOn && e->song.linearPitch!=2);
|
||||||
|
if (ImGui::Checkbox(_("Pitch control"),&susOn)) { PARAMETER
|
||||||
|
op.sus=susOn;
|
||||||
|
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||||
|
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||||
|
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||||
|
}
|
||||||
|
popWarningColor();
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
if (susOn && e->song.linearPitch!=2) {
|
||||||
|
ImGui::SetTooltip(_("only works on linear pitch! go to Compatibility Flags > Pitch/Playback and set Pitch linearity to Full."));
|
||||||
|
} else {
|
||||||
|
ImGui::SetTooltip(_("use op's arpeggio and pitch macros control instead of block/f-num macros"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//52.0 controls vert scaling; default 96
|
//52.0 controls vert scaling; default 96
|
||||||
|
|
@ -5643,31 +5702,34 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
||||||
|
|
||||||
if (ins->type==DIV_INS_OPZ) {
|
if (ins->type==DIV_INS_OPZ) {
|
||||||
if (op.egt) {
|
if (op.egt) {
|
||||||
int block=op.dt;
|
bool susOn=op.sus;
|
||||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
if (!susOn) {
|
||||||
|
int block=op.dt;
|
||||||
|
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||||
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
if (CWSliderInt(FM_NAME(FM_MULT),&block,0,7)) { PARAMETER
|
if (CWSliderInt(FM_NAME(FM_MULT),&block,0,7)) { PARAMETER
|
||||||
if (block<0) block=0;
|
if (block<0) block=0;
|
||||||
if (block>7) block=7;
|
if (block>7) block=7;
|
||||||
op.dt=block;
|
op.dt=block;
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("Block");
|
ImGui::Text("Block");
|
||||||
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
if (CWSliderInt(FM_NAME(FM_FINE),&freqNum,0,255)) { PARAMETER
|
if (CWSliderInt(FM_NAME(FM_FINE),&freqNum,0,255)) { PARAMETER
|
||||||
if (freqNum<0) freqNum=0;
|
if (freqNum<0) freqNum=0;
|
||||||
if (freqNum>255) freqNum=255;
|
if (freqNum>255) freqNum=255;
|
||||||
op.mult=freqNum>>4;
|
op.mult=freqNum>>4;
|
||||||
op.dvb=freqNum&15;
|
op.dvb=freqNum&15;
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text(_("FreqNum"));
|
ImGui::Text(_("FreqNum"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
@ -6636,6 +6698,13 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
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_EGS),&ins->std.opMacros[ordi].egtMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||||
} else if (ins->type==DIV_INS_ESFM) {
|
} else if (ins->type==DIV_INS_ESFM) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
|
if (ins->esfm.op[ordi].fixed) {
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Block"),&ins->std.opMacros[ordi].ssgMacro,0,7,64,uiColors[GUI_COLOR_MACRO_PITCH],true));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("FreqNum"),&ins->std.opMacros[ordi].dtMacro,0,1023,160,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
|
} else {
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Arpeggio"),&ins->std.opMacros[ordi].ssgMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.opMacros[ordi].ssgMacro.val,true));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Pitch"),&ins->std.opMacros[ordi].dtMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode,NULL,false,NULL,false,NULL,false,true));
|
||||||
|
}
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_DELAY),&ins->std.opMacros[ordi].dt2Macro,0,7,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_DELAY),&ins->std.opMacros[ordi].dt2Macro,0,7,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DR),&ins->std.opMacros[ordi].drMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DR),&ins->std.opMacros[ordi].drMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
|
@ -6646,14 +6715,6 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
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_WS),&ins->std.opMacros[ordi].wsMacro,0,7,64,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_OUTLVL),&ins->std.opMacros[ordi].egtMacro,0,7,64,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_OUTLVL),&ins->std.opMacros[ordi].egtMacro,0,7,64,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_MODIN),&ins->std.opMacros[ordi].d2rMacro,0,7,64,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
macroList.push_back(FurnaceGUIMacroDesc(ESFM_NAME(ESFM_MODIN),&ins->std.opMacros[ordi].d2rMacro,0,7,64,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
if (ins->esfm.op[ordi].fixed) {
|
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(_("Block"),&ins->std.opMacros[ordi].ssgMacro,0,7,64,uiColors[GUI_COLOR_MACRO_PITCH],true));
|
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(_("FreqNum"),&ins->std.opMacros[ordi].dtMacro,0,1023,160,uiColors[GUI_COLOR_MACRO_PITCH]));
|
|
||||||
} else {
|
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Arpeggio"),&ins->std.opMacros[ordi].ssgMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.opMacros[ordi].ssgMacro.val,true));
|
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Pitch"),&ins->std.opMacros[ordi].dtMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode,NULL,false,NULL,false,NULL,false,true));
|
|
||||||
}
|
|
||||||
|
|
||||||
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,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_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_DAM),&ins->std.opMacros[ordi].damMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DAM),&ins->std.opMacros[ordi].damMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||||
|
|
@ -6661,7 +6722,7 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
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_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_SUS),&ins->std.opMacros[ordi].susMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Panning"),&ins->std.opMacros[ordi].rsMacro,0,2,40,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,panBits));
|
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Panning"),&ins->std.opMacros[ordi].rsMacro,0,2,40,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,panBits));
|
||||||
} else {
|
} else if (ins->type==DIV_INS_FM || ins->type==DIV_INS_OPM) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DR),&ins->std.opMacros[ordi].drMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DR),&ins->std.opMacros[ordi].drMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
|
@ -6671,7 +6732,7 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_RS),&ins->std.opMacros[ordi].rsMacro,0,3,32,uiColors[GUI_COLOR_MACRO_OTHER]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_RS),&ins->std.opMacros[ordi].rsMacro,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_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_PITCH]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT),&ins->std.opMacros[ordi].dtMacro,0,7,64,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
if (ins->type==DIV_INS_OPM || ins->type==DIV_INS_OPZ) {
|
if (ins->type==DIV_INS_OPM) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT2),&ins->std.opMacros[ordi].dt2Macro,0,3,32,uiColors[GUI_COLOR_MACRO_PITCH]));
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT2),&ins->std.opMacros[ordi].dt2Macro,0,3,32,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
}
|
}
|
||||||
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,NULL,NULL,true));
|
||||||
|
|
@ -6679,6 +6740,28 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
if (ins->type==DIV_INS_FM) {
|
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_ENVELOPE],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_ENVELOPE],false,NULL,NULL,true,ssgEnvBits));
|
||||||
}
|
}
|
||||||
|
} else if (ins->type==DIV_INS_OPZ) {
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_TL),&ins->std.opMacros[ordi].tlMacro,0,maxTl,128,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
|
if (ins->fm.op[ordi].egt) {
|
||||||
|
if (!ins->fm.op[ordi].sus) {
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Block"),&ins->std.opMacros[ordi].ssgMacro,0,7,64,uiColors[GUI_COLOR_MACRO_PITCH],true));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("FreqNum"),&ins->std.opMacros[ordi].susMacro,0,255,160,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
|
} else {
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Arpeggio"),&ins->std.opMacros[ordi].ssgMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.opMacros[ordi].ssgMacro.val,true));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(_("Op. Pitch"),&ins->std.opMacros[ordi].susMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode,NULL,false,NULL,false,NULL,false,true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_AR),&ins->std.opMacros[ordi].arMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DR),&ins->std.opMacros[ordi].drMacro,0,maxArDr,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_D2R),&ins->std.opMacros[ordi].d2rMacro,0,31,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_RR),&ins->std.opMacros[ordi].rrMacro,0,15,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_SL),&ins->std.opMacros[ordi].slMacro,0,15,64,uiColors[GUI_COLOR_MACRO_ENVELOPE]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_RS),&ins->std.opMacros[ordi].rsMacro,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_DT),&ins->std.opMacros[ordi].dtMacro,0,7,64,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc(FM_NAME(FM_DT2),&ins->std.opMacros[ordi].dt2Macro,0,3,32,uiColors[GUI_COLOR_MACRO_PITCH]));
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
drawMacros(macroList,macroEditStateOP[ordi]);
|
drawMacros(macroList,macroEditStateOP[ordi]);
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue