separate VRC6 and VRC6 saw ins types

This commit is contained in:
tildearrow 2022-03-31 15:25:58 -05:00
parent f689409f02
commit d321292543
9 changed files with 30 additions and 14 deletions

View File

@ -29,6 +29,7 @@ furthermore, an `or reserved` indicates this field is always present, but is res
the format versions are:
- 74: Furnace dev74
- 73: Furnace dev73
- 72: Furnace dev72
- 71: Furnace dev71

View File

@ -42,8 +42,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev73"
#define DIV_ENGINE_VERSION 73
#define DIV_VERSION "dev74"
#define DIV_ENGINE_VERSION 74
// for imports
#define DIV_VERSION_MOD 0xff01

View File

@ -53,6 +53,7 @@ enum DivInstrumentType {
DIV_INS_MIKEY=23,
DIV_INS_VERA=24,
DIV_INS_X1_010=25,
DIV_INS_VRC6_SAW=26,
DIV_INS_MAX,
};

View File

@ -128,6 +128,10 @@ void FurnaceGUI::drawInsList() {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VRC6]);
name=fmt::sprintf(ICON_FA_BAR_CHART " %.2X: %s##_INS%d",i,ins->name,i);
break;
case DIV_INS_VRC6_SAW:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VRC6_SAW]);
name=fmt::sprintf(ICON_FA_BAR_CHART " %.2X: %s##_INS%d",i,ins->name,i);
break;
case DIV_INS_OPLL:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPLL]);
name=fmt::sprintf(ICON_FA_AREA_CHART " %.2X: %s##_INS%d",i,ins->name,i);
@ -364,4 +368,4 @@ void FurnaceGUI::actualSampleList() {
}
}
}
}
}

View File

@ -764,7 +764,7 @@ void FurnaceGUI::stopPreviewNote(SDL_Scancode scancode, bool autoNote) {
}
}
void FurnaceGUI::noteInput(int num, int key) {
void FurnaceGUI::noteInput(int num, int key, int vol) {
DivPattern* pat=e->song.pat[cursor.xCoarse].getPattern(e->song.orders.ord[cursor.xCoarse][e->getOrder()],true);
prepareUndo(GUI_UNDO_PATTERN_EDIT);
@ -791,9 +791,11 @@ void FurnaceGUI::noteInput(int num, int key) {
} else if (latchIns!=-1 && !e->song.ins.empty()) {
pat->data[cursor.y][2]=MIN(((int)e->song.ins.size())-1,latchIns);
}
int maxVol=e->getMaxVolumeChan(cursor.xCoarse);
if (latchVol!=-1) {
int maxVol=e->getMaxVolumeChan(cursor.xCoarse);
pat->data[cursor.y][3]=MIN(maxVol,latchVol);
} else if (vol!=-1) {
pat->data[cursor.y][3]=(vol*maxVol)/127;
}
if (latchEffect!=-1) pat->data[cursor.y][4]=latchEffect;
if (latchEffectVal!=-1) pat->data[cursor.y][5]=latchEffectVal;
@ -1931,8 +1933,11 @@ bool FurnaceGUI::loop() {
} else switch (msg.type&0xf0) {
case TA_MIDI_NOTE_ON:
if (edit && msg.data[1]!=0) {
noteInput(msg.data[0]-12,0);
// TODO volume input
noteInput(
msg.data[0]-12,
0,
midiMap.volInput?((int)(pow((double)msg.data[2]/127.0,midiMap.volExp)*127.0)):-1
);
}
break;
case TA_MIDI_PROGRAM:

View File

@ -95,6 +95,7 @@ enum FurnaceGUIColors {
GUI_COLOR_INSTR_VIC,
GUI_COLOR_INSTR_PET,
GUI_COLOR_INSTR_VRC6,
GUI_COLOR_INSTR_VRC6_SAW,
GUI_COLOR_INSTR_OPLL,
GUI_COLOR_INSTR_OPL,
GUI_COLOR_INSTR_FDS,
@ -980,7 +981,7 @@ class FurnaceGUI {
void doUndo();
void doRedo();
void editOptions(bool topMenu);
void noteInput(int num, int key);
void noteInput(int num, int key, int vol=-1);
void doUndoSample();
void doRedoSample();

View File

@ -92,7 +92,8 @@ const char* insTypes[DIV_INS_MAX]={
"WonderSwan",
"Atari Lynx",
"VERA",
"X1-010"
"X1-010",
"VRC6 (saw)"
};
const char* sampleDepths[17]={

View File

@ -2091,7 +2091,7 @@ void FurnaceGUI::drawInsEdit() {
if ((ins->type==DIV_INS_PCE || ins->type==DIV_INS_AY8930)) {
volMax=31;
}
if (ins->type==DIV_INS_OPL || ins->type==DIV_INS_VERA || ins->type==DIV_INS_VRC6) {
if (ins->type==DIV_INS_OPL || ins->type==DIV_INS_VERA || ins->type==DIV_INS_VRC6_SAW) {
volMax=63;
}
if (ins->type==DIV_INS_AMIGA) {
@ -2128,9 +2128,9 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_FM) {
dutyLabel="Noise Freq";
}
if (ins->type == DIV_INS_MIKEY) {
dutyLabel = "Duty/Int";
dutyMax = 10;
if (ins->type==DIV_INS_MIKEY) {
dutyLabel="Duty/Int";
dutyMax=10;
}
if (ins->type==DIV_INS_AY8930) {
dutyMax=255;
@ -2145,7 +2145,7 @@ void FurnaceGUI::drawInsEdit() {
dutyLabel="Noise";
dutyMax=8;
}
if (ins->type==DIV_INS_OPLL || ins->type==DIV_INS_OPL) {
if (ins->type==DIV_INS_OPLL || ins->type==DIV_INS_OPL || ins->type==DIV_INS_VRC6_SAW) {
dutyMax=0;
}
if (ins->type==DIV_INS_VERA) {

View File

@ -803,6 +803,7 @@ void FurnaceGUI::drawSettings() {
UI_COLOR_CONFIG(GUI_COLOR_INSTR_VIC,"VIC");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_PET,"PET");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_VRC6,"VRC6");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_VRC6_SAW,"VRC6 (saw)");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_OPLL,"FM (OPLL)");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_OPL,"FM (OPL)");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_FDS,"FDS");
@ -1581,6 +1582,7 @@ void FurnaceGUI::commitSettings() {
PUT_UI_COLOR(GUI_COLOR_INSTR_VIC);
PUT_UI_COLOR(GUI_COLOR_INSTR_PET);
PUT_UI_COLOR(GUI_COLOR_INSTR_VRC6);
PUT_UI_COLOR(GUI_COLOR_INSTR_VRC6_SAW);
PUT_UI_COLOR(GUI_COLOR_INSTR_OPLL);
PUT_UI_COLOR(GUI_COLOR_INSTR_OPL);
PUT_UI_COLOR(GUI_COLOR_INSTR_FDS);
@ -1972,6 +1974,7 @@ void FurnaceGUI::applyUISettings() {
GET_UI_COLOR(GUI_COLOR_INSTR_VIC,ImVec4(0.2f,1.0f,0.6f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_PET,ImVec4(1.0f,1.0f,0.8f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_VRC6,ImVec4(1.0f,0.9f,0.5f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_VRC6_SAW,ImVec4(0.8f,0.3f,0.0f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_OPLL,ImVec4(0.6f,0.7f,1.0f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_OPL,ImVec4(0.3f,1.0f,0.9f,1.0f));
GET_UI_COLOR(GUI_COLOR_INSTR_FDS,ImVec4(0.8f,0.5f,1.0f,1.0f));