sample import detune load setting
This commit is contained in:
parent
1b712e03ee
commit
52eac7e3c6
3 changed files with 22 additions and 9 deletions
|
|
@ -402,13 +402,12 @@ std::vector<DivSample*> DivEngine::sampleFromFile(const char* path) {
|
|||
{
|
||||
// There's no documentation on libsndfile detune range, but the code
|
||||
// implies -50..50. Yet when loading a file you can get a >50 value.
|
||||
// disabled for now
|
||||
/*
|
||||
if(inst.detune > 50)
|
||||
inst.detune = inst.detune - 100;
|
||||
short pitch = ((0x3c-inst.basenote)*100) + inst.detune;
|
||||
sample->centerRate=si.samplerate*pow(2.0,pitch/(12.0 * 100.0));
|
||||
*/
|
||||
if (getConfInt("sampleImportInstDetune", 0)) {
|
||||
if(inst.detune > 50)
|
||||
inst.detune = inst.detune - 100;
|
||||
short pitch = ((0x3c-inst.basenote)*100) + inst.detune;
|
||||
sample->centerRate=si.samplerate*pow(2.0,pitch/(12.0 * 100.0));
|
||||
}
|
||||
if(inst.loop_count && inst.loops[0].mode >= SF_LOOP_FORWARD)
|
||||
{
|
||||
sample->loop=true;
|
||||
|
|
|
|||
|
|
@ -2058,6 +2058,7 @@ class FurnaceGUI {
|
|||
int s3mOPL3;
|
||||
int songNotesWrap;
|
||||
int rackShowLEDs;
|
||||
int sampleImportInstDetune;
|
||||
String mainFontPath;
|
||||
String headFontPath;
|
||||
String patFontPath;
|
||||
|
|
@ -2311,6 +2312,7 @@ class FurnaceGUI {
|
|||
s3mOPL3(1),
|
||||
songNotesWrap(0),
|
||||
rackShowLEDs(1),
|
||||
sampleImportInstDetune(0),
|
||||
mainFontPath(""),
|
||||
headFontPath(""),
|
||||
patFontPath(""),
|
||||
|
|
|
|||
|
|
@ -1162,9 +1162,10 @@ void FurnaceGUI::drawSettings() {
|
|||
settings.newSongBehavior=1;
|
||||
settingsChanged=true;
|
||||
}
|
||||
if (ImGui::InputText(_("Default author name"), &settings.defaultAuthorName)) settingsChanged=true;
|
||||
ImGui::Unindent();
|
||||
|
||||
if (ImGui::InputText(_("Default author name"), &settings.defaultAuthorName)) settingsChanged=true;
|
||||
|
||||
// SUBSECTION START-UP
|
||||
CONFIG_SUBSECTION(_("Start-up"));
|
||||
#ifndef NO_INTRO
|
||||
|
|
@ -1230,6 +1231,14 @@ void FurnaceGUI::drawSettings() {
|
|||
settings.s3mOPL3=s3mOPL3B;
|
||||
settingsChanged=true;
|
||||
}
|
||||
bool sampleImportInstDetuneB=settings.sampleImportInstDetune;
|
||||
if (ImGui::Checkbox(_("Load sample fine tuning when importing a sample"), &sampleImportInstDetuneB)) {
|
||||
settings.sampleImportInstDetune=sampleImportInstDetuneB;
|
||||
settingsChanged=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(_("this may result in glitches with some samples."));
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
// SUBSECTION ANDROID
|
||||
|
|
@ -3844,7 +3853,7 @@ void FurnaceGUI::drawSettings() {
|
|||
settingsChanged=true;
|
||||
}
|
||||
|
||||
// SUBSECTION SONG COMMENTS
|
||||
// SUBSECTION CHIP MANAGER
|
||||
CONFIG_SUBSECTION(_("Chip Manager"));
|
||||
bool rackShowLEDsB=settings.rackShowLEDs;
|
||||
if (ImGui::Checkbox(_("Show channel indicators"), &rackShowLEDsB)) {
|
||||
|
|
@ -4881,6 +4890,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
settings.vibrationLength=conf.getInt("vibrationLength",20);
|
||||
|
||||
settings.s3mOPL3=conf.getInt("s3mOPL3",1);
|
||||
settings.sampleImportInstDetune=conf.getInt("sampleImportInstDetune",0);
|
||||
|
||||
settings.backupEnable=conf.getInt("backupEnable",1);
|
||||
settings.backupInterval=conf.getInt("backupInterval",30);
|
||||
|
|
@ -5396,6 +5406,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
clampSetting(settings.autoFillSave,0,1);
|
||||
clampSetting(settings.autoMacroStepSize,0,2);
|
||||
clampSetting(settings.s3mOPL3,0,1);
|
||||
clampSetting(settings.sampleImportInstDetune,0,1);
|
||||
clampSetting(settings.backgroundPlay,0,1);
|
||||
clampSetting(settings.noMaximizeWorkaround,0,1);
|
||||
|
||||
|
|
@ -5478,6 +5489,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
conf.set("vibrationLength",settings.vibrationLength);
|
||||
|
||||
conf.set("s3mOPL3",settings.s3mOPL3);
|
||||
conf.set("sampleImportInstDetune",settings.sampleImportInstDetune);
|
||||
|
||||
conf.set("backupEnable",settings.backupEnable);
|
||||
conf.set("backupInterval",settings.backupInterval);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue