Permalink
Browse files

Started renaming all mentions of the ZASF "Controller" object as "ZAS…

…F_Controller" to be able to use with the standard LMMS Controller.
  • Loading branch information...
1 parent b6c1bb0 commit 5d0be9ca9c80a8f677dcc8eea8fe6fdd93944b3b @Orpheon committed Jul 17, 2012
@@ -130,7 +130,7 @@ class Master
REALTYPE vuoutpeakpart[NUM_MIDI_PARTS];
unsigned char fakepeakpart[NUM_MIDI_PARTS]; //this is used to compute the "peak" when the part is disabled
- Controller ctl;
+ ZASF_Controller ctl;
int swaplr; //1 if L and R are swapped
//Sequencer
@@ -145,7 +145,7 @@ class Part
REALTYPE volume, oldvolumel, oldvolumer; //this is applied by Master
REALTYPE panning; //this is applied by Master, too
- Controller ctl; //Part controllers
+ ZASF_Controller ctl; //Part controllers
EffectMgr *partefx[NUM_PART_EFX]; //insertion part effects (they are part of the instrument)
unsigned char Pefxroute[NUM_PART_EFX]; //how the effect's output is routed(to next effect/to out)
@@ -1,7 +1,7 @@
/*
- ZynAddSubFX - a software synthesizer
+ ZASF_AddSubFX - a software synthesizer
@Orpheon
Orpheon Jul 17, 2012 Owner

Oh whoops

- Controller.cpp - (Midi) Controllers implementation
+ ZASF_Controller.cpp - (Midi) Controllers implementation
Copyright (C) 2002-2005 Nasca Octavian Paul
Author: Nasca Octavian Paul
@@ -21,19 +21,21 @@
*/
#include "Controller.h"
+#include "../../../../include/Controller.h"
+
#include <math.h>
#include <stdio.h>
-Controller::Controller()
+ZASF_Controller::ZASF_Controller()
{
defaults();
resetall();
}
-Controller::~Controller()
+ZASF_Controller::~ZASF_Controller()
{}
-void Controller::defaults()
+void ZASF_Controller::defaults()
{
setpitchwheelbendrange(200); //2 halftones
expression.receive = 1;
@@ -67,7 +69,7 @@ void Controller::defaults()
setportamento(0);
}
-void Controller::resetall()
+void ZASF_Controller::resetall()
{
setpitchwheel(0); //center
setexpression(127);
@@ -89,7 +91,7 @@ void Controller::resetall()
NRPN.vallo = -1;
}
-void Controller::setpitchwheel(int value)
+void ZASF_Controller::setpitchwheel(int value)
{
pitchwheel.data = value;
REALTYPE cents = value / 8192.0;
@@ -98,12 +100,12 @@ void Controller::setpitchwheel(int value)
//fprintf(stderr,"%ld %ld -> %.3f\n",pitchwheel.bendrange,pitchwheel.data,pitchwheel.relfreq);fflush(stderr);
}
-void Controller::setpitchwheelbendrange(unsigned short int value)
+void ZASF_Controller::setpitchwheelbendrange(unsigned short int value)
{
pitchwheel.bendrange = value;
}
-void Controller::setexpression(int value)
+void ZASF_Controller::setexpression(int value)
{
expression.data = value;
if(expression.receive != 0)
@@ -112,26 +114,26 @@ void Controller::setexpression(int value)
expression.relvolume = 1.0;
}
-void Controller::setpanning(int value)
+void ZASF_Controller::setpanning(int value)
{
panning.data = value;
panning.pan = (value / 128.0 - 0.5) * (panning.depth / 64.0);
}
-void Controller::setfiltercutoff(int value)
+void ZASF_Controller::setfiltercutoff(int value)
{
filtercutoff.data = value;
filtercutoff.relfreq =
(value - 64.0) * filtercutoff.depth / 4096.0 * 3.321928; //3.3219..=ln2(10)
}
-void Controller::setfilterq(int value)
+void ZASF_Controller::setfilterq(int value)
{
filterq.data = value;
filterq.relq = pow(30.0, (value - 64.0) / 64.0 * (filterq.depth / 64.0));
}
-void Controller::setbandwidth(int value)
+void ZASF_Controller::setbandwidth(int value)
{
bandwidth.data = value;
if(bandwidth.exponential == 0) {
@@ -148,7 +150,7 @@ void Controller::setbandwidth(int value)
;
}
-void Controller::setmodwheel(int value)
+void ZASF_Controller::setmodwheel(int value)
{
modwheel.data = value;
if(modwheel.exponential == 0) {
@@ -164,7 +166,7 @@ void Controller::setmodwheel(int value)
pow(25.0, (value - 64.0) / 64.0 * (modwheel.depth / 80.0));
}
-void Controller::setfmamp(int value)
+void ZASF_Controller::setfmamp(int value)
{
fmamp.data = value;
fmamp.relamp = value / 127.0;
@@ -174,7 +176,7 @@ void Controller::setfmamp(int value)
fmamp.relamp = 1.0;
}
-void Controller::setvolume(int value)
+void ZASF_Controller::setvolume(int value)
{
volume.data = value;
if(volume.receive != 0)
@@ -183,7 +185,7 @@ void Controller::setvolume(int value)
volume.volume = 1.0;
}
-void Controller::setsustain(int value)
+void ZASF_Controller::setsustain(int value)
{
sustain.data = value;
if(sustain.receive != 0)
@@ -192,14 +194,14 @@ void Controller::setsustain(int value)
sustain.sustain = 0;
}
-void Controller::setportamento(int value)
+void ZASF_Controller::setportamento(int value)
{
portamento.data = value;
if(portamento.receive != 0)
portamento.portamento = ((value < 64) ? 0 : 1);
}
-int Controller::initportamento(REALTYPE oldfreq,
+int ZASF_Controller::initportamento(REALTYPE oldfreq,
REALTYPE newfreq,
bool legatoflag)
{
@@ -261,7 +263,7 @@ int Controller::initportamento(REALTYPE oldfreq,
return 1;
}
-void Controller::updateportamento()
+void ZASF_Controller::updateportamento()
{
if(portamento.used == 0)
return;
@@ -276,13 +278,13 @@ void Controller::updateportamento()
}
-void Controller::setresonancecenter(int value)
+void ZASF_Controller::setresonancecenter(int value)
{
resonancecenter.data = value;
resonancecenter.relcenter =
pow(3.0, (value - 64.0) / 64.0 * (resonancecenter.depth / 64.0));
}
-void Controller::setresonancebw(int value)
+void ZASF_Controller::setresonancebw(int value)
{
resonancebandwidth.data = value;
resonancebandwidth.relbw =
@@ -291,7 +293,7 @@ void Controller::setresonancebw(int value)
//Returns 0 if there is NRPN or 1 if there is not
-int Controller::getnrpn(int *parhi, int *parlo, int *valhi, int *vallo)
+int ZASF_Controller::getnrpn(int *parhi, int *parlo, int *valhi, int *vallo)
{
if(NRPN.receive == 0)
return 1;
@@ -307,7 +309,7 @@ int Controller::getnrpn(int *parhi, int *parlo, int *valhi, int *vallo)
}
-void Controller::setparameternumber(unsigned int type, int value)
+void ZASF_Controller::setparameternumber(unsigned int type, int value)
{
switch(type) {
case C_nrpnhi:
@@ -333,7 +335,7 @@ void Controller::setparameternumber(unsigned int type, int value)
-void Controller::add2XML(XMLwrapper *xml)
+void ZASF_Controller::add2XML(XMLwrapper *xml)
{
xml->addpar("pitchwheel_bendrange", pitchwheel.bendrange);
@@ -362,7 +364,7 @@ void Controller::add2XML(XMLwrapper *xml)
xml->addpar("resonance_bandwidth_depth", resonancebandwidth.depth);
}
-void Controller::getfromXML(XMLwrapper *xml)
+void ZASF_Controller::getfromXML(XMLwrapper *xml)
{
pitchwheel.bendrange = xml->getpar("pitchwheel_bendrange",
pitchwheel.bendrange,
@@ -1,5 +1,5 @@
/*
- ZynAddSubFX - a software synthesizer
+ ZASF_AddSubFX - a software synthesizer
Controller.h - (Midi) Controllers implementation
Copyright (C) 2002-2005 Nasca Octavian Paul
@@ -26,13 +26,14 @@
#include "../globals.h"
#include "../Misc/XMLwrapper.h"
+#include "../../../../include/Controller.h"
/**(Midi) Controllers implementation*/
-class Controller
+class ZASF_Controller
{
public:
- Controller();
- ~Controller();
+ ZASF_Controller();
+ ~ZASF_Controller();
void resetall();
void add2XML(XMLwrapper *xml);
@@ -30,7 +30,7 @@
ADnote::ADnote(ADnoteParameters *pars,
- Controller *ctl_,
+ ZASF_Controller *ctl_,
REALTYPE freq,
REALTYPE velocity,
int portamento_,
@@ -426,7 +426,7 @@ void ADnote::ADlegatonote(REALTYPE freq,
bool externcall)
{
ADnoteParameters *pars = partparams;
- //Controller *ctl_=ctl;
+ //ZASF_Controller *ctl_=ctl;
// Manage legato stuff
if(externcall)
@@ -1214,7 +1214,7 @@ void ADnote::computecurrentparameters()
/ 100.0;
voicefreq = getvoicebasefreq(nvoice)
* pow(2, (voicepitch + globalpitch) / 12.0); //Hz frequency
- voicefreq *= ctl->pitchwheel.relfreq; //change the frequency by the controller
+ voicefreq *= ctl->pitchwheel.relfreq; //change the frequency by the ZASF_Controller
setfreq(nvoice, voicefreq * portamentofreqrap);
/***************/
@@ -43,13 +43,13 @@ class ADnote //ADDitive note
public:
/**Constructor.
* @param pars Note Parameters
- * @param ctl_ Pointer to system Controller
+ * @param ctl_ Pointer to system ZASF_Controller
* @param freq Base frequency for note
* @param velocity Velocity of note
* @param portamento_ 1 if the note has portamento
* @param midinote_ The midi number of the note
* @param besilent Start silent note if true*/
- ADnote(ADnoteParameters *pars, Controller *ctl_, REALTYPE freq,
+ ADnote(ADnoteParameters *pars, ZASF_Controller *ctl_, REALTYPE freq,
REALTYPE velocity, int portamento_, int midinote_,
bool besilent);
/**Destructor*/
@@ -131,7 +131,7 @@ class ADnote //ADDitive note
REALTYPE velocity, basefreq;
ONOFFTYPE NoteEnabled;
- Controller *ctl;
+ ZASF_Controller *ctl;
/*****************************************************************/
/* GLOBAL PARAMETERS */
@@ -23,7 +23,7 @@
#include "../Misc/Config.h"
PADnote::PADnote(PADnoteParameters *parameters,
- Controller *ctl_,
+ ZASF_Controller *ctl_,
REALTYPE freq,
REALTYPE velocity,
int portamento_,
@@ -180,7 +180,7 @@ void PADnote::PADlegatonote(REALTYPE freq,
bool externcall)
{
PADnoteParameters *parameters = pars;
- //Controller *ctl_=ctl;
+ //ZASF_Controller *ctl_=ctl;
// Manage legato stuff
if(externcall)
@@ -34,7 +34,7 @@ class PADnote
{
public:
PADnote(PADnoteParameters *parameters,
- Controller *ctl_,
+ ZASF_Controller *ctl_,
REALTYPE freq,
REALTYPE velocity,
int portamento_,
@@ -119,7 +119,7 @@ class PADnote
REALTYPE globaloldamplitude, globalnewamplitude, velocity, realfreq;
REALTYPE *tmpwave;
- Controller *ctl;
+ ZASF_Controller *ctl;
// Legato vars
struct {
@@ -28,7 +28,7 @@
#include "../Misc/Util.h"
SUBnote::SUBnote(SUBnoteParameters *parameters,
- Controller *ctl_,
+ ZASF_Controller *ctl_,
REALTYPE freq,
REALTYPE velocity,
int portamento_,
@@ -203,7 +203,7 @@ void SUBnote::SUBlegatonote(REALTYPE freq,
bool externcall)
{
//SUBnoteParameters *parameters=pars;
- //Controller *ctl_=ctl;
+ //ZASF_Controller *ctl_=ctl;
// Manage legato stuff
if(externcall)
@@ -543,7 +543,7 @@ void SUBnote::computecurrentparameters()
envbw = BandWidthEnvelope->envout();
envbw = pow(2, envbw);
}
- envbw *= ctl->bandwidth.relbw; //bandwidth controller
+ envbw *= ctl->bandwidth.relbw; //bandwidth ZASF_Controller
REALTYPE tmpgain = 1.0 / sqrt(envbw * envfreq);
@@ -33,7 +33,7 @@ class SUBnote
{
public:
SUBnote(SUBnoteParameters *parameters,
- Controller *ctl_,
+ ZASF_Controller *ctl_,
REALTYPE freq,
REALTYPE velocity,
int portamento_,
@@ -107,7 +107,7 @@ class SUBnote
REALTYPE *tmpsmp;
REALTYPE *tmprnd; //this is filled with random numbers
- Controller *ctl;
+ ZASF_Controller *ctl;
int oldpitchwheel, oldbandwidth;
REALTYPE globalfiltercenterq;

0 comments on commit 5d0be9c

Please sign in to comment.