add sample preview volume setting
it was too loud
This commit is contained in:
parent
41bd28c41a
commit
41544bcced
|
@ -3246,6 +3246,10 @@ void DivEngine::setMetronomeVol(float vol) {
|
||||||
metroVol=vol;
|
metroVol=vol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivEngine::setSamplePreviewVol(float vol) {
|
||||||
|
previewVol=vol;
|
||||||
|
}
|
||||||
|
|
||||||
void DivEngine::setConsoleMode(bool enable) {
|
void DivEngine::setConsoleMode(bool enable) {
|
||||||
consoleMode=enable;
|
consoleMode=enable;
|
||||||
}
|
}
|
||||||
|
@ -3450,6 +3454,7 @@ bool DivEngine::initAudioBackend() {
|
||||||
clampSamples=getConfInt("clampSamples",0);
|
clampSamples=getConfInt("clampSamples",0);
|
||||||
lowLatency=getConfInt("lowLatency",0);
|
lowLatency=getConfInt("lowLatency",0);
|
||||||
metroVol=(float)(getConfInt("metroVol",100))/100.0f;
|
metroVol=(float)(getConfInt("metroVol",100))/100.0f;
|
||||||
|
previewVol=(float)(getConfInt("sampleVol",50))/100.0f;
|
||||||
midiOutClock=getConfInt("midiOutClock",0);
|
midiOutClock=getConfInt("midiOutClock",0);
|
||||||
midiOutTime=getConfInt("midiOutTime",0);
|
midiOutTime=getConfInt("midiOutTime",0);
|
||||||
midiOutTimeRate=getConfInt("midiOutTimeRate",0);
|
midiOutTimeRate=getConfInt("midiOutTimeRate",0);
|
||||||
|
@ -3457,6 +3462,8 @@ bool DivEngine::initAudioBackend() {
|
||||||
midiOutMode=getConfInt("midiOutMode",DIV_MIDI_MODE_NOTE);
|
midiOutMode=getConfInt("midiOutMode",DIV_MIDI_MODE_NOTE);
|
||||||
if (metroVol<0.0f) metroVol=0.0f;
|
if (metroVol<0.0f) metroVol=0.0f;
|
||||||
if (metroVol>2.0f) metroVol=2.0f;
|
if (metroVol>2.0f) metroVol=2.0f;
|
||||||
|
if (previewVol<0.0f) previewVol=0.0f;
|
||||||
|
if (previewVol>1.0f) previewVol=1.0f;
|
||||||
renderPoolThreads=getConfInt("renderPoolThreads",0);
|
renderPoolThreads=getConfInt("renderPoolThreads",0);
|
||||||
|
|
||||||
if (lowLatency) logI("using low latency mode.");
|
if (lowLatency) logI("using low latency mode.");
|
||||||
|
|
|
@ -490,6 +490,7 @@ class DivEngine {
|
||||||
float metroFreq, metroPos;
|
float metroFreq, metroPos;
|
||||||
float metroAmp;
|
float metroAmp;
|
||||||
float metroVol;
|
float metroVol;
|
||||||
|
float previewVol;
|
||||||
|
|
||||||
size_t totalProcessed;
|
size_t totalProcessed;
|
||||||
|
|
||||||
|
@ -729,6 +730,9 @@ class DivEngine {
|
||||||
int getSamplePreviewPos();
|
int getSamplePreviewPos();
|
||||||
double getSamplePreviewRate();
|
double getSamplePreviewRate();
|
||||||
|
|
||||||
|
// set sample preview volume (1.0 = 100%)
|
||||||
|
void setSamplePreviewVol(float vol);
|
||||||
|
|
||||||
// trigger sample preview
|
// trigger sample preview
|
||||||
void previewSample(int sample, int note=-1, int pStart=-1, int pEnd=-1);
|
void previewSample(int sample, int note=-1, int pStart=-1, int pEnd=-1);
|
||||||
void stopSamplePreview();
|
void stopSamplePreview();
|
||||||
|
@ -1282,6 +1286,7 @@ class DivEngine {
|
||||||
metroPos(0),
|
metroPos(0),
|
||||||
metroAmp(0.0f),
|
metroAmp(0.0f),
|
||||||
metroVol(1.0f),
|
metroVol(1.0f),
|
||||||
|
previewVol(1.0f),
|
||||||
totalProcessed(0),
|
totalProcessed(0),
|
||||||
renderPoolThreads(0),
|
renderPoolThreads(0),
|
||||||
renderPool(NULL),
|
renderPool(NULL),
|
||||||
|
|
|
@ -2202,7 +2202,7 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
|
||||||
} else if (srcPortSet==0xffd) {
|
} else if (srcPortSet==0xffd) {
|
||||||
// sample preview
|
// sample preview
|
||||||
for (size_t j=0; j<size; j++) {
|
for (size_t j=0; j<size; j++) {
|
||||||
out[destSubPort][j]+=samp_bbOut[j]/32768.0;
|
out[destSubPort][j]+=previewVol*(samp_bbOut[j]/32768.0);
|
||||||
}
|
}
|
||||||
} else if (srcPortSet==0xffe && playing && !halted) {
|
} else if (srcPortSet==0xffe && playing && !halted) {
|
||||||
// metronome
|
// metronome
|
||||||
|
|
|
@ -1503,6 +1503,7 @@ class FurnaceGUI {
|
||||||
int separateFMColors;
|
int separateFMColors;
|
||||||
int insEditColorize;
|
int insEditColorize;
|
||||||
int metroVol;
|
int metroVol;
|
||||||
|
int sampleVol;
|
||||||
int pushNibble;
|
int pushNibble;
|
||||||
int scrollChangesOrder;
|
int scrollChangesOrder;
|
||||||
int oplStandardWaveNames;
|
int oplStandardWaveNames;
|
||||||
|
@ -1683,6 +1684,7 @@ class FurnaceGUI {
|
||||||
separateFMColors(0),
|
separateFMColors(0),
|
||||||
insEditColorize(0),
|
insEditColorize(0),
|
||||||
metroVol(100),
|
metroVol(100),
|
||||||
|
sampleVol(50),
|
||||||
pushNibble(0),
|
pushNibble(0),
|
||||||
scrollChangesOrder(0),
|
scrollChangesOrder(0),
|
||||||
oplStandardWaveNames(0),
|
oplStandardWaveNames(0),
|
||||||
|
|
|
@ -967,7 +967,7 @@ void FurnaceGUI::drawSettings() {
|
||||||
// SUBSECTION METRONOME
|
// SUBSECTION METRONOME
|
||||||
CONFIG_SUBSECTION("Metronome");
|
CONFIG_SUBSECTION("Metronome");
|
||||||
ImGui::AlignTextToFramePadding();
|
ImGui::AlignTextToFramePadding();
|
||||||
ImGui::Text("Metronome volume");
|
ImGui::Text("Volume");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::SliderInt("##MetroVol",&settings.metroVol,0,200,"%d%%")) {
|
if (ImGui::SliderInt("##MetroVol",&settings.metroVol,0,200,"%d%%")) {
|
||||||
if (settings.metroVol<0) settings.metroVol=0;
|
if (settings.metroVol<0) settings.metroVol=0;
|
||||||
|
@ -975,6 +975,17 @@ void FurnaceGUI::drawSettings() {
|
||||||
e->setMetronomeVol(((float)settings.metroVol)/100.0f);
|
e->setMetronomeVol(((float)settings.metroVol)/100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SUBSECTION SAMPLE PREVIEW
|
||||||
|
CONFIG_SUBSECTION("Sample preview");
|
||||||
|
ImGui::AlignTextToFramePadding();
|
||||||
|
ImGui::Text("Volume");
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::SliderInt("##SampleVol",&settings.sampleVol,0,100,"%d%%")) {
|
||||||
|
if (settings.sampleVol<0) settings.sampleVol=0;
|
||||||
|
if (settings.sampleVol>100) settings.sampleVol=100;
|
||||||
|
e->setSamplePreviewVol(((float)settings.sampleVol)/100.0f);
|
||||||
|
}
|
||||||
|
|
||||||
END_SECTION;
|
END_SECTION;
|
||||||
}
|
}
|
||||||
CONFIG_SECTION("MIDI") {
|
CONFIG_SECTION("MIDI") {
|
||||||
|
@ -3246,6 +3257,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.separateFMColors=e->getConfInt("separateFMColors",0);
|
settings.separateFMColors=e->getConfInt("separateFMColors",0);
|
||||||
settings.insEditColorize=e->getConfInt("insEditColorize",0);
|
settings.insEditColorize=e->getConfInt("insEditColorize",0);
|
||||||
settings.metroVol=e->getConfInt("metroVol",100);
|
settings.metroVol=e->getConfInt("metroVol",100);
|
||||||
|
settings.sampleVol=e->getConfInt("sampleVol",50);
|
||||||
settings.pushNibble=e->getConfInt("pushNibble",0);
|
settings.pushNibble=e->getConfInt("pushNibble",0);
|
||||||
settings.scrollChangesOrder=e->getConfInt("scrollChangesOrder",0);
|
settings.scrollChangesOrder=e->getConfInt("scrollChangesOrder",0);
|
||||||
settings.oplStandardWaveNames=e->getConfInt("oplStandardWaveNames",0);
|
settings.oplStandardWaveNames=e->getConfInt("oplStandardWaveNames",0);
|
||||||
|
@ -3407,6 +3419,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.separateFMColors,0,1);
|
clampSetting(settings.separateFMColors,0,1);
|
||||||
clampSetting(settings.insEditColorize,0,1);
|
clampSetting(settings.insEditColorize,0,1);
|
||||||
clampSetting(settings.metroVol,0,200);
|
clampSetting(settings.metroVol,0,200);
|
||||||
|
clampSetting(settings.sampleVol,0,100);
|
||||||
clampSetting(settings.pushNibble,0,1);
|
clampSetting(settings.pushNibble,0,1);
|
||||||
clampSetting(settings.scrollChangesOrder,0,2);
|
clampSetting(settings.scrollChangesOrder,0,2);
|
||||||
clampSetting(settings.oplStandardWaveNames,0,1);
|
clampSetting(settings.oplStandardWaveNames,0,1);
|
||||||
|
@ -3535,6 +3548,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
|
|
||||||
e->setMidiDirect(midiMap.directChannel);
|
e->setMidiDirect(midiMap.directChannel);
|
||||||
e->setMetronomeVol(((float)settings.metroVol)/100.0f);
|
e->setMetronomeVol(((float)settings.metroVol)/100.0f);
|
||||||
|
e->setSamplePreviewVol(((float)settings.sampleVol)/100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FurnaceGUI::commitSettings() {
|
void FurnaceGUI::commitSettings() {
|
||||||
|
@ -3656,6 +3670,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("separateFMColors",settings.separateFMColors);
|
e->setConf("separateFMColors",settings.separateFMColors);
|
||||||
e->setConf("insEditColorize",settings.insEditColorize);
|
e->setConf("insEditColorize",settings.insEditColorize);
|
||||||
e->setConf("metroVol",settings.metroVol);
|
e->setConf("metroVol",settings.metroVol);
|
||||||
|
e->setConf("sampleVol",settings.sampleVol);
|
||||||
e->setConf("pushNibble",settings.pushNibble);
|
e->setConf("pushNibble",settings.pushNibble);
|
||||||
e->setConf("scrollChangesOrder",settings.scrollChangesOrder);
|
e->setConf("scrollChangesOrder",settings.scrollChangesOrder);
|
||||||
e->setConf("oplStandardWaveNames",settings.oplStandardWaveNames);
|
e->setConf("oplStandardWaveNames",settings.oplStandardWaveNames);
|
||||||
|
|
Loading…
Reference in a new issue