1 //===========================================================================
2 //
3 // DeicsOnze an emulator of the YAMAHA DX11 synthesizer
4 //
5 // Version 0.5.5
6 //
7 //
8 //
9 //
10 // Copyright (c) 2004-2006 Nil Geisweiller
11 //
12 //
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 // 02111-1301, USA or point your web browser to http://www.gnu.org.
28 //===========================================================================
29
30 #include "deicsonze.h"
31 #include "deicsonzeplugin.h"
32 #include "libsimpleplugin/simpler_plugin.h"
33 //#include "ctrl.h"
34 #include "fastlog.h"
35 #include "muse/midi_consts.h"
36 #include "awl/floatentry.h"
37 #include "awl/slider.h"
38 #include "awl/checkbox.h"
39
40 using Awl::FloatEntry;
41 using Awl::Slider;
42 using Awl::CheckBox;
43
44 class PluginDialog;
45
initPluginReverb(MusESimplePlugin::Plugin * pluginReverb)46 void DeicsOnze::initPluginReverb(MusESimplePlugin::Plugin* pluginReverb) {
47 if(_pluginIReverb) delete(_pluginIReverb);
48 _pluginIReverb = 0;
49
50 _pluginIReverb = pluginReverb->createPluginI(
51 2, // Channels
52 sampleRate(),
53 DEI_segmentSize,
54 DEI_useDenormalBias,
55 DEI_denormalBias);
56 if(!_pluginIReverb)
57 return;
58
59 for(int i = 0; i < (int)_pluginIReverb->parameters(); i++) {
60
61
62 // From DSSI host. Maybe use this to add automation controllers. Problems with this method.
63 // // Support a special block for dssi synth ladspa controllers.
64 // // Put the ID at a special block after plugins (far after).
65 // //int id = MusECore::genACnum(MusECore::MAX_PLUGINS, cip);
66 // int id = MusECore::genACnum(MusECore::MAX_PLUGINS, i);
67
68 // FIXME FIXME Tim
69 /* Ctrl* c = new Ctrl();
70 c->setCurVal((float)pluginReverb->defaultValue(i));
71 _pluginIReverb->setControllerList(c);
72 */
73
74 //setReverbParam(i, pluginReverb->defaultValue(i));
75 //setReverbParam(i, _pluginIReverb->defaultValue(i));
76 _pluginIReverb->setParam(i, _pluginIReverb->defaultValue(i));
77 }
78
79 //send build gui to the gui
80 char data;
81 data = SYSEX_BUILDGUIREVERB;
82 MusECore::MidiPlayEvent evSysex(0, 0,MusECore::ME_SYSEX,(const unsigned char*)&data, 1);
83 _gui->writeEvent(evSysex);
84 }
85
initPluginChorus(MusESimplePlugin::Plugin * pluginChorus)86 void DeicsOnze::initPluginChorus(MusESimplePlugin::Plugin* pluginChorus) {
87 if(_pluginIChorus) delete(_pluginIChorus);
88 _pluginIChorus = 0;
89
90 _pluginIChorus = pluginChorus->createPluginI(
91 2, // Channels
92 sampleRate(),
93 DEI_segmentSize,
94 DEI_useDenormalBias,
95 DEI_denormalBias);
96 if(!_pluginIChorus)
97 return;
98
99 //for(int i = 0; i < pluginChorus->parameter(); i++) {
100 for(int i = 0; i < (int)_pluginIChorus->parameters(); i++) {
101
102 // FIXME FIXME Tim
103 /*
104 Ctrl* c = new Ctrl();
105 c->setCurVal((float)pluginChorus->defaultValue(i));
106 _pluginIChorus->setControllerList(c);
107 */
108
109 //setChorusParam(i, pluginChorus->defaultValue(i));
110 //setChorusParam(i, _pluginIChorus->defaultValue(i));
111 _pluginIChorus->setParam(i, _pluginIChorus->defaultValue(i));
112 }
113
114 //send build gui to the gui
115 char data;
116 data = SYSEX_BUILDGUICHORUS;
117 MusECore::MidiPlayEvent evSysex(0, 0,MusECore::ME_SYSEX,(const unsigned char*)&data, 1);
118 _gui->writeEvent(evSysex);
119 }
120
initPluginDelay(MusESimplePlugin::Plugin * pluginDelay)121 void DeicsOnze::initPluginDelay(MusESimplePlugin::Plugin* pluginDelay) {
122 if(_pluginIDelay) delete(_pluginIDelay);
123 _pluginIDelay = 0;
124
125 _pluginIDelay = pluginDelay->createPluginI(
126 2, // Channels
127 sampleRate(),
128 DEI_segmentSize,
129 DEI_useDenormalBias,
130 DEI_denormalBias);
131 if(!_pluginIDelay)
132 return;
133
134 for(int i = 0; i < (int)_pluginIDelay->parameters(); i++) {
135
136 // FIXME FIXME Tim
137 /*
138 Ctrl* c = new Ctrl();
139 c->setCurVal((float)pluginDelay->defaultValue(i));
140 _pluginIDelay->setControllerList(c);
141 */
142
143 //setChorusParam(i, pluginDelay->defaultValue(i));
144 //setDelayParam(i, _pluginIDelay->defaultValue(i));
145 _pluginIDelay->setParam(i, _pluginIDelay->defaultValue(i));
146 }
147
148 //setDelayDryWet(1);
149 _pluginIDelay->setParam(5, 1.0);
150
151 float f;
152 char dataDelayBPM[sizeof(float)+1];
153 dataDelayBPM[0] = SYSEX_DELAYBPM;
154 f = getDelayBPM();
155 memcpy(&dataDelayBPM[1], &f, sizeof(float));
156 MusECore::MidiPlayEvent evSysexDelayBPM(0, 0,MusECore::ME_SYSEX,
157 (const unsigned char*)dataDelayBPM,
158 sizeof(float)+1);
159 _gui->writeEvent(evSysexDelayBPM);
160 char dataDelayBeatRatio[sizeof(float)+1];
161 dataDelayBeatRatio[0] = SYSEX_DELAYBEATRATIO;
162 f = getDelayBeatRatio();
163 memcpy(&dataDelayBeatRatio[1], &f, sizeof(float));
164 MusECore::MidiPlayEvent evSysexDelayBeatRatio(0, 0,MusECore::ME_SYSEX,
165 (const unsigned char*)dataDelayBeatRatio,
166 sizeof(float)+1);
167 _gui->writeEvent(evSysexDelayBeatRatio);
168 char dataDelayFeedback[sizeof(float)+1];
169 dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK;
170 f = getDelayFeedback();
171 memcpy(&dataDelayFeedback[1], &f, sizeof(float));
172 MusECore::MidiPlayEvent evSysexDelayFeedback(0, 0,MusECore::ME_SYSEX,
173 (const unsigned char*)dataDelayFeedback,
174 sizeof(float)+1);
175 _gui->writeEvent(evSysexDelayFeedback);
176 char dataDelayLFOFreq[sizeof(float)+1];
177 dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ;
178 f = getDelayLFOFreq();
179 memcpy(&dataDelayLFOFreq[1], &f, sizeof(float));
180 MusECore::MidiPlayEvent evSysexDelayLFOFreq(0, 0,MusECore::ME_SYSEX,
181 (const unsigned char*)dataDelayLFOFreq,
182 sizeof(float)+1);
183 _gui->writeEvent(evSysexDelayLFOFreq);
184 char dataDelayLFODepth[sizeof(float)+1];
185 dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH;
186 f = getDelayLFODepth();
187 memcpy(&dataDelayLFODepth[1], &f, sizeof(float));
188 MusECore::MidiPlayEvent evSysexDelayLFODepth(0, 0,MusECore::ME_SYSEX,
189 (const unsigned char*)dataDelayLFODepth,
190 sizeof(float)+1);
191 _gui->writeEvent(evSysexDelayLFODepth);
192 char dataDelayWetDryMix[sizeof(float)+1];
193 dataDelayWetDryMix[0] = SYSEX_DELAYWETDRYMIX;
194 f = getDelayDryWet();
195 memcpy(&dataDelayWetDryMix[1], &f, sizeof(float));
196 MusECore::MidiPlayEvent evSysexDelayWetDryMix(0, 0,MusECore::ME_SYSEX,
197 (const unsigned char*)dataDelayWetDryMix,
198 sizeof(float)+1);
199 _gui->writeEvent(evSysexDelayWetDryMix);
200 }
201
setReverbParam(int index,float val)202 void DeicsOnze::setReverbParam(int index, float val) {
203 ///if(_pluginIReverb) _pluginIReverb->controller(index)->setCurVal((float)val);
204 if(_pluginIReverb) _pluginIReverb->setParam(index, val);
205 else printf("Warning : no DeicsOnze reverb loaded\n");
206 }
setChorusParam(int index,float val)207 void DeicsOnze::setChorusParam(int index, float val) {
208 ///if(_pluginIChorus) _pluginIChorus->controller(index)->setCurVal((float)val);
209 if(_pluginIChorus) _pluginIChorus->setParam(index, val);
210 else printf("Warning : no DeicsOnze chorus loaded\n");
211 }
setDelayParam(int index,float val)212 void DeicsOnze::setDelayParam(int index, float val) {
213 ///if(_pluginIDelay) _pluginIDelay->controller(index)->setCurVal((float)val);
214 if(_pluginIDelay) _pluginIDelay->setParam(index, val);
215 else printf("Warning : no DeicsOnze delay loaded\n");
216 }
217
getReverbParam(int index) const218 float DeicsOnze::getReverbParam(int index) const {
219 ///if(_pluginIReverb) return _pluginIReverb->controller(index)->curVal().f;
220 if(_pluginIReverb) return _pluginIReverb->param(index);
221 else {
222 fprintf(stderr, "Warning : no DeicsOnze reverb loaded\n");
223 return 0.0;
224 }
225 }
226
getChorusParam(int index) const227 float DeicsOnze::getChorusParam(int index) const {
228 ///if(_pluginIChorus) return _pluginIChorus->controller(index)->curVal().f;
229 if(_pluginIChorus) return _pluginIChorus->param(index);
230 else {
231 fprintf(stderr, "Warning : no DeicsOnze chorus loaded\n");
232 return 0.0;
233 }
234 }
235
getDelayParam(int index) const236 float DeicsOnze::getDelayParam(int index) const {
237 ///if(_pluginIDelay) return _pluginIDelay->controller(index)->curVal().f;
238 if(_pluginIDelay) return _pluginIDelay->param(index);
239 else {
240 fprintf(stderr, "Warning : no DeicsOnze delay loaded\n");
241 return 0.0;
242 }
243 }
244
addPluginCheckBox(int index,QString text,bool toggled,QWidget * parent,QGridLayout * grid,bool isReverb)245 void DeicsOnzeGui::addPluginCheckBox(int index, QString text, bool toggled,
246 QWidget* parent, QGridLayout* grid,
247 bool isReverb) {
248 CheckBox* cb = new CheckBox(parent);
249 cb->setId(index);
250 cb->setText(text);
251 cb->setChecked(toggled);
252 grid->addWidget(cb, index, 0);
253 //push on vectors
254 if(isReverb) {
255 _reverbSliderVector.push_back(NULL);
256 _reverbFloatEntryVector.push_back(NULL);
257 _reverbCheckBoxVector.push_back(cb);
258 }
259 else {
260 _chorusSliderVector.push_back(NULL);
261 _chorusFloatEntryVector.push_back(NULL);
262 _chorusCheckBoxVector.push_back(cb);
263 }
264 //connect slots
265 if(isReverb) {
266 connect(cb, SIGNAL(valueChanged(double, int)),
267 this, SLOT(setReverbCheckBox(double, int)));
268 }
269 else {
270 connect(cb, SIGNAL(valueChanged(double, int)),
271 this, SLOT(setChorusCheckBox(double, int)));
272 }
273 }
274
addPluginIntSlider(int index,QString text,double min,double max,double val,QWidget * parent,QGridLayout * grid,bool isReverb)275 void DeicsOnzeGui::addPluginIntSlider(int index, QString text, double min,
276 double max, double val, QWidget* parent,
277 QGridLayout* grid, bool isReverb) {
278 addPluginSlider(index, text, false, min, max, val, parent, grid, isReverb);
279 }
280
addPluginSlider(int index,QString text,bool isLog,double min,double max,double val,QWidget * parent,QGridLayout * grid,bool isReverb)281 void DeicsOnzeGui::addPluginSlider(int index, QString text, bool isLog,
282 double min, double max, double val,
283 QWidget* parent, QGridLayout* grid,
284 bool isReverb) {
285 QLabel* l = new QLabel(text, parent);
286 grid->addWidget(l, index, 0);
287 FloatEntry* f = new FloatEntry(parent);
288 f->setId(index);
289 f->setLog(isLog);
290 f->setLogRange(min, max);
291 f->setValue(val);
292 f->setMaximumWidth(72);
293 grid->addWidget(f, index, 1);
294 Slider* s = new Slider(parent);
295 s->setId(index);
296 s->setLog(isLog);
297 s->setLogRange(min, max);
298 s->setValue(val);
299 s->setOrientation(Qt::Horizontal);
300 //s->setFixedHeight(h);
301 s->setLineStep((min-max)/100.0);
302 s->setPageStep((min-max)/10.0);
303 grid->addWidget(s, index, 2);
304 //push on vectors
305 if(isReverb) {
306 _reverbSliderVector.push_back(s);
307 _reverbFloatEntryVector.push_back(f);
308 _reverbCheckBoxVector.push_back(NULL);
309 }
310 else {
311 _chorusSliderVector.push_back(s);
312 _chorusFloatEntryVector.push_back(f);
313 _chorusCheckBoxVector.push_back(NULL);
314 }
315 //connect slots
316 if(isReverb) {
317 connect(f, SIGNAL(valueChanged(double, int)),
318 this, SLOT(setReverbFloatEntry(double, int)));
319 connect(s, SIGNAL(valueChanged(double, int)),
320 this, SLOT(setReverbSlider(double, int)));
321 }
322 else {
323 connect(f, SIGNAL(valueChanged(double, int)),
324 this, SLOT(setChorusFloatEntry(double, int)));
325 connect(s, SIGNAL(valueChanged(double, int)),
326 this, SLOT(setChorusSlider(double, int)));
327 }
328 }
329
buildGuiReverb()330 void DeicsOnzeGui::buildGuiReverb() {
331 if(!_deicsOnze->_pluginIReverb)
332 return;
333 MusESimplePlugin::PluginI* plugI = _deicsOnze->_pluginIReverb;
334 QString name = plugI->name();
335 name.resize(name.size()-2);
336 updateLadspaReverbLineEdit(name);
337 //build super layout
338 if(parametersReverbGroupBox->layout())
339 delete(parametersReverbGroupBox->layout());
340 QGridLayout* superLayout = new QGridLayout(parametersReverbGroupBox);
341 parametersReverbGroupBox->setLayout(superLayout);
342 //build super widget
343 if(_reverbSuperWidget) delete(_reverbSuperWidget);
344 _reverbSuperWidget = new QWidget(parametersReverbGroupBox);
345 superLayout->addWidget(_reverbSuperWidget);
346 //build grid
347 QGridLayout* grid = new QGridLayout(_reverbSuperWidget);
348 _reverbSuperWidget->setLayout(grid);
349 grid->setSpacing(0);
350 //init vectors
351 if(!_reverbSliderVector.empty()) _reverbSliderVector.clear();
352 if(!_reverbFloatEntryVector.empty()) _reverbFloatEntryVector.clear();
353 if(!_reverbCheckBoxVector.empty()) _reverbCheckBoxVector.clear();
354 //build sliders
355 for(int i = 0; i < (int)plugI->plugin()->parameter(); i++) {
356 float min, max, val;
357 plugI->range(i, &min, &max);
358
359 val = _deicsOnze->getReverbParam(i);
360 if(plugI->isBool(i))
361 addPluginCheckBox(i, plugI->paramName(i), val > 0.0,
362 _reverbSuperWidget, grid, true);
363 else if(plugI->isInt(i))
364 addPluginIntSlider(i, plugI->paramName(i), rint(min), rint(max),
365 rint(val), _reverbSuperWidget, grid, true);
366 else
367 addPluginSlider(i, plugI->paramName(i), plugI->isLog(i),
368 min, max, val, _reverbSuperWidget, grid, true);
369 }
370 //update colors of the new sliders (and the whole gui actually)
371 setEditTextColor(reinterpret_cast<const QColor &>(*etColor));
372 setEditBackgroundColor(reinterpret_cast<const QColor &>(*ebColor));
373 }
374
buildGuiChorus()375 void DeicsOnzeGui::buildGuiChorus() {
376 if(!_deicsOnze->_pluginIChorus)
377 return;
378 MusESimplePlugin::PluginI* plugI = _deicsOnze->_pluginIChorus;
379 QString name = plugI->name();
380 name.resize(name.size()-2);
381 updateLadspaChorusLineEdit(name);
382 //build super layout
383 if(parametersChorusGroupBox->layout())
384 delete(parametersChorusGroupBox->layout());
385 QGridLayout* superLayout = new QGridLayout(parametersChorusGroupBox);
386 parametersChorusGroupBox->setLayout(superLayout);
387 //build super widget
388 if(_chorusSuperWidget) delete(_chorusSuperWidget);
389 _chorusSuperWidget = new QWidget(parametersChorusGroupBox);
390 superLayout->addWidget(_chorusSuperWidget);
391 //build grid
392 QGridLayout* grid = new QGridLayout(_chorusSuperWidget);
393 _chorusSuperWidget->setLayout(grid);
394 grid->setSpacing(2);
395 //init vectors
396 if(!_chorusSliderVector.empty()) _chorusSliderVector.clear();
397 if(!_chorusFloatEntryVector.empty()) _chorusFloatEntryVector.clear();
398 if(!_chorusCheckBoxVector.empty()) _chorusCheckBoxVector.clear();
399 //build sliders
400 for(int i = 0; i < (int)plugI->plugin()->parameter(); i++) {
401 float min, max, val;
402 plugI->range(i, &min, &max);
403
404 val = _deicsOnze->getChorusParam(i);
405 if(plugI->isBool(i))
406 addPluginCheckBox(i, plugI->paramName(i), val > 0.0,
407 _chorusSuperWidget, grid, false);
408 else if(plugI->isInt(i))
409 addPluginIntSlider(i, plugI->paramName(i), rint(min), rint(max),
410 rint(val), _chorusSuperWidget, grid, false);
411 else
412 addPluginSlider(i, plugI->paramName(i), plugI->isLog(i),
413 min, max, val, _chorusSuperWidget, grid, false);
414 }
415 //update colors of the new sliders (and the whole gui actually)
416 setEditTextColor(reinterpret_cast<const QColor &>(*etColor));
417 setEditBackgroundColor(reinterpret_cast<const QColor &>(*ebColor));
418 }
419
420 //setReverbCheckBox is used, by the way, to send the value
421 //of the parameter because it sends a double and does not
422 //change any thing
setReverbCheckBox(double v,int i)423 void DeicsOnzeGui::setReverbCheckBox(double v, int i) {
424 // REMOVE Tim. Or keep. TESTING...
425 // if(i>=256) {
426 // printf("setReverbCheckBox Error : controller index >= 256\n");
427 // return;
428 // }
429 // float f = (float)v;
430 // unsigned char message[sizeof(float)+4];
431 // message[0]=MUSE_SYNTH_SYSEX_MFG_ID;
432 // message[1]=DEICSONZE_UNIQUE_ID;
433 // message[2]=SYSEX_REVERBPARAM;
434 // message[3]=(unsigned char)i;
435 // memcpy(&message[4], &f, sizeof(float));
436 // sendSysex(message, sizeof(float)+4);
437
438 // Putting directly to the control FIFO without SYSEX should be OK. Tim.
439 _deicsOnze->setReverbParam(i, v);
440 }
441
442 //setChorusCheckBox is used, by the way, to send the value
443 //of the parameter because it sends a double and does not
444 //change any thing
setChorusCheckBox(double v,int i)445 void DeicsOnzeGui::setChorusCheckBox(double v, int i) {
446 // REMOVE Tim. Or keep. TESTING...
447 // if(i>=256) {
448 // printf("setChorusCheckBox Error : controller index >= 256\n");
449 // return;
450 // }
451 // float f = (float)v;
452 // unsigned char message[sizeof(float)+4];
453 // message[0]=MUSE_SYNTH_SYSEX_MFG_ID;
454 // message[1]=DEICSONZE_UNIQUE_ID;
455 // message[2]=SYSEX_CHORUSPARAM;
456 // message[3]=(unsigned char)i;
457 // memcpy(&message[4], &f, sizeof(float));
458 // sendSysex(message, sizeof(float)+4);
459
460 // Putting directly to the control FIFO without SYSEX should be OK. Tim.
461 _deicsOnze->setChorusParam(i, v);
462 }
463
setReverbFloatEntry(double v,int i)464 void DeicsOnzeGui::setReverbFloatEntry(double v, int i) {
465 if(_deicsOnze->_pluginIReverb) {
466
467 if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v);
468 updateReverbFloatEntry(v, i);
469 updateReverbSlider(v, i);
470 setReverbCheckBox(v, i); //because this send the SYSEX
471 }
472 else printf("Warning : no DeicsOnze reverb loaded\n");
473 }
setReverbSlider(double v,int i)474 void DeicsOnzeGui::setReverbSlider(double v, int i) {
475 if(_deicsOnze->_pluginIReverb) {
476
477 if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v);
478 updateReverbFloatEntry(v, i);
479 updateReverbSlider(v, i);
480 setReverbCheckBox(v, i); //because this send the SYSEX
481 }
482 else printf("Warning : no DeicsOnze reverb loaded\n");
483 }
setChorusFloatEntry(double v,int i)484 void DeicsOnzeGui::setChorusFloatEntry(double v, int i) {
485 if(_deicsOnze->_pluginIReverb) {
486 if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v);
487 updateChorusFloatEntry(v, i);
488 updateChorusSlider(v, i);
489 setChorusCheckBox(v, i); //because this send the SYSEX
490 }
491 else printf("Warning : no DeicsOnze chorus loaded\n");
492 }
setChorusSlider(double v,int i)493 void DeicsOnzeGui::setChorusSlider(double v, int i) {
494 if(_deicsOnze->_pluginIReverb) {
495 if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v);
496 updateChorusSlider(v, i);
497 updateChorusFloatEntry(v, i);
498 setChorusCheckBox(v, i); //because this send the SYSEX
499 }
500 else printf("Warning : no DeicsOnze chorus loaded\n");
501 }
502
503 //updates
updateReverbSlider(double v,int i)504 void DeicsOnzeGui::updateReverbSlider(double v, int i) {
505 if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) {
506 _reverbSliderVector[i]->blockSignals(true);
507 _reverbSliderVector[i]->setValue(v);
508 _reverbSliderVector[i]->blockSignals(false);
509 }
510 }
updateReverbFloatEntry(double v,int i)511 void DeicsOnzeGui::updateReverbFloatEntry(double v, int i) {
512 if(i < (int)_reverbFloatEntryVector.size() && _reverbFloatEntryVector[i]) {
513 _reverbFloatEntryVector[i]->blockSignals(true);
514 _reverbFloatEntryVector[i]->setValue(v);
515 _reverbFloatEntryVector[i]->blockSignals(false);
516 }
517 }
updateChorusSlider(double v,int i)518 void DeicsOnzeGui::updateChorusSlider(double v, int i) {
519 if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) {
520 _chorusSliderVector[i]->blockSignals(true);
521 _chorusSliderVector[i]->setValue(v);
522 _chorusSliderVector[i]->blockSignals(false);
523 }
524 }
updateChorusFloatEntry(double v,int i)525 void DeicsOnzeGui::updateChorusFloatEntry(double v, int i) {
526 if(i < (int)_chorusFloatEntryVector.size() && _chorusFloatEntryVector[i]) {
527 _chorusFloatEntryVector[i]->blockSignals(true);
528 _chorusFloatEntryVector[i]->setValue(v);
529 _chorusFloatEntryVector[i]->blockSignals(false);
530 }
531 }
532
533 //-------------------------------------------------------------
534 // set Delay
535 //-------------------------------------------------------------
setDelayBPM(float val)536 void DeicsOnze::setDelayBPM(float val) {
537 ///if(_pluginIDelay) _pluginIDelay->controller(0)->setCurVal(val);
538 if(_pluginIDelay) _pluginIDelay->setParam(0, val);
539 else printf("Warning : no DeicsOnze delay loaded\n");
540 }
setDelayBeatRatio(float val)541 void DeicsOnze::setDelayBeatRatio(float val) {
542 ///if(_pluginIDelay) _pluginIDelay->controller(1)->setCurVal(val);
543 if(_pluginIDelay) _pluginIDelay->setParam(1, val);
544 else printf("Warning : no DeicsOnze delay loaded\n");
545 }
getDelayBPM() const546 float DeicsOnze::getDelayBPM() const {
547 ///if(_pluginIDelay) return _pluginIDelay->controller(0)->curVal().f;
548 if(_pluginIDelay) return _pluginIDelay->param(0);
549 else {
550 printf("Warning : no DeicsOnze delay loaded\n");
551 return 0.0;
552 }
553 }
getDelayBeatRatio() const554 float DeicsOnze::getDelayBeatRatio() const {
555 ///if(_pluginIDelay) return _pluginIDelay->controller(1)->curVal().f;
556 if(_pluginIDelay) return _pluginIDelay->param(1);
557 else {
558 printf("Warning : no DeicsOnze delay loaded\n");
559 return 0.0;
560 }
561 }
setDelayFeedback(float val)562 void DeicsOnze::setDelayFeedback(float val) {
563 ///if(_pluginIDelay) return _pluginIDelay->controller(2)->setCurVal(val);
564 if(_pluginIDelay) return _pluginIDelay->setParam(2, val);
565 else printf("Warning : no DeicsOnze delay loaded\n");
566 }
getDelayFeedback() const567 float DeicsOnze::getDelayFeedback() const {
568 ///if(_pluginIDelay) return _pluginIDelay->controller(2)->curVal().f;
569 if(_pluginIDelay) return _pluginIDelay->param(2);
570 else {
571 printf("Warning : no DeicsOnze delay loaded\n");
572 return 0.0;
573 }
574 }
setDelayLFOFreq(float val)575 void DeicsOnze::setDelayLFOFreq(float val) {
576 ///if(_pluginIDelay) _pluginIDelay->controller(3)->setCurVal(val);
577 if(_pluginIDelay) _pluginIDelay->setParam(3, val);
578 else printf("Warning : no DeicsOnze delay loaded\n");
579 }
getDelayLFOFreq() const580 float DeicsOnze::getDelayLFOFreq() const {
581 ///if(_pluginIDelay) return _pluginIDelay->controller(3)->curVal().f;
582 if(_pluginIDelay) return _pluginIDelay->param(3);
583 else {
584 printf("Warning : no DeicsOnze delay loaded\n");
585 return 0.0;
586 }
587 }
setDelayLFODepth(float val)588 void DeicsOnze::setDelayLFODepth(float val) {
589 ///if(_pluginIDelay) _pluginIDelay->controller(4)->setCurVal(val);
590 if(_pluginIDelay) _pluginIDelay->setParam(4, val);
591 else printf("Warning : no DeicsOnze delay loaded\n");
592 }
getDelayLFODepth() const593 float DeicsOnze::getDelayLFODepth() const {
594 ///if(_pluginIDelay) return _pluginIDelay->controller(4)->curVal().f;
595 if(_pluginIDelay) return _pluginIDelay->param(4);
596 else {
597 printf("Warning : no DeicsOnze delay loaded\n");
598 return 0.0;
599 }
600 }
setDelayDryWet(float val)601 void DeicsOnze::setDelayDryWet(float val) {
602 ///if(_pluginIDelay) _pluginIDelay->controller(5)->setCurVal(val);
603 if(_pluginIDelay) _pluginIDelay->setParam(5, val);
604 else printf("Warning : no DeicsOnze delay loaded\n");
605 }
getDelayDryWet() const606 float DeicsOnze::getDelayDryWet() const {
607 ///if(_pluginIDelay) return _pluginIDelay->controller(5)->curVal().f;
608 if(_pluginIDelay) return _pluginIDelay->param(5);
609 else {
610 printf("Warning : no DeicsOnze delay loaded\n");
611 return 0.0;
612 }
613 }
614
615