diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01817d11b..fe4d4579e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,8 @@ jobs: - { name: 'Windows MSVC x86_64', os: windows-latest, compiler: msvc, arch: x86_64 } #- { name: 'Windows MinGW x86', os: ubuntu-20.04, compiler: mingw, arch: x86 } #- { name: 'Windows MinGW x86_64', os: ubuntu-20.04, compiler: mingw, arch: x86_64 } - - { name: 'macOS x86_64', os: macos-latest, arch: x86_64 } - - { name: 'macOS ARM', os: macos-latest, arch: arm64 } + #- { name: 'macOS x86_64', os: macos-latest, arch: x86_64 } + #- { name: 'macOS ARM', os: macos-latest, arch: arm64 } - { name: 'Linux x86_64', os: ubuntu-20.04, arch: x86_64 } #- { name: 'Linux ARM', os: ubuntu-18.04, arch: armhf } fail-fast: false diff --git a/doc/4-instrument/README.md b/doc/4-instrument/README.md index b85c957e5..56386082a 100644 --- a/doc/4-instrument/README.md +++ b/doc/4-instrument/README.md @@ -126,14 +126,25 @@ finally, the sequence of values can be directly edited in the text box at the bo - in arpeggio macros, a value starting with a `@` is a fixed value as described above. - in bitmask-style macros, the values are added up in binary and converted to decimal. see [the hexadecimal guide](../1-intro/hex.md) for more info. - +in all cases except bitmask macros, right-clicking on the graph opens up an editing menu: +- **copy**: copies the macro. +- **paste**: pastes the macro in the clipboard. +- **clear**: clears the macro. +- **clear contents**: resets all values to 0. +- **offset**: + - **X**: slides the data "horizontally" within the macro, filling the gap with zeroes. data moved past the start or end is lost. + - **Y**: increases or decreases all values, clipping them if they would move past the allowed range. +- **scale**: + - **X**: stretches the macro. + - **Y**: multiplies all values by the scale factor, clipping them if they would exceed the allowed range. +- **randomize**: replaces all values with random values between **Min** and **Max**. ### ADSR ![ADSR macro editor](macro-ADSR.png) - **Bottom** and **Top** determine the range of outputs generated by the macro. (Bottom can be larger than Top to invert the envelope!) All outputs will be between these two values. -- attack, Decay, Sustain, SusDecay, and Release accept inputs between 0 to 255. these are scaled to the distance between Bottom and Top. +- Attack, Decay, Sustain, SusDecay, and Release accept inputs between 0 to 255. these are scaled to the distance between Bottom and Top. - **Attack** is how much the value moves toward Top with each tick. - **Hold** sets how many ticks to stay at Top before Decay. - **Decay** is how much the value moves to the Sustain level. diff --git a/doc/4-instrument/wavetable.png b/doc/4-instrument/wavetable.png index 64589ae04..8ab9d7857 100644 Binary files a/doc/4-instrument/wavetable.png and b/doc/4-instrument/wavetable.png differ diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index bfdcf6883..6dcb6171e 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -48,7 +48,9 @@ enum DivDispatchCmds { DIV_CMD_ENV_RELEASE, DIV_CMD_INSTRUMENT, // (ins, force) DIV_CMD_VOLUME, // (vol) + // TODO: think of possibly moving this DIV_CMD_GET_VOLUME, // () -> vol + // TODO: move. shouldn't be a command. DIV_CMD_GET_VOLMAX, // () -> volMax DIV_CMD_NOTE_PORTA, // (target, speed) -> 2 if target reached DIV_CMD_PITCH, // (pitch) @@ -589,6 +591,14 @@ class DivDispatch { */ virtual bool isVolGlobal(); + /** + * map MIDI velocity (from 0 to 127) to chip volume. + * @param ch the chip channel. -1 means N/A. + * @param vel input velocity. + * @return output volume. + */ + virtual int mapVelocity(int ch, unsigned char vel); + /** * get the lowest note in a portamento. * @param ch the channel in question. diff --git a/src/engine/engine.h b/src/engine/engine.h index 4ffe7744b..db8cb7b34 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -190,7 +190,7 @@ struct DivNoteEvent { channel(-1), ins(0), note(0), - volume(0), + volume(-1), on(false), nop(true), pad1(false), diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index e0b0229cb..aaa27a494 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -102,6 +102,11 @@ bool DivDispatch::isVolGlobal() { return false; } +int DivDispatch::mapVelocity(int ch, unsigned char vel) { + const int volMax=MAX(1,dispatch(DivCommand(DIV_CMD_GET_VOLMAX,MAX(ch,0)))); + return (vel*volMax)/127; +} + int DivDispatch::getPortaFloor(int ch) { return 0x00; } diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 6aa17ef45..d2a0db179 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1372,7 +1372,11 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) { } if (note.on) { dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1)); - //dispatchCmd(DivCommand(DIV_CMD_VOLUME,note.channel,(note.volume*(chan[note.channel].volMax>>8))/127)); + if (note.volume>=0) { + int mappedVol=disCont[dispatchOfChan[note.channel]].dispatch->mapVelocity(note.channel,note.volume); + logV("dispatching volume (%d -> %d)",note.volume,mappedVol); + dispatchCmd(DivCommand(DIV_CMD_VOLUME,note.channel,mappedVol)); + } dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,note.channel,note.note)); keyHit[note.channel]=true; chan[note.channel].releasing=false; diff --git a/src/gui/chanOsc.cpp b/src/gui/chanOsc.cpp index 49a31d2b0..f702fdb96 100644 --- a/src/gui/chanOsc.cpp +++ b/src/gui/chanOsc.cpp @@ -135,7 +135,7 @@ void FurnaceGUI::drawChanOsc() { ImGui::Text("Columns"); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##COSColumns",&chanOscCols,1,1)) { + if (ImGui::InputInt("##COSColumns",&chanOscCols,1,3)) { if (chanOscCols<1) chanOscCols=1; if (chanOscCols>64) chanOscCols=64; } @@ -144,7 +144,7 @@ void FurnaceGUI::drawChanOsc() { ImGui::Text("Size (ms)"); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputFloat("##COSWinSize",&chanOscWindowSize,1.0f,1.0f)) { + if (ImGui::InputFloat("##COSWinSize",&chanOscWindowSize,1.0f,10.0f)) { if (chanOscWindowSize<1.0f) chanOscWindowSize=1.0f; if (chanOscWindowSize>50.0f) chanOscWindowSize=50.0f; } diff --git a/src/gui/findReplace.cpp b/src/gui/findReplace.cpp index 5f0d63218..5e2825231 100644 --- a/src/gui/findReplace.cpp +++ b/src/gui/findReplace.cpp @@ -924,14 +924,14 @@ void FurnaceGUI::drawFindReplace() { if (queryReplaceIns>255) queryReplaceIns=255; } } else if (queryReplaceInsMode==GUI_QUERY_REPLACE_ADD || queryReplaceInsMode==GUI_QUERY_REPLACE_ADD_OVERFLOW) { - if (ImGui::InputInt("##IRValue",&queryReplaceIns,1,12)) { + if (ImGui::InputInt("##IRValue",&queryReplaceIns,1,16)) { if (queryReplaceIns<-255) queryReplaceIns=-255; if (queryReplaceIns>255) queryReplaceIns=255; } } else if (queryReplaceInsMode==GUI_QUERY_REPLACE_SCALE) { if (queryReplaceIns<0) queryReplaceIns=0; if (queryReplaceIns>400) queryReplaceIns=400; - if (ImGui::InputInt("##IRValue",&queryReplaceIns,1,12)) { + if (ImGui::InputInt("##IRValue",&queryReplaceIns,1,10)) { if (queryReplaceIns<0) queryReplaceIns=0; if (queryReplaceIns>400) queryReplaceIns=400; } @@ -953,14 +953,14 @@ void FurnaceGUI::drawFindReplace() { if (queryReplaceVol>255) queryReplaceVol=255; } } else if (queryReplaceVolMode==GUI_QUERY_REPLACE_ADD || queryReplaceVolMode==GUI_QUERY_REPLACE_ADD_OVERFLOW) { - if (ImGui::InputInt("##VRValue",&queryReplaceVol,1,12)) { + if (ImGui::InputInt("##VRValue",&queryReplaceVol,1,16)) { if (queryReplaceVol<-255) queryReplaceVol=-255; if (queryReplaceVol>255) queryReplaceVol=255; } } else if (queryReplaceVolMode==GUI_QUERY_REPLACE_SCALE) { if (queryReplaceVol<0) queryReplaceVol=0; if (queryReplaceVol>400) queryReplaceVol=400; - if (ImGui::InputInt("##VRValue",&queryReplaceVol,1,12)) { + if (ImGui::InputInt("##VRValue",&queryReplaceVol,1,10)) { if (queryReplaceVol<0) queryReplaceVol=0; if (queryReplaceVol>400) queryReplaceVol=400; } @@ -984,14 +984,14 @@ void FurnaceGUI::drawFindReplace() { if (queryReplaceEffect[i]>255) queryReplaceEffect[i]=255; } } else if (queryReplaceEffectMode[i]==GUI_QUERY_REPLACE_ADD || queryReplaceEffectMode[i]==GUI_QUERY_REPLACE_ADD_OVERFLOW) { - if (ImGui::InputInt("##ERValue",&queryReplaceEffect[i],1,12)) { + if (ImGui::InputInt("##ERValue",&queryReplaceEffect[i],1,16)) { if (queryReplaceEffect[i]<-255) queryReplaceEffect[i]=-255; if (queryReplaceEffect[i]>255) queryReplaceEffect[i]=255; } } else if (queryReplaceEffectMode[i]==GUI_QUERY_REPLACE_SCALE) { if (queryReplaceEffect[i]<0) queryReplaceEffect[i]=0; if (queryReplaceEffect[i]>400) queryReplaceEffect[i]=400; - if (ImGui::InputInt("##ERValue",&queryReplaceEffect[i],1,12)) { + if (ImGui::InputInt("##ERValue",&queryReplaceEffect[i],1,10)) { if (queryReplaceEffect[i]<0) queryReplaceEffect[i]=0; if (queryReplaceEffect[i]>400) queryReplaceEffect[i]=400; } @@ -1013,14 +1013,14 @@ void FurnaceGUI::drawFindReplace() { if (queryReplaceEffectVal[i]>255) queryReplaceEffectVal[i]=255; } } else if (queryReplaceEffectValMode[i]==GUI_QUERY_REPLACE_ADD || queryReplaceEffectValMode[i]==GUI_QUERY_REPLACE_ADD_OVERFLOW) { - if (ImGui::InputInt("##ERValueV",&queryReplaceEffectVal[i],1,12)) { + if (ImGui::InputInt("##ERValueV",&queryReplaceEffectVal[i],1,16)) { if (queryReplaceEffectVal[i]<-255) queryReplaceEffectVal[i]=-255; if (queryReplaceEffectVal[i]>255) queryReplaceEffectVal[i]=255; } } else if (queryReplaceEffectValMode[i]==GUI_QUERY_REPLACE_SCALE) { if (queryReplaceEffectVal[i]<0) queryReplaceEffectVal[i]=0; if (queryReplaceEffectVal[i]>400) queryReplaceEffectVal[i]=400; - if (ImGui::InputInt("##ERValueV",&queryReplaceEffectVal[i],1,12)) { + if (ImGui::InputInt("##ERValueV",&queryReplaceEffectVal[i],1,10)) { if (queryReplaceEffectVal[i]<0) queryReplaceEffectVal[i]=0; if (queryReplaceEffectVal[i]>400) queryReplaceEffectVal[i]=400; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 0f12eff68..a9efea15b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2854,7 +2854,7 @@ void FurnaceGUI::editOptions(bool topMenu) { ImGui::Text("transpose"); ImGui::SameLine(); ImGui::SetNextItemWidth(120.0f*dpiScale); - if (ImGui::InputInt("##TransposeAmount",&transposeAmount,1,1)) { + if (ImGui::InputInt("##TransposeAmount",&transposeAmount,1,12)) { if (transposeAmount<-96) transposeAmount=-96; if (transposeAmount>96) transposeAmount=96; } @@ -2886,7 +2886,7 @@ void FurnaceGUI::editOptions(bool topMenu) { if (!basicMode) { if (ImGui::BeginMenu("gradient/fade...")) { - if (ImGui::InputInt("Start",&fadeMin,1,1)) { + if (ImGui::InputInt("Start",&fadeMin,1,16)) { if (fadeMin<0) fadeMin=0; if (fadeMode) { if (fadeMin>15) fadeMin=15; @@ -2894,7 +2894,7 @@ void FurnaceGUI::editOptions(bool topMenu) { if (fadeMin>255) fadeMin=255; } } - if (ImGui::InputInt("End",&fadeMax,1,1)) { + if (ImGui::InputInt("End",&fadeMax,1,16)) { if (fadeMax<0) fadeMax=0; if (fadeMode) { if (fadeMax>15) fadeMax=15; @@ -2918,7 +2918,7 @@ void FurnaceGUI::editOptions(bool topMenu) { ImGui::EndMenu(); } if (ImGui::BeginMenu("scale...")) { - if (ImGui::InputFloat("##ScaleMax",&scaleMax,1,1,"%.1f%%")) { + if (ImGui::InputFloat("##ScaleMax",&scaleMax,1,10,"%.1f%%")) { if (scaleMax<0.0f) scaleMax=0.0f; if (scaleMax>25600.0f) scaleMax=25600.0f; } @@ -2929,7 +2929,7 @@ void FurnaceGUI::editOptions(bool topMenu) { ImGui::EndMenu(); } if (ImGui::BeginMenu("randomize...")) { - if (ImGui::InputInt("Minimum",&randomizeMin,1,1)) { + if (ImGui::InputInt("Minimum",&randomizeMin,1,16)) { if (randomizeMin<0) randomizeMin=0; if (randomMode) { if (randomizeMin>15) randomizeMin=15; @@ -2938,7 +2938,7 @@ void FurnaceGUI::editOptions(bool topMenu) { } if (randomizeMin>randomizeMax) randomizeMin=randomizeMax; } - if (ImGui::InputInt("Maximum",&randomizeMax,1,1)) { + if (ImGui::InputInt("Maximum",&randomizeMax,1,16)) { if (randomizeMax<0) randomizeMax=0; if (randomizeMax256) collapseAmount=256; } @@ -4212,7 +4212,7 @@ bool FurnaceGUI::loop() { if (ImGui::BeginMenu("export ZSM...")) { exitDisabledTimer=1; ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,10)) { if (zsmExportTickRate<1) zsmExportTickRate=1; if (zsmExportTickRate>44100) zsmExportTickRate=44100; } @@ -6088,7 +6088,7 @@ bool FurnaceGUI::loop() { ImGui::Text("Channels"); ImGui::SameLine(); ImGui::SetNextItemWidth(120.0f*dpiScale); - if (ImGui::InputInt("##RSChans",&pendingRawSampleChannels)) { + if (ImGui::InputInt("##RSChans",&pendingRawSampleChannels,1,2)) { } ImGui::Text("(will be mixed down to mono)"); ImGui::Checkbox("Unsigned",&pendingRawSampleUnsigned); diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 75decd374..9761af578 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -538,7 +538,11 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("SAVE", "Save file", FURKMOD_CMD|SDLK_s), D("SAVE_AS", "Save as", FURKMOD_CMD|FURKMOD_SHIFT|SDLK_s), D("UNDO", "Undo", FURKMOD_CMD|SDLK_z), +#ifdef __APPLE__ + D("REDO", "Redo", FURKMOD_CMD|FURKMOD_SHIFT|SDLK_z), +#else D("REDO", "Redo", FURKMOD_CMD|SDLK_y), +#endif D("PLAY_TOGGLE", "Play/Stop (toggle)", SDLK_RETURN), D("PLAY", "Play", 0), D("STOP", "Stop", 0), @@ -574,7 +578,11 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("WINDOW_SAMPLE_LIST", "Sample List", 0), D("WINDOW_SAMPLE_EDIT", "Sample Editor", 0), D("WINDOW_ABOUT", "About", 0), +#ifdef __APPLE__ + D("WINDOW_SETTINGS", "Settings", FURKMOD_CMD|SDLK_COMMA), +#else D("WINDOW_SETTINGS", "Settings", 0), +#endif D("WINDOW_MIXER", "Mixer", 0), D("WINDOW_DEBUG", "Debug Menu", FURKMOD_CMD|FURKMOD_SHIFT|SDLK_d), D("WINDOW_OSCILLOSCOPE", "Oscilloscope (master)", 0), diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 35c7273f5..3e2eb578d 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1858,7 +1858,7 @@ void FurnaceGUI::drawMacros(std::vector& macros, FurnaceGUI float lenAvail=ImGui::GetContentRegionAvail().x; //ImGui::Dummy(ImVec2(120.0f*dpiScale,dpiScale)); ImGui::SetNextItemWidth(120.0f*dpiScale); - if (ImGui::InputInt("##MacroPointSize",¯oPointSize,1,16)) { + if (ImGui::InputInt("##MacroPointSize",¯oPointSize,1,4)) { if (macroPointSize<1) macroPointSize=1; if (macroPointSize>256) macroPointSize=256; } @@ -2064,7 +2064,7 @@ void FurnaceGUI::drawMacros(std::vector& macros, FurnaceGUI ImGui::Button(ICON_FA_SEARCH_PLUS "##MacroZoomB"); if (ImGui::BeginPopupContextItem("MacroZoomP",ImGuiPopupFlags_MouseButtonLeft)) { ImGui::SetNextItemWidth(120.0f*dpiScale); - if (ImGui::InputInt("##MacroPointSize",¯oPointSize,1,16)) { + if (ImGui::InputInt("##MacroPointSize",¯oPointSize,1,4)) { if (macroPointSize<1) macroPointSize=1; if (macroPointSize>256) macroPointSize=256; } @@ -2250,7 +2250,7 @@ void FurnaceGUI::alterSampleMap(int column, int val) { } \ } \ ImGui::TableNextColumn(); \ - if (ImGui::InputInt(df,&fNum,1,1)) { \ + if (ImGui::InputInt(df,&fNum,1,16)) { \ if (fNum<0) fNum=0; \ if (ins->type==DIV_INS_OPLL) { \ if (fNum>511) fNum=511; \ @@ -4799,7 +4799,7 @@ void FurnaceGUI::drawInsEdit() { int len=ins->gb.hwSeq[i].data+1; curFrame+=ins->gb.hwSeq[i].data+1; - if (ImGui::InputInt("Ticks",&len)) { + if (ImGui::InputInt("Ticks",&len,1,4)) { if (len<1) len=1; if (len>255) len=256; somethingChanged=true; @@ -4818,7 +4818,7 @@ void FurnaceGUI::drawInsEdit() { case DivInstrumentGB::DIV_GB_HWCMD_LOOP_REL: { int pos=ins->gb.hwSeq[i].data; - if (ImGui::InputInt("Position",&pos)) { + if (ImGui::InputInt("Position",&pos,1,1)) { if (pos<0) pos=0; if (pos>(ins->gb.hwSeqLen-1)) pos=(ins->gb.hwSeqLen-1); somethingChanged=true; @@ -5159,7 +5159,7 @@ void FurnaceGUI::drawInsEdit() { case DivInstrumentSoundUnit::DIV_SU_HWCMD_LOOP_REL: { int pos=ins->su.hwSeq[i].val; - if (ImGui::InputInt("Position",&pos)) { + if (ImGui::InputInt("Position",&pos,1,4)) { if (pos<0) pos=0; if (pos>(ins->su.hwSeqLen-1)) pos=(ins->su.hwSeqLen-1); somethingChanged=true; @@ -5354,7 +5354,7 @@ void FurnaceGUI::drawInsEdit() { if (ImGui::IsItemHovered()) { ImGui::SetTooltip("only use for compatibility with .dmf modules!\n- initializes modulation table with first wavetable\n- does not alter modulation parameters on instrument change"); } - if (ImGui::InputInt("Modulation depth",&ins->fds.modDepth,1,32)) { + if (ImGui::InputInt("Modulation depth",&ins->fds.modDepth,1,4)) { if (ins->fds.modDepth<0) ins->fds.modDepth=0; if (ins->fds.modDepth>63) ins->fds.modDepth=63; } @@ -5938,23 +5938,23 @@ void FurnaceGUI::drawInsEdit() { ImGui::EndTable(); } - if (ImGui::InputScalar("Update Rate",ImGuiDataType_U8,&ins->ws.rateDivider,&_ONE,&_SEVEN)) { + if (ImGui::InputScalar("Update Rate",ImGuiDataType_U8,&ins->ws.rateDivider,&_ONE,&_EIGHT)) { wavePreviewInit=true; } int speed=ins->ws.speed+1; - if (ImGui::InputInt("Speed",&speed,1,16)) { + if (ImGui::InputInt("Speed",&speed,1,8)) { if (speed<1) speed=1; if (speed>256) speed=256; ins->ws.speed=speed-1; wavePreviewInit=true; } - if (ImGui::InputScalar("Amount",ImGuiDataType_U8,&ins->ws.param1,&_ONE,&_SEVEN)) { + if (ImGui::InputScalar("Amount",ImGuiDataType_U8,&ins->ws.param1,&_ONE,&_EIGHT)) { wavePreviewInit=true; } if (ins->ws.effect==DIV_WS_PHASE_MOD) { - if (ImGui::InputScalar("Power",ImGuiDataType_U8,&ins->ws.param2,&_ONE,&_SEVEN)) { + if (ImGui::InputScalar("Power",ImGuiDataType_U8,&ins->ws.param2,&_ONE,&_EIGHT)) { wavePreviewInit=true; } } diff --git a/src/gui/intConst.cpp b/src/gui/intConst.cpp index 167fdd7e8..09a988e84 100644 --- a/src/gui/intConst.cpp +++ b/src/gui/intConst.cpp @@ -22,7 +22,9 @@ const int _ZERO=0; const int _ONE=1; const int _THREE=3; +const int _FOUR=4; const int _SEVEN=7; +const int _EIGHT=8; const int _TEN=10; const int _FIFTEEN=15; const int _SIXTEEN=16; diff --git a/src/gui/intConst.h b/src/gui/intConst.h index 082f421a7..153fc868c 100644 --- a/src/gui/intConst.h +++ b/src/gui/intConst.h @@ -24,7 +24,9 @@ extern const int _ZERO; extern const int _ONE; extern const int _THREE; +extern const int _FOUR; extern const int _SEVEN; +extern const int _EIGHT; extern const int _TEN; extern const int _FIFTEEN; extern const int _SIXTEEN; diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 5c070eebc..3ab8fe7a3 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -1123,11 +1123,11 @@ void FurnaceGUI::drawSampleEdit() { float highP=sampleFilterH*100.0f; float resP=sampleFilterRes*100.0f; ImGui::Text("Cutoff:"); - if (ImGui::InputFloat("From",&sampleFilterCutStart,1.0f,100.0f,"%.0f")) { + if (ImGui::InputFloat("From",&sampleFilterCutStart,10.0f,1000.0f,"%.0f")) { if (sampleFilterCutStart<0.0) sampleFilterCutStart=0.0; if (sampleFilterCutStart>sample->rate*0.5) sampleFilterCutStart=sample->rate*0.5; } - if (ImGui::InputFloat("To",&sampleFilterCutEnd,1.0f,100.0f,"%.0f")) { + if (ImGui::InputFloat("To",&sampleFilterCutEnd,10.0f,1000.0f,"%.0f")) { if (sampleFilterCutEnd<0.0) sampleFilterCutEnd=0.0; if (sampleFilterCutEnd>sample->rate*0.5) sampleFilterCutEnd=sample->rate*0.5; } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index d5cf926e5..381c2eb9e 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -474,7 +474,7 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } - if (ImGui::InputInt("Number of recent files",&settings.maxRecentFile)) { + if (ImGui::InputInt("Number of recent files",&settings.maxRecentFile,1,5)) { if (settings.maxRecentFile<0) settings.maxRecentFile=0; if (settings.maxRecentFile>30) settings.maxRecentFile=30; settingsChanged=true; @@ -957,7 +957,7 @@ void FurnaceGUI::drawSettings() { ImGui::AlignTextToFramePadding(); ImGui::Text("Outputs"); ImGui::TableNextColumn(); - if (ImGui::InputInt("##AudioChansI",&settings.audioChans,1,1)) { + if (ImGui::InputInt("##AudioChansI",&settings.audioChans,1,2)) { if (settings.audioChans<1) settings.audioChans=1; if (settings.audioChans>16) settings.audioChans=16; settingsChanged=true; @@ -1781,7 +1781,7 @@ void FurnaceGUI::drawSettings() { ImGui::TableNextColumn(); if (i.val<100) { snprintf(id,4095,"##SNValue_%d",i.scan); - if (ImGui::InputInt(id,&i.val,1,1)) { + if (ImGui::InputInt(id,&i.val,1,12)) { if (i.val<0) i.val=0; if (i.val>96) i.val=96; noteKeys[i.scan]=i.val; @@ -2398,7 +2398,7 @@ void FurnaceGUI::drawSettings() { } rightClickable } - if (ImGui::InputInt("Icon size",&settings.iconSize)) { + if (ImGui::InputInt("Icon size",&settings.iconSize,1,3)) { if (settings.iconSize<3) settings.iconSize=3; if (settings.iconSize>48) settings.iconSize=48; settingsChanged=true; @@ -2434,7 +2434,7 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } } - if (ImGui::InputInt("Size##MainFontSize",&settings.mainFontSize)) { + if (ImGui::InputInt("Size##MainFontSize",&settings.mainFontSize,1,3)) { if (settings.mainFontSize<3) settings.mainFontSize=3; if (settings.mainFontSize>96) settings.mainFontSize=96; settingsChanged=true; @@ -2453,7 +2453,7 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } } - if (ImGui::InputInt("Size##HeadFontSize",&settings.headFontSize)) { + if (ImGui::InputInt("Size##HeadFontSize",&settings.headFontSize,1,3)) { if (settings.headFontSize<3) settings.headFontSize=3; if (settings.headFontSize>96) settings.headFontSize=96; settingsChanged=true; @@ -2472,7 +2472,7 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } } - if (ImGui::InputInt("Size##PatFontSize",&settings.patFontSize)) { + if (ImGui::InputInt("Size##PatFontSize",&settings.patFontSize,1,3)) { if (settings.patFontSize<3) settings.patFontSize=3; if (settings.patFontSize>96) settings.patFontSize=96; settingsChanged=true; diff --git a/src/gui/songInfo.cpp b/src/gui/songInfo.cpp index 8091fab1e..7c9b6063b 100644 --- a/src/gui/songInfo.cpp +++ b/src/gui/songInfo.cpp @@ -108,7 +108,7 @@ void FurnaceGUI::drawSongInfo(bool asChild) { float tune=e->song.tuning; float avail=ImGui::GetContentRegionAvail().x; ImGui::SetNextItemWidth(avail); - if (ImGui::InputFloat("##Tuning",&tune,1.0f,3.0f,"%g")) { MARK_MODIFIED + if (ImGui::InputFloat("##Tuning",&tune,1.0f,10.0f,"%g")) { MARK_MODIFIED if (tune<220.0f) tune=220.0f; if (tune>880.0f) tune=880.0f; e->song.tuning=tune; diff --git a/src/gui/speed.cpp b/src/gui/speed.cpp index 593467852..b9b4988bc 100644 --- a/src/gui/speed.cpp +++ b/src/gui/speed.cpp @@ -53,7 +53,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { float halfAvail=(avail-ImGui::GetStyle().ItemSpacing.x)*0.5; ImGui::SetNextItemWidth(halfAvail); float setHz=tempoView?e->curSubSong->hz*2.5:e->curSubSong->hz; - if (ImGui::InputFloat("##Rate",&setHz,1.0f,1.0f,"%g")) { MARK_MODIFIED + if (ImGui::InputFloat("##Rate",&setHz,1.0f,10.0f,"%g")) { MARK_MODIFIED if (tempoView) setHz/=2.5; if (setHz<1) setHz=1; if (setHz>999) setHz=999; @@ -169,7 +169,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { ImGui::Text("Virtual Tempo"); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(halfAvail); - if (ImGui::InputScalar("##VTempoN",ImGuiDataType_S16,&e->curSubSong->virtualTempoN,&_ONE,&_THREE)) { MARK_MODIFIED + if (ImGui::InputScalar("##VTempoN",ImGuiDataType_S16,&e->curSubSong->virtualTempoN,&_ONE,&_TEN)) { MARK_MODIFIED if (e->curSubSong->virtualTempoN<1) e->curSubSong->virtualTempoN=1; if (e->curSubSong->virtualTempoN>255) e->curSubSong->virtualTempoN=255; } @@ -178,7 +178,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { } ImGui::SameLine(); ImGui::SetNextItemWidth(halfAvail); - if (ImGui::InputScalar("##VTempoD",ImGuiDataType_S16,&e->curSubSong->virtualTempoD,&_ONE,&_THREE)) { MARK_MODIFIED + if (ImGui::InputScalar("##VTempoD",ImGuiDataType_S16,&e->curSubSong->virtualTempoD,&_ONE,&_TEN)) { MARK_MODIFIED if (e->curSubSong->virtualTempoD<1) e->curSubSong->virtualTempoD=1; if (e->curSubSong->virtualTempoD>255) e->curSubSong->virtualTempoD=255; } @@ -208,12 +208,12 @@ void FurnaceGUI::drawSpeed(bool asChild) { ImGui::Text("Highlight"); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(halfAvail); - if (ImGui::InputScalar("##Highlight1",ImGuiDataType_U8,&e->curSubSong->hilightA,&_ONE,&_THREE)) { + if (ImGui::InputScalar("##Highlight1",ImGuiDataType_U8,&e->curSubSong->hilightA,&_ONE,&_FOUR)) { MARK_MODIFIED; } ImGui::SameLine(); ImGui::SetNextItemWidth(halfAvail); - if (ImGui::InputScalar("##Highlight2",ImGuiDataType_U8,&e->curSubSong->hilightB,&_ONE,&_THREE)) { + if (ImGui::InputScalar("##Highlight2",ImGuiDataType_U8,&e->curSubSong->hilightB,&_ONE,&_FOUR)) { MARK_MODIFIED; } ImGui::EndTable(); @@ -233,7 +233,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { float avail=ImGui::GetContentRegionAvail().x; ImGui::SetNextItemWidth(avail); int patLen=e->curSubSong->patLen; - if (ImGui::InputInt("##PatLength",&patLen,1,3)) { MARK_MODIFIED + if (ImGui::InputInt("##PatLength",&patLen,1,16)) { MARK_MODIFIED if (patLen<1) patLen=1; if (patLen>DIV_MAX_PATTERNS) patLen=DIV_MAX_PATTERNS; e->curSubSong->patLen=patLen; @@ -247,7 +247,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { ImGui::TableNextColumn(); ImGui::SetNextItemWidth(avail); int ordLen=e->curSubSong->ordersLen; - if (ImGui::InputInt("##OrdLength",&ordLen,1,3)) { MARK_MODIFIED + if (ImGui::InputInt("##OrdLength",&ordLen,1,4)) { MARK_MODIFIED if (ordLen<1) ordLen=1; if (ordLen>DIV_MAX_PATTERNS) ordLen=DIV_MAX_PATTERNS; e->curSubSong->ordersLen=ordLen; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 89433564f..813ba80bb 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -2312,7 +2312,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl altered=true; } ImGui::Indent(); - if (ImGui::InputInt("Hz",&customClock)) { + if (ImGui::InputInt("Hz",&customClock,100,10000)) { if (customClockMAX_CUSTOM_CLOCK) customClock=MAX_CUSTOM_CLOCK; altered=true; diff --git a/src/gui/waveEdit.cpp b/src/gui/waveEdit.cpp index de7cee606..cb4cf0462 100644 --- a/src/gui/waveEdit.cpp +++ b/src/gui/waveEdit.cpp @@ -455,7 +455,7 @@ void FurnaceGUI::drawWaveEdit() { ImGui::TableNextColumn(); ImGui::SetNextItemWidth(80.0f*dpiScale); - if (ImGui::InputInt("##CurWave",&curWave,1,1)) { + if (ImGui::InputInt("##CurWave",&curWave,1,10)) { if (curWave<0) curWave=0; if (curWave>=(int)e->song.wave.size()) curWave=e->song.wave.size()-1; } @@ -499,7 +499,7 @@ void FurnaceGUI::drawWaveEdit() { } ImGui::SameLine(); ImGui::SetNextItemWidth(96.0f*dpiScale); - if (ImGui::InputInt("##_WTW",&wave->len,1,2)) { + if (ImGui::InputInt("##_WTW",&wave->len,1,16)) { if (wave->len>256) wave->len=256; if (wave->len<1) wave->len=1; e->notifyWaveChange(curWave); @@ -514,7 +514,7 @@ void FurnaceGUI::drawWaveEdit() { ImGui::SameLine(); ImGui::SetNextItemWidth(96.0f*dpiScale); int realMax=wave->max+1; - if (ImGui::InputInt("##_WTH",&realMax,1,2)) { + if (ImGui::InputInt("##_WTH",&realMax,1,16)) { if (realMax>256) realMax=256; if (realMax<2) realMax=2; wave->max=realMax-1;