2 ZynAddSubFX - a software synthesizer
4 Controller.h - (Midi) Controllers implementation
5 Copyright (C) 2002-2005 Nasca Octavian Paul
6 Author: Nasca Octavian Paul
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
19 #include "../globals.h"
23 /**(Midi) Controllers implementation*/
27 Controller(const SYNTH_T
&synth
, const AbsTime
*time
= nullptr);
31 void add2XML(XMLwrapper
& xml
);
33 void getfromXML(XMLwrapper
& xml
);
35 //Controllers functions
36 void setpitchwheel(int value
);
37 void setpitchwheel(void);
38 void setexpression(int value
);
39 void setexpression(void);
40 void setpanning(int value
);
41 void setpanning(void);
42 void setfiltercutoff(int value
);
43 void setfiltercutoff(void);
44 void setfilterq(int value
);
45 void setfilterq(void);
46 void setbandwidth(int value
);
47 void setbandwidth(void);
48 void setmodwheel(int value
);
49 void setmodwheel(void);
50 void setfmamp(int value
);
52 void setvolume(int value
);
54 void setsustain(int value
);
55 void setsustain(void);
56 /**Enable or disable portamento
57 * @param value 0-127 MIDI value (greater than 64 enables)*/
58 void setportamento(int value
);
59 void setresonancecenter(int value
);
60 void setresonancecenter(void);
61 void setresonancebw(int value
);
62 void setresonancebw(void);
65 void setparameternumber(unsigned int type
, int value
); //used for RPN and NRPN's
66 int getnrpn(int *parhi
, int *parlo
, int *valhi
, int *vallo
);
69 struct { //Pitch Wheel
71 bool is_split
; //Up and down bends may be different
72 short int bendrange
; //bendrange is in cents
73 short int bendrange_down
;
74 float relfreq
; //the relative frequency (default is 1.0f)
80 unsigned char receive
;
90 struct { //Filter cutoff
106 unsigned char exponential
;
109 struct { //Modulation Wheel
113 unsigned char exponential
;
116 struct { //FM amplitude
119 unsigned char receive
;
125 unsigned char receive
;
130 unsigned char receive
;
133 struct { /**<Portamento*/
136 unsigned char portamento
;
137 /**Whether the portamento midi events are received or not*/
138 unsigned char receive
;
139 /**Whether legato playing is needed to get portamento*/
140 unsigned char automode
;
141 /** The time that it takes for the portamento to complete
143 * Translates in an expontal fashion to 0 Seconds to 1.93f Seconds
144 * of completion time*/
146 /**If the portamento is proportinal to the distance spanned
148 * 0 - constant time(default)
150 unsigned char proportional
;
151 /**Rate of proportinal portamento*/
152 unsigned char propRate
;
153 /**Depth of proportinal portamento*/
154 unsigned char propDepth
;
155 /**pitchthresh is the threshold of enabling protamento*/
156 unsigned char pitchthresh
;
157 /**enable the portamento only below(0)/above(1) the threshold*/
158 unsigned char pitchthreshtype
;
160 /**this value represent how the portamento time is reduced
161 * 0 - for down portamento
162 * 1-63 - the up portamento's time is smaller than the down portamento
163 * 64 - the portamento time is always the same
164 * 64-126 - the down portamento's time is smaller than the up portamento
165 * 127 - for upper portamento
166 * 'up portamento' means when the frequency is rising
167 * (eg: the portamento is from 200Hz to 300 Hz)
168 * 'down portamento' means when the frequency is lowering
169 * (eg: the portamento is from 300Hz to 200 Hz)
171 unsigned char updowntimestretch
;
174 struct { //Resonance Center Frequency
180 struct { //Resonance Bandwidth
184 } resonancebandwidth
;
191 unsigned char receive
; //this is saved to disk by Master
196 int64_t last_update_timestamp
;
198 static const rtosc::Ports ports
;
200 const SYNTH_T
&synth
;