PowerNoise: and now implement it
This commit is contained in:
parent
3548226e46
commit
bf3353ebb8
|
|
@ -206,6 +206,7 @@ void DivPlatformPowerNoise::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER);
|
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER);
|
||||||
|
chan[i].freq>>=chan[i].octaveOff;
|
||||||
|
|
||||||
if (chan[i].freq<0) chan[i].freq=0;
|
if (chan[i].freq<0) chan[i].freq=0;
|
||||||
if (chan[i].freq>0x7ffffff) chan[i].freq=0x7ffffff;
|
if (chan[i].freq>0x7ffffff) chan[i].freq=0x7ffffff;
|
||||||
|
|
@ -268,6 +269,9 @@ int DivPlatformPowerNoise::dispatch(DivCommand c) {
|
||||||
chan[c.chan].freqChanged=true;
|
chan[c.chan].freqChanged=true;
|
||||||
chan[c.chan].note=c.value;
|
chan[c.chan].note=c.value;
|
||||||
}
|
}
|
||||||
|
if (chan[c.chan].insChanged) {
|
||||||
|
chan[c.chan].octaveOff=ins->powernoise.octave;
|
||||||
|
}
|
||||||
chan[c.chan].active=true;
|
chan[c.chan].active=true;
|
||||||
chan[c.chan].macroInit(ins);
|
chan[c.chan].macroInit(ins);
|
||||||
if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) {
|
if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class DivPlatformPowerNoise: public DivDispatch {
|
||||||
struct Channel: public SharedChannel<signed char> {
|
struct Channel: public SharedChannel<signed char> {
|
||||||
int fNum;
|
int fNum;
|
||||||
unsigned short initLFSR;
|
unsigned short initLFSR;
|
||||||
unsigned char octave, pan, tapA, tapB;
|
unsigned char octave, pan, tapA, tapB, octaveOff;
|
||||||
bool slope, am, tapBEnable, keyOn, keyOff;
|
bool slope, am, tapBEnable, keyOn, keyOff;
|
||||||
SlopePortion slopeA, slopeB;
|
SlopePortion slopeA, slopeB;
|
||||||
|
|
||||||
|
|
@ -58,6 +58,7 @@ class DivPlatformPowerNoise: public DivDispatch {
|
||||||
pan(255),
|
pan(255),
|
||||||
tapA(1),
|
tapA(1),
|
||||||
tapB(2),
|
tapB(2),
|
||||||
|
octaveOff(0),
|
||||||
slope(false),
|
slope(false),
|
||||||
am(false),
|
am(false),
|
||||||
tapBEnable(false),
|
tapBEnable(false),
|
||||||
|
|
|
||||||
|
|
@ -7295,6 +7295,18 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
drawMacros(macroList,macroEditStateMacros);
|
drawMacros(macroList,macroEditStateMacros);
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
|
if (ins->type==DIV_INS_POWERNOISE) {
|
||||||
|
if (ImGui::BeginTabItem("PowerNoise")) {
|
||||||
|
int pnOctave=ins->powernoise.octave;
|
||||||
|
if (ImGui::InputInt("Octave offset",&pnOctave,1,4)) { PARAMETER
|
||||||
|
if (pnOctave<0) pnOctave=0;
|
||||||
|
if (pnOctave>15) pnOctave=15;
|
||||||
|
ins->powernoise.octave=pnOctave;
|
||||||
|
}
|
||||||
|
ImGui::Text("go to Macros for other parameters.");
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ins->type==DIV_INS_NES ||
|
if (ins->type==DIV_INS_NES ||
|
||||||
ins->type==DIV_INS_AY ||
|
ins->type==DIV_INS_AY ||
|
||||||
ins->type==DIV_INS_AY8930 ||
|
ins->type==DIV_INS_AY8930 ||
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue