zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit e3dc820d11811736b7580fcca7cf4c96f049b0fa
parent ab08b528c7361df094540c5831b93f75217ea4d4
Author: Johannes Lorenz <[email protected]>
Date:   Sat, 22 Aug 2020 19:39:14 +0200

Don't use Smp in OscilGen object names

Diffstat:
Msrc/Misc/MiddleWare.cpp | 4++--
Msrc/Params/ADnoteParameters.cpp | 32++++++++++++++++----------------
Msrc/Params/ADnoteParameters.h | 4++--
Msrc/Synth/ADnote.cpp | 26+++++++++++++-------------
Msrc/Tests/MessageTest.h | 4++--
Msrc/Tests/UnisonTest.h | 2+-
6 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -260,8 +260,8 @@ struct NonRtObjStore std::string nbase = base+"adpars/VoicePar"+to_s(k)+"/"; if(adpars) { auto &nobj = adpars->VoicePar[k]; - objmap[nbase+"OscilSmp/"] = nobj.OscilSmp; - objmap[nbase+"FMSmp/"] = nobj.FMSmp; + objmap[nbase+"OscilSmp/"] = nobj.OscilGn; + objmap[nbase+"FMSmp/"] = nobj.FmGn; } else { objmap[nbase+"OscilSmp/"] = nullptr; objmap[nbase+"FMSmp/"] = nullptr; diff --git a/src/Params/ADnoteParameters.cpp b/src/Params/ADnoteParameters.cpp @@ -42,8 +42,8 @@ static const Ports voicePorts = { {"OscilSmp/", rDoc("Primary Oscillator"), &OscilGen::ports, rBOIL_BEGIN - if(obj->OscilSmp == NULL) return; - data.obj = obj->OscilSmp; + if(obj->OscilGn == NULL) return; + data.obj = obj->OscilGn; SNIP OscilGen::realtime_ports.dispatch(msg, data); if(data.matches == 0) @@ -52,8 +52,8 @@ static const Ports voicePorts = { {"FMSmp/", rDoc("Modulating Oscillator"), &OscilGen::ports, rBOIL_BEGIN - if(obj->FMSmp == NULL) return; - data.obj = obj->FMSmp; + if(obj->FmGn == NULL) return; + data.obj = obj->FmGn; SNIP OscilGen::realtime_ports.dispatch(msg, data); if(data.matches == 0) @@ -601,8 +601,8 @@ void ADnoteVoiceParam::defaults() PFMAmpEnvelopeEnabled = 0; PFMVelocityScaleFunction = 64; - OscilSmp->defaults(); - FMSmp->defaults(); + OscilGn->defaults(); + FmGn->defaults(); AmpEnvelope->defaults(); AmpLfo->defaults(); @@ -632,8 +632,8 @@ void ADnoteParameters::EnableVoice(const SYNTH_T &synth, int nvoice, void ADnoteVoiceParam::enable(const SYNTH_T &synth, FFTwrapper *fft, Resonance *Reson, const AbsTime *time) { - OscilSmp = new OscilGen(synth, fft, Reson); - FMSmp = new OscilGen(synth, fft, NULL); + OscilGn = new OscilGen(synth, fft, Reson); + FmGn = new OscilGen(synth, fft, NULL); AmpEnvelope = new EnvelopeParams(64, 1, time); AmpEnvelope->init(ad_voice_amp); @@ -688,8 +688,8 @@ void ADnoteParameters::KillVoice(int nvoice) void ADnoteVoiceParam::kill() { - delete OscilSmp; - delete FMSmp; + delete OscilGn; + delete FmGn; delete AmpEnvelope; delete AmpLfo; @@ -775,7 +775,7 @@ void ADnoteVoiceParam::add2XML(XMLwrapper& xml, bool fmoscilused) xml.addpar("fm_enabled", (int)PFMEnabled); xml.beginbranch("OSCIL"); - OscilSmp->add2XML(xml); + OscilGn->add2XML(xml); xml.endbranch(); @@ -883,7 +883,7 @@ void ADnoteVoiceParam::add2XML(XMLwrapper& xml, bool fmoscilused) } xml.beginbranch("OSCIL"); - FMSmp->add2XML(xml); + FmGn->add2XML(xml); xml.endbranch(); xml.endbranch(); @@ -1126,7 +1126,7 @@ void ADnoteVoiceParam::paste(ADnoteVoiceParam &a) copy(PFMEnabled); copy(PFMFixedFreq); - RCopy(OscilSmp); + RCopy(OscilGn); copy(PPanning); @@ -1185,7 +1185,7 @@ void ADnoteVoiceParam::paste(ADnoteVoiceParam &a) RCopy(FMFreqEnvelope); - RCopy(FMSmp); + RCopy(FmGn); if ( time ) { last_update_timestamp = time->time(); @@ -1263,7 +1263,7 @@ void ADnoteVoiceParam::getfromXML(XMLwrapper& xml, unsigned nvoice) PFMEnabled = (FMTYPE)xml.getpar127("fm_enabled", (int)PFMEnabled); if(xml.enterbranch("OSCIL")) { - OscilSmp->getfromXML(xml); + OscilGn->getfromXML(xml); xml.exitbranch(); } @@ -1390,7 +1390,7 @@ void ADnoteVoiceParam::getfromXML(XMLwrapper& xml, unsigned nvoice) } if(xml.enterbranch("OSCIL")) { - FMSmp->getfromXML(xml); + FmGn->getfromXML(xml); xml.exitbranch(); } diff --git a/src/Params/ADnoteParameters.h b/src/Params/ADnoteParameters.h @@ -164,7 +164,7 @@ struct ADnoteVoiceParam { unsigned char Pfilterbypass; /** Voice oscillator */ - OscilGen *OscilSmp; + OscilGen *OscilGn; /********************************** * FREQUENCY PARAMETERS * @@ -270,7 +270,7 @@ struct ADnoteVoiceParam { short int PFMVoice; /* Modulator oscillator */ - OscilGen *FMSmp; + OscilGen *FmGn; /* Modulator Volume */ float FMvolume; diff --git a/src/Synth/ADnote.cpp b/src/Synth/ADnote.cpp @@ -108,7 +108,7 @@ void ADnote::setupVoice(int nvoice) for (int i = 0; i < 14; i++) voice.pinking[i] = 0.0; - param.OscilSmp->newrandseed(prng()); + param.OscilGn->newrandseed(prng()); voice.OscilSmp = NULL; voice.FMSmp = NULL; voice.VoiceOut = NULL; @@ -170,9 +170,9 @@ void ADnote::setupVoice(int nvoice) if(pars.VoicePar[nvoice].Pextoscil != -1) vc = pars.VoicePar[nvoice].Pextoscil; if(!pars.GlobalPar.Hrandgrouping) - pars.VoicePar[vc].OscilSmp->newrandseed(prng()); + pars.VoicePar[vc].OscilGn->newrandseed(prng()); int oscposhi_start = - pars.VoicePar[vc].OscilSmp->get(NoteVoicePar[nvoice].OscilSmp, + pars.VoicePar[vc].OscilGn->get(NoteVoicePar[nvoice].OscilSmp, getvoicebasefreq(nvoice), pars.VoicePar[nvoice].Presonance); @@ -435,7 +435,7 @@ void ADnote::setupVoiceMod(int nvoice, bool first_run) //Triggers when a user enables modulation on a running voice if(!first_run && voice.FMEnabled != FMTYPE::NONE && voice.FMSmp == NULL && voice.FMVoice < 0) { - param.FMSmp->newrandseed(prng()); + param.FmGn->newrandseed(prng()); voice.FMSmp = memory.valloc<float>(synth.oscilsize + OSCIL_SMP_EXTRA_SAMPLES); memset(voice.FMSmp, 0, sizeof(float)*(synth.oscilsize + OSCIL_SMP_EXTRA_SAMPLES)); int vc = nvoice; @@ -443,17 +443,17 @@ void ADnote::setupVoiceMod(int nvoice, bool first_run) vc = param.PextFMoscil; float tmp = 1.0f; - if((pars.VoicePar[vc].FMSmp->Padaptiveharmonics != 0) + if((pars.VoicePar[vc].FmGn->Padaptiveharmonics != 0) || (voice.FMEnabled == FMTYPE::MIX) || (voice.FMEnabled == FMTYPE::RING_MOD)) tmp = getFMvoicebasefreq(nvoice); if(!pars.GlobalPar.Hrandgrouping) - pars.VoicePar[vc].FMSmp->newrandseed(prng()); + pars.VoicePar[vc].FmGn->newrandseed(prng()); for(int k = 0; k < voice.unison_size; ++k) voice.oscposhiFM[k] = (voice.oscposhi[k] - + pars.VoicePar[vc].FMSmp->get( + + pars.VoicePar[vc].FmGn->get( voice.FMSmp, tmp)) % synth.oscilsize; @@ -702,7 +702,7 @@ void ADnote::legatonote(const LegatoParams &lpars) /* Voice Modulation Parameters Init */ if((NoteVoicePar[nvoice].FMEnabled != FMTYPE::NONE) && (NoteVoicePar[nvoice].FMVoice < 0)) { - pars.VoicePar[nvoice].FMSmp->newrandseed(prng()); + pars.VoicePar[nvoice].FmGn->newrandseed(prng()); //Perform Anti-aliasing only on MIX or RING MODULATION @@ -711,7 +711,7 @@ void ADnote::legatonote(const LegatoParams &lpars) vc = pars.VoicePar[nvoice].PextFMoscil; if(!pars.GlobalPar.Hrandgrouping) - pars.VoicePar[vc].FMSmp->newrandseed(prng()); + pars.VoicePar[vc].FmGn->newrandseed(prng()); for(int i = 0; i < OSCIL_SMP_EXTRA_SAMPLES; ++i) NoteVoicePar[nvoice].FMSmp[synth.oscilsize + i] = @@ -893,7 +893,7 @@ void ADnote::initparameters(WatchManager *wm, const char *prefix) /* Voice Modulation Parameters Init */ if((vce.FMEnabled != FMTYPE::NONE) && (vce.FMVoice < 0)) { - param.FMSmp->newrandseed(prng()); + param.FmGn->newrandseed(prng()); vce.FMSmp = memory.valloc<float>(synth.oscilsize + OSCIL_SMP_EXTRA_SAMPLES); //Perform Anti-aliasing only on MIX or RING MODULATION @@ -903,17 +903,17 @@ void ADnote::initparameters(WatchManager *wm, const char *prefix) vc = param.PextFMoscil; float tmp = 1.0f; - if((pars.VoicePar[vc].FMSmp->Padaptiveharmonics != 0) + if((pars.VoicePar[vc].FmGn->Padaptiveharmonics != 0) || (vce.FMEnabled == FMTYPE::MIX) || (vce.FMEnabled == FMTYPE::RING_MOD)) tmp = getFMvoicebasefreq(nvoice); if(!pars.GlobalPar.Hrandgrouping) - pars.VoicePar[vc].FMSmp->newrandseed(prng()); + pars.VoicePar[vc].FmGn->newrandseed(prng()); for(int k = 0; k < vce.unison_size; ++k) vce.oscposhiFM[k] = (vce.oscposhi[k] - + pars.VoicePar[vc].FMSmp->get( + + pars.VoicePar[vc].FmGn->get( vce.FMSmp, tmp)) % synth.oscilsize; diff --git a/src/Tests/MessageTest.h b/src/Tests/MessageTest.h @@ -86,9 +86,9 @@ class MessageTest:public CxxTest::TestSuite ms->applyOscEvent(ms->uToB->read()); TS_ASSERT(!ms->uToB->hasNext()); - auto &osc_src = *ms->part[0]->kit[0].adpars->VoicePar[0].FMSmp; + auto &osc_src = *ms->part[0]->kit[0].adpars->VoicePar[0].FmGn; auto &osc_dst = *ms->part[0]->kit[0].padpars->oscilgen; - auto &osc_oth = *ms->part[0]->kit[0].adpars->VoicePar[1].OscilSmp; + auto &osc_oth = *ms->part[0]->kit[0].adpars->VoicePar[1].OscilGn; TS_ASSERT_EQUALS(osc_src.Pbasefuncpar, 64); osc_src.Pbasefuncpar = 32; diff --git a/src/Tests/UnisonTest.h b/src/Tests/UnisonTest.h @@ -62,7 +62,7 @@ class AdNoteTest:public CxxTest::TestSuite params = new ADnoteParameters(*synth, fft, time); //sawtooth to make things a bit more interesting - params->VoicePar[0].OscilSmp->Pcurrentbasefunc = 3; + params->VoicePar[0].OscilGn->Pcurrentbasefunc = 3; params->GlobalPar.PFilterVelocityScale = 64; params->GlobalPar.GlobalFilter->basefreq = 5076.203125;