From a9639d6bcc6603b31c233a11c6aec29aca80f2ed Mon Sep 17 00:00:00 2001 From: Nil Geisweiller Date: Sat, 6 Jan 2007 21:42:45 +0000 Subject: see ChangeLog --- muse/ChangeLog | 8 + muse/plugins/CMakeLists.txt | 2 +- muse/plugins/doublechorus/doublechorusmodel.h | 18 +- muse/plugins/pandelay/CMakeLists.txt | 33 + muse/plugins/pandelay/ladspapandelay.cpp | 95 ++ muse/plugins/pandelay/ladspapandelay.h | 55 + muse/plugins/pandelay/pandelay.cpp | 167 +++ muse/plugins/pandelay/pandelaymodel.cpp | 142 +++ muse/plugins/pandelay/pandelaymodel.h | 84 ++ muse/synti/deicsonze/CMakeLists.txt | 2 +- muse/synti/deicsonze/deicsonze.cpp | 200 +++- muse/synti/deicsonze/deicsonze.h | 45 +- muse/synti/deicsonze/deicsonzegui.cpp | 254 ++++- muse/synti/deicsonze/deicsonzegui.h | 24 +- muse/synti/deicsonze/deicsonzegui.ui | 1461 ++++++++++++++----------- muse/synti/deicsonze/deicsonzeplugin.cpp | 82 +- muse/synti/deicsonze/deicsonzeplugin.h | 1 + 17 files changed, 1948 insertions(+), 725 deletions(-) create mode 100644 muse/plugins/pandelay/CMakeLists.txt create mode 100644 muse/plugins/pandelay/ladspapandelay.cpp create mode 100644 muse/plugins/pandelay/ladspapandelay.h create mode 100644 muse/plugins/pandelay/pandelay.cpp create mode 100644 muse/plugins/pandelay/pandelaymodel.cpp create mode 100644 muse/plugins/pandelay/pandelaymodel.h diff --git a/muse/ChangeLog b/muse/ChangeLog index 6612d080..16350ec4 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,11 @@ +06.01 (ng) + - added panDelay plugin FX + - added panDelay in DeicsOnze + +*********************** +* Happy new year 2007 * +*********************** + 29.12 (ng) - fixed sync LFO Deicsonze - update II miditracker (not working yet) diff --git a/muse/plugins/CMakeLists.txt b/muse/plugins/CMakeLists.txt index e62f25ad..1293902f 100644 --- a/muse/plugins/CMakeLists.txt +++ b/muse/plugins/CMakeLists.txt @@ -18,5 +18,5 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #============================================================================= -subdirs( freeverb doublechorus ) +subdirs( freeverb doublechorus pandelay ) diff --git a/muse/plugins/doublechorus/doublechorusmodel.h b/muse/plugins/doublechorus/doublechorusmodel.h index 6dc7f3ac..40ce9f3f 100644 --- a/muse/plugins/doublechorus/doublechorusmodel.h +++ b/muse/plugins/doublechorus/doublechorusmodel.h @@ -49,15 +49,15 @@ class DoubleChorusModel { DoubleChorusModel(unsigned long samplerate); ~DoubleChorusModel(); - void processMix(long numsamples); - void processReplace(long numsamples); - void setPan1(float value); - void setLFOFreq1(float value); - void setDepth1(float value); - void setPan2(float value); - void setLFOFreq2(float value); - void setDepth2(float value); - void setDryWet(float value); + void processMix(long numsamples); + void processReplace(long numsamples); + void setPan1(float value); + void setLFOFreq1(float value); + void setDepth1(float value); + void setPan2(float value); + void setLFOFreq2(float value); + void setDepth2(float value); + void setDryWet(float value); float getPan1(); float getLFOFreq1(); float getDepth1(); diff --git a/muse/plugins/pandelay/CMakeLists.txt b/muse/plugins/pandelay/CMakeLists.txt new file mode 100644 index 00000000..5ebb08a0 --- /dev/null +++ b/muse/plugins/pandelay/CMakeLists.txt @@ -0,0 +1,33 @@ +#============================================================================= +# MusE +# Linux Music Editor +# $Id:$ +# +# Copyright (C) 2002-2006 by Werner Schweer and others +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#============================================================================= + +add_library ( pandelay SHARED + pandelay.cpp ladspapandelay.cpp pandelaymodel.cpp + ) + +# tell cmake to name the target pandelay.so instead of +# libpandelay.so +# +set_target_properties (pandelay + PROPERTIES PREFIX "" + #COMPILE_FLAGS "-O3" + ) + +install_targets ( /lib/${MusE_INSTALL_NAME}/plugins pandelay) diff --git a/muse/plugins/pandelay/ladspapandelay.cpp b/muse/plugins/pandelay/ladspapandelay.cpp new file mode 100644 index 00000000..8c1caa20 --- /dev/null +++ b/muse/plugins/pandelay/ladspapandelay.cpp @@ -0,0 +1,95 @@ +//=========================================================================== +// +// ladspapandelay +// +// Version 0.0.1 +// +// +// +// +// Copyright (c) 2006 Nil Geisweiller +// +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA or point your web browser to http://www.gnu.org. +//=========================================================================== + +#include "ladspapandelay.h" + +//--------------------------------------------------------- +// PanDelay +//--------------------------------------------------------- + +LADSPAPanDelay::LADSPAPanDelay(unsigned long samplerate) + : PanDelayModel(samplerate) { + //TODO init param +} + +LADSPAPanDelay::~LADSPAPanDelay() { +} + +//--------------------------------------------------------- +// activate +//--------------------------------------------------------- + +void LADSPAPanDelay::activate() { + *port[4] = param[0]; + *port[5] = param[1]; + *port[6] = param[2]; + *port[7] = param[3]; + *port[8] = param[4]; +} + +void LADSPAPanDelay::updateParameters() { + if (param[0] != *port[4]) { + param[0] = *port[4]; + setDelayTime(param[0]); + } + if (param[1] != *port[5]) { + param[1] = *port[5]; + setFeedback(param[1]); + } + if (param[2] != *port[6]) { + param[2] = *port[6]; + setPanLFOFreq(param[2]); + } + if (param[3] != *port[7]) { + param[3] = *port[7]; + setPanLFODepth(param[3]); + } + if (param[4] != *port[8]) { + param[4] = *port[8]; + setDryWet(param[4]); + } +} + +//--------------------------------------------------------- +// processReplace +//--------------------------------------------------------- + +void LADSPAPanDelay::processReplace(long n) { + updateParameters(); + PanDelayModel::processReplace(port[0], port[1], port[2], port[3], n); +} + +//--------------------------------------------------------- +// processMix +//--------------------------------------------------------- + +void LADSPAPanDelay::processMix(long n) { + updateParameters(); + PanDelayModel::processMix(port[0], port[1], port[2], port[3], n); +} diff --git a/muse/plugins/pandelay/ladspapandelay.h b/muse/plugins/pandelay/ladspapandelay.h new file mode 100644 index 00000000..1918895c --- /dev/null +++ b/muse/plugins/pandelay/ladspapandelay.h @@ -0,0 +1,55 @@ +//=========================================================================== +// +// ladspapandelay +// +// Version 0.0.1 +// +// +// +// +// Copyright (c) 2006 Nil Geisweiller +// +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA or point your web browser to http://www.gnu.org. +//=========================================================================== + +#ifndef __LADSPAPANDELAY_H +#define __LADSPAPANDELAY_H + +#include "pandelaymodel.h" +#include "../../muse/ladspa.h" + +#define NBRPARAM 5 + +class LADSPAPanDelay : public PanDelayModel { + private: + + public: + LADSPAPanDelay(unsigned long samplerate); + ~LADSPAPanDelay(); + + LADSPA_Data* port[NBRPARAM + 4]; + float param[NBRPARAM]; + + void updateParameters(); + void processMix(long numsamples); + void processReplace(long numsamples); + + void activate(); +}; + +#endif diff --git a/muse/plugins/pandelay/pandelay.cpp b/muse/plugins/pandelay/pandelay.cpp new file mode 100644 index 00000000..401e03af --- /dev/null +++ b/muse/plugins/pandelay/pandelay.cpp @@ -0,0 +1,167 @@ +//========================================================= +// PanDelay for MusE +// +// (C) Copyright 2006 Nil Geisweiller +//========================================================= + +#include "ladspapandelay.h" +#include + +//--------------------------------------------------------- +// instantiate pandelay +// Construct a new plugin instance. +//--------------------------------------------------------- + +LADSPA_Handle instantiate(const LADSPA_Descriptor* /*Descriptor*/, + unsigned long samplerate) +{ + return new LADSPAPanDelay(samplerate); +} + +//--------------------------------------------------------- +// connect PortTo pandelay +// Connect a port to a data location. +//--------------------------------------------------------- + +void connect(LADSPA_Handle Instance, unsigned long port, + LADSPA_Data* data) +{ + ((LADSPAPanDelay*)Instance)->port[port] = data; +} + +//--------------------------------------------------------- +// activate +//--------------------------------------------------------- + +void activate(LADSPA_Handle instance) +{ + ((LADSPAPanDelay*)instance)->activate(); +} + +//--------------------------------------------------------- +// deactivate +//--------------------------------------------------------- + +void deactivate(LADSPA_Handle /*Instance*/) +{ +} + +//--------------------------------------------------------- +// run pandelay +//--------------------------------------------------------- + +void run(LADSPA_Handle Instance, unsigned long n) +{ + ((LADSPAPanDelay*)Instance)->processReplace(n); +} + +//--------------------------------------------------------- +// runAdding pandelay +// *ADD* the output to the output buffer. +//--------------------------------------------------------- + +void runAdding(LADSPA_Handle Instance, unsigned long n) +{ + ((LADSPAPanDelay*)Instance)->processMix(n); +} + +//--------------------------------------------------------- +// set pandelay RunAddingGain +//--------------------------------------------------------- + +void setGain(LADSPA_Handle /*Instance*/, LADSPA_Data /*Gain*/) +{ + printf("TEST setGain\n"); + // ((LADSPAPanDelay*)Instance)->m_fRunAddingGain = Gain; +} + +//--------------------------------------------------------- +// cleanup pandelay +//--------------------------------------------------------- + +void cleanup(LADSPA_Handle Instance) +{ + delete (LADSPAPanDelay*)Instance; +} + +static const char* portNames[] = { + "Input (Left)", + "Input (Right)", + "Output (Left)", + "Output (Right)", + "Delay Time (ms)", + "Feedback", + "Pan LFO Freq", + "Pan LFO Depth", + "Dry/Wet" +}; + +LADSPA_PortDescriptor portDescriptors[] = { + LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO, + LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO, + LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, + LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, + LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL +}; + +LADSPA_PortRangeHint portRangeHints[] = { + { 0, 0.0, 0.0 }, + { 0, 0.0, 0.0 }, + { 0, 0.0, 0.0 }, + { 0, 0.0, 0.0 }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_LOW, MINDELAYTIME, MAXDELAYTIME }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_HIGH, -1.0, 1.0 }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_DEFAULT_HIGH, MINFREQ, MAXFREQ }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_HIGH, 0.0, 1.0 }, + { LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_DEFAULT_MIDDLE, 0.0, 1.0 } +}; + +LADSPA_Descriptor descriptor = { + 1052, + "pandelay", + LADSPA_PROPERTY_HARD_RT_CAPABLE, + "PanDelay", + "Nil Geisweiller", + "GPL", + NBRPARAM + 4, + portDescriptors, + portNames, + portRangeHints, + 0, // impl. data + instantiate, + connect, + activate, + run, + runAdding, + setGain, + deactivate, + cleanup +}; + +//--------------------------------------------------------- +// _init +// called automatically when the plugin library is first +// loaded. +//--------------------------------------------------------- +void _init() { +} + +//--------------------------------------------------------- +// _fini +// called automatically when the library is unloaded. +//--------------------------------------------------------- +void _fini() { +} + +//--------------------------------------------------------- +// ladspa_descriptor +// Return a descriptor of the requested plugin type. +//--------------------------------------------------------- +const LADSPA_Descriptor* ladspa_descriptor(unsigned long i) { + return (i == 0) ? &descriptor : 0; +} + diff --git a/muse/plugins/pandelay/pandelaymodel.cpp b/muse/plugins/pandelay/pandelaymodel.cpp new file mode 100644 index 00000000..b3ce16a7 --- /dev/null +++ b/muse/plugins/pandelay/pandelaymodel.cpp @@ -0,0 +1,142 @@ +//=========================================================================== +// +// PanDelay, panoramic rotating delay +// +// version 0.0.1 +// +// pandelaymodel.cpp +// +// +// Copyright (c) 2006 Nil Geisweiller +// +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA or point your web browser to http://www.gnu.org. +//=========================================================================== + +#include "pandelaymodel.h" + +PanDelayModel::PanDelayModel(int samplerate) { + for(int i = 0; i < MAXBUFFERLENGTH; i++) { + _leftBuffer[i] = 0.0; + _rightBuffer[i] = 0.0; + } + _bufferPointer = 0; + _inc = 0.0; + _l = 1.0; + _r = 1.0; + + _samplerate = samplerate; + setPanDelay(); +} + +PanDelayModel::~PanDelayModel() { +} + +void PanDelayModel::setSamplerate(int sr) { + _samplerate = sr; + setPanDelay(); +} + +void PanDelayModel::setDelayTime(float dt) { + if(dt < MINDELAYTIME) _delayTime = MINDELAYTIME; + else if(dt > MAXDELAYTIME) _delayTime = MAXDELAYTIME; + else _delayTime = dt; + setPanDelay(); +} + +void PanDelayModel::setFeedback(float fb) { + _feedback = fb; + setPanDelay(); +} + +void PanDelayModel::setPanLFOFreq(float pf) { + _panLFOFreq = pf; + setPanDelay(); +} + +void PanDelayModel::setPanLFODepth(float pd) { + _panLFODepth = pd; + setPanDelay(); +} + +void PanDelayModel::setDryWet(float dw) { + _dryWet = dw; +} + +void PanDelayModel::setPanDelay() { + float numLFOSample = (1.0/_panLFOFreq) * (float)_samplerate; + _inc = 2.0 / numLFOSample; + _delaySampleSize = (int)(_delayTime * (float)_samplerate); + _lBound = 1.0 - _panLFODepth; + _rBound = 1.0 + _panLFODepth; +} + +void PanDelayModel::processMix(float* leftSamplesIn, float* rightSamplesIn, + float* leftSamplesOut, float* rightSamplesOut, + unsigned n) { + float ls, rs, p; + p = 1.0 - _dryWet; + for(unsigned i = 0; i < n; i++) { + //read buffer + ls = _leftBuffer[_bufferPointer]; + rs = _rightBuffer[_bufferPointer]; + //write buffer + _leftBuffer[_bufferPointer] *= _feedback; + _leftBuffer[_bufferPointer] += leftSamplesIn[i]; + _rightBuffer[_bufferPointer] *= _feedback; + _rightBuffer[_bufferPointer] += rightSamplesIn[i]; + //write out + leftSamplesOut[i] += _l * _dryWet * ls + p * leftSamplesIn[i]; + rightSamplesOut[i] += _r * _dryWet * rs + p * rightSamplesIn[i]; + //update _bufferPointer + _bufferPointer++; + _bufferPointer%=_delaySampleSize; + //update _l _r + _r += _inc; + _l -= _inc; + //update _inc + if(_r > _rBound || _r < _lBound) _inc = -_inc; + } +} + +void PanDelayModel::processReplace(float* leftSamplesIn, float* rightSamplesIn, + float* leftSamplesOut, + float* rightSamplesOut, unsigned n) { + float ls, rs, p; + p = 1.0 - _dryWet; + for(unsigned i = 0; i < n; i++) { + //read buffer + ls = _leftBuffer[_bufferPointer]; + rs = _rightBuffer[_bufferPointer]; + //write buffer + _leftBuffer[_bufferPointer] *= _feedback; + _leftBuffer[_bufferPointer] += leftSamplesIn[i]; + _rightBuffer[_bufferPointer] *= _feedback; + _rightBuffer[_bufferPointer] += rightSamplesIn[i]; + //write out + leftSamplesOut[i] = _l * _dryWet * ls + p * leftSamplesIn[i]; + rightSamplesOut[i] = _r * _dryWet * rs + p * rightSamplesIn[i]; + //update _bufferPointer + _bufferPointer++; + _bufferPointer%=_delaySampleSize; + //update _l _r + _r += _inc; + _l -= _inc; + //update _inc + if(_r > _rBound || _r < _lBound) _inc = -_inc; + } +} diff --git a/muse/plugins/pandelay/pandelaymodel.h b/muse/plugins/pandelay/pandelaymodel.h new file mode 100644 index 00000000..ed4255e2 --- /dev/null +++ b/muse/plugins/pandelay/pandelaymodel.h @@ -0,0 +1,84 @@ +//=========================================================================== +// +// PanDelay, panoramic rotating delay +// +// version 0.0.1 +// +// pandelaymodel.h +// +// +// Copyright (c) 2006 Nil Geisweiller +// +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA or point your web browser to http://www.gnu.org. +//=========================================================================== + +#ifndef __PANDELAYMODEL_H +#define __PANDELAYMODEL_H + +#include + +#define MAXBUFFERLENGTH 192000 +#define MINFREQ 0.1 //in Hz +#define MAXFREQ 10.0 //in Hz +#define MINDELAYTIME 0.01 //in second +#define MAXDELAYTIME 2.0 //in second + +#define NBRPARAM 5 + +class PanDelayModel { + private: + int _samplerate; + + float _delayTime; + float _feedback; + float _panLFOFreq; + float _panLFODepth; + float _dryWet; //0.0 : dry, 1.0 : wet + + int _delaySampleSize; + float _lBound; + float _rBound; + float _inc; + float _l; + float _r; + + float _leftBuffer[MAXBUFFERLENGTH]; + float _rightBuffer[MAXBUFFERLENGTH]; + int _bufferPointer; + + public: + PanDelayModel(int samplerate); + ~PanDelayModel(); + + void setSamplerate(int sr); + void setDelayTime(float dt); + void setFeedback(float dt); + void setPanLFOFreq(float pf); + void setPanLFODepth(float pd); + void setDryWet(float dw); + void setPanDelay(); + + void processMix(float* leftInSamples, float* rightInSamples, + float* leftOutSamples, float* rightOutSamples, + unsigned n); + void processReplace(float* leftInSamples, float* rightInSamples, + float* leftOutSamples, float* rightOutSamples, + unsigned n); +}; + +#endif /* __PANDELAYMODEL_H */ diff --git a/muse/synti/deicsonze/CMakeLists.txt b/muse/synti/deicsonze/CMakeLists.txt index 63a88744..6f0d0e4e 100644 --- a/muse/synti/deicsonze/CMakeLists.txt +++ b/muse/synti/deicsonze/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries( deicsonze synti ) # set_target_properties ( deicsonze PROPERTIES PREFIX "" - #COMPILE_FLAGS "-O3 -include ${PROJECT_BINARY_DIR}/all-pic.h" + #COMPILE_FLAGS "-O2 -include ${PROJECT_BINARY_DIR}/all-pic.h" COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all-pic.h" ) diff --git a/muse/synti/deicsonze/deicsonze.cpp b/muse/synti/deicsonze/deicsonze.cpp index dbbba68f..660c41e4 100644 --- a/muse/synti/deicsonze/deicsonze.cpp +++ b/muse/synti/deicsonze/deicsonze.cpp @@ -89,15 +89,21 @@ DeicsOnze::DeicsOnze() : Mess(2) { tempInputChorus = (float**) malloc(sizeof(float*)*NBRFXINPUTS); for(int i = 0; i < NBRFXINPUTS; i++) tempInputChorus[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); - tempInputReverb = (float**) malloc(sizeof(float*)*NBRFXINPUTS); - for(int i = 0; i < NBRFXINPUTS; i++) - tempInputReverb[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); tempOutputChorus = (float**) malloc(sizeof(float*)*NBRFXOUTPUTS); for(int i = 0; i < NBRFXOUTPUTS; i++) tempOutputChorus[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); + tempInputReverb = (float**) malloc(sizeof(float*)*NBRFXINPUTS); + for(int i = 0; i < NBRFXINPUTS; i++) + tempInputReverb[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); tempOutputReverb = (float**) malloc(sizeof(float*)*NBRFXOUTPUTS); for(int i = 0; i < NBRFXOUTPUTS; i++) tempOutputReverb[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); + tempInputDelay = (float**) malloc(sizeof(float*)*NBRFXINPUTS); + for(int i = 0; i < NBRFXINPUTS; i++) + tempInputDelay[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); + tempOutputDelay = (float**) malloc(sizeof(float*)*NBRFXOUTPUTS); + for(int i = 0; i < NBRFXOUTPUTS; i++) + tempOutputDelay[i] = (float*) malloc(sizeof(float*)*MAXFXBUFFERSIZE); srand(time(0)); // initialize random number generator @@ -123,14 +129,17 @@ DeicsOnze::DeicsOnze() : Mess(2) { //FX _pluginIReverb = NULL; - _pluginIChorus = NULL; initPluginReverb(plugins.find("freeverb", "freeverb1")); + _pluginIChorus = NULL; initPluginChorus(plugins.find("doublechorus", "doublechorus1")); + _pluginIDelay = NULL; + initPluginDelay(plugins.find("pandelay", "pandelay")); //Filter _dryFilter = new LowFilter(); _chorusFilter = new LowFilter(); _reverbFilter = new LowFilter(); + _delayFilter = new LowFilter(); //Load configuration QString defaultConf = (QString(getenv("HOME")) + QString("/." DEICSONZESTR ".dco")); @@ -173,6 +182,13 @@ DeicsOnze::DeicsOnze() : Mess(2) { dataChorusRet[1]=(unsigned char)getChorusReturn(); MidiEvent evChorusRet(0,ME_SYSEX,(const unsigned char*)dataChorusRet, 2); _gui->writeEvent(evChorusRet); + unsigned char *dataDelayRet = new unsigned char[2]; + dataDelayRet[0]=SYSEX_DELAYRETURN; + dataDelayRet[1]=(unsigned char)getDelayReturn(); + //printf("DELAY RET = %d, REVERB RET = %d\n", + //getDelayReturn(), getReverbReturn()); + MidiEvent evDelayRet(0,ME_SYSEX,(const unsigned char*)dataDelayRet, 2); + _gui->writeEvent(evDelayRet); //update font size unsigned char *dataFontSize = new unsigned char[2]; dataFontSize[0]=SYSEX_FONTSIZE; @@ -199,12 +215,16 @@ DeicsOnze::~DeicsOnze() //dealloc temp buffers chorus and reverb for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputChorus[i]); free(tempInputChorus); - for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputReverb[i]); - free(tempInputReverb); for(int i = 0; i < NBRFXOUTPUTS; i++) free(tempOutputChorus[i]); free(tempOutputChorus); + for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputReverb[i]); + free(tempInputReverb); for(int i = 0; i < NBRFXOUTPUTS; i++) free(tempOutputReverb[i]); free(tempOutputReverb); + for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputDelay[i]); + free(tempInputDelay); + for(int i = 0; i < NBRFXOUTPUTS; i++) free(tempOutputDelay[i]); + free(tempOutputDelay); } //--------------------------------------------------------- @@ -248,6 +268,7 @@ void DeicsOnze::setSampleRate(int sr) { _dryFilter->setSamplerate(sr); _chorusFilter->setSamplerate(sr); _reverbFilter->setSamplerate(sr); + _delayFilter->setSamplerate(sr); setQuality(_global.quality); } @@ -518,6 +539,8 @@ void DeicsOnze::initGlobal() { _global.chorusReturn = level2amp(INITFXRETURN); _global.isReverbActivated = false; _global.reverbReturn = level2amp(INITFXRETURN); + _global.isDelayActivated = false; + _global.delayReturn = level2amp(INITFXRETURN); initChannels(); } @@ -542,6 +565,7 @@ void DeicsOnze::initChannel(int c) { _global.channel[c].isLastNote = false; _global.channel[c].chorusAmount = 0.0; _global.channel[c].reverbAmount = 0.0; + _global.channel[c].delayAmount = 0.0; applyChannelAmp(c); initVoices(c); } @@ -748,6 +772,12 @@ void DeicsOnze::setChannelReverb(int c, int r) { void DeicsOnze::setChannelChorus(int c, int val) { _global.channel[c].chorusAmount = (float)lowlevel2amp(val); } +//---------------------------------------------------------------- +// setChannelDelay +//---------------------------------------------------------------- +void DeicsOnze::setChannelDelay(int c, int val) { + _global.channel[c].delayAmount = (float)lowlevel2amp(val); +} //---------------------------------------------------------------- // setChorusReturn @@ -763,6 +793,13 @@ void DeicsOnze::setReverbReturn(int val) { _global.reverbReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 } +//---------------------------------------------------------------- +// setDelayReturn +//---------------------------------------------------------------- +void DeicsOnze::setDelayReturn(int val) { + _global.delayReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 +} + //---------------------------------------------------------------- // getNbrVoices //---------------------------------------------------------------- @@ -845,6 +882,12 @@ int DeicsOnze::getChannelChorus(int c) const { return(amp2lowlevel(_global.channel[c].chorusAmount)); } //---------------------------------------------------------------- +// getChannelDelay +//---------------------------------------------------------------- +int DeicsOnze::getChannelDelay(int c) const { + return(amp2lowlevel(_global.channel[c].delayAmount)); +} +//---------------------------------------------------------------- // getChorusReturn //---------------------------------------------------------------- int DeicsOnze::getChorusReturn() const { @@ -856,6 +899,12 @@ int DeicsOnze::getChorusReturn() const { int DeicsOnze::getReverbReturn() const { return(amp2level(_global.reverbReturn/2.0)); } +//---------------------------------------------------------------- +// getReverbReturn +//---------------------------------------------------------------- +int DeicsOnze::getDelayReturn() const { + return(amp2level(_global.delayReturn/2.0)); +} //---------------------------------------------------------------- // setLfo @@ -1022,6 +1071,7 @@ void DeicsOnze::setQuality(Quality q) { _dryFilter->setCutoff(_global.deiSampleRate/4.0); _reverbFilter->setCutoff(_global.deiSampleRate/4.0); _chorusFilter->setCutoff(_global.deiSampleRate/4.0); + _delayFilter->setCutoff(_global.deiSampleRate/4.0); } //----------------------------------------------------------------- @@ -2238,6 +2288,7 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { buffer[NUM_CHANNEL_RELEASE + c] = (unsigned char) getChannelRelease(c); buffer[NUM_CHANNEL_REVERB + c] = (unsigned char) getChannelReverb(c); buffer[NUM_CHANNEL_CHORUS + c] = (unsigned char) getChannelChorus(c); + buffer[NUM_CHANNEL_DELAY + c] = (unsigned char) getChannelDelay(c); buffer[NUM_CURRENTPROG + c] = (unsigned char) _preset[c]->prog; buffer[NUM_CURRENTLBANK + c] = (unsigned char) _preset[c]->_subcategory->_lbank; @@ -2273,6 +2324,7 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { MAXSTRLENGTHBACKGROUNDPIXPATH); } //FX + //reverb buffer[NUM_IS_REVERB_ON]=(unsigned char)_global.isReverbActivated; buffer[NUM_REVERB_RETURN]=(unsigned char)getReverbReturn(); buffer[NUM_REVERB_PARAM_NBR]= @@ -2283,6 +2335,7 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { strncpy((char*)&buffer[NUM_REVERB_LABEL], _pluginIReverb->plugin()->label().toLatin1().data(), MAXSTRLENGTHFXLABEL); + //chorus buffer[NUM_IS_CHORUS_ON]=(unsigned char)_global.isChorusActivated; buffer[NUM_CHORUS_RETURN]=(unsigned char)getChorusReturn(); buffer[NUM_CHORUS_PARAM_NBR]= @@ -2293,6 +2346,9 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { strncpy((char*)&buffer[NUM_CHORUS_LABEL], _pluginIChorus->plugin()->label().toLatin1().data(), MAXSTRLENGTHFXLABEL); + //delay + buffer[NUM_IS_DELAY_ON]=(unsigned char)_global.isDelayActivated; + buffer[NUM_DELAY_RETURN]=(unsigned char)getDelayReturn(); //save FX parameters //reverb for(int i = 0; i < _pluginIReverb->plugin()->parameter(); i++) { @@ -2306,6 +2362,12 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) { + sizeof(float)*_pluginIReverb->plugin()->parameter() + sizeof(float)*i], &val, sizeof(float)); } + //delay + buffer[NUM_DELAY_TIME] = (unsigned char)getDelayTime(); + buffer[NUM_DELAY_FEEDBACK] = (unsigned char)getDelayFeedback(); + buffer[NUM_DELAY_LFO_FREQ] = (unsigned char)getDelayLFOFreq(); + buffer[NUM_DELAY_LFO_DEPTH] = (unsigned char)getDelayLFODepth(); + //save set data for(int i = NUM_CONFIGLENGTH + sizeof(float)*_pluginIReverb->plugin()->parameter() @@ -2402,6 +2464,12 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { evChChorus(0, c, ME_CONTROLLER, CTRL_CHORUS_SEND, data[NUM_CHANNEL_CHORUS + c]); _gui->writeEvent(evChChorus); + //channel delay + setChannelDelay(c, data[NUM_CHANNEL_DELAY + c]); + MidiEvent + evChDelay(0, c, ME_CONTROLLER, + CTRL_VARIATION_SEND, data[NUM_CHANNEL_DELAY + c]); + _gui->writeEvent(evChDelay); } //load configuration _saveConfig = (bool)data[NUM_SAVECONFIG]; @@ -2533,6 +2601,49 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { MidiEvent evSysexBuildCho(0,ME_SYSEX, (const unsigned char*)&dataBuildCho, 1); _gui->writeEvent(evSysexBuildCho); + //delay + _global.isDelayActivated = (bool)data[NUM_IS_DELAY_ON]; + unsigned char *dataDelayAct = new unsigned char[2]; + dataDelayAct[0]=SYSEX_DELAYACTIV; + dataDelayAct[1]=(unsigned char)_global.isDelayActivated; + MidiEvent evDelayAct(0,ME_SYSEX,(const unsigned char*)dataDelayAct, 2); + _gui->writeEvent(evDelayAct); + setDelayReturn((int)data[NUM_DELAY_RETURN]); + unsigned char *dataDelayRet = new unsigned char[2]; + dataDelayRet[0]=SYSEX_DELAYRETURN; + dataDelayRet[1]=(unsigned char)getDelayReturn(); + MidiEvent evDelayRet(0,ME_SYSEX,(const unsigned char*)dataDelayRet, 2); + _gui->writeEvent(evDelayRet); + //initPluginDelay(plugins.find("pandelay", "pandelay")); + setDelayTime((int)data[NUM_DELAY_TIME]); + char dataDelayTime[2]; + dataDelayTime[0] = SYSEX_DELAYTIME; + dataDelayTime[1] = (unsigned char)getDelayTime(); + MidiEvent evSysexDelayTime(0,ME_SYSEX, + (const unsigned char*)dataDelayTime, 2); + _gui->writeEvent(evSysexDelayTime); + setDelayFeedback((int)data[NUM_DELAY_FEEDBACK]); + char dataDelayFeedback[2]; + dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; + dataDelayFeedback[1] = (unsigned char)getDelayFeedback(); + MidiEvent evSysexDelayFeedback(0,ME_SYSEX, + (const unsigned char*)dataDelayFeedback, 2); + _gui->writeEvent(evSysexDelayFeedback); + setDelayLFOFreq((int)data[NUM_DELAY_LFO_FREQ]); + char dataDelayLFOFreq[2]; + dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; + dataDelayLFOFreq[1] = (unsigned char)getDelayLFOFreq(); + MidiEvent evSysexDelayLFOFreq(0,ME_SYSEX, + (const unsigned char*)dataDelayLFOFreq, 2); + _gui->writeEvent(evSysexDelayLFOFreq); + setDelayLFODepth((int)data[NUM_DELAY_LFO_DEPTH]); + char dataDelayLFODepth[2]; + dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; + dataDelayLFODepth[1] = (unsigned char)getDelayLFODepth(); + MidiEvent evSysexDelayLFODepth(0,ME_SYSEX, + (const unsigned char*)dataDelayLFODepth, 2); + _gui->writeEvent(evSysexDelayLFODepth); + //load set FILE* tmp; char* tmpname; @@ -2750,6 +2861,13 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { _gui->writeEvent(evSysex); } break; + case SYSEX_DELAYACTIV: + _global.isDelayActivated = (bool)data[1]; + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; case SYSEX_CHORUSRETURN: setChorusReturn((int)data[1]); if(!fromGui) { @@ -2764,6 +2882,13 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { _gui->writeEvent(evSysex); } break; + case SYSEX_DELAYRETURN: + setDelayReturn((int)data[1]); + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; case SYSEX_SELECTREVERB: Plugin* pluginReverb; memcpy(&pluginReverb, &data[1], sizeof(Plugin*)); @@ -2774,6 +2899,34 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { memcpy(&pluginChorus, &data[1], sizeof(Plugin*)); initPluginChorus(pluginChorus); break; + case SYSEX_DELAYTIME: + setDelayTime((int)data[1]); + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYFEEDBACK: + setDelayFeedback((int)data[1]); + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYLFOFREQ: + setDelayLFOFreq((int)data[1]); + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYLFODEPTH: + setDelayLFODepth((int)data[1]); + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; default: break; } @@ -3359,6 +3512,13 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { _gui->writeEvent(ev); } break; + case CTRL_VARIATION_SEND: + setChannelDelay(ch, val); + if(!fromGui) { + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_VARIATION_SEND, val); + _gui->writeEvent(ev); + } + break; case CTRL_SUSTAIN: setSustain(ch, val); break; @@ -3792,6 +3952,8 @@ void DeicsOnze::process(float** buffer, int offset, int n) { _global.lastInputRightChorusSample = 0.0; _global.lastInputLeftReverbSample = 0.0; _global.lastInputRightReverbSample = 0.0; + _global.lastInputLeftDelaySample = 0.0; + _global.lastInputRightDelaySample = 0.0; //per channel for(int c = 0; c < NBRCHANNELS; c++) { tempChannelOutput = 0.0; @@ -4054,6 +4216,12 @@ void DeicsOnze::process(float** buffer, int offset, int n) { _global.lastInputRightReverbSample += tempChannelRightOutput * _global.channel[c].reverbAmount; } + if(_global.isDelayActivated) { + _global.lastInputLeftDelaySample += tempChannelLeftOutput * + _global.channel[c].delayAmount; + _global.lastInputRightDelaySample += tempChannelRightOutput * + _global.channel[c].delayAmount; + } tempLeftOutput += tempChannelLeftOutput; tempRightOutput += tempChannelRightOutput; } @@ -4072,6 +4240,10 @@ void DeicsOnze::process(float** buffer, int offset, int n) { tempInputReverb[0][i] = _global.lastInputLeftReverbSample; tempInputReverb[1][i] = _global.lastInputRightReverbSample; } + if(_global.isDelayActivated) { + tempInputDelay[0][i] = _global.lastInputLeftDelaySample; + tempInputDelay[1][i] = _global.lastInputRightDelaySample; + } _global.qualityCounter++; _global.qualityCounter %= _global.qualityCounterTop; @@ -4097,7 +4269,7 @@ void DeicsOnze::process(float** buffer, int offset, int n) { //apply Filter if(_global.filter) _reverbFilter->process(tempOutputReverb[0], tempOutputReverb[1], n); - //apply Chorus + //apply Reverb _pluginIReverb->apply(n, 2, tempInputReverb, tempOutputReverb); for(int i = 0; i < n; i++) { leftOutput[i] += @@ -4106,6 +4278,20 @@ void DeicsOnze::process(float** buffer, int offset, int n) { tempOutputReverb[1][i] * _global.reverbReturn * _global.masterVolume; } } + //Delay + if(_global.isDelayActivated) { + //apply Filter + if(_global.filter) _delayFilter->process(tempOutputDelay[0], + tempOutputDelay[1], n); + //apply Delay + _pluginIDelay->apply(n, 2, tempInputDelay, tempOutputDelay); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputDelay[0][i] * _global.delayReturn * _global.masterVolume; + rightOutput[i] += + tempOutputDelay[1][i] * _global.delayReturn * _global.masterVolume; + } + } } diff --git a/muse/synti/deicsonze/deicsonze.h b/muse/synti/deicsonze/deicsonze.h index 6102eb34..4bc49b16 100644 --- a/muse/synti/deicsonze/deicsonze.h +++ b/muse/synti/deicsonze/deicsonze.h @@ -149,6 +149,13 @@ #define SYSEX_BUILDGUICHORUS 85 #define SYSEX_FILTER 90 #define FILTERSTR "Filter" +#define SYSEX_DELAYACTIV 91 +#define SYSEX_DELAYRETURN 92 +#define SYSEX_DELAYTIME 93 +#define SYSEX_DELAYFEEDBACK 94 +#define SYSEX_DELAYLFOFREQ 95 +#define SYSEX_DELAYLFODEPTH 96 + //REVERB PARAMETERS #define DEFAULTVOL 200 @@ -165,7 +172,8 @@ enum { NUM_CHANNEL_RELEASE = NUM_CHANNEL_ATTACK + NBRCHANNELS + 1, NUM_CHANNEL_REVERB = NUM_CHANNEL_RELEASE + NBRCHANNELS + 1, NUM_CHANNEL_CHORUS = NUM_CHANNEL_REVERB + NBRCHANNELS + 1, - NUM_CURRENTPROG = NUM_CHANNEL_CHORUS + NBRCHANNELS + 1, + NUM_CHANNEL_DELAY = NUM_CHANNEL_CHORUS + NBRCHANNELS + 1, + NUM_CURRENTPROG = NUM_CHANNEL_DELAY + NBRCHANNELS + 1, NUM_CURRENTLBANK = NUM_CURRENTPROG + NBRCHANNELS + 1, NUM_CURRENTHBANK = NUM_CURRENTLBANK + NBRCHANNELS + 1, NUM_NBRVOICES = NUM_CURRENTHBANK + NBRCHANNELS + 1, @@ -200,7 +208,13 @@ enum { NUM_CHORUS_PARAM_NBR, NUM_CHORUS_LIB, NUM_CHORUS_LABEL = NUM_CHORUS_LIB + MAXSTRLENGTHFXLIB + 1, - NUM_CONFIGLENGTH = NUM_CHORUS_LABEL + MAXSTRLENGTHFXLABEL + 1 + NUM_IS_DELAY_ON = NUM_CHORUS_LABEL + MAXSTRLENGTHFXLABEL + 1, + NUM_DELAY_RETURN, + NUM_DELAY_TIME, + NUM_DELAY_FEEDBACK, + NUM_DELAY_LFO_FREQ, + NUM_DELAY_LFO_DEPTH, + NUM_CONFIGLENGTH = NUM_DELAY_LFO_DEPTH + 1 }; class DeicsOnzeGui; @@ -370,6 +384,7 @@ struct Channel { //FX float chorusAmount; //between 0.0 and 1.0 float reverbAmount; //between 0.0 and 1.0 + float delayAmount; //between 0.0 and 1.0 }; //--------------------------------------------------------- @@ -396,11 +411,15 @@ struct Global { float lastInputRightChorusSample; float lastInputLeftReverbSample; float lastInputRightReverbSample; + float lastInputLeftDelaySample; + float lastInputRightDelaySample; Channel channel[NBRCHANNELS]; bool isChorusActivated; float chorusReturn; bool isReverbActivated; float reverbReturn; + bool isDelayActivated; + float delayReturn; }; //--------------------------------------------------------- @@ -419,9 +438,11 @@ class DeicsOnze : public Mess { public: float** tempInputChorus; - float** tempInputReverb; float** tempOutputChorus; + float** tempInputReverb; float** tempOutputReverb; + float** tempInputDelay; + float** tempOutputDelay; float* getSinusWaveTable(); @@ -441,19 +462,31 @@ class DeicsOnze : public Mess { //FX PluginI* _pluginIReverb; PluginI* _pluginIChorus; + PluginI* _pluginIDelay; void initPluginReverb(Plugin*); void initPluginChorus(Plugin*); + void initPluginDelay(Plugin*); void setReverbParam(int i, double val); - void setChorusParam(int i, double val); double getReverbParam(int i); + void setChorusParam(int i, double val); double getChorusParam(int i); + void setDelayTime(int val); //0-255 + void setDelayFeedback(int val); //0-255 + void setDelayLFOFreq(int val); //0-255 + void setDelayLFODepth(int val); //0-255 + void setDelayDryWet(int val); //0-255 + int getDelayTime(); + int getDelayFeedback(); + int getDelayLFOFreq(); + int getDelayLFODepth(); //Filter LowFilter* _dryFilter; LowFilter* _chorusFilter; LowFilter* _reverbFilter; + LowFilter* _delayFilter; mutable MidiPatch _patch; mutable int _numPatchProg; //used by getPatchInfo @@ -507,8 +540,10 @@ class DeicsOnze : public Mess { void setChannelRelease(int c, int r); void setChannelReverb(int c, int r); void setChannelChorus(int c, int val); + void setChannelDelay(int c, int val); void setChorusReturn(int val); void setReverbReturn(int val); + void setDelayReturn(int val); bool getChannelEnable(int c) const; int getNbrVoices(int c) const; int getMasterVol(void) const; @@ -522,8 +557,10 @@ class DeicsOnze : public Mess { int getChannelRelease(int c) const; int getChannelReverb(int c) const; int getChannelChorus(int c) const; + int getChannelDelay(int c) const; int getChorusReturn(void) const; int getReverbReturn(void) const; + int getDelayReturn(void) const; void setPitchBendCoef(int c, int val); void setModulation(int c, int val); //TODO check between setChannelModulation void setSustain(int c, int val); diff --git a/muse/synti/deicsonze/deicsonzegui.cpp b/muse/synti/deicsonze/deicsonzegui.cpp index 25089b75..364ba5c2 100644 --- a/muse/synti/deicsonze/deicsonzegui.cpp +++ b/muse/synti/deicsonze/deicsonzegui.cpp @@ -32,6 +32,7 @@ #include "config.h" #include "plugin.h" #include "plugingui.h" +#include "plugins/pandelay/pandelaymodel.h" #include "deicsonzegui.h" @@ -216,8 +217,8 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) this, SLOT(setLfoAmpSens(int))); connect(transposeSlider, SIGNAL(valueChanged(int)), this, SLOT(setTranspose(int))); - connect(channelDetuneSlider, SIGNAL(valueChanged(int)), - this, SLOT(setChannelDetune(int))); + //connect(channelDetuneSlider, SIGNAL(valueChanged(int)), + // this, SLOT(setChannelDetune(int))); connect(algorithmComboBox, SIGNAL(activated(int)), this, SLOT(setAlgorithm(int))); connect(pitchBendRangeSlider, SIGNAL(valueChanged(int)), @@ -256,8 +257,8 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) this, SLOT(setAtPitchBias(int))); connect(atEgBiasSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setAtEgBias(int))); - connect(reverbSpinBox, SIGNAL(valueChanged(int)), - this, SLOT(setReverbRate(int))); + //connect(reverbSpinBox, SIGNAL(valueChanged(int)), + // this, SLOT(setReverbRate(int))); connect(polyMonoComboBox, SIGNAL(activated(int)), this, SLOT(setPolyMode(int))); connect(PortFingerFullComboBox, SIGNAL(activated(int)), @@ -355,6 +356,29 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) this, SLOT(setWaveForm3(int))); connect(WaveForm4ComboBox, SIGNAL(activated(int)), this, SLOT(setWaveForm4(int))); + //PanDelay + connect(delayActivCheckBox, SIGNAL(toggled(bool)), this, + SLOT(setActivDelay(bool))); + connect(delayReturnSlider, SIGNAL(valueChanged(int)), this, + SLOT(setDelayReturn(int))); + connect(chDelaySlider, SIGNAL(valueChanged(int)), this, + SLOT(setChannelDelay(int))); + connect(delayTimeSlider, SIGNAL(valueChanged(int)), this, + SLOT(setDelayTime(int))); + connect(delayTimeFloatentry, SIGNAL(valueChanged(double, int)), this, + SLOT(setDelayTime(double))); + connect(delayFeedbackSlider, SIGNAL(valueChanged(int)), this, + SLOT(setDelayFeedback(int))); + connect(delayFeedbackFloatentry, SIGNAL(valueChanged(double, int)), this, + SLOT(setDelayFeedback(double))); + connect(delayPanLFOFreqSlider, SIGNAL(valueChanged(int)), this, + SLOT(setDelayPanLFOFreq(int))); + connect(delayPanLFOFreqFloatentry, SIGNAL(valueChanged(double, int)), this, + SLOT(setdelayPanLFOFreq(double))); + connect(delayPanLFODepthSlider, SIGNAL(valueChanged(int)), this, + SLOT(setDelayPanLFODepth(int))); + connect(delayPanLFODepthFloatentry, SIGNAL(valueChanged(double, int)), this, + SLOT(setDelayPanLFODepth(double))); //category subcategory preset connect(categoryListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), @@ -783,10 +807,10 @@ void DeicsOnzeGui::setTextColor(const QColor & c) { DetWaveEGS4GroupBox->setPalette(p); sensitivity4groupBox->setPalette(p); transposeGroupBox->setPalette(p); - detuneGroupBox->setPalette(p); - footSWGroupBox->setPalette(p); + //detuneGroupBox->setPalette(p); + //footSWGroupBox->setPalette(p); pitchBendRangeGroupBox->setPalette(p); - reverbGroupBox->setPalette(p); + //reverbGroupBox->setPalette(p); modeGroupBox->setPalette(p); portamentoGroupBox->setPalette(p); colorGroupBox->setPalette(p); @@ -803,6 +827,12 @@ void DeicsOnzeGui::setTextColor(const QColor & c) { channelChorusGroupBox->setPalette(p); parametersChorusGroupBox->setPalette(p); fontSizeGroupBox->setPalette(p); + delayTimeGroupBox->setPalette(p); + delayFeedbackGroupBox->setPalette(p); + delayPanLFOGroupBox->setPalette(p); + delayPanDepthGroupBox->setPalette(p); + delayReturnGroupBox->setPalette(p); + channelDelayGroupBox->setPalette(p); } void DeicsOnzeGui::setBackgroundColor(const QColor & c) { @@ -848,10 +878,10 @@ void DeicsOnzeGui::setEditTextColor(const QColor & c) { DetWaveEGS4GroupBox->setPalette(p); sensitivity4groupBox->setPalette(p); transposeGroupBox->setPalette(p); - detuneGroupBox->setPalette(p); - footSWGroupBox->setPalette(p); + //detuneGroupBox->setPalette(p); + //footSWGroupBox->setPalette(p); pitchBendRangeGroupBox->setPalette(p); - reverbGroupBox->setPalette(p); + //reverbGroupBox->setPalette(p); modeGroupBox->setPalette(p); portamentoGroupBox->setPalette(p); colorGroupBox->setPalette(p); @@ -910,10 +940,10 @@ void DeicsOnzeGui::setEditBackgroundColor(const QColor & c) { DetWaveEGS4GroupBox->setPalette(p); sensitivity4groupBox->setPalette(p); transposeGroupBox->setPalette(p); - detuneGroupBox->setPalette(p); - footSWGroupBox->setPalette(p); + //detuneGroupBox->setPalette(p); + //footSWGroupBox->setPalette(p); pitchBendRangeGroupBox->setPalette(p); - reverbGroupBox->setPalette(p); + //reverbGroupBox->setPalette(p); modeGroupBox->setPalette(p); portamentoGroupBox->setPalette(p); colorGroupBox->setPalette(p); @@ -1401,7 +1431,7 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { case CTRL_FIXRANGE+3*DECAPAR2: updateFIXRANGE(3, val); break; case CTRL_OSW+3*DECAPAR2: updateOSW(3, val); break; case CTRL_SHFT+3*DECAPAR2: updateSHFT(3, val); break; - case CTRL_REVERBRATE: updateReverbRate(val); break; + case CTRL_REVERBRATE: /*updateReverbRate(val);*/ break; case CTRL_FCPITCH: updateFcPitch(val); break; case CTRL_FCAMPLITUDE: updateFcAmplitude(val); break; case CTRL_CHANNELENABLE: @@ -1416,6 +1446,7 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { case CTRL_RELEASE_TIME: updateRelease(val); break; case CTRL_CHORUS_SEND: updateChannelChorus(val); break; case CTRL_REVERB_SEND: updateChannelReverb(val); break; + case CTRL_VARIATION_SEND: updateChannelDelay(val); break; case CTRL_MODULATION: updateModulation(val); break; case CTRL_PROGRAM : int hbank = (val & 0xff0000) >> 16; @@ -1473,6 +1504,24 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { case SYSEX_CHORUS2DEPTH : updateDepthChorus2((int)data[1]); break;*/ + case SYSEX_DELAYACTIV : + updateDelayActiv((bool)data[1]); + break; + case SYSEX_DELAYRETURN : + updateDelayReturn((int)data[1]); + break; + case SYSEX_DELAYTIME : + updateDelayTime((int) data[1]); + break; + case SYSEX_DELAYFEEDBACK : + updateDelayFeedback((int) data[1]); + break; + case SYSEX_DELAYLFOFREQ : + updateDelayPanLFOFreq((int) data[1]); + break; + case SYSEX_DELAYLFODEPTH : + updateDelayPanLFODepth((int) data[1]); + break; case SYSEX_QUALITY : updateQuality((int)data[1]); break; @@ -2541,7 +2590,8 @@ void DeicsOnzeGui::setModulationKnob(double val) { (int)(val*(double)MAXMODULATION)); } void DeicsOnzeGui::setDetuneKnob(double val) { - channelDetuneSlider->setValue((int)((2.0*val-1.0)*(double)MAXCHANNELDETUNE)); + //channelDetuneSlider->setValue((int)((2.0*val-1.0)*(double)MAXCHANNELDETUNE)); + setChannelDetune((int)((2.0*val-1.0)*(double)MAXCHANNELDETUNE)); } void DeicsOnzeGui::setAttackKnob(double val) { sendController(_currentChannel, CTRL_ATTACK_TIME, @@ -2934,6 +2984,86 @@ void DeicsOnzeGui::setWaveForm3(int w) { void DeicsOnzeGui::setWaveForm4(int w) { sendController(_currentChannel, CTRL_OSW+3*DECAPAR2, w); } +//-------------------------------------------------------------- +// set delay +//-------------------------------------------------------------- +void DeicsOnzeGui::setActivDelay(bool a) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYACTIV; + message[1]=(unsigned char)a; + sendSysex(message, 2); +} +void DeicsOnzeGui::setDelayReturn(int r) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYRETURN; + message[1]=(unsigned char)r; + sendSysex(message, 2); +} +void DeicsOnzeGui::setChannelDelay(int d) { + sendController(_currentChannel, CTRL_VARIATION_SEND, (unsigned char)d); +} +void DeicsOnzeGui::setDelayTime(int t) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYTIME; + message[1]=(unsigned char)t; + sendSysex(message, 2); + updateDelayTime(t); +} +void DeicsOnzeGui::setDelayTime(double t) { + int it = (int)(((t - MINDELAYTIME) / (MAXDELAYTIME - MINDELAYTIME))*255.0); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYTIME; + message[1]=(unsigned char)it; + sendSysex(message, 2); + updateDelayTime(it); +} +void DeicsOnzeGui::setDelayFeedback(int f) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYFEEDBACK; + message[1]=(unsigned char)f; + sendSysex(message, 2); + updateDelayFeedback(f); +} +void DeicsOnzeGui::setDelayFeedback(double f) { + int idf = (int)(f*128.0+128.0); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYFEEDBACK; + message[1]=(unsigned char)idf; + sendSysex(message, 2); + updateDelayFeedback(idf); +} +void DeicsOnzeGui::setDelayPanLFOFreq(int pf) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYLFOFREQ; + message[1]=(unsigned char)pf; + sendSysex(message, 2); + updateDelayPanLFOFreq(pf); +} +void DeicsOnzeGui::setDelayPanLFOFreq(double pf) { + int ipf = (int)(((pf - MINFREQ) / (MAXFREQ - MINFREQ))*255.0); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYLFOFREQ; + message[1]=(unsigned char)ipf; + sendSysex(message, 2); + updateDelayPanLFOFreq(ipf); +} +void DeicsOnzeGui::setDelayPanLFODepth(int pd) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYLFODEPTH; + message[1]=(unsigned char)pd; + sendSysex(message, 2); + updateDelayPanLFODepth(pd); +} +void DeicsOnzeGui::setDelayPanLFODepth(double pd) { + int ipd = (int)(pd*255.0); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_DELAYLFODEPTH; + message[1]=(unsigned char)ipd; + sendSysex(message, 2); + updateDelayPanLFODepth(ipd); +} + + //-------------------------------------------------------------- // setSet // Display the set, that is the category list @@ -3039,6 +3169,8 @@ void DeicsOnzeGui::setEnabledPreset(bool b) { Op3Tab->setEnabled(b); Op4Tab->setEnabled(b); FunctionsTab->setEnabled(b); + chorusTab->setEnabled(b); + reverbTab->setEnabled(b); _enabledPreset=b; } @@ -3163,6 +3295,60 @@ void DeicsOnzeGui::updateLadspaChorusLineEdit(QString s) { selectLadspaChorusLineEdit->blockSignals(false); } +void DeicsOnzeGui::updateDelayActiv(bool a) { + delayActivCheckBox->blockSignals(true); + delayActivCheckBox->setChecked(a); + delayActivCheckBox->blockSignals(false); +} +void DeicsOnzeGui::updateChannelDelay(int r) { + chDelaySlider->blockSignals(true); + chDelaySlider->setValue(r); + chDelaySlider->blockSignals(false); + chDelaySpinBox->blockSignals(true); + chDelaySpinBox->setValue(r); + chDelaySpinBox->blockSignals(false); +} +void DeicsOnzeGui::updateDelayReturn(int r) { + delayReturnSlider->blockSignals(true); + delayReturnSlider->setValue(r); + delayReturnSlider->blockSignals(false); +} +void DeicsOnzeGui::updateDelayPanLFOFreq(int plf) { + delayPanLFOFreqSlider->blockSignals(true); + delayPanLFOFreqSlider->setValue(plf); + delayPanLFOFreqSlider->blockSignals(false); + delayPanLFOFreqFloatentry->blockSignals(true); + delayPanLFOFreqFloatentry->setValue(MINFREQ + (MAXFREQ - MINFREQ) + *((float)plf/255.0)); + delayPanLFOFreqFloatentry->blockSignals(false); +} +void DeicsOnzeGui::updateDelayTime(int dt) { + delayTimeSlider->blockSignals(true); + delayTimeSlider->setValue(dt); + delayTimeSlider->blockSignals(false); + delayTimeFloatentry->blockSignals(true); + delayTimeFloatentry->setValue(MINDELAYTIME + + (MAXDELAYTIME - MINDELAYTIME) + *((float)dt/255.0)); + delayTimeFloatentry->blockSignals(false); +} +void DeicsOnzeGui::updateDelayFeedback(int df) { + delayFeedbackSlider->blockSignals(true); + delayFeedbackSlider->setValue(df); + delayFeedbackSlider->blockSignals(false); + delayFeedbackFloatentry->blockSignals(true); + delayFeedbackFloatentry->setValue((float)(df - 128)/128.0); + delayFeedbackFloatentry->blockSignals(false); +} +void DeicsOnzeGui::updateDelayPanLFODepth(int dpd) { + delayPanLFODepthSlider->blockSignals(true); + delayPanLFODepthSlider->setValue(dpd); + delayPanLFODepthSlider->blockSignals(false); + delayPanLFODepthFloatentry->blockSignals(true); + delayPanLFODepthFloatentry->setValue((float)dpd/255.0); + delayPanLFODepthFloatentry->blockSignals(false); +} + void DeicsOnzeGui::applyFontSize(int fs) { QFont f = font(); f.setPointSize(fs); @@ -3317,14 +3503,14 @@ void DeicsOnzeGui::updateAtEgBias(int val) { atEgBiasSlider->setValue(val); atEgBiasSlider->blockSignals(false); } -void DeicsOnzeGui::updateReverbRate(int val) { - reverbSpinBox->blockSignals(true); - reverbSpinBox->setValue(val); - reverbSpinBox->blockSignals(false); - reverbSlider->blockSignals(true); - reverbSlider->setValue(val); - reverbSlider->blockSignals(false); -} +//void DeicsOnzeGui::updateReverbRate(int val) { + //reverbSpinBox->blockSignals(true); + //reverbSpinBox->setValue(val); + //reverbSpinBox->blockSignals(false); + //reverbSlider->blockSignals(true); + //reverbSlider->setValue(val); + //reverbSlider->blockSignals(false); +//} //Envelope void DeicsOnzeGui::updateAR(int op, int val) { Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); @@ -3910,7 +4096,7 @@ void DeicsOnzeGui::updateFIXRANGE(int op, int val) { case 0: Freq1SpinBox->blockSignals(true); Freq1SpinBox->setValue(val/100); - //val/100 because it is still a coarse display + //val/100 because it is still a coarse display Freq1SpinBox->blockSignals(false); break; case 1: @@ -3983,21 +4169,21 @@ void DeicsOnzeGui::updateSHFT(int op, int val) { } void DeicsOnzeGui::updateChannelDetune(int val) { updateChannelDetuneKnob(val); - updateChannelDetuneSlider(val); + //updateChannelDetuneSlider(val); } void DeicsOnzeGui::updateChannelDetuneKnob(int val) { detuneKnob->blockSignals(true); detuneKnob->setValue((((double)val)/((double)MAXCHANNELDETUNE))/2.0+0.5); detuneKnob->blockSignals(false); } -void DeicsOnzeGui::updateChannelDetuneSlider(int val) { - channelDetuneSlider->blockSignals(true); - channelDetuneSlider->setValue(val); - channelDetuneSlider->blockSignals(false); - channelDetuneSpinBox->blockSignals(true); - channelDetuneSpinBox->setValue(val); - channelDetuneSpinBox->blockSignals(false); -} +//void DeicsOnzeGui::updateChannelDetuneSlider(int val) { + //channelDetuneSlider->blockSignals(true); + //channelDetuneSlider->setValue(val); + //channelDetuneSlider->blockSignals(false); + //channelDetuneSpinBox->blockSignals(true); + //channelDetuneSpinBox->setValue(val); + //channelDetuneSpinBox->blockSignals(false); +//} void DeicsOnzeGui::updateChannelVolume(int val) { channelVolumeKnob->blockSignals(true); channelVolumeKnob->setValue(((double)val)/(double)MAXCHANNELVOLUME); @@ -4159,7 +4345,7 @@ void DeicsOnzeGui::updatePreset(Preset* p) { updateAtAmplitude(p->function.atAmplitude); updateAtPitchBias(p->function.atPitchBias); updateAtEgBias(p->function.atEgBias); - updateReverbRate(p->function.reverbRate); + //updateReverbRate(p->function.reverbRate); updatePOLYMODE((int)p->function.mode); updatePORTAMODE((int)p->function.portamento); updatePORTATIME((int)p->function.portamentoTime); diff --git a/muse/synti/deicsonze/deicsonzegui.h b/muse/synti/deicsonze/deicsonzegui.h index 18a28929..fbbdaccd 100644 --- a/muse/synti/deicsonze/deicsonzegui.h +++ b/muse/synti/deicsonze/deicsonzegui.h @@ -31,6 +31,7 @@ #define __DEICSONZEGUI_H #include "deicsonze.h" + #include "deicsonzepreset.h" #include "ui_deicsonzegui.h" #include "libsynti/gui.h" @@ -332,6 +333,18 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setWaveForm2(int); void setWaveForm3(int); void setWaveForm4(int); + //Delay + void setActivDelay(bool); + void setDelayReturn(int); + void setChannelDelay(int); + void setDelayTime(int); + void setDelayTime(double); + void setDelayFeedback(int); + void setDelayFeedback(double); + void setDelayPanLFOFreq(int); + void setDelayPanLFOFreq(double); + void setDelayPanLFODepth(int); + void setDelayPanLFODepth(double); //category subcategory preset void setSet(void); //display the set, that is the category list void setCategory(Category*); @@ -365,6 +378,13 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void updateReverbReturn(int r); void updateLadspaReverbLineEdit(QString s); void updateLadspaChorusLineEdit(QString s); + void updateDelayActiv(bool a); + void updateChannelDelay(int r); + void updateDelayReturn(int r); + void updateDelayPanLFOFreq(int plf); + void updateDelayTime(int dt); + void updateDelayFeedback(int df); + void updateDelayPanLFODepth(int dpd); void addPluginCheckBox(int index, QString text, bool toggled, QWidget* parent, QGridLayout* grid, bool isReverb); void addPluginIntSlider(int index, QString text, double min, double max, @@ -414,7 +434,7 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void updateAtAmplitude(int val); void updateAtPitchBias(int val); void updateAtEgBias(int val); - void updateReverbRate(int val); + //void updateReverbRate(int val); //update envelope void updateAR(int op, int val); void updateD1R(int op, int val); @@ -452,7 +472,7 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void updateSHFT(int op, int val); void updateChannelDetune(int val); void updateChannelDetuneKnob(int val); - void updateChannelDetuneSlider(int val); + //void updateChannelDetuneSlider(int val); void updateChannelVolume(int val); void updateCategoryName(QString cn, bool enable); void updateSubcategoryName(QString sn, bool enable); diff --git a/muse/synti/deicsonze/deicsonzegui.ui b/muse/synti/deicsonze/deicsonzegui.ui index 0c9be940..d649195c 100644 --- a/muse/synti/deicsonze/deicsonzegui.ui +++ b/muse/synti/deicsonze/deicsonzegui.ui @@ -6,8 +6,8 @@ 0 0 - 740 - 590 + 672 + 522 @@ -26,233 +26,6 @@ 6 - - - - - 96 - 16 - - - - Channel Ctrl - - - - 9 - - - 6 - - - - - 13 - - - 0.000000000000000 - - - 1.000000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - false - - - - - - - QFrame::StyledPanel - - - Release - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - - - - - QFrame::StyledPanel - - - Attack - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - - - - - QFrame::StyledPanel - - - Detune - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - - - - - QFrame::StyledPanel - - - Brightness - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - - - - - QFrame::StyledPanel - - - Modulation - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - - - - - QFrame::StyledPanel - - - Pan - - - Qt::AlignCenter - - - - - - - QFrame::StyledPanel - - - Volume - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - 13 - - - 1.000000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - 270 - - - 6 - - - - - - @@ -4185,30 +3958,321 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin 6 - - - - 0 + + + + + 16777215 + 80 + - - - Foot Control - - - - 9 - - - 6 - - - - - Pitch Bend Range - - - 99 - + + Delay Time (ms) + + + + 9 + + + 6 + + + + + + 48 + 16777215 + + + + 0.010000000000000 + + + 2.000000000000000 + + + + + + + 13 + + + Channel Chorus + + + 255 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Pan Depth + + + + 9 + + + 6 + + + + + + 48 + 16777215 + + + + + + + + 13 + + + Channel Chorus + + + 255 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Feedback + + + + 9 + + + 6 + + + + + + 48 + 16777215 + + + + -1.000000000000000 + + + + + + + 13 + + + Channel Chorus + + + 255 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Pan LFO Freq + + + + 9 + + + 6 + + + + + 13 + + + Channel Chorus + + + 255 + + + Qt::Horizontal + + + + + + + + 48 + 16777215 + + + + 0.100000000000000 + + + 10.000000000000000 + + + + + + + + + + + 16777215 + 80 + + + + Delay On/Off, Return Level + + + + 9 + + + 6 + + + + + 13 + + + On + + + + + + + 255 + + + 128 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Ch Send Level + + + + 9 + + + 6 + + + + + 127 + + + + + + + 13 + + + Channel Chorus + + + 127 + + + Qt::Horizontal + + + + + + + + + + 0 + + + + Foot Control + + + + 9 + + + 6 + + + + + Pitch Bend Range + + + 99 + @@ -4868,139 +4932,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin - - - - Detune - - - - 10 - - - 6 - - - - - 13 - - - Detune - - - -63 - - - 63 - - - 1 - - - Qt::Horizontal - - - - - - - Detune - - - 63 - - - -61 - - - - - - - - - - Foot Switch - - - - 10 - - - 6 - - - - - false - - - - Sustain - - - - - Portamento - - - - - - - - - - - Pitch Bend Range - - - - 10 - - - 6 - - - - - 13 - - - Pitch Bend Range - - - 0 - - - 12 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 12 - - - - - - - + Potamento @@ -5092,13 +5024,10 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin - - - - false - + + - Reverb + Pitch Bend Range @@ -5108,37 +5037,37 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin 6 - + 13 - Detune + Pitch Bend Range 0 - 7 + 12 1 + + 0 + Qt::Horizontal - + - Detune + Pitch Bend Range - 7 - - - 0 + 12 @@ -5919,6 +5848,233 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin + + + + + 96 + 16 + + + + Channel Ctrl + + + + 9 + + + 6 + + + + + 13 + + + 0.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + false + + + + + + + QFrame::StyledPanel + + + Release + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + + + + + QFrame::StyledPanel + + + Attack + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + + + + + QFrame::StyledPanel + + + Detune + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + + + + + QFrame::StyledPanel + + + Brightness + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + + + + + QFrame::StyledPanel + + + Modulation + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + + + + + QFrame::StyledPanel + + + Pan + + + Qt::AlignCenter + + + + + + + QFrame::StyledPanel + + + Volume + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + 13 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + 270 + + + 6 + + + + + + @@ -5928,7 +6084,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin - -28.009242824902255 + -31.287818861687722 0.000000000000000 @@ -7036,16 +7192,21 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin - - Awl::VolKnob - Awl::Knob -
awl/volknob.h
-
Awl::Knob QWidget
awl/knob.h
+ + Awl::FloatEntry + QLineEdit +
awl/floatentry.h
+
+ + Awl::VolKnob + Awl::Knob +
awl/volknob.h
+
deicsOnzeTabWidget @@ -7177,12 +7338,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 445 - 170 + 110 + 115 - 606 - 173 + 110 + 115 @@ -7193,12 +7354,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 606 - 173 + 110 + 115 - 445 - 170 + 110 + 115 @@ -7209,12 +7370,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 252 - 270 + 110 + 115 - 304 - 273 + 110 + 115 @@ -7225,12 +7386,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 273 + 110 + 115 - 252 - 270 + 110 + 115 @@ -7241,12 +7402,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 252 - 301 + 110 + 115 - 304 - 304 + 110 + 115 @@ -7257,12 +7418,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 304 + 110 + 115 - 252 - 301 + 110 + 115 @@ -7273,12 +7434,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 335 + 110 + 115 - 194 - 332 + 110 + 115 @@ -7289,12 +7450,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 366 + 110 + 115 - 194 - 363 + 110 + 115 @@ -7305,12 +7466,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 194 - 394 + 110 + 115 - 304 - 397 + 110 + 115 @@ -7321,12 +7482,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 397 + 110 + 115 - 194 - 394 + 110 + 115 @@ -7337,12 +7498,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 194 - 425 + 110 + 115 - 304 - 428 + 110 + 115 @@ -7353,12 +7514,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 304 - 428 + 110 + 115 - 194 - 425 + 110 + 115 @@ -7369,12 +7530,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 194 - 332 + 110 + 115 - 304 - 335 + 110 + 115 @@ -8425,12 +8586,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 240 - 207 + 262 + 163 - 607 - 210 + 515 + 166 @@ -8441,12 +8602,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 607 - 210 + 515 + 166 - 240 - 207 + 262 + 163 @@ -8457,12 +8618,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 240 - 329 + 262 + 209 - 596 - 332 + 504 + 212 @@ -8473,12 +8634,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 596 - 332 + 504 + 212 - 240 - 329 + 262 + 209 @@ -8489,12 +8650,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 596 - 439 + 504 + 258 - 240 - 442 + 262 + 255 @@ -8505,44 +8666,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 240 - 442 - - - 596 - 439 - - - - - channelDetuneSpinBox - valueChanged(int) - channelDetuneSlider - setValue(int) - - - 110 - 115 - - - 110 - 115 - - - - - channelDetuneSlider - valueChanged(int) - channelDetuneSpinBox - setValue(int) - - - 110 - 115 + 262 + 255 - 110 - 115 + 504 + 258 @@ -8553,12 +8682,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 485 + 484 - 110 - 115 + 537 + 487 @@ -8569,44 +8698,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 - - - 110 - 115 - - - - - reverbSlider - valueChanged(int) - reverbSpinBox - setValue(int) - - - 110 - 115 - - - 110 - 115 - - - - - reverbSpinBox - valueChanged(int) - reverbSlider - setValue(int) - - - 110 - 115 + 537 + 487 - 110 - 115 + 485 + 484 @@ -8617,12 +8714,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 329 + 484 - 110 - 115 + 381 + 487 @@ -8633,12 +8730,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 381 + 487 - 110 - 115 + 329 + 484 @@ -8649,12 +8746,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8665,12 +8762,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8681,12 +8778,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8697,12 +8794,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8713,12 +8810,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8729,12 +8826,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8745,12 +8842,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8761,12 +8858,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8777,12 +8874,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8793,12 +8890,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8809,12 +8906,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8825,12 +8922,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8841,12 +8938,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8857,12 +8954,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8873,12 +8970,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8889,12 +8986,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8905,12 +9002,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8921,12 +9018,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8937,12 +9034,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8953,12 +9050,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8969,12 +9066,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -8985,12 +9082,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 121 + 149 - 110 - 115 + 121 + 149 @@ -9017,12 +9114,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 486 + 150 - 110 - 115 + 538 + 153 @@ -9033,12 +9130,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 110 - 115 + 538 + 153 - 110 - 115 + 486 + 150 @@ -9081,12 +9178,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 203 - 163 + 110 + 115 - 287 - 171 + 110 + 115 @@ -9097,12 +9194,44 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin setValue(int) - 270 - 156 + 110 + 115 + + + 110 + 115 + + + + + chDelaySlider + valueChanged(int) + chDelaySpinBox + setValue(int) + + + 302 + 339 + + + 344 + 343 + + + + + chDelaySpinBox + valueChanged(int) + chDelaySlider + setValue(int) + + + 346 + 329 - 169 - 157 + 278 + 329 diff --git a/muse/synti/deicsonze/deicsonzeplugin.cpp b/muse/synti/deicsonze/deicsonzeplugin.cpp index 8788d152..5d882ff5 100644 --- a/muse/synti/deicsonze/deicsonzeplugin.cpp +++ b/muse/synti/deicsonze/deicsonzeplugin.cpp @@ -84,6 +84,46 @@ void DeicsOnze::initPluginChorus(Plugin* pluginChorus) { _gui->writeEvent(evSysex); } +void DeicsOnze::initPluginDelay(Plugin* pluginDelay) { + if(_pluginIDelay) delete(_pluginIDelay); + _pluginIDelay = new PluginI(NULL); + + _pluginIDelay->initPluginInstance(pluginDelay, 2); + + for(int i = 0; i < pluginDelay->parameter(); i++) { + Ctrl* c = new Ctrl(); + c->setCurVal((float)pluginDelay->defaultValue(i)); + _pluginIDelay->setControllerList(c); + //setChorusParam(i, pluginDelay->defaultValue(i)); + } + setDelayDryWet(255); + + char dataDelayTime[2]; + dataDelayTime[0] = SYSEX_DELAYTIME; + dataDelayTime[1] = (unsigned char)getDelayTime(); + MidiEvent evSysexDelayTime(0,ME_SYSEX, + (const unsigned char*)dataDelayTime, 2); + _gui->writeEvent(evSysexDelayTime); + char dataDelayFeedback[2]; + dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; + dataDelayFeedback[1] = (unsigned char)getDelayFeedback(); + MidiEvent evSysexDelayFeedback(0,ME_SYSEX, + (const unsigned char*)dataDelayFeedback, 2); + _gui->writeEvent(evSysexDelayFeedback); + char dataDelayLFOFreq[2]; + dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; + dataDelayLFOFreq[1] = (unsigned char)getDelayLFOFreq(); + MidiEvent evSysexDelayLFOFreq(0,ME_SYSEX, + (const unsigned char*)dataDelayLFOFreq, 2); + _gui->writeEvent(evSysexDelayLFOFreq); + char dataDelayLFODepth[2]; + dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; + dataDelayLFODepth[1] = (unsigned char)getDelayLFODepth(); + MidiEvent evSysexDelayLFODepth(0,ME_SYSEX, + (const unsigned char*)dataDelayLFODepth, 2); + _gui->writeEvent(evSysexDelayLFODepth); +} + void DeicsOnze::setReverbParam(int index, double val) { _pluginIReverb->controller(index)->setCurVal((float)val); } @@ -290,7 +330,7 @@ void DeicsOnzeGui::setReverbCheckBox(double v, int i) { //of the parameter because it sends a double and does not //change any thing void DeicsOnzeGui::setChorusCheckBox(double v, int i) { - float f = (float)v; + float f = (float)v; unsigned char* message = new unsigned char[2+sizeof(float)]; message[0]=SYSEX_CHORUSPARAM; if(i<256) { @@ -355,3 +395,43 @@ void DeicsOnzeGui::updateChorusFloatEntry(double v, int i) { _chorusFloatEntryVector[i]->blockSignals(false); } } + +//------------------------------------------------------------- +// set Delay +//------------------------------------------------------------- +void DeicsOnze::setDelayTime(int val) { + float res = MINDELAYTIME + (MAXDELAYTIME - MINDELAYTIME)*((float)val/255.0); + _pluginIDelay->controller(0)->setCurVal(res); +} +int DeicsOnze::getDelayTime() { + float dtf = _pluginIDelay->controller(0)->curVal().f; + return (int)(((dtf - MINDELAYTIME) / (MAXDELAYTIME - MINDELAYTIME))*255.0); +} +void DeicsOnze::setDelayFeedback(int val) { + float res = (float)(val - 128)/128.0; + _pluginIDelay->controller(1)->setCurVal(res); +} +int DeicsOnze::getDelayFeedback() { + float dtf = _pluginIDelay->controller(1)->curVal().f; + return (int)(dtf*128.0+128.0); +} +void DeicsOnze::setDelayLFOFreq(int val) { + float res = MINFREQ + (MAXFREQ - MINFREQ)*((float)val/255.0); + _pluginIDelay->controller(2)->setCurVal(res); +} +int DeicsOnze::getDelayLFOFreq() { + float dtf = _pluginIDelay->controller(2)->curVal().f; + return (int)(((dtf - MINFREQ) / (MAXFREQ - MINFREQ))*255.0); +} +void DeicsOnze::setDelayLFODepth(int val) { + float res = (float)val/255.0; + _pluginIDelay->controller(3)->setCurVal(res); +} +int DeicsOnze::getDelayLFODepth() { + float dtd = _pluginIDelay->controller(3)->curVal().f; + return (int)(dtd*255.0); +} +void DeicsOnze::setDelayDryWet(int val) { + float res = (float)val/255.0; + _pluginIDelay->controller(4)->setCurVal(res); +} diff --git a/muse/synti/deicsonze/deicsonzeplugin.h b/muse/synti/deicsonze/deicsonzeplugin.h index a6b2aa45..d9527e23 100644 --- a/muse/synti/deicsonze/deicsonzeplugin.h +++ b/muse/synti/deicsonze/deicsonzeplugin.h @@ -32,6 +32,7 @@ #include "deicsonze.h" #include "deicsonzegui.h" +#include "plugins/pandelay/pandelaymodel.h" class DeicsOnze; class DeicsOnzeGui; -- cgit v1.2.3