commit 0b31dfb57c5f374df50faf46f68df774e78bd8fe
parent 0fe01feac7b3647b48aa346ee83e97fd1755b638
Author: Christopher A. Oliver <caowasteland@gmail.com>
Date: Sat, 17 Oct 2015 13:19:06 -0400
Fix missing inheritance of detune type by advoices.
Diffstat:
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/Params/ADnoteParameters.cpp b/src/Params/ADnoteParameters.cpp
@@ -112,9 +112,12 @@ static const Ports voicePorts = {
[](const char *, RtData &d)
{
rObject *obj = (rObject *)d.obj;
+ unsigned detuneType =
+ obj->PDetuneType == 0 ? *(obj->GlobalPDetuneType)
+ : obj->PDetuneType;
//TODO check if this is accurate or if PCoarseDetune is utilized
//TODO do the same for the other engines
- d.reply(d.loc, "f", getdetune(obj->PDetuneType, 0, obj->PDetune));
+ d.reply(d.loc, "f", getdetune(detuneType, 0, obj->PDetune));
}},
{"octave::c:i", rProp(parameter) rDoc("Octave note offset"), NULL,
[](const char *msg, RtData &d)
@@ -149,9 +152,12 @@ static const Ports voicePorts = {
{"FMdetunevalue:", rMap(unit,cents) rDoc("Get modulator detune"), NULL, [](const char *, RtData &d)
{
rObject *obj = (rObject *)d.obj;
+ unsigned detuneType =
+ obj->PFMDetuneType == 0 ? *(obj->GlobalPDetuneType)
+ : obj->PFMDetuneType;
//TODO check if this is accurate or if PCoarseDetune is utilized
//TODO do the same for the other engines
- d.reply(d.loc, "f", getdetune(obj->PFMDetuneType, 0, obj->PFMDetune));
+ d.reply(d.loc, "f", getdetune(detuneType, 0, obj->PFMDetune));
}},
{"FMoctave::c:i", rProp(parameter) rDoc("Octave note offset for modulator"), NULL,
[](const char *msg, RtData &d)
@@ -288,8 +294,10 @@ ADnoteParameters::ADnoteParameters(const SYNTH_T &synth, FFTwrapper *fft_)
fft = fft_;
- for(int nvoice = 0; nvoice < NUM_VOICES; ++nvoice)
+ for(int nvoice = 0; nvoice < NUM_VOICES; ++nvoice) {
+ VoicePar[nvoice].GlobalPDetuneType = &GlobalPar.PDetuneType;
EnableVoice(synth, nvoice);
+ }
defaults();
}
diff --git a/src/Params/ADnoteParameters.h b/src/Params/ADnoteParameters.h
@@ -282,6 +282,8 @@ struct ADnoteVoiceParam {
unsigned char PFMAmpEnvelopeEnabled;
EnvelopeParams *FMAmpEnvelope;
+ unsigned char *GlobalPDetuneType;
+
static const rtosc::Ports &ports;
};
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -934,7 +934,10 @@ class ADnoteUI {open : {public PresetsUI_}
}
Fl_Choice detunetype {
label {Detune Type}
- callback {detunevalueoutput->update();} open
+ callback {detunevalueoutput->update();
+ ui->partui->adnoteui->advoice->detunevalueoutput->update();
+ ui->partui->adnoteui->advoice->fmdetunevalueoutput->update();
+ } open
xywh {455 340 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
code1 {o->init("PDetuneType",1);}