From 2a079213ac507ab4866d9e27c5cf86ddcb7a3c6d Mon Sep 17 00:00:00 2001 From: Nil Geisweiller Date: Sun, 14 Nov 2010 07:41:38 +0000 Subject: see ChangeLog --- muse2/ChangeLog | 2 + muse2/synti/deicsonze2/CMakeLists.txt | 38 +- muse2/synti/deicsonze2/deicsonze.cpp | 4361 ----------- muse2/synti/deicsonze2/deicsonze.h | 603 -- muse2/synti/deicsonze2/deicsonze2.cpp | 4361 +++++++++++ muse2/synti/deicsonze2/deicsonze2.h | 603 ++ muse2/synti/deicsonze2/deicsonze2filter.cpp | 67 + muse2/synti/deicsonze2/deicsonze2filter.h | 59 + muse2/synti/deicsonze2/deicsonze2gui.cpp | 0 muse2/synti/deicsonze2/deicsonze2gui.h | 571 ++ muse2/synti/deicsonze2/deicsonze2gui.ui | 10237 ++++++++++++++++++++++++++ muse2/synti/deicsonze2/deicsonze2guibase.h | 312 + muse2/synti/deicsonze2/deicsonze2plugin.cpp | 502 ++ muse2/synti/deicsonze2/deicsonze2plugin.h | 40 + muse2/synti/deicsonze2/deicsonze2preset.cpp | 1202 +++ muse2/synti/deicsonze2/deicsonze2preset.h | 567 ++ muse2/synti/deicsonze2/deicsonzefilter.cpp | 67 - muse2/synti/deicsonze2/deicsonzefilter.h | 59 - muse2/synti/deicsonze2/deicsonzegui.cpp | 0 muse2/synti/deicsonze2/deicsonzegui.h | 571 -- muse2/synti/deicsonze2/deicsonzegui.ui | 10237 -------------------------- muse2/synti/deicsonze2/deicsonzeguibase.h | 312 - muse2/synti/deicsonze2/deicsonzeplugin.cpp | 502 -- muse2/synti/deicsonze2/deicsonzeplugin.h | 40 - muse2/synti/deicsonze2/deicsonzepreset.cpp | 1202 --- muse2/synti/deicsonze2/deicsonzepreset.h | 567 -- 26 files changed, 18542 insertions(+), 18540 deletions(-) delete mode 100644 muse2/synti/deicsonze2/deicsonze.cpp delete mode 100644 muse2/synti/deicsonze2/deicsonze.h create mode 100644 muse2/synti/deicsonze2/deicsonze2.cpp create mode 100644 muse2/synti/deicsonze2/deicsonze2.h create mode 100644 muse2/synti/deicsonze2/deicsonze2filter.cpp create mode 100644 muse2/synti/deicsonze2/deicsonze2filter.h create mode 100644 muse2/synti/deicsonze2/deicsonze2gui.cpp create mode 100644 muse2/synti/deicsonze2/deicsonze2gui.h create mode 100644 muse2/synti/deicsonze2/deicsonze2gui.ui create mode 100644 muse2/synti/deicsonze2/deicsonze2guibase.h create mode 100644 muse2/synti/deicsonze2/deicsonze2plugin.cpp create mode 100644 muse2/synti/deicsonze2/deicsonze2plugin.h create mode 100644 muse2/synti/deicsonze2/deicsonze2preset.cpp create mode 100644 muse2/synti/deicsonze2/deicsonze2preset.h delete mode 100644 muse2/synti/deicsonze2/deicsonzefilter.cpp delete mode 100644 muse2/synti/deicsonze2/deicsonzefilter.h delete mode 100644 muse2/synti/deicsonze2/deicsonzegui.cpp delete mode 100644 muse2/synti/deicsonze2/deicsonzegui.h delete mode 100644 muse2/synti/deicsonze2/deicsonzegui.ui delete mode 100644 muse2/synti/deicsonze2/deicsonzeguibase.h delete mode 100644 muse2/synti/deicsonze2/deicsonzeplugin.cpp delete mode 100644 muse2/synti/deicsonze2/deicsonzeplugin.h delete mode 100644 muse2/synti/deicsonze2/deicsonzepreset.cpp delete mode 100644 muse2/synti/deicsonze2/deicsonzepreset.h (limited to 'muse2') diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 2006b45c..1295f7fd 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +14.11.2010 + - renamed deicsonze2 files and classes with '2' suffixes 12.11.2010 - Fixed arranger alignment issues - set layout margins to zero. (Tim) TODO: Track list items aligned to canvas tracks are still off by one lousy vertical pixel. diff --git a/muse2/synti/deicsonze2/CMakeLists.txt b/muse2/synti/deicsonze2/CMakeLists.txt index 12f88212..c498fc0c 100644 --- a/muse2/synti/deicsonze2/CMakeLists.txt +++ b/muse2/synti/deicsonze2/CMakeLists.txt @@ -20,40 +20,40 @@ include(${PROJECT_SOURCE_DIR}/pch.txt) -QT4_WRAP_CPP ( deicsonze_mocs deicsonzegui.h ) -QT4_WRAP_UI ( deicsonze_uis deicsonzegui.ui ) +QT4_WRAP_CPP ( deicsonze2_mocs deicsonze2gui.h ) +QT4_WRAP_UI ( deicsonze2_uis deicsonze2gui.ui ) -add_library ( deicsonze SHARED +add_library ( deicsonze2 SHARED ${PROJECT_BINARY_DIR}/all.h ${PROJECT_BINARY_DIR}/all-pic.h.pch - deicsonze.cpp - deicsonzepreset.cpp - deicsonzeplugin.cpp - deicsonzefilter.cpp - deicsonzegui.cpp - deicsonzegui.h - - ${deicsonze_mocs} - ${deicsonze_uis} + deicsonze2.cpp + deicsonze2preset.cpp + deicsonze2plugin.cpp + deicsonze2filter.cpp + deicsonze2gui.cpp + deicsonze2gui.h + + ${deicsonze2_mocs} + ${deicsonze2_uis} ) -target_link_libraries( deicsonze synti ) +target_link_libraries( deicsonze2 synti ) -# - tell cmake to name target deicsonze.so instead of -# libdeicsonze.so +# - tell cmake to name target deicsonze2.so instead of +# libdeicsonze2.so # - use precompiled header files # -set_target_properties ( deicsonze +set_target_properties ( deicsonze2 PROPERTIES PREFIX "" #COMPILE_FLAGS "-O2 -include ${PROJECT_BINARY_DIR}/all-pic.h" COMPILE_FLAGS "-fvisibility=hidden -include ${PROJECT_BINARY_DIR}/all-pic.h" ) -target_link_libraries(deicsonze +target_link_libraries(deicsonze2 al awl synti ${QT_LIBRARIES} ) -install_targets ( /${CMAKE_INSTALL_LIBDIR}/${MusE_INSTALL_NAME}/synthi/ deicsonze ) +install_targets ( /${CMAKE_INSTALL_LIBDIR}/${MusE_INSTALL_NAME}/synthi/ deicsonze2 ) -install_files ( /${SHARE_INSTALL_PREFIX}/${MusE_INSTALL_NAME}/presets/deicsonze SutulaBank.dei ) +install_files ( /${SHARE_INSTALL_PREFIX}/${MusE_INSTALL_NAME}/presets/deicsonze2 SutulaBank.dei ) diff --git a/muse2/synti/deicsonze2/deicsonze.cpp b/muse2/synti/deicsonze2/deicsonze.cpp deleted file mode 100644 index 74c1f56e..00000000 --- a/muse2/synti/deicsonze2/deicsonze.cpp +++ /dev/null @@ -1,4361 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// -// -// -// Copyright (c) 2004-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 -#include - -// #include - -#include "muse/midi.h" -#include "libsynti/mess.h" -#include "muse/plugin.h" -#include "muse/midictrl.h" -#include "deicsonze.h" -#include "config.h" - -#define ABS(x) (x>=0?x:-x) - - -float DeicsOnze::waveTable[NBRWAVES][RESOLUTION]; -int DeicsOnze::useCount = 0; - -//--------------------------------------------------------- -// DeicsOnze -//--------------------------------------------------------- - -DeicsOnze::DeicsOnze() : Mess(2) { - if (useCount++ == 0) { - // create sinus wave table, W1 - for(int i = 0; i < RESOLUTION; i++) - waveTable[W1][i] = - (float)(sin((i * 2.0 * M_PI) / (double)RESOLUTION)); - // create sinus*abs(sinus) wave table, W2 - for(int i = 0; i < RESOLUTION; i++){ - double t = (i * 2.0 * M_PI) / (double)RESOLUTION; - waveTable[W2][i] = (float)(ABS(sin(t))*sin(t));} - // create halfsinus_ wave table, W3 - for(int i = 0; i < RESOLUTION; i++) - waveTable[W3][i] = (float) - (ihide(); // to avoid flicker during MusE startup - // TODO _gui->setWindowTitle(QString("DeicsOnze")); - - //FX - Plugin* p; - p = plugins.find("freeverb", "freeverb1"); - _pluginIReverb = NULL; - if(p) initPluginReverb(p); - _pluginIChorus = NULL; - p = plugins.find("doublechorus", "doublechorus1"); - if(p) initPluginChorus(p); - _pluginIDelay = NULL; - p = plugins.find("pandelay", "pandelay"); - if(p) initPluginDelay(p); - - //Filter - _dryFilter = new LowFilter(); - _chorusFilter = new LowFilter(); - _reverbFilter = new LowFilter(); - _delayFilter = new LowFilter(); - - //Load configuration - QString defaultConf = - (QString(getenv("HOME")) + QString("/." DEICSONZESTR ".dco")); - FILE* f; - f = fopen(defaultConf.ascii(), "r"); - if(f) { - fclose(f); - loadConfiguration(defaultConf); - } - - //load Set - _set=new Set("Initial Bank"); - if(_isInitSet) loadSet(_initSetPath); - - //loadSutulaPresets(); - - _initialPreset = new - Preset(new Subcategory(new Category(NULL, "NONE", 0), "NONE", 0), 0); - for(int c = 0; c < NBRCHANNELS; c++) { - _preset[c]=_initialPreset; - setPreset(c); - } - //update display gui - //update mastervol - unsigned char dataMasterVol[2]; - dataMasterVol[0]=SYSEX_MASTERVOL; - dataMasterVol[1]=getMasterVol(); - MidiPlayEvent evSysexMasterVol(0, ME_SYSEX, - (const unsigned char*)dataMasterVol, - 2); - _gui->writeEvent(evSysexMasterVol); - //update return fx - unsigned char *dataReverbRet = new unsigned char[2]; - dataReverbRet[0]=SYSEX_REVERBRETURN; - dataReverbRet[1]=(unsigned char)getReverbReturn(); - MidiPlayEvent evReverbRet(0,ME_SYSEX,(const unsigned char*)dataReverbRet, 2); - _gui->writeEvent(evReverbRet); - unsigned char *dataChorusRet = new unsigned char[2]; - dataChorusRet[0]=SYSEX_CHORUSRETURN; - dataChorusRet[1]=(unsigned char)getChorusReturn(); - MidiPlayEvent 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()); - MidiPlayEvent 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; - dataFontSize[1]=(unsigned char)_global.fontSize; - MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); - _gui->writeEvent(evFontSize); - //display load preset - unsigned char dataUpdateGuiSet[1]; - dataUpdateGuiSet[0]=SYSEX_UPDATESETGUI; - MidiPlayEvent evSysexUpdateGuiSet(0, ME_SYSEX, - (const unsigned char*)dataUpdateGuiSet, - 1); - _gui->writeEvent(evSysexUpdateGuiSet); -} - -//--------------------------------------------------------- -// ~DeicsOnze -//--------------------------------------------------------- - -DeicsOnze::~DeicsOnze() -{ - //if (--useCount == 0) - //delete[] sine_table; - //dealloc temp buffers chorus and reverb - for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputChorus[i]); - free(tempInputChorus); - 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); -} - -//--------------------------------------------------------- -// getSinusWaveTable -//--------------------------------------------------------- -float* DeicsOnze::getSinusWaveTable() { - return waveTable[W1]; -} - -//--------------------------------------------------------- -// guiVisible -//--------------------------------------------------------- -bool DeicsOnze::guiVisible() const -{ - return _gui->isVisible(); -} - -//--------------------------------------------------------- -// showGui -//--------------------------------------------------------- -void DeicsOnze::showGui(bool val) -{ - _gui->setShown(val); -} - -//--------------------------------------------------------- -// getGeometry -//--------------------------------------------------------- - -void DeicsOnze::getGeometry(int* x, int* y, int* w, int* h) const { - QPoint pos(_gui->pos()); - QSize size(_gui->size()); - *x = pos.x(); - *y = pos.y(); - *w = size.width(); - *h = size.height(); -} - -void DeicsOnze::setSampleRate(int sr) { - Mess::setSampleRate(sr); - _dryFilter->setSamplerate(sr); - _chorusFilter->setSamplerate(sr); - _reverbFilter->setSamplerate(sr); - _delayFilter->setSamplerate(sr); - setQuality(_global.quality); -} - -//--------------------------------------------------------- -// setGeometry -//--------------------------------------------------------- - -void DeicsOnze::setGeometry(int x, int y, int w, int h) { - _gui->resize(QSize(w, h)); - _gui->move(QPoint(x, y)); -} - -//--------------------------------------------------------- -// initCtrls -//--------------------------------------------------------- -void DeicsOnze::initCtrls() { - int i=0; - for(int k=0; kfindPreset(hbank, lbank, prog); -} -Subcategory* DeicsOnze::findSubcategory(int hbank, int lbank) const { - return _set->findSubcategory(hbank, lbank); -} -Category* DeicsOnze::findCategory(int hbank) const { - return _set->findCategory(hbank); -} -//--------------------------------------------------------- -// isPitchEnv -// return true iff all levels are in the middle -//--------------------------------------------------------- -inline bool isPitchEnv(PitchEg* pe) { - return(pe->pl1 != 50 || pe->pl2 != 50 || pe->pl3 != 50); -} -//--------------------------------------------------------- -// getPitchEnvCoefInct -// returns the coefInct according to level pl -//--------------------------------------------------------- -inline double getPitchEnvCoefInct(int pl) { - /* - pl = 0 <--> -4oct, pl = 50 <--> 0oct, pl = 100 <--> 4oct - - y = a * exp((pl - 50)/b) - 1.0 = a*exp(0) ==> a = 1.0 - 8.0 = exp(50/b) ==> log 8.0 = 50/b ==> b = 50/log(8.0) - */ - double b = 50.0/log(8.0); - return exp((pl-50.0)/b); -} - -//--------------------------------------------------------- -// getPitchEnvCoefInctInct -//--------------------------------------------------------- -inline double getPitchEnvCoefInctInct(int pl1, int pl2, int pr, double sr) { - //TODO : depending on the sampleRate - int a = pr; - double c = 1.0 + COEFPITCHENV*((double)(a*a)+1.0); - double inctInct = exp(log(c)*48000.0/sr); - if(pl1pl2) - return(1.0/inctInct); - else return 1.0; -} - -//--------------------------------------------------------- -// existsKeyOn -//--------------------------------------------------------- -bool DeicsOnze::existsKeyOn(int ch) { - return !_global.channel[ch].lastVoiceKeyOn.empty(); -} - -//--------------------------------------------------------- -// note2Amp -// return the Amp of a note depending on the level scaling -//--------------------------------------------------------- -inline double note2Amp(double note, int ls) -{ - if(ls==0) return(1.0); - else return((noteMAXNBRVOICES?MAXNBRVOICES:(nv<1?1:nv)); - //we assume that any voices - //that is not included in the active voices is properly initialized - for(int v=nv; v<_global.channel[c].nbrVoices; v++) - initVoice(c, v); - _global.channel[c].nbrVoices=nv; -} - -//---------------------------------------------------------------- -// setMasterVol -//---------------------------------------------------------------- -void DeicsOnze::setMasterVol(int mv) { - _global.masterVolume=level2amp(mv); //watch out that MAXMASTERVOLUME==255 -} -//---------------------------------------------------------------- -// setChannelEnable -//---------------------------------------------------------------- -void DeicsOnze::setChannelEnable(int c, bool e) { - _global.channel[c].isEnable = e; - setLfo(c); -} - -//---------------------------------------------------------------- -// setChannelVol -//---------------------------------------------------------------- -void DeicsOnze::setChannelVol(int c, int v) { - _global.channel[c].volume = v; -} - -void DeicsOnze::applyChannelAmp(int c) { - _global.channel[c].ampLeft = - level2amp(_global.channel[c].volume) - * ((double)(MAXCHANNELPAN - _global.channel[c].pan) - /(double)(2*MAXCHANNELPAN)); - _global.channel[c].ampRight = - level2amp(_global.channel[c].volume) - * ((double)(MAXCHANNELPAN + _global.channel[c].pan) - /(double)(2*MAXCHANNELPAN)); -} - -//---------------------------------------------------------------- -// setChannelPan -//---------------------------------------------------------------- -void DeicsOnze::setChannelPan(int c, int p) { - _global.channel[c].pan = p; -} -//---------------------------------------------------------------- -// setChannelDetune -//---------------------------------------------------------------- -void DeicsOnze::setChannelDetune(int c, int p) { - _global.channel[c].detune = p; -} -//---------------------------------------------------------------- -// setChannelBrightness -//---------------------------------------------------------------- -void DeicsOnze::setChannelBrightness(int c, int b) { - _global.channel[c].brightness = b; -} -//---------------------------------------------------------------- -// setChannelModulation -//---------------------------------------------------------------- -void DeicsOnze::setChannelModulation(int c, int m) { - _global.channel[c].modulation = m; -} -//---------------------------------------------------------------- -// setChannelAttack -//---------------------------------------------------------------- -void DeicsOnze::setChannelAttack(int c, int a) { - _global.channel[c].attack = a; -} -//---------------------------------------------------------------- -// setChannelRelease -//---------------------------------------------------------------- -void DeicsOnze::setChannelRelease(int c, int r) { - _global.channel[c].release = r; -} -//---------------------------------------------------------------- -// setChannelReverb -//---------------------------------------------------------------- -void DeicsOnze::setChannelReverb(int c, int r) { - _global.channel[c].reverbAmount = (float)lowlevel2amp(r); -} -//---------------------------------------------------------------- -// setChannelChorus -//---------------------------------------------------------------- -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 -//---------------------------------------------------------------- -void DeicsOnze::setChorusReturn(int val) { - _global.chorusReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 -} - -//---------------------------------------------------------------- -// setReverbReturn -//---------------------------------------------------------------- -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 -//---------------------------------------------------------------- -int DeicsOnze::getNbrVoices(int c) const { - return(_global.channel[c].nbrVoices); -} -//---------------------------------------------------------------- -// getMasterVol -//---------------------------------------------------------------- -int DeicsOnze::getMasterVol(void) const { - return(amp2level(_global.masterVolume)); -} -//---------------------------------------------------------------- -// getFilter -//---------------------------------------------------------------- -bool DeicsOnze::getFilter(void) const { - return _global.filter; -} -//---------------------------------------------------------------- -// getChannelEnable -//---------------------------------------------------------------- -bool DeicsOnze::getChannelEnable(int c) const { - return _global.channel[c].isEnable; -} - -//---------------------------------------------------------------- -// getChannelVol -//---------------------------------------------------------------- -int DeicsOnze::getChannelVol(int c) const { //TODO : to see if correct - //return((int)(MAX(_global.channel[c].ampLeft, _global.channel[c].ampRight) - //*(double)MAXCHANNELVOLUME)); - return(_global.channel[c].volume); -} -//---------------------------------------------------------------- -// getChannelPan -//---------------------------------------------------------------- -int DeicsOnze::getChannelPan(int c) const { - return(_global.channel[c].pan); -} -//---------------------------------------------------------------- -// setChannelDetune -//---------------------------------------------------------------- -int DeicsOnze::getChannelDetune(int c) const { - return _global.channel[c].detune; -} -//---------------------------------------------------------------- -// getChannelBrightness -//---------------------------------------------------------------- -int DeicsOnze::getChannelBrightness(int c) const { - return(_global.channel[c].brightness); -} -//---------------------------------------------------------------- -// getChannelModulation -//---------------------------------------------------------------- -int DeicsOnze::getChannelModulation(int c) const { - return(_global.channel[c].modulation); -} -//---------------------------------------------------------------- -// getChannelAttack -//---------------------------------------------------------------- -int DeicsOnze::getChannelAttack(int c) const { - return(_global.channel[c].attack); -} -//---------------------------------------------------------------- -// getChannelRelease -//---------------------------------------------------------------- -int DeicsOnze::getChannelRelease(int c) const { - return(_global.channel[c].release); -} -//---------------------------------------------------------------- -// getChannelReverb -//---------------------------------------------------------------- -int DeicsOnze::getChannelReverb(int c) const { - return(amp2lowlevel(_global.channel[c].reverbAmount)); -} -//---------------------------------------------------------------- -// getChannelChorus -//---------------------------------------------------------------- -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 { - return(amp2level(_global.chorusReturn/2.0)); -} -//---------------------------------------------------------------- -// getReverbReturn -//---------------------------------------------------------------- -int DeicsOnze::getReverbReturn() const { - return(amp2level(_global.reverbReturn/2.0)); -} -//---------------------------------------------------------------- -// getReverbReturn -//---------------------------------------------------------------- -int DeicsOnze::getDelayReturn() const { - return(amp2level(_global.delayReturn/2.0)); -} - -//---------------------------------------------------------------- -// setLfo -//---------------------------------------------------------------- -void DeicsOnze::setLfo(int c/*channel*/) -{ - double x; - x=(double)_preset[c]->lfo.speed; - // lfoSpeed to Hz, obtained by fitting the actual curve by a polynomial - _global.channel[c].lfoFreq = - -1.9389e-08*x*x*x*x*x+2.8826e-06*x*x*x*x-9.0316e-05*x*x*x - +4.7453e-03*x*x-1.2295e-02*x+7.0347e-02;//a revoir - //Pitch LFO - _global.channel[c].lfoMaxIndex = - (_global.channel[c].lfoFreq==0?0:(int)((1.0/_global.channel[c].lfoFreq) - *(double)_global.deiSampleRate)); - double totalpDepth = - ((double)_preset[c]->lfo.pModDepth + - (((double)_global.channel[c].modulation)/127.0) - * ((double)(MAXPMODDEPTH - _preset[c]->lfo.pModDepth)) - )/(double)MAXPMODDEPTH; - _global.channel[c].lfoPitch = - totalpDepth * (COEFPLFO(_preset[c]->sensitivity.pitch)); - //Amplitude LFO - double totalaDepth = - ((double)_preset[c]->lfo.aModDepth + - (((double)_global.channel[c].modulation)/127.0) - * ((double)(MAXAMODDEPTH - _preset[c]->lfo.aModDepth)) - )/(double)MAXAMODDEPTH; - _global.channel[c].lfoMaxAmp = - totalaDepth * (COEFALFO(_preset[c]->sensitivity.amplitude)); - //index is concidered on the half of the frequency of the LFO - _global.channel[c].lfoDelayMaxIndex = - delay2Time(_preset[c]->lfo.delay)*_global.channel[c].lfoFreq*2; - _global.channel[c].lfoDelayInct = - (double)(RESOLUTION/4)/_global.channel[c].lfoDelayMaxIndex; - - //update the actuall values controlling the modulation now - if(_global.channel[c].lfoDelayIndex<(double)(RESOLUTION/4)) { - double delayCoef = - (double)waveTable[W2][(int)_global.channel[c].lfoDelayIndex]; - _global.channel[c].lfoMaxCoefInct = - exp((log(2.0)/12.0)*_global.channel[c].lfoPitch*delayCoef); - _global.channel[c].lfoCoefInctInct = - exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch*delayCoef) - /_global.channel[c].lfoMaxIndex)); - _global.channel[c].lfoMaxDAmp = delayCoef*_global.channel[c].lfoMaxAmp; - } - else - if(_global.channel[c].delayPassed) { - _global.channel[c].lfoMaxCoefInct = - exp((log(2.0)/12.0)*_global.channel[c].lfoPitch); - _global.channel[c].lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch) - /_global.channel[c].lfoMaxIndex)); - _global.channel[c].lfoMaxDAmp=_global.channel[c].lfoMaxAmp; - } -} - -//----------------------------------------------------------------- -// setOutLevel -//----------------------------------------------------------------- -void DeicsOnze::setOutLevel(int c, int k) { - for(int v=0; v<_global.channel[c].nbrVoices; v++) { - if(_global.channel[c].voices[v].op[k].envState!=OFF) { - _global.channel[c].voices[v].op[k].amp = - outLevel2Amp(_preset[c]->outLevel[k]) - * _global.channel[c].voices[v].op[k].ampVeloNote - * brightness2Amp(c, k); - } - } -} -void DeicsOnze::setOutLevel(int c) { - for(int k=0; keg[k].ar==0?0: - (double)(RESOLUTION/4)/(envAR2s(_preset[c]->eg[k].ar) - *_global.deiSampleRate)) - *coefAttack(_global.channel[c].attack); -} -void DeicsOnze::setEnvAttack(int c, int k) { - for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvAttack(c, v, k); -} -void DeicsOnze::setEnvAttack(int c) { - for(int k=0; keg[k].rr, _global.deiSampleRate, - _global.channel[c].release); -} -void DeicsOnze::setEnvRelease(int c, int k) { - for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvRelease(c, v, k); -} -void DeicsOnze::setEnvRelease(int c) { - for(int k=0; kpitchEg)) { - if(_global.channel[c].voices[v].pitchEnvCoefInct - > _global.channel[c].voices[v].pitchEnvCoefInctPhase1) { - _global.channel[c].voices[v].pitchEnvCoefInctInct = - getPitchEnvCoefInctInct(1, 0, _preset[c]->pitchEg.pr3, - _global.deiSampleRate); - _global.channel[c].voices[v].pitchEnvState = RELEASE_PE; - } - else if(_global.channel[c].voices[v].pitchEnvCoefInct - < _global.channel[c].voices[v].pitchEnvCoefInctPhase1) { - _global.channel[c].voices[v].pitchEnvCoefInctInct = - getPitchEnvCoefInctInct(0, 1, _preset[c]->pitchEg.pr3, - _global.deiSampleRate); - _global.channel[c].voices[v].pitchEnvState = RELEASE_PE; - } - else { - _global.channel[c].voices[v].pitchEnvCoefInctInct = 1.0; - _global.channel[c].voices[v].pitchEnvState = OFF_PE; - } - } -} - -//----------------------------------------------------------------- -// setQuality -//----------------------------------------------------------------- -void DeicsOnze::setQuality(Quality q) { - _global.quality = q; - switch(q) { - case high : - _global.qualityCounterTop = 1; - break; - case middle : - _global.qualityCounterTop = 2; - break; - case low : - _global.qualityCounterTop = 4; - break; - case ultralow : - _global.qualityCounterTop = 6; - break; - default : printf("Error switch setQuality : out of value\n"); - break; - } - //calculate _global.deiSampleRate - _global.deiSampleRate = (double)sampleRate() - / (double)_global.qualityCounterTop; - _global.qualityCounter = 0; - //update lfo to consider the new samplerate - for(int c = 0; c < 16; c++) if(_global.channel[c].isEnable) setLfo(c); - //update the cutoffs of the filters - _dryFilter->setCutoff(_global.deiSampleRate/4.0); - _reverbFilter->setCutoff(_global.deiSampleRate/4.0); - _chorusFilter->setCutoff(_global.deiSampleRate/4.0); - _delayFilter->setCutoff(_global.deiSampleRate/4.0); -} - -//----------------------------------------------------------------- -// setFilter -//----------------------------------------------------------------- -void DeicsOnze::setFilter(bool f) { - _global.filter = f; -} -//----------------------------------------------------------------- -// brightness2Amp -//----------------------------------------------------------------- -double DeicsOnze::brightness2Amp(int c, int k) { - if( - (k==1 && (_preset[c]->algorithm!=SIXTH || _preset[c]->algorithm!=SEVENTH - || _preset[c]->algorithm!=EIGHTH)) - || - (k==2 && (_preset[c]->algorithm==FIRST || _preset[c]->algorithm==SECOND - || _preset[c]->algorithm==THIRD || _preset[c]->algorithm==FOURTH)) - || - (k==3 && (_preset[c]->algorithm!=EIGHTH)) - ) { - double x = 2.0*(double)_global.channel[c].brightness - / (double)MAXFINEBRIGHTNESS; - double square_x = x*x; - return(square_x*x); - } - else return(1.0); -} -//----------------------------------------------------------------- -// setFeedback -//----------------------------------------------------------------- -void DeicsOnze::setFeedback(int c) { - _global.channel[c].feedbackAmp = - COEFFEEDBACK*exp(log(2)*(double)(_preset[c]->feedback-MAXFEEDBACK)); -} - -//----------------------------------------------------------------- -// setPreset -//----------------------------------------------------------------- - -void DeicsOnze::setPreset(int c) { - setFeedback(c); - setLfo(c); - setEnvAttack(c); - setEnvRelease(c); - setOutLevel(c); -} - - -inline double coarseFine2Ratio(int c,int f) { - double tab[64][16]= - { - {0.50,0.56,0.62,0.68,0.75,0.81,0.87,0.93,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, - {0.71,0.79,0.88,0.96,1.05,1.14,1.23,1.32,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, - {0.78,0.88,0.98,1.07,1.17,1.27,1.37,1.47,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, - {0.87,0.97,1.08,1.18,1.29,1.40,1.51,1.62,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, - {1.00,1.06,1.12,1.18,1.25,1.31,1.37,1.43,1.50,1.56,1.62,1.68,1.75,1.81,1.87,1.93}, - {1.41,1.49,1.58,1.67,1.76,1.85,1.93,2.02,2.11,2.20,2.29,2.37,2.46,2.55,2.64,2.73}, - {1.57,1.66,1.76,1.86,1.96,2.06,2.15,2.25,2.35,2.45,2.55,2.64,2.74,2.84,2.94,3.04}, - {1.73,1.83,1.94,2.05,2.16,2.27,2.37,2.48,2.59,2.70,2.81,2.91,3.02,3.13,3.24,3.35}, - {2.00,2.06,2.12,2.18,2.25,2.31,2.37,2.43,2.50,2.56,2.62,2.68,2.75,2.81,2.87,2.93}, - {2.82,2.90,2.99,3.08,3.17,3.26,3.34,3.43,3.52,3.61,3.70,3.78,3.87,3.96,4.05,3.14}, - {3.00,3.06,3.12,3.18,3.25,3.31,3.37,3.43,3.50,3.56,3.62,3.68,3.75,3.81,3.87,3.93} , - {3.14,3.23,3.33,3.43,3.53,3.63,3.72,3.82,3.92,4.02,4.12,4.21,4.31,4.41,4.51,4.61}, - {3.46,3.56,3.67,3.78,3.89,4.00,4.10,4.21,4.32,4.43,4.54,4.64,4.75,4.86,4.97,5.08}, - {4.00,4.06,4.12,4.18,4.25,4.31,4.37,4.43,4.50,4.56,4.62,4.68,4.75,4.81,4.87,4.93}, - {4.24,4.31,4.40,4.49,4.58,4.67,4.75,4.84,4.93,5.02,5.11,5.19,5.28,5.37,5.46,5.55}, - {4.71,4.80,4.90,5.00,5.10,5.20,5.29,5.39,5.49,5.59,5.69,5.78,5.88,5.98,6.08,6.18}, - {5.00,5.06,5.12,5.18,5.25,5.31,5.37,5.43,5.50,5.56,5.62,5.68,5.75,5.81,5.87,5.93}, - {5.19,5.29,5.40,5.51,5.62,5.73,5.83,5.94,6.05,6.16,6.27,6.37,6.48,6.59,6.70,6.81}, - {5.65,5.72,5.81,5.90,5.99,6.08,6.16,6.25,6.34,6.43,6.52,6.60,6.69,6.78,6.87,6.96}, - {6.00,6.06,6.12,6.18,6.25,6.31,6.37,6.43,6.50,6.56,6.62,6.68,6.75,6.81,6.87,6.93}, - {6.28,6.37,6.47,6.57,6.67,6.77,6.86,6.96,7.06,7.16,7.26,7.35,7.45,7.55,7.65,7.75}, - {6.92,7.02,7.13,7.24,7.35,7.46,7.56,7.67,7.78,7.89,8.00,8.10,8.21,8.32,8.43,8.54}, - {7.00,7.06,7.12,7.18,7.25,7.31,7.37,7.43,7.50,7.56,7.62,7.68,7.75,7.81,7.87,7.93}, - {7.07,7.13,7.22,7.31,7.40,7.49,7.57,7.66,7.75,7.84,7.93,8.01,8.10,8.19,8.28,8.37}, - {7.85,7.94,8.04,8.14,8.24,8.34,8.43,8.53,8.63,8.73,8.83,8.92,9.02,9.12,9.22,9.32}, - {8.00,8.06,8.12,8.18,8.25,8.31,8.37,8.43,8.50,8.56,8.62,8.68,8.75,8.81,8.87,8.93}, - {8.48,8.54,8.63,8.72,8.81,8.90,8.98,9.07,9.16,9.25,9.34,9.42,9.51,9.60,9.69,9.78}, - {8.65,8.75,8.86,8.97,9.08,9.19,9.29,9.40,9.51,9.62,9.73,9.83,9.94,10.05,10.16,10.27}, - {9.00,9.06,9.12,9.18,9.25,9.31,9.37,9.43,9.50,9.56,9.62,9.68,9.75,9.81,9.87,9.93}, - {9.42,9.51,9.61,9.71,9.81,9.91,10.00,10.10,10.20,10.30,10.40,10.49,10.59,10.69,10.79,10.89}, - {9.89,9.95,10.04,10.13,10.22,10.31,10.39,10.48,10.57,10.66,10.75,10.83,10.92,11.01,11.10,11.19}, - {10.00,10.06,10.12,10.18,10.25,10.31,10.37,10.43,10.50,10.56,10.62,10.68,10.75,10.81,10.87,10.93}, - {10.38,10.48,10.59,10.70,10.81,10.92,11.02,11.13,11.24,11.35,11.46,11.56,11.67,11.78,11.89,12.00}, - {10.99,11.08,11.18,11.28,11.38,11.48,11.57,11.67,11.77,11.87,11.97,12.06,12.16,12.26,12.36,12.46}, - {11.00,11.06,11.12,11.18,11.25,11.31,11.37,11.43,11.50,11.56,11.62,11.68,11.75,11.81,11.87,11.93}, - {11.30,11.36,11.45,11.54,11.63,11.72,11.80,11.89,11.98,12.07,12.16,12.24,12.33,12.42,12.51,12.60}, - {12.00,12.06,12.12,12.18,12.25,12.31,12.37,12.43,12.50,12.56,12.62,12.68,12.75,12.81,12.87,12.93}, - {12.11,12.21,12.32,12.43,12.54,12.65,12.75,12.86,12.97,13.08,13.19,13.29,13.40,13.51,13.62,13.73}, - {12.56,12.65,12.75,12.85,12.95,13.05,13.14,13.24,13.34,13.44,13.54,13.63,13.73,13.83,13.93,14.03}, - {12.72,12.77,12.86,12.95,13.04,13.13,13.21,13.30,13.39,13.48,13.57,13.65,13.74,13.83,13.92,14.01}, - {13.00,13.06,13.12,13.18,13.25,13.31,13.37,13.43,13.50,13.56,13.62,13.68,13.75,13.81,13.87,13.93}, - {13.84,13.94,14.05,14.16,14.27,14.38,14.48,14.59,14.70,14.81,14.92,15.02,15.13,15.24,15.35,15.46}, - {14.00,14.06,14.12,14.18,14.25,14.31,14.37,14.43,14.50,14.56,14.62,14.68,14.75,14.81,14.87,14.93}, - {14.10,14.18,14.27,14.36,14.45,14.54,14.62,14.71,14.80,14.89,14.98,15.06,15.15,15.24,15.33,15.42}, - {14.13,14.22,14.32,14.42,14.52,14.62,14.71,14.81,14.91,15.01,15.11,15.20,15.30,15.40,15.50,15.60}, - {15.00,15.06,15.12,15.18,15.25,15.31,15.37,15.43,15.50,15.56,15.62,15.68,15.75,15.81,15.87,15.93}, - {15.55,15.59,15.68,15.77,15.86,15.95,16.03,16.12,16.21,16.30,16.39,16.47,16.56,16.65,16.74,16.83}, - {15.57,15.67,15.78,15.89,16.00,16.11,16.21,16.32,16.43,16.54,16.65,16.75,16.86,16.97,17.08,17.19}, - {15.70,15.79,15.89,15.99,16.09,16.19,16.28,16.38,16.48,16.58,16.68,16.77,16.87,16.97,17.07,17.17}, - {16.96,17.00,17.09,17.18,17.27,17.36,17.44,17.53,17.62,17.71,17.80,17.88,17.97,18.06,18.15,18.24}, - {17.27,17.36,17.46,17.56,17.66,17.76,17.85,17.95,18.05,18.15,18.25,18.34,18.44,18.54,18.64,18.74}, - {17.30,17.40,17.51,17.62,17.73,17.84,17.94,18.05,18.16,18.27,18.38,18.48,18.59,18.70,18.81,18.92}, - {18.37,18.41,18.50,18.59,18.68,18.77,18.85,18.94,19.03,19.12,19.21,19.29,19.38,19.47,19.56,19.65}, - {18.84,18.93,19.03,19.13,19.23,19.33,19.42,19.52,19.62,19.72,19.82,19.91,20.01,20.11,20.21,20.31}, - {19.03,19.13,19.24,19.35,19.46,19.57,19.67,19.78,19.89,20.00,20.11,20.21,20.32,20.43,20.54,20.65}, - {19.78,19.82,19.91,20.00,20.09,20.18,20.26,20.35,20.44,20.53,20.62,20.70,20.79,20.88,20.97,21.06}, - {20.41,20.50,20.60,20.70,20.80,20.90,20.99,21.09,21.19,21.29,21.39,21.48,21.58,21.68,21.78,21.88}, - {20.76,20.86,20.97,21.08,21.19,21.30,21.40,21.51,21.62,21.73,21.84,21.94,22.05,22.16,22.27,22.38}, - {21.20,21.23,21.32,21.41,21.50,21.59,21.67,21.76,21.85,21.94,22.03,22.11,22.20,22.29,22.38,22.47}, - {21.98,22.07,22.17,22.17,22.37,22.47,22.56,22.66,22.76,22.86,22.96,23.05,23.15,23.25,23.35,23.45}, - {22.49,22.59,22.70,22.81,22.92,23.03,23.13,13.24,13.35,13.46,13.57,13.67,13.78,13.89,24.00,24.11}, - {23.55,23.64,23.74,23.84,23.94,24.04,24.13,24.23,24.33,24.43,24.53,24.62,24.72,24.82,24.92,25.02}, - {24.22,24.32,24.43,24.54,24.65,24.76,24.86,24.97,25.08,25.19,25.30,25.40,25.51,25.62,25.73,25.84}, - {25.95,26.05,26.16,26.27,26.38,26.49,26.59,26.70,26.81,26.92,27.03,27.13,27.24,27.35,27.46,27.57} - }; - return(tab[c][f]); -} - -//--------------------------------------------------------------- -// loadSet -//--------------------------------------------------------------- -void DeicsOnze::loadSet(QString fileName) { - // read the XML file and create DOM tree - if(!fileName.isEmpty()) { - QFile deicsonzeFile(fileName); - if(!deicsonzeFile.open(QIODevice::ReadOnly)) { - printf("Critical Error Cannot open file %s\n", - fileName.toAscii().data()); - return; - } - QDomDocument domTree; - if (!domTree.setContent(&deicsonzeFile )) { - printf("Critical Error Parsing error for file %s\n", - fileName.toAscii().data()); - deicsonzeFile.close(); - return; - } - deicsonzeFile.close(); - - QDomNode node = domTree.documentElement(); - while (!node.isNull()) { - QDomElement e = node.toElement(); - if (e.isNull()) - continue; - if (e.tagName() == "deicsOnzeSet") { - QString version = e.attribute(QString("version")); - if (version == "1.0") { - for(int c = 0; c_categoryVector.empty()) - delete(*_set->_categoryVector.begin()); - _set->readSet(node.firstChild()); - //display load preset - unsigned char dataUpdateGuiSet[1]; - dataUpdateGuiSet[0]=SYSEX_UPDATESETGUI; - MidiPlayEvent evSysexUpdateGuiSet(0, ME_SYSEX, - (const unsigned char*)dataUpdateGuiSet, - 1); - _gui->writeEvent(evSysexUpdateGuiSet); - } - else printf("unsupported *.dei file version %s\n", - version.toLatin1().data()); - } - else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); - node = node.nextSibling(); - } - } -} -//--------------------------------------------------------------- -// loadSutulaPreset -//--------------------------------------------------------------- - -void DeicsOnze::loadSutulaPresets() -{ - FILE* file; - int v; - int crs[NBROP], fin[NBROP]; //coarse ratio, fine ratio - char s[500]; - char sname[LENGTHNAME+1]; - char scategory[LENGTHCATEGORY+1]; - char ssubcategory[LENGTHSUBCATEGORY+1]; - int k; - int nhBank, nlBank, nPreset; - Preset* presetTemp; - Subcategory* subcategoryTemp = NULL; - Category* categoryTemp = NULL; - - if(!_set) _set=new Set("Sutula Bank"); - - nhBank=0; - nlBank=0; - nPreset=0; - - //QString presetPath(INSTPREFIX); - //presetPath += "/share/" PACKAGEVERSION "/presets/deicsonze/ARCH_ALIN"; - - QString presetPath("/home/a-lin/sources/svnMusEDev/lmuse/muse/synti/deicsonze/ARCH_ALIN"); - - file = fopen (presetPath.toLatin1().data(), "rt"); - if (file == NULL) { - printf("can't open "); - printf(presetPath.toLatin1().data()); - printf("\n"); - } - else - { - while(fgets(s, 500, file) && !strstr(s, "** Source:")) - { - if (strstr(s,"* CATEGORY")) - { - sscanf(s, "* CATEGORY %s", scategory); - categoryTemp=new Category(_set, scategory,0); - } - if (strstr(s,"* SUBCATEGORY")) - { - sscanf(s, "* SUBCATEGORY %s", ssubcategory); - subcategoryTemp=new Subcategory(categoryTemp,ssubcategory,0); - nlBank++; - } - } - while(!feof(file)) - { - - presetTemp=new Preset(subcategoryTemp); - // Fill the preset - //OP.4 to OP.1 - for(int kaka=(NBROP-1); kaka>=0; kaka--) - { - k=(kaka==2?1:(kaka==1?2:kaka)); - - fscanf(file, "%x", &v);//0 - presetTemp->eg[k].ar=v; - fscanf(file, "%x", &v);//1 - presetTemp->eg[k].d1r=v; - fscanf(file, "%x", &v);//2 - presetTemp->eg[k].d2r=v; - fscanf(file, "%x", &v);//3 - presetTemp->eg[k].rr=v; - fscanf(file, "%x", &v);//4 - presetTemp->eg[k].d1l=v; - fscanf(file, "%x", &v);//5 - presetTemp->scaling.level[k]=v; - fscanf(file, "%x", &v);//6 - presetTemp->sensitivity.keyVelocity[k]= - v & 0x7; - presetTemp->sensitivity.egBias[k]= - (v & 0x38)>>3; - presetTemp->sensitivity.ampOn[k]= - (v & 0x40)>>6; - fscanf(file, "%x", &v);//7 - presetTemp->outLevel[k]=v; - fscanf(file, "%x", &v);//8 - crs[k]=v; - fscanf(file, "%x", &v);//9 - presetTemp->detune[k]=(v & 0x7)-3; - presetTemp->scaling.rate[k]=(v & 0x18)>>3; - } - fscanf(file, "%x", &v);//40 - presetTemp->algorithm= - ((v & 0x7)==0?FIRST: - ((v & 0x7)==1?SECOND: - ((v & 0x7)==2?THIRD: - ((v & 0x7)==3?FOURTH: - ((v & 0x7)==4?FIFTH: - ((v & 0x7)==5?SIXTH: - ((v & 0x7)==6?SEVENTH:EIGHTH))))))); - presetTemp->feedback=(v & 0x38)>>3; - presetTemp->lfo.sync=(v & 0x40)>>6; - fscanf(file, "%x", &v);//41 - presetTemp->lfo.speed=v; - fscanf(file, "%x", &v);//42 - presetTemp->lfo.delay=v; - fscanf(file, "%x", &v);//43 - presetTemp->lfo.pModDepth=v; - fscanf(file, "%x", &v);//44 - presetTemp->lfo.aModDepth=v; - fscanf(file, "%x", &v);//45 - presetTemp->lfo.wave= - ((v & 0x3)==0?SAWUP: - ((v & 0x3)==1?SQUARE: - ((v & 0x3)==2?TRIANGL:SHOLD))); - presetTemp->sensitivity.amplitude=(v & 0xc)>>2; - presetTemp->sensitivity.pitch=(v & 0x70)>>4; - fscanf(file, "%x", &v);//46 - presetTemp->function.transpose=v-24; - fscanf(file, "%x", &v);//47 - presetTemp->function.pBendRange=v; - fscanf(file, "%x", &v);//48 - presetTemp->function.portamento= - ((v & 0x1)==0?FULL:FINGER); - presetTemp->function.footSw= - ((v & 0x4)==0?SUS:POR); - presetTemp->function.mode= - ((v & 0x8)==0?POLY:MONO); - fscanf(file, "%x", &v);//49 - presetTemp->function.portamentoTime=v; - fscanf(file, "%x", &v);//50 - presetTemp->function.fcVolume=v; - fscanf(file, "%x", &v);//51 - presetTemp->function.mwPitch=v; - fscanf(file, "%x", &v);//52 - presetTemp->function.mwAmplitude=v; - fscanf(file, "%x", &v);//53 - presetTemp->function.bcPitch=v; - fscanf(file, "%x", &v);//54 - presetTemp->function.bcAmplitude=v; - fscanf(file, "%x", &v);//55 - presetTemp->function.bcPitchBias=v; - fscanf(file, "%x", &v);//56 - presetTemp->function.bcEgBias=v; - for(int l=0; l<10; l++) - { - fscanf(file, "%x", &v);//57 to 66 - sname[l]=(char)v; - } - sname[10]='\0'; - presetTemp->name=sname; - fscanf(file, "%x", &v);//67 - presetTemp->pitchEg.pr1=v; - fscanf(file, "%x", &v);//68 - presetTemp->pitchEg.pr2=v; - fscanf(file, "%x", &v);//69 - presetTemp->pitchEg.pr3=v; - fscanf(file, "%x", &v);//70 - presetTemp->pitchEg.pl1=v; - fscanf(file, "%x", &v);//71 - presetTemp->pitchEg.pl1=v; - fscanf(file, "%x", &v);//72 - presetTemp->pitchEg.pl1=v; - for(int kaka=(NBROP-1); kaka>=0; kaka--) - { - k=(kaka==2?1:(kaka==1?2:kaka)); - - fscanf(file, "%x", &v);//73, 75, 77, 79 - presetTemp->frequency[k].isFix=(v & 0x8)>>3; - presetTemp->frequency[k].freq=((v & 0x7)==0?8:(v & 0x7)*16); - presetTemp->eg[k].egShift= - (((v & 0x30)>>4)==0?VOF: - (((v & 0x30)>>4)==1?V48: - (((v & 0x30)>>4)==2?V24:V12))); - fscanf(file, "%x", &v);//74, 76, 78, 80 - fin[k]=v & 0xF; - presetTemp->frequency[k].freq+=fin[k]; - presetTemp->frequency[k].ratio= - coarseFine2Ratio(crs[k],fin[k]); - presetTemp->oscWave[k]= - (((v & 0x70)>>4)==0?W1: - (((v & 0x70)>>4)==1?W2: - (((v & 0x70)>>4)==2?W3: - (((v & 0x70)>>4)==3?W4: - (((v & 0x70)>>4)==4?W5: - (((v & 0x70)>>4)==5?W6: - (((v & 0x70)>>4)==6?W7:W8))))))); - } - fscanf(file, "%x", &v);//81 - presetTemp->function.reverbRate=v; - fscanf(file, "%x", &v);//82 - presetTemp->function.fcPitch=v; - fscanf(file, "%x", &v);//83 - presetTemp->function.fcAmplitude=v; - //presetTemp->globalDetune=0; - presetTemp->prog=nPreset; - // End of filling the preset - - nPreset++; - while(fgets(s, 500, file) && !strstr(s, "** Source:")) - { - if (strstr(s,"* CATEGORY")) - { - sscanf(s, "* CATEGORY %s", scategory); - nhBank++; - categoryTemp=new Category(_set,scategory,nhBank); - nlBank=0; - } - if (strstr(s,"* SUBCATEGORY")) - { - sscanf(s, "* SUBCATEGORY %s", ssubcategory); - subcategoryTemp=new - Subcategory(categoryTemp,ssubcategory,nlBank); - nlBank++; - nPreset=0; - } - } - } - } - fclose(file); -} - -//--------------------------------------------------------- -// minVolu2Voice -// return the number of the voice which is the least aloud -// and is not is the ATTACK state -//--------------------------------------------------------- -int DeicsOnze::minVolu2Voice(int c) { - int minVoice=0; - double min=MAXVOLUME; - for(int i=0; i<_global.channel[c].nbrVoices; i++) - { - min=((min>_global.channel[c].voices[i].volume - && _global.channel[c].voices[i].op[0].envState!=ATTACK - && _global.channel[c].voices[i].op[1].envState!=ATTACK - && _global.channel[c].voices[i].op[2].envState!=ATTACK - && _global.channel[c].voices[i].op[3].envState!=ATTACK)? - _global.channel[c].voices[i].volume:min); - minVoice=(min==_global.channel[c].voices[i].volume?i:minVoice); - } - return minVoice; -} - -//--------------------------------------------------------- -// noteOff2Voice -// return the number of one off voice, MAXNBRVOICES otherwise -//--------------------------------------------------------- -int DeicsOnze::noteOff2Voice(int c) { - int offVoice=MAXNBRVOICES; - for(int i=0; i<_global.channel[c].nbrVoices; i++) - offVoice = (_global.channel[c].voices[i].isOn - || _global.channel[c].voices[i].keyOn? - offVoice:i); - return offVoice; -} - -//--------------------------------------------------------- -// pitchOn2Voice -// return the number of the voice which has the input -// pitch and is keyOn -//--------------------------------------------------------- -int DeicsOnze::pitchOn2Voice(int c, int pitch) { - int pitchVoice=MAXNBRVOICES; - for(int i=0; i<_global.channel[c].nbrVoices; i++) { - if(_global.channel[c].voices[i].pitch== - pitch && _global.channel[c].voices[i].keyOn - && !_global.channel[c].voices[i].isSustained) { - pitchVoice = i; - return pitchVoice; - } - } - return pitchVoice; -} - -//--------------------------------------------------------- -// getAttractor -//--------------------------------------------------------- -inline double getAttractor(int portamentoTime, double sr) { - /* some explanations - - c(48000) = c > 1 - - f_sr(0) = 1000, f_sr(t) = 2000 - - f_sr*2(0) = 1000, f_sr*2(t*2) = 2000 - - f_sr(t) = exp(t*ln(c(sr))) * 1000 - - 2000 = exp(t*ln(c(48000))) * 1000 - - 2000 = exp(t*2*ln(c(48000*2))) * 1000 - - t*ln(c(48000)) = t*2*ln(c(48000*2)) - - c(48000*m) = exp(ln(c)/m) - - sr = 48000*m - */ - double c; - c = 1.0 + COEFPORTA/(double)(portamentoTime*portamentoTime); - return(exp(log(c)*48000.0/sr)); -} - -//--------------------------------------------------------- -// pitch2freq -//--------------------------------------------------------- -inline double pitch2freq(double p) { - return(LOWERNOTEFREQ*exp(p*log(2.0)/12.0)); -} - -//--------------------------------------------------------- -// lfoUpdate -// update the coefficent which multiplies the current inct -// in order to -// get the right current frequency with respect to the lfo -// update the coefficent which multiplies the amplitude. -//--------------------------------------------------------- -inline void lfoUpdate(Preset* p, Channel* p_c, float* wt) { - double delayCoef; - - //Manage LFO delay - if(!p_c->delayPassed) { - if(p_c->lfoIndex==0 || p_c->lfoIndex==p_c->lfoMaxIndex/2) { - if(p_c->lfoDelayIndex<(double)(RESOLUTION/4)) { - delayCoef=(double)wt[(int)p_c->lfoDelayIndex]; - p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch*delayCoef); - p_c->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_c->lfoPitch*delayCoef)/p_c->lfoMaxIndex)); - p_c->lfoDelayIndex+=p_c->lfoDelayInct; - p_c->lfoMaxDAmp=delayCoef*p_c->lfoMaxAmp; - } - else { - p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch); - p_c->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_c->lfoPitch)/p_c->lfoMaxIndex)); - p_c->delayPassed=true; - p_c->lfoMaxDAmp=p_c->lfoMaxAmp; - } - } - } - switch(p->lfo.wave) { - case SAWUP : - if(p_c->lfoIndex==0) { - p_c->lfoCoefInct=1.0/(p_c->lfoMaxCoefInct); - p_c->lfoCoefAmp=p_c->lfoMaxDAmp/(double)p_c->lfoMaxIndex; - p_c->lfoAmp=1.0; - } - else { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - break; - case SQUARE : - if(p_c->lfoIndex==0) { - p_c->lfoCoefInct=p_c->lfoMaxCoefInct; - p_c->lfoAmp=1.0; - } - if(p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { - p_c->lfoCoefInct=1.0/p_c->lfoMaxCoefInct; - p_c->lfoAmp=1.0-p_c->lfoMaxDAmp; - } - break; - case TRIANGL : - if(p_c->lfoIndex==0) { - p_c->lfoCoefInct=1.0; - p_c->lfoCoefAmp=p_c->lfoMaxDAmp - /(double)(p_c->lfoMaxIndex/2); - p_c->lfoAmp=1.0-p_c->lfoMaxDAmp/2.0; - } - else if(p_c->lfoIndex<(p_c->lfoMaxIndex/4)) { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - else if(p_c->lfoIndex<((3*p_c->lfoMaxIndex)/4)) { - p_c->lfoCoefInct/=p_c->lfoCoefInctInct; - p_c->lfoAmp+=p_c->lfoCoefAmp; - } - else if(p_c->lfoIndexlfoMaxIndex) { - p_c->lfoCoefInct*=p_c->lfoCoefInctInct; - p_c->lfoAmp-=p_c->lfoCoefAmp; - } - break; - case SHOLD : - if(p_c->lfoIndex==0||p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { - double r;//uniform random between -1.0 and 1.0 - r = (double)(2*rand()-RAND_MAX)/(double)RAND_MAX; - p_c->lfoCoefInct=(r>=0.0?1.0+r*(p_c->lfoMaxCoefInct-1.0) - :1.0/(1.0-r*(p_c->lfoMaxCoefInct-1.0))); - p_c->lfoAmp=1.0-(r/2.0+0.5)*p_c->lfoMaxDAmp; - } - break; - default : printf("Error : lfo wave does not exist\n"); - break; - } - p_c->lfoIndex=(p_c->lfoIndexlfoMaxIndex?p_c->lfoIndex+1:0); -} - -//--------------------------------------------------------- -// portamento update -//--------------------------------------------------------- -inline void portamentoUpdate(Channel* p_c, Voice* p_v) { - double inctTemp; - bool allTargetReached; - if(p_v->hasAttractor) { - allTargetReached = true; - for(int k = 0; kop[k].inct < p_v->op[k].targetInct) { - inctTemp = p_v->op[k].inct * p_v->attractor; - if(inctTemp < p_v->op[k].targetInct) { - allTargetReached = false; - p_v->op[k].inct = inctTemp; - } - else p_v->op[k].inct = p_v->op[k].targetInct; - } - else if(p_v->op[k].inct > p_v->op[k].targetInct) { - inctTemp = p_v->op[k].inct / p_v->attractor; - if(inctTemp > p_v->op[k].targetInct) { - allTargetReached = false; - p_v->op[k].inct = inctTemp; - } - else p_v->op[k].inct = p_v->op[k].targetInct; - } - p_c->lastInc[k] = p_v->op[k].inct; - } - if(allTargetReached) p_v->hasAttractor = false; - } -} - - -//--------------------------------------------------------- -// pitchEnvelopeUpdate -//--------------------------------------------------------- -inline void pitchEnvelopeUpdate(Voice* v, PitchEg* pe, double sr) { - if(v->pitchEnvState != OFF_PE) { - switch(v->pitchEnvState) { - case PHASE1 : - if( //change to phase2 - (v->pitchEnvCoefInctInct == 1.0) - || (v->pitchEnvCoefInctInct > 1.0 && - v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase2) - || (v->pitchEnvCoefInctInct < 1.0 && - v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase2) - ) { - v->pitchEnvState = PHASE2; - v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl2); - v->pitchEnvCoefInctInct = - getPitchEnvCoefInctInct(pe->pl2, pe->pl3, pe->pr2, sr); - } - else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; - break; - case PHASE2 : - if( //change to off (temporarely) - (v->pitchEnvCoefInctInct == 1.0) - || (v->pitchEnvCoefInctInct > 1.0 && - v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase3) - || (v->pitchEnvCoefInctInct < 1.0 && - v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase3) - ) { - v->pitchEnvState = OFF_PE; - v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl3); - v->pitchEnvCoefInctInct = 1.0; - } - else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; - break; - case RELEASE_PE : - if( //change to release2 - (v->pitchEnvCoefInctInct == 1.0) - || (v->pitchEnvCoefInctInct > 1.0 && - v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase1) - || (v->pitchEnvCoefInctInct < 1.0 && - v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase1) - ) { - v->pitchEnvState = OFF_PE; - v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl1); - v->pitchEnvCoefInctInct = 1.0; - } - else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; - break; - case OFF_PE : - //do nothing, should not appear anyway - break; - default : - printf("Error switch pitchEnvelopeUpdate, no such case\n"); - break; - } - } -} - -//--------------------------------------------------------- -// outLevel2Amp, Amp for amplitude //between 0.0 and 2.0 or more -// 100->2.0, 90->1.0, 80->0.5 ... -//--------------------------------------------------------- -inline double outLevel2Amp(int ol) { - double a; - double b; - a = log(2)/10.0; - b = -a*DB0LEVEL; - return exp(a*(double)ol+b); -} - -//--------------------------------------------------------- -// lowlevel2amp, -// 127->0dB->1.0, 0->-25dB->0 -//--------------------------------------------------------- -inline double lowlevel2amp(int l) { - double a, b, c, db; - if(l==0) return 0.0; - else { - a = DB_MIN/127.0; - b = -DB_MIN; - db = a*l+b; - c = -log(2)/3; - return exp(-c*db); - } -} - -//--------------------------------------------------------- -// level2amp, -// 255->0dB->1.0, 0->-25dB->0 -//--------------------------------------------------------- -inline double level2amp(int l) { - double a, b, c, db; - if(l==0) return 0.0; - else { - a = DB_MIN/255.0; - b = -DB_MIN; - db = a*l+b; - c = -log(2.0)/3.0; - return exp(-c*db); - } -} - -//--------------------------------------------------------- -// amp2level -// 1.0->0dB->255, 0->-25dB->0 -//--------------------------------------------------------- -inline int amp2level(double amp){ - double a, b, c; - a = 255.0/DB_MIN; - b = 255.0; - c = log(2.0)/3.0; - return (int)(a*(log(amp)/c)+b); -} - -//--------------------------------------------------------- -// amp2lowlevel -// 1.0->0dB->127, 0->-25dB->0 -//--------------------------------------------------------- -inline int amp2lowlevel(double amp){ - double a, b, c; - a = 127.0/DB_MIN; - b = 127.0; - c = log(2.0)/3.0; - return (int)(a*(log(amp)/c)+b); -} - -//--------------------------------------------------------- -// velo2RAmp, AmpR between 0.0 and 1.0 -// return an amplitude ratio with respect to _preset->sensitivity.keyVelocity -//--------------------------------------------------------- -inline double velo2AmpR(int velo, int kvs) { - double lev; - lev = exp(-log(2)*kvs); - return (lev+(1.0-lev)*((double)velo/(double)MAXVELO)); -} - -//--------------------------------------------------------- -// envAR2s -// return the time in second of the ATTACK duration -//--------------------------------------------------------- -inline double envAR2s(int ar) { - //determined using the fitting feature of gnuplot - return 10.4423*exp(-0.353767*ar); -} - -//--------------------------------------------------------- -// envD1R2coef -// return the coefficient for the exponential decrease -// with respect to d1r and sampleRate, sr -//--------------------------------------------------------- -inline double envD1R2coef(int d1r, double sr) { - double dt;//such that amp(t+dt)=amp(t)/2 - double alpha;//such that amp(t)=exp(alpha*t) - - if(d1r==0) return 1.0; - else - { - //dt has been determined with the fitting function of gnuplot - dt=9.80715*exp(-0.356053*(double)d1r); - - //amp(0)=1 - //amp(t+dt)=amp(t)/2 - //amp(t)=exp(alpha*t) - //amp(t+mt) - //following the above equational system we found : - alpha=-log(2)/dt; - return exp(alpha/sr); - } -} - -//--------------------------------------------------------- -// coefRelease -// convert the release value to a coef for coefVLevel -//--------------------------------------------------------- -inline double coefRelease(unsigned char release) { - double x = COEFGRELEASE*(double)release/(double)MIDRELEASE+1.0-COEFGRELEASE; - double square_x = x*x; - return(1.0/(square_x*x)); -} - -//--------------------------------------------------------- -// envRR2coef -// return the coefficient for the exponential decrease -// with respect to rr and sampleRate, sr -//--------------------------------------------------------- -inline double envRR2coef(int rr, double sr, unsigned char release) { - double dt;//such that amp(t+dt)=amp(t)/2 - double alpha;//such that amp(t)=exp(alpha*t) - - //dt has been determined with the fitting function of gnuplot - dt=7.06636*exp(-0.697606*(double)rr); - - dt*=coefRelease(release); - //printf("demi life = %e\n", dt); - //amp(0)=1 - //amp(t+dt)=amp(t)/2 - //amp(t)=exp(alpha*t) - //amp(t+mt) - //following the above equational system we found : - alpha=-log(2)/dt; - return exp(alpha/sr); -} - -//--------------------------------------------------------- -// coefAttack -// convert the attack value to a coef for envInct -//--------------------------------------------------------- -inline double coefAttack(unsigned char attack) { - double x = COEFGATTACK*(double)attack/(double)MIDATTACK + 1.0-COEFGATTACK; - double square_x = x*x; - return(square_x*square_x*x); -} - -//--------------------------------------------------------- -// env2RAmp -// return the amplitude ratio with respect to an envelope and an -// envelope state, making evoluate the envelope -// sr is the sample rate and st the sine_table -//--------------------------------------------------------- -inline double env2AmpR(double sr, float* wt, Eg eg, OpVoice* p_opVoice) { - switch(p_opVoice->envState) { - case ATTACK: - p_opVoice->envIndex+=p_opVoice->envInct; - if (p_opVoice->envIndex<(RESOLUTION/4)) { - p_opVoice->envLevel=wt[(int)p_opVoice->envIndex]; - } - else { - p_opVoice->envState=DECAY; - p_opVoice->envLevel=1.0; - p_opVoice->coefVLevel=envD1R2coef(eg.d1r, sr); - } - return p_opVoice->envLevel; - break; - case DECAY: - if (p_opVoice->envLevel>((double)eg.d1l/(double)MAXD1L)+COEFERRDECSUS) { - p_opVoice->envLevel*=p_opVoice->coefVLevel; - } - else { - p_opVoice->envState=SUSTAIN; - p_opVoice->envLevel=((double)eg.d1l/(double)MAXD1L); - p_opVoice->coefVLevel=envD1R2coef(eg.d2r, sr);//probably the same - } - return p_opVoice->envLevel; - break; - case SUSTAIN: - if (p_opVoice->envLevel>COEFERRSUSREL) { - p_opVoice->envLevel*=p_opVoice->coefVLevel; - } - else { - p_opVoice->envState=OFF; - p_opVoice->envLevel=0.0; - } - return p_opVoice->envLevel; - break; - case RELEASE: - if (p_opVoice->envLevel > COEFERRSUSREL) { - p_opVoice->envLevel*=p_opVoice->coefVLevel; - } - else { - p_opVoice->envState=OFF; - p_opVoice->envLevel=0.0; - } - return p_opVoice->envLevel; - break; - case OFF: return 0.0; - break; - default: printf("Error case envelopeState"); - break; - } - return p_opVoice->envLevel; -} - -//--------------------------------------------------------- -// programSelect -//--------------------------------------------------------- - -void DeicsOnze::programSelect(int c, int hbank, int lbank, int prog) { - Preset* foundPreset; - foundPreset=findPreset(hbank, lbank, prog); - if (foundPreset) _preset[c]=foundPreset; - else { - _preset[c]=_initialPreset; - _preset[c]->prog=prog; - _preset[c]->_subcategory->_lbank=lbank; //TODO : real link - _preset[c]->_subcategory->_category->_hbank=hbank; - } - setPreset(c); -} - -//--------------------------------------------------------- -// setModulation -//--------------------------------------------------------- -void DeicsOnze::setModulation(int c, int val) { - _global.channel[c].modulation = (unsigned char) val; - setLfo(c); -} -//--------------------------------------------------------- -// setPitchBendCoef -//--------------------------------------------------------- -void DeicsOnze::setPitchBendCoef(int c, int val) { - _global.channel[c].pitchBendCoef = - exp(log(2)*((double)_preset[c]->function.pBendRange - /(double)MAXPBENDRANGE) - *((double)val/(double)MAXPITCHBENDVALUE)); -} - -//--------------------------------------------------------- -// setSustain -//--------------------------------------------------------- -void DeicsOnze::setSustain(int c, int val) { - _global.channel[c].sustain=(val>64); - if(!_global.channel[c].sustain) - for(int i=0; i<_global.channel[c].nbrVoices; i++) - if(_global.channel[c].voices[i].isSustained) { - for(int j=0; jwriteEvent(evNbrVoices); - }*/ - //channelNum - /* - if(qdEl.tagName()==CHANNELNUMSTR) { - _global.channelNum = (qdEl.text()==ALLSTR?-1:qdEl.text().toInt()-1); - unsigned char *dataChannelNum = new unsigned char[2]; - dataChannelNum[0]=SYSEX_CHANNELNUM; - dataChannelNum[1]=(unsigned char)_global.channelNum; - MidiPlayEvent - evChannelNum(0, ME_SYSEX, (const unsigned char*)dataChannelNum, 2); - _gui->writeEvent(evChannelNum); - }*/ - //quality - if(qdEl.tagName()==QUALITYSTR) { - _global.quality = (qdEl.text()==HIGHSTR?high: - (qdEl.text()==MIDDLESTR?middle: - (qdEl.text()==LOWSTR?low:ultralow))); - setQuality(_global.quality); - unsigned char *dataQuality = new unsigned char[2]; - dataQuality[0]=SYSEX_QUALITY; - dataQuality[1]=(unsigned char)_global.quality; - MidiPlayEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); - _gui->writeEvent(evQuality); - } - //filter - if(qdEl.tagName()==FILTERSTR) { - setFilter(qdEl.text()==YESSTRDEI?true:false); - unsigned char *dataFilter = new unsigned char[2]; - dataFilter[0]=SYSEX_FILTER; - dataFilter[1]=(unsigned char)getFilter(); - MidiPlayEvent evFilter(0, ME_SYSEX, (const unsigned char*)dataFilter, 2); - _gui->writeEvent(evFilter); - } - //font size - if(qdEl.tagName()==FONTSIZESTR) { - _global.fontSize = qdEl.text().toInt(); - unsigned char *dataFontSize = new unsigned char[2]; - dataFontSize[0]=SYSEX_FONTSIZE; - dataFontSize[1]=(unsigned char)_global.fontSize; - MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); - _gui->writeEvent(evFontSize); - } - //saveConfig - if(qdEl.tagName()==SAVECONFIGSTR) { - _saveConfig = (qdEl.text()==YESSTRDEI?true:false); - unsigned char *dataSaveConfig = new unsigned char[2]; - dataSaveConfig[0]=SYSEX_SAVECONFIG; - dataSaveConfig[1]=(unsigned char)_saveConfig; - MidiPlayEvent - evSaveConfig(0, ME_SYSEX, (const unsigned char*)dataSaveConfig, 2); - _gui->writeEvent(evSaveConfig); - } - //saveOnlyUsed - if(qdEl.tagName()==SAVEONLYUSEDSTR) { - _saveOnlyUsed = (qdEl.text()==YESSTRDEI?true:false); - unsigned char *dataSaveOnlyUsed = new unsigned char[2]; - dataSaveOnlyUsed[0]=SYSEX_SAVEONLYUSED; - dataSaveOnlyUsed[1]=(unsigned char)_saveOnlyUsed; - MidiPlayEvent - evSaveOnlyUsed(0, ME_SYSEX, (const unsigned char*)dataSaveOnlyUsed, 2); - _gui->writeEvent(evSaveOnlyUsed); - } - //colors - if(qdEl.tagName()==TEXTCOLORSTR) textColor = readColor(qdn); - if(qdEl.tagName()==BACKGROUNDCOLORSTR) backgroundColor = readColor(qdn); - if(qdEl.tagName()==EDITTEXTCOLORSTR) editTextColor = readColor(qdn); - if(qdEl.tagName()==EDITBACKGROUNDCOLORSTR) - editBackgroundColor = readColor(qdn); - - //must insert load image, later - - //load init set - if(qdEl.tagName()==ISINITSETSTR) { - _isInitSet = (qdEl.text()==YESSTRDEI?true:false); - unsigned char *dataIsInitSet = new unsigned char[2]; - dataIsInitSet[0]=SYSEX_ISINITSET; - dataIsInitSet[1]=(unsigned char)_isInitSet; - MidiPlayEvent - evIsInitSet(0, ME_SYSEX, (const unsigned char*)dataIsInitSet, 2); - _gui->writeEvent(evIsInitSet); - } - if(qdEl.tagName()==INITSETPATHSTR) { - _initSetPath = qdEl.text(); - unsigned char *dataInitSetPath = - new unsigned char[1+MAXSTRLENGTHINITSETPATH]; - dataInitSetPath[0]=SYSEX_INITSETPATH; - strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().data(), - MAXSTRLENGTHINITSETPATH); - MidiPlayEvent - evInitSetPath(0, ME_SYSEX, (const unsigned char*)dataInitSetPath, - 1+MAXSTRLENGTHINITSETPATH); - _gui->writeEvent(evInitSetPath); - } - //load background pix - if(qdEl.tagName()==ISBACKGROUNDPIXSTR) { - _isBackgroundPix = (qdEl.text()==YESSTRDEI?true:false); - unsigned char *dataIsBackgroundPix = new unsigned char[2]; - dataIsBackgroundPix[0]=SYSEX_ISBACKGROUNDPIX; - dataIsBackgroundPix[1]=(unsigned char)_isBackgroundPix; - MidiPlayEvent - evIsBackgroundPix(0, ME_SYSEX, - (const unsigned char*)dataIsBackgroundPix, 2); - _gui->writeEvent(evIsBackgroundPix); - } - if(qdEl.tagName()==BACKGROUNDPIXPATHSTR) { - _backgroundPixPath = qdEl.text(); - unsigned char *dataBackgroundPixPath = - new unsigned char[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; - dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; - strncpy((char*)&dataBackgroundPixPath[1], - _backgroundPixPath.toLatin1().data(), - MAXSTRLENGTHBACKGROUNDPIXPATH); - MidiPlayEvent - evBackgroundPixPath(0, ME_SYSEX, - (const unsigned char*)dataBackgroundPixPath, - 1+MAXSTRLENGTHBACKGROUNDPIXPATH); - _gui->writeEvent(evBackgroundPixPath); - } - qdn = qdn.nextSibling(); - } - //send colors - unsigned char dataColorGui[COLORSYSEXLENGTH+1]; - dataColorGui[0]=SYSEX_COLORGUI; - dataColorGui[1]=(unsigned char)textColor.red(); - dataColorGui[2]=(unsigned char)textColor.green(); - dataColorGui[3]=(unsigned char)textColor.blue(); - dataColorGui[4]=(unsigned char)backgroundColor.red(); - dataColorGui[5]=(unsigned char)backgroundColor.green(); - dataColorGui[6]=(unsigned char)backgroundColor.blue(); - dataColorGui[7]=(unsigned char)editTextColor.red(); - dataColorGui[8]=(unsigned char)editTextColor.green(); - dataColorGui[9]=(unsigned char)editTextColor.blue(); - dataColorGui[10]=(unsigned char)editBackgroundColor.red(); - dataColorGui[11]=(unsigned char)editBackgroundColor.green(); - dataColorGui[12]=(unsigned char)editBackgroundColor.blue(); - MidiPlayEvent evSysexColor(0, ME_SYSEX, (const unsigned char*)dataColorGui, - COLORSYSEXLENGTH+1); - _gui->writeEvent(evSysexColor); -} - -//----------------------------------------------------------- -// loadConfiguration -//----------------------------------------------------------- -void DeicsOnze::loadConfiguration(QString fileName) { - // read the XML file and create DOM tree - if(!fileName.isEmpty()) { - QFile confFile(fileName); - if(!confFile.open(QIODevice::ReadOnly)) { - printf("Critical Error. Cannot open file %s\n", - fileName.toAscii().data()); - return; - } - QDomDocument domTree; - if (!domTree.setContent(&confFile )) { - printf("Critical Error. Parsing error for file %s\n", - fileName.toAscii().data()); - confFile.close(); - return; - } - - confFile.close(); - - QDomNode node = domTree.documentElement(); - while (!node.isNull()) { - QDomElement e = node.toElement(); - if (e.isNull()) - continue; - if (e.tagName() == DEICSONZECONFIGURATIONSTR) { - QString version = e.attribute(QString("version")); - if (version == "1.0") { - readConfiguration(node.firstChild()); - } - else printf("unsupported *.dco file version %s\n", - version.toLatin1().data()); - } - else printf("DeicsOnze: %s not supported\n", - e.tagName().toLatin1().data()); - node = node.nextSibling(); - } - } -} - -//--------------------------------------------------------- -// writeConfiguration -//--------------------------------------------------------- -void DeicsOnze::writeConfiguration(AL::Xml* xml) { - QString str; - xml->stag("deicsOnzeConfiguation version=\"1.0\""); - //xml->intTag(NBRVOICESSTR, (int)_global.nbrVoices); - //xml->strTag(CHANNELNUMSTR, (_global.channelNum==-1?ALLSTR: - // str.setNum(_global.channelNum+1))); - xml->tag(QUALITYSTR, QString((_global.quality==high?HIGHSTR: - (_global.quality==middle?MIDDLESTR: - (_global.quality==low?LOWSTR:ULTRALOWSTR))))); - xml->tag(FILTERSTR, QString(getFilter()==true?YESSTRDEI:NOSTRDEI)); - xml->tag(FONTSIZESTR, _global.fontSize); - xml->tag(SAVECONFIGSTR, QString((_saveConfig?YESSTRDEI:NOSTRDEI))); - xml->tag(SAVEONLYUSEDSTR, QString((_saveOnlyUsed?YESSTRDEI:NOSTRDEI))); - xml->tag(TEXTCOLORSTR, - reinterpret_cast(*_gui->tColor)); - xml->tag(BACKGROUNDCOLORSTR, - reinterpret_cast(*_gui->bColor)); - xml->tag(EDITTEXTCOLORSTR, - reinterpret_cast(*_gui->etColor)); - xml->tag(EDITBACKGROUNDCOLORSTR, - reinterpret_cast(*_gui->ebColor)); - xml->tag(ISINITSETSTR, QString((_isInitSet?YESSTRDEI:NOSTRDEI))); - xml->tag(INITSETPATHSTR, QString(_initSetPath)); - xml->tag(ISBACKGROUNDPIXSTR, QString((_isBackgroundPix?YESSTRDEI:NOSTRDEI))); - xml->tag(BACKGROUNDPIXPATHSTR, _backgroundPixPath); - - xml->etag(DEICSONZECONFIGURATIONSTR); -} - -//--------------------------------------------------------- -// getInitData -//--------------------------------------------------------- -void DeicsOnze::getInitData(int* length, const unsigned char** data) { - - //write the set in a temporary file and in a QByteArray - QTemporaryFile file; - file.open(); - AL::Xml* xml=new AL::Xml(&file); - xml->header(); - _set->writeSet(xml, _saveOnlyUsed); - file.reset(); //seek the start of the file - QByteArray ba = file.readAll(); - file.close(); - - //compress the QByteArray at default rate - QByteArray baComp = qCompress(ba); - - //save the set - *length = NUM_CONFIGLENGTH - + (_pluginIReverb?sizeof(float)*_pluginIReverb->plugin()->parameter():0) - + (_pluginIChorus?sizeof(float)*_pluginIChorus->plugin()->parameter():0) - + baComp.size(); - - unsigned char* buffer = new unsigned char[*length]; - //save init data - buffer[0]=SYSEX_INIT_DATA; - buffer[1]=SYSEX_INIT_DATA_VERSION; - //save global data - buffer[NUM_MASTERVOL] = (unsigned char) getMasterVol(); - for(int c = 0; c < NBRCHANNELS; c++) { - buffer[NUM_CHANNEL_ENABLE + c] = (unsigned char) getChannelEnable(c); - buffer[NUM_CHANNEL_VOL + c] = (unsigned char) getChannelVol(c); - buffer[NUM_CHANNEL_PAN + c] = (unsigned char) getChannelPan(c); - int b = getChannelBrightness(c); - buffer[NUM_CHANNEL_BRIGHTNESS + 2*c] = (unsigned char) (b%256); - buffer[NUM_CHANNEL_BRIGHTNESS + 2*c + 1] = (unsigned char) (b/256); - buffer[NUM_CHANNEL_MODULATION + c] = - (unsigned char) getChannelModulation(c); - buffer[NUM_CHANNEL_DETUNE + c] = - (unsigned char) getChannelDetune(c) + MAXCHANNELDETUNE; - buffer[NUM_CHANNEL_ATTACK + c] = (unsigned char) getChannelAttack(c); - 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; - buffer[NUM_CURRENTHBANK + c] = - (unsigned char) _preset[c]->_subcategory->_category->_hbank; - buffer[NUM_NBRVOICES + c] = (unsigned char) getNbrVoices(c); - } - buffer[NUM_SAVEONLYUSED]=(unsigned char) _saveOnlyUsed; - buffer[NUM_SAVECONFIG]=(unsigned char) _saveConfig; - //save config data - if(_saveConfig) { - buffer[NUM_QUALITY]=(unsigned char)_global.quality; - buffer[NUM_FILTER]=(unsigned char)getFilter(); - buffer[NUM_FONTSIZE]=(unsigned char)_global.fontSize; - buffer[NUM_RED_TEXT]=(unsigned char)_gui->tColor->Qt::red(); - buffer[NUM_GREEN_TEXT]=(unsigned char)_gui->tColor->Qt::green(); - buffer[NUM_BLUE_TEXT]=(unsigned char)_gui->tColor->Qt::blue(); - buffer[NUM_RED_BACKGROUND]=(unsigned char)_gui->bColor->Qt::red(); - buffer[NUM_GREEN_BACKGROUND]=(unsigned char)_gui->bColor->Qt::green(); - buffer[NUM_BLUE_BACKGROUND]=(unsigned char)_gui->bColor->Qt::blue(); - buffer[NUM_RED_EDITTEXT]=(unsigned char)_gui->etColor->Qt::red(); - buffer[NUM_GREEN_EDITTEXT]=(unsigned char)_gui->etColor->Qt::green(); - buffer[NUM_BLUE_EDITTEXT]=(unsigned char)_gui->etColor->Qt::blue(); - buffer[NUM_RED_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::red(); - buffer[NUM_GREEN_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::green(); - buffer[NUM_BLUE_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::blue(); - buffer[NUM_ISINITSET]=(unsigned char)_isInitSet; - strncpy((char*)&buffer[NUM_INITSETPATH], - _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); - buffer[NUM_ISBACKGROUNDPIX]=(unsigned char)_isBackgroundPix; - strncpy((char*)&buffer[NUM_BACKGROUNDPIXPATH], - _backgroundPixPath.toLatin1().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]= - (_pluginIReverb?(unsigned char)_pluginIReverb->plugin()->parameter() : 0); - strncpy((char*)&buffer[NUM_REVERB_LIB], - (_pluginIReverb? - _pluginIReverb->plugin()->lib().toLatin1().data() : "\0"), - MAXSTRLENGTHFXLIB); - strncpy((char*)&buffer[NUM_REVERB_LABEL], - (_pluginIReverb? - _pluginIReverb->plugin()->label().toLatin1().data() : "\0"), - MAXSTRLENGTHFXLABEL); - //chorus - buffer[NUM_IS_CHORUS_ON]=(unsigned char)_global.isChorusActivated; - buffer[NUM_CHORUS_RETURN]=(unsigned char)getChorusReturn(); - buffer[NUM_CHORUS_PARAM_NBR]= - (_pluginIChorus?(unsigned char)_pluginIChorus->plugin()->parameter() : 0); - strncpy((char*)&buffer[NUM_CHORUS_LIB], - (_pluginIChorus? - _pluginIChorus->plugin()->lib().toLatin1().data() : "\0"), - MAXSTRLENGTHFXLIB); - strncpy((char*)&buffer[NUM_CHORUS_LABEL], - (_pluginIChorus? - _pluginIChorus->plugin()->label().toLatin1().data() : "\0"), - 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 < (int)buffer[NUM_REVERB_PARAM_NBR]; i++) { - float val = (float)getReverbParam(i); - memcpy(&buffer[NUM_CONFIGLENGTH + sizeof(float)*i], &val, sizeof(float)); - } - //chorus - for(int i = 0; i < (int)buffer[NUM_CHORUS_PARAM_NBR]; i++) { - float val = (float)getChorusParam(i); - memcpy(&buffer[NUM_CONFIGLENGTH - + sizeof(float)*(int)buffer[NUM_REVERB_PARAM_NBR] - + sizeof(float)*i], &val, sizeof(float)); - } - //delay - float delayfloat; - delayfloat = getDelayBPM(); - memcpy(&buffer[NUM_DELAY_BPM], &delayfloat, 4); - delayfloat = getDelayBeatRatio(); - memcpy(&buffer[NUM_DELAY_BEATRATIO], &delayfloat, sizeof(float)); - delayfloat = getDelayFeedback(); - memcpy(&buffer[NUM_DELAY_FEEDBACK], &delayfloat, sizeof(float)); - delayfloat = getDelayLFOFreq(); - memcpy(&buffer[NUM_DELAY_LFO_FREQ], &delayfloat, sizeof(float)); - delayfloat = getDelayLFODepth(); - memcpy(&buffer[NUM_DELAY_LFO_DEPTH], &delayfloat, sizeof(float)); - - //save set data - int offset = - NUM_CONFIGLENGTH - + sizeof(float)*(int)buffer[NUM_REVERB_PARAM_NBR] - + sizeof(float)*(int)buffer[NUM_CHORUS_PARAM_NBR]; - for(int i = offset; i < *length; i++) - buffer[i]=(unsigned char)baComp.at(i - offset); - - *data=buffer; -} -//--------------------------------------------------------- -// parseInitData -//--------------------------------------------------------- -void DeicsOnze::parseInitData(int length, const unsigned char* data) { - if(data[1]==SYSEX_INIT_DATA_VERSION) { - //load global parameters - //master volume - setMasterVol(data[NUM_MASTERVOL]); - unsigned char *dataMasterVol = new unsigned char[2]; - dataMasterVol[0]=SYSEX_MASTERVOL; - dataMasterVol[1]=(unsigned char) getMasterVol(); - MidiPlayEvent - evMasterVol(0, ME_SYSEX, (const unsigned char*)dataMasterVol, 2); - _gui->writeEvent(evMasterVol); - //channel configuration - for(int c = 0; c < NBRCHANNELS; c++) { - //isEnable - setChannelEnable(c, data[NUM_CHANNEL_ENABLE + c]); - MidiPlayEvent - evChEnable(0, c, ME_CONTROLLER, - CTRL_CHANNELENABLE, data[NUM_CHANNEL_ENABLE + c]); - _gui->writeEvent(evChEnable); - //nbrVoices - setNbrVoices(c, data[NUM_NBRVOICES + c]); - MidiPlayEvent - evNbrVoices(0,c,ME_CONTROLLER,CTRL_NBRVOICES, data[NUM_NBRVOICES + c]); - _gui->writeEvent(evNbrVoices); - //channel volume - setChannelVol(c, data[NUM_CHANNEL_VOL + c]); - MidiPlayEvent - evChVol(0, c, ME_CONTROLLER, - CTRL_CHANNELVOLUME, data[NUM_CHANNEL_VOL + c]); - _gui->writeEvent(evChVol); - //channel pan - setChannelPan(c, data[NUM_CHANNEL_PAN + c]); - MidiPlayEvent - evChPan(0, c, ME_CONTROLLER, CTRL_CHANNELPAN, - data[NUM_CHANNEL_PAN + c]); - _gui->writeEvent(evChPan); - if(getChannelEnable(c)) applyChannelAmp(c); - //channel detune - setChannelDetune(c, data[NUM_CHANNEL_DETUNE + c]-MAXCHANNELDETUNE); - MidiPlayEvent - evChDetune(0, c, ME_CONTROLLER, CTRL_CHANNELDETUNE, - data[NUM_CHANNEL_DETUNE + c]-MAXCHANNELDETUNE); - _gui->writeEvent(evChDetune); - //channel brightness - setChannelBrightness(c, - data[NUM_CHANNEL_BRIGHTNESS + 2*c] - + data[NUM_CHANNEL_BRIGHTNESS + 2*c + 1] * 256); - MidiPlayEvent - evChBrightness(0, c, ME_CONTROLLER, - CTRL_FINEBRIGHTNESS, getChannelBrightness(c)); - _gui->writeEvent(evChBrightness); - //channel modulation - setChannelModulation(c, data[NUM_CHANNEL_MODULATION + c]); - MidiPlayEvent - evChMod(0, c, ME_CONTROLLER, - CTRL_MODULATION, data[NUM_CHANNEL_MODULATION + c]); - _gui->writeEvent(evChMod); - //channel attack - setChannelAttack(c, data[NUM_CHANNEL_ATTACK + c]); - MidiPlayEvent - evChAttack(0, c, ME_CONTROLLER, - CTRL_ATTACK_TIME, data[NUM_CHANNEL_ATTACK + c]); - _gui->writeEvent(evChAttack); - //channel release - setChannelRelease(c, data[NUM_CHANNEL_RELEASE + c]); - MidiPlayEvent - evChRelease(0, c, ME_CONTROLLER, - CTRL_RELEASE_TIME, data[NUM_CHANNEL_RELEASE + c]); - _gui->writeEvent(evChRelease); - //channel reverb - setChannelReverb(c, data[NUM_CHANNEL_REVERB + c]); - MidiPlayEvent - evChReverb(0, c, ME_CONTROLLER, - CTRL_REVERB_SEND, data[NUM_CHANNEL_REVERB + c]); - _gui->writeEvent(evChReverb); - //channel chorus - setChannelChorus(c, data[NUM_CHANNEL_CHORUS + c]); - MidiPlayEvent - 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]); - MidiPlayEvent - evChDelay(0, c, ME_CONTROLLER, - CTRL_VARIATION_SEND, data[NUM_CHANNEL_DELAY + c]); - _gui->writeEvent(evChDelay); - } - //load configuration - _saveConfig = (bool)data[NUM_SAVECONFIG]; - unsigned char *dataSaveConfig = new unsigned char[2]; - dataSaveConfig[0]=SYSEX_SAVECONFIG; - dataSaveConfig[1]=(unsigned char)_saveConfig; - MidiPlayEvent - evSaveConfig(0, ME_SYSEX, (const unsigned char*)dataSaveConfig, 2); - _gui->writeEvent(evSaveConfig); - if(_saveConfig) { - //saveOnlyUsed - _saveOnlyUsed = (bool)data[NUM_SAVEONLYUSED]; - unsigned char *dataSaveOnlyUsed = new unsigned char[2]; - dataSaveOnlyUsed[0]=SYSEX_SAVEONLYUSED; - dataSaveOnlyUsed[1]=(unsigned char)_saveOnlyUsed; - MidiPlayEvent - evSaveOnlyUsed(0, ME_SYSEX, (const unsigned char*)dataSaveOnlyUsed, 2); - _gui->writeEvent(evSaveOnlyUsed); - //colors - unsigned char dataColorGui[COLORSYSEXLENGTH+1]; - dataColorGui[0]=SYSEX_COLORGUI; - for (int i=0; iwriteEvent(evSysexColor); - //quality - unsigned char dataQuality[2]; - dataQuality[0]=SYSEX_QUALITY; - dataQuality[1]=data[NUM_QUALITY]; - setQuality((Quality)data[NUM_QUALITY]); - MidiPlayEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); - _gui->writeEvent(evQuality); - //filter - unsigned char dataFilter[2]; - dataFilter[0]=SYSEX_FILTER; - dataFilter[1]=data[NUM_FILTER]; - setFilter((bool)data[NUM_FILTER]); - MidiPlayEvent evFilter(0, ME_SYSEX, (const unsigned char*)dataFilter, 2); - _gui->writeEvent(evFilter); - //font size - unsigned char dataFontSize[2]; - dataFontSize[0]=SYSEX_FONTSIZE; - dataFontSize[1]=data[NUM_FONTSIZE]; - MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); - _gui->writeEvent(evFontSize); - //load init set - unsigned char dataIsInitSet[2]; - dataIsInitSet[0]=SYSEX_ISINITSET; - dataIsInitSet[1]=data[NUM_ISINITSET]; - MidiPlayEvent evIsInitSet(0, ME_SYSEX, - (const unsigned char*)dataIsInitSet, 2); - _gui->writeEvent(evIsInitSet); - unsigned char dataInitSetPath[1+MAXSTRLENGTHINITSETPATH]; - dataInitSetPath[0]=SYSEX_INITSETPATH; - for(int a = 0; a < MAXSTRLENGTHINITSETPATH; a++) - dataInitSetPath[a+1] = data[a+NUM_INITSETPATH]; - MidiPlayEvent evInitSetPath(0,ME_SYSEX,(const unsigned char*)dataInitSetPath, - 1+MAXSTRLENGTHINITSETPATH); - _gui->writeEvent(evInitSetPath); - //load background pix - unsigned char dataIsBackgroundPix[2]; - dataIsBackgroundPix[0]=SYSEX_ISBACKGROUNDPIX; - dataIsBackgroundPix[1]=data[NUM_ISBACKGROUNDPIX]; - MidiPlayEvent evIsBackgroundPix(0, ME_SYSEX, - (const unsigned char*)dataIsBackgroundPix, 2); - _gui->writeEvent(evIsBackgroundPix); - unsigned char dataBackgroundPixPath[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; - dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; - for(int a = 0; a < MAXSTRLENGTHBACKGROUNDPIXPATH; a++) - dataBackgroundPixPath[a+1] = data[a+NUM_BACKGROUNDPIXPATH]; - MidiPlayEvent evBackgroundPixPath(0,ME_SYSEX, - (const unsigned char*)dataBackgroundPixPath, - 1+MAXSTRLENGTHBACKGROUNDPIXPATH); - _gui->writeEvent(evBackgroundPixPath); - } - else _gui->saveConfigCheckBox->setChecked(false); - //load FX - //reverb - _global.isReverbActivated = (bool)data[NUM_IS_REVERB_ON]; - unsigned char *dataReverbAct = new unsigned char[2]; - dataReverbAct[0]=SYSEX_REVERBACTIV; - dataReverbAct[1]=(unsigned char)_global.isReverbActivated; - MidiPlayEvent evReverbAct(0,ME_SYSEX,(const unsigned char*)dataReverbAct, 2); - _gui->writeEvent(evReverbAct); - setReverbReturn((int)data[NUM_REVERB_RETURN]); - unsigned char *dataReverbRet = new unsigned char[2]; - dataReverbRet[0]=SYSEX_REVERBRETURN; - dataReverbRet[1]=(unsigned char)getReverbReturn(); - MidiPlayEvent evReverbRet(0,ME_SYSEX,(const unsigned char*)dataReverbRet, 2); - _gui->writeEvent(evReverbRet); - Plugin* p; - p = plugins.find((const char*)&data[NUM_REVERB_LIB], - (const char*)&data[NUM_REVERB_LABEL]); - if(p) { - initPluginReverb(p); - for(int i = 0; i < _pluginIReverb->plugin()->parameter(); i++) { - float val; - memcpy(&val, &data[NUM_CONFIGLENGTH + sizeof(float)*i], sizeof(float)); - setReverbParam(i, (double)val); - } - char dataBuildRev; - dataBuildRev = SYSEX_BUILDGUIREVERB; - MidiPlayEvent evSysexBuildRev(0,ME_SYSEX, - (const unsigned char*)&dataBuildRev, 1); - _gui->writeEvent(evSysexBuildRev); - } - else _pluginIReverb = NULL; - //chorus - _global.isChorusActivated = (bool)data[NUM_IS_CHORUS_ON]; - unsigned char *dataChorusAct = new unsigned char[2]; - dataChorusAct[0]=SYSEX_CHORUSACTIV; - dataChorusAct[1]=(unsigned char)_global.isChorusActivated; - MidiPlayEvent evChorusAct(0,ME_SYSEX,(const unsigned char*)dataChorusAct, 2); - _gui->writeEvent(evChorusAct); - setChorusReturn((int)data[NUM_CHORUS_RETURN]); - unsigned char *dataChorusRet = new unsigned char[2]; - dataChorusRet[0]=SYSEX_CHORUSRETURN; - dataChorusRet[1]=(unsigned char)getChorusReturn(); - MidiPlayEvent evChorusRet(0,ME_SYSEX,(const unsigned char*)dataChorusRet, 2); - _gui->writeEvent(evChorusRet); - p = plugins.find((const char*)&data[NUM_CHORUS_LIB], - (const char*)&data[NUM_CHORUS_LABEL]); - if(p) { - initPluginChorus(p); - for(int i = 0; i < _pluginIChorus->plugin()->parameter(); i++) { - float val; - memcpy(&val, &data[NUM_CONFIGLENGTH - + sizeof(float)*(int)data[NUM_REVERB_PARAM_NBR] - + sizeof(float)*i], - sizeof(float)); - setChorusParam(i, (double)val); - } - char dataBuildCho; - dataBuildCho = SYSEX_BUILDGUICHORUS; - MidiPlayEvent evSysexBuildCho(0,ME_SYSEX, - (const unsigned char*)&dataBuildCho, 1); - _gui->writeEvent(evSysexBuildCho); - } - else _pluginIChorus = NULL; - //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; - MidiPlayEvent 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(); - MidiPlayEvent evDelayRet(0,ME_SYSEX,(const unsigned char*)dataDelayRet, 2); - _gui->writeEvent(evDelayRet); - //initPluginDelay(plugins.find("pandelay", "pandelay")); - float delayfloat; - memcpy(&delayfloat, &data[NUM_DELAY_BPM], sizeof(float)); - setDelayBPM(delayfloat); - char dataDelayBPM[sizeof(float)+1]; - dataDelayBPM[0] = SYSEX_DELAYBPM; - memcpy(&dataDelayBPM[1], &delayfloat, sizeof(float)); - MidiPlayEvent evSysexDelayBPM(0,ME_SYSEX, - (const unsigned char*)dataDelayBPM, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayBPM); - memcpy(&delayfloat, &data[NUM_DELAY_BEATRATIO], sizeof(float)); - setDelayBeatRatio(delayfloat); - char dataDelayBeatRatio[sizeof(float)+1]; - dataDelayBeatRatio[0] = SYSEX_DELAYBEATRATIO; - memcpy(&dataDelayBeatRatio[1], &delayfloat, sizeof(float)); - MidiPlayEvent evSysexDelayBeatRatio(0,ME_SYSEX, - (const unsigned char*)dataDelayBeatRatio, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayBeatRatio); - memcpy(&delayfloat, &data[NUM_DELAY_FEEDBACK], sizeof(float)); - setDelayFeedback(delayfloat); - char dataDelayFeedback[sizeof(float)+1]; - dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; - memcpy(&dataDelayFeedback[1], &delayfloat, sizeof(float)); - MidiPlayEvent evSysexDelayFeedback(0,ME_SYSEX, - (const unsigned char*)dataDelayFeedback, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayFeedback); - memcpy(&delayfloat, &data[NUM_DELAY_LFO_FREQ], sizeof(float)); - setDelayLFOFreq(delayfloat); - char dataDelayLFOFreq[sizeof(float)+1]; - dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; - memcpy(&dataDelayLFOFreq[1], &delayfloat, sizeof(float)); - MidiPlayEvent evSysexDelayLFOFreq(0,ME_SYSEX, - (const unsigned char*)dataDelayLFOFreq, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayLFOFreq); - memcpy(&delayfloat, &data[NUM_DELAY_LFO_DEPTH], sizeof(float)); - setDelayLFODepth(delayfloat); - char dataDelayLFODepth[sizeof(float)+1]; - dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; - memcpy(&dataDelayLFODepth[1], &delayfloat, sizeof(float)); - MidiPlayEvent evSysexDelayLFODepth(0,ME_SYSEX, - (const unsigned char*)dataDelayLFODepth, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayLFODepth); - - //load the set compressed - int offset = - NUM_CONFIGLENGTH - + sizeof(float)*(int)data[NUM_REVERB_PARAM_NBR] - + sizeof(float)*(int)data[NUM_CHORUS_PARAM_NBR]; - QByteArray baComp = QByteArray((const char*)&data[offset], length-offset); - - //uncompress the set - QByteArray baUncomp = qUncompress(baComp); - - //save the set in a temporary file and - // read the XML file and create DOM tree - QTemporaryFile file; - file.open(); - file.write(baUncomp); - QDomDocument domTree; - file.reset(); //seek the start of the file - domTree.setContent(&file); - file.close(); - QDomNode node = domTree.documentElement(); - - while (!node.isNull()) { - QDomElement e = node.toElement(); - if (e.isNull()) - continue; - if (e.tagName() == "deicsOnzeSet") { - QString version = e.attribute(QString("version")); - if (version == "1.0") { - for(int c = 0; c < NBRCHANNELS; c++) _preset[c]=_initialPreset; - //read the set - if((bool)data[NUM_SAVEONLYUSED]) { - //printf("Mini\n"); - //updateSaveOnlyUsed(true); - } - else { - //printf("Huge\n"); - while(!_set->_categoryVector.empty()) - delete(*_set->_categoryVector.begin()); - //updateSaveOnlyUsed(false); - } - _set->readSet(node.firstChild()); - //display load preset - //setSet(); - } - else printf("Wrong set version : %s\n", - version.toLatin1().data()); - } - node = node.nextSibling(); - } - //send sysex to the gui to load the set (actually not because it doesn't - //work -the code is just zapped in the middle???-, so it is done above - //int dL=2+baUncomp.size(); - int dL = 2; - char dataSend[dL]; - dataSend[0]=SYSEX_LOADSET; - dataSend[1]=data[NUM_SAVEONLYUSED]; - //for(int i=2; iwriteEvent(evSysex); - - //select programs per channel - for(int c = 0; c < NBRCHANNELS; c++) { - int hbank=(int)data[NUM_CURRENTHBANK+c]; - int lbank=(int)data[NUM_CURRENTLBANK+c]; - int prog=(int)data[NUM_CURRENTPROG+c]; - programSelect(c, hbank, lbank, prog); - int val=prog+(lbank<<8)+(hbank<<16); - MidiPlayEvent evProgSel(0, c, ME_CONTROLLER, CTRL_PROGRAM, val); - _gui->writeEvent(evProgSel); - } - - } -} -//--------------------------------------------------------- -// sysex -//--------------------------------------------------------- -bool DeicsOnze::sysex(int length, const unsigned char* data) { - sysex(length, data, false); - return false; -} -bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { - int cmd=data[0]; - int index; - float f; - switch(cmd) { - case SYSEX_INIT_DATA: - parseInitData(length, data); - break; - case SYSEX_MASTERVOL: - setMasterVol((int)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - //case SYSEX_CHANNELNUM: - //_global.channelNum = (char)data[1]; - //if(!fromGui) { - // MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - // _gui->writeEvent(evSysex); - //} - //break; - case SYSEX_QUALITY: - setQuality((Quality)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_FILTER: - setFilter((bool)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_FONTSIZE: - _global.fontSize = (int)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_SAVECONFIG: - _saveConfig = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_SAVEONLYUSED: - _saveOnlyUsed = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_ISINITSET: - _isInitSet = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_INITSETPATH: - _initSetPath = (char*)&data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_ISBACKGROUNDPIX: - _isBackgroundPix = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_BACKGROUNDPIXPATH: - _backgroundPixPath = (char*)&data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_PANIC: - resetVoices(); - break; - case SYSEX_CHORUSACTIV: - _global.isChorusActivated = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_CHORUSPARAM: - index = (int)data[1]; - memcpy(&f, &data[2], sizeof(float)); - setChorusParam(index, (double)f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_REVERBACTIV: - _global.isReverbActivated = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_REVERBPARAM: - index = (int)data[1]; - memcpy(&f, &data[2], sizeof(float)); - setReverbParam(index, (double)f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYACTIV: - _global.isDelayActivated = (bool)data[1]; - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_CHORUSRETURN: - setChorusReturn((int)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_REVERBRETURN: - setReverbReturn((int)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYRETURN: - setDelayReturn((int)data[1]); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_SELECTREVERB: - Plugin* pluginReverb; - memcpy(&pluginReverb, &data[1], sizeof(Plugin*)); - initPluginReverb(pluginReverb); - break; - case SYSEX_SELECTCHORUS: - Plugin* pluginChorus; - memcpy(&pluginChorus, &data[1], sizeof(Plugin*)); - initPluginChorus(pluginChorus); - break; - case SYSEX_DELAYBPM: - memcpy(&f, &data[1], sizeof(float)); - setDelayBPM(f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYBEATRATIO: - memcpy(&f, &data[1], sizeof(float)); - setDelayBeatRatio(f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYFEEDBACK: - memcpy(&f, &data[1], sizeof(float)); - setDelayFeedback(f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYLFOFREQ: - memcpy(&f, &data[1], sizeof(float)); - setDelayLFOFreq(f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - case SYSEX_DELAYLFODEPTH: - memcpy(&f, &data[1], sizeof(float)); - setDelayLFODepth(f); - if(!fromGui) { - MidiPlayEvent evSysex(0, ME_SYSEX, data, length); - _gui->writeEvent(evSysex); - } - break; - default: - break; - } - return false; -} -//--------------------------------------------------------- -// setController -//--------------------------------------------------------- -bool DeicsOnze::setController(int channel, int id, int val) { - setController(channel, id, val, false); - return false; -} -bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { - int deiPan, k=0; - if(_global.channel[ch].isEnable || ctrl==CTRL_CHANNELENABLE) { - if(ctrl>=CTRL_AR && ctrlCTRL_PL3 && ctrlsetIsUsed(true); - _preset[ch]->eg[k].ar=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AR+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_D1R: - _preset[ch]->setIsUsed(true); - _preset[ch]->eg[k].d1r=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D1R+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_D2R: - _preset[ch]->setIsUsed(true); - _preset[ch]->eg[k].d2r=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D2R+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_RR: - _preset[ch]->setIsUsed(true); - _preset[ch]->eg[k].rr=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_RR+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_D1L: - _preset[ch]->setIsUsed(true); - _preset[ch]->eg[k].d1l=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D1L+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_LS: - _preset[ch]->setIsUsed(true); - _preset[ch]->scaling.level[k]=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_LS+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_RS: - _preset[ch]->setIsUsed(true); - _preset[ch]->scaling.rate[k]=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_RS+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_EBS: - _preset[ch]->setIsUsed(true); - _preset[ch]->sensitivity.egBias[k]=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_EBS+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_AME: - _preset[ch]->setIsUsed(true); - _preset[ch]->sensitivity.ampOn[k]=val==1; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AME+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_KVS: - _preset[ch]->setIsUsed(true); - _preset[ch]->sensitivity.keyVelocity[k]=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_KVS+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_OUT: - _preset[ch]->setIsUsed(true); - _preset[ch]->outLevel[k]=val; - setOutLevel(k); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_OUT+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_RATIO: - _preset[ch]->setIsUsed(true); - _preset[ch]->frequency[k].ratio=((double)val)/100.0; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER, - CTRL_RATIO+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_DET: - _preset[ch]->setIsUsed(true); - _preset[ch]->detune[k]=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_DET+k*DECAPAR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_ALG: - _preset[ch]->setIsUsed(true); - _preset[ch]->algorithm=(Algorithm)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ALG,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FEEDBACK: - _preset[ch]->setIsUsed(true); - _preset[ch]->feedback=val; - setFeedback(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FEEDBACK,val); - _gui->writeEvent(ev); - } - break; - case CTRL_SPEED: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.speed=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SPEED,val); - _gui->writeEvent(ev); - } - break; - case CTRL_DELAY: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.delay=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_DELAY,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PMODDEPTH: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.pModDepth=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODDEPTH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_AMODDEPTH: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.aModDepth=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AMODDEPTH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_SYNC: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.sync=val==1; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SYNC,val); - _gui->writeEvent(ev); - } - break; - case CTRL_WAVE: - _preset[ch]->setIsUsed(true); - _preset[ch]->lfo.wave=(Wave)val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_WAVE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PMODSENS: - _preset[ch]->setIsUsed(true); - _preset[ch]->sensitivity.pitch=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODSENS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_AMS: - _preset[ch]->setIsUsed(true); - _preset[ch]->sensitivity.amplitude=val; - setLfo(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AMS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_TRANSPOSE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.transpose=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_TRANSPOSE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_POLYMODE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.mode=(Mode)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_POLYMODE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PBENDRANGE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.pBendRange=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PBENDRANGE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PORTAMODE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.portamento=(Portamento)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTAMODE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PORTATIME: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.portamentoTime=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTATIME,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FCVOLUME: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.fcVolume=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCVOLUME,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FSW: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.footSw=(FootSw)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FSW,val); - _gui->writeEvent(ev); - } - break; - case CTRL_MWPITCH: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.mwPitch=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_MWPITCH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_MWAMPLITUDE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.mwAmplitude=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_MWAMPLITUDE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_BCPITCH: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.bcPitch=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_BCAMPLITUDE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.bcAmplitude=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCAMPLITUDE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_BCPITCHBIAS: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.bcPitchBias=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCHBIAS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_BCEGBIAS: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.bcEgBias=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCEGBIAS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_ATPITCH: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.atPitch=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_ATAMPLITUDE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.atAmplitude=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATAMPLITUDE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_ATPITCHBIAS: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.atPitchBias=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCHBIAS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_ATEGBIAS: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.atEgBias=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATEGBIAS,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PR1: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pr1=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PR2: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pr2=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PR3: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pr3=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR3,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PL1: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pl1=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL1,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PL2: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pl2=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_PL3: - _preset[ch]->setIsUsed(true); - _preset[ch]->pitchEg.pl3=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL3,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FIX: - _preset[ch]->setIsUsed(true); - _preset[ch]->frequency[k].isFix=val==1; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FIX+k*DECAPAR2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FIXRANGE: - _preset[ch]->setIsUsed(true); - _preset[ch]->frequency[k].freq=((double)val)/100.0; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER, - CTRL_FIXRANGE+k*DECAPAR2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_OSW: - _preset[ch]->setIsUsed(true); - _preset[ch]->oscWave[k]=(OscWave)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_OSW+k*DECAPAR2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_SHFT: - _preset[ch]->setIsUsed(true); - _preset[ch]->eg[k].egShift=(egShiftValue)val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SHFT+k*DECAPAR2,val); - _gui->writeEvent(ev); - } - break; - case CTRL_REVERBRATE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.reverbRate=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_REVERBRATE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FCPITCH: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.fcPitch=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCPITCH,val); - _gui->writeEvent(ev); - } - break; - case CTRL_FCAMPLITUDE: - _preset[ch]->setIsUsed(true); - _preset[ch]->function.fcAmplitude=val; - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCAMPLITUDE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_CHANNELENABLE: - setChannelEnable(ch, (bool)val); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELENABLE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_CHANNELDETUNE: - _preset[ch]->setIsUsed(true); - setChannelDetune(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELDETUNE,val); - _gui->writeEvent(ev); - } - break; - case CTRL_CHANNELVOLUME: - setChannelVol(ch, val); - applyChannelAmp(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELVOLUME,val); - _gui->writeEvent(ev); - } - break; - case CTRL_NBRVOICES: - setNbrVoices(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_NBRVOICES, val); - _gui->writeEvent(ev); - } - break; - case CTRL_PROGRAM: { - int hbank = (val & 0xff0000) >> 16; - int lbank = (val & 0xff00) >> 8; - int prog = val & 0x7f; - if (hbank > 127) // map "dont care" to 0 - hbank = 0; - if (lbank > 127) - lbank = 0; - programSelect(ch, hbank, lbank, prog); - _preset[ch]->setIsUsed(true);//TODO : not sure to put that - if(!fromGui) { - MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_PROGRAM, val); - _gui->writeEvent(ev); - } - } break; - case CTRL_MODULATION: - setModulation(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_MODULATION, val); - _gui->writeEvent(ev); - } - break; - case CTRL_PITCH: - setPitchBendCoef(ch, val); - break; - case CTRL_PANPOT: - _preset[ch]->setIsUsed(true); - deiPan = val*2*MAXCHANNELPAN/127-MAXCHANNELPAN; - setChannelPan(ch, deiPan); - applyChannelAmp(ch); - if(!fromGui) { - MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, deiPan); - _gui->writeEvent(ev); - } - break; - case CTRL_CHANNELPAN: - _preset[ch]->setIsUsed(true); - setChannelPan(ch, val); - applyChannelAmp(ch); - if(!fromGui) { - MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, val); - _gui->writeEvent(ev); - } - break; - case CTRL_FINEBRIGHTNESS: - _preset[ch]->setIsUsed(true); - setChannelBrightness(ch, val); - setOutLevel(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_FINEBRIGHTNESS, val); - _gui->writeEvent(ev); - } - break; - case CTRL_BRIGHTNESS: - _preset[ch]->setIsUsed(true); - setChannelBrightness(ch, val*(MIDFINEBRIGHTNESS/MIDBRIGHTNESS)); - setOutLevel(ch); - if(!fromGui) { - MidiPlayEvent - ev(0,ch,ME_CONTROLLER,CTRL_FINEBRIGHTNESS,getChannelBrightness(ch)); - _gui->writeEvent(ev); - } - break; - case CTRL_ATTACK_TIME: - _preset[ch]->setIsUsed(true); - setChannelAttack(ch, val); - setEnvAttack(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_ATTACK_TIME, val); - _gui->writeEvent(ev); - } - break; - case CTRL_RELEASE_TIME: - _preset[ch]->setIsUsed(true); - setChannelRelease(ch, val); - setEnvRelease(ch); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_RELEASE_TIME, val); - _gui->writeEvent(ev); - } - break; - case CTRL_REVERB_SEND: - setChannelReverb(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_REVERB_SEND, val); - _gui->writeEvent(ev); - } - break; - case CTRL_CHORUS_SEND: - setChannelChorus(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_CHORUS_SEND, val); - _gui->writeEvent(ev); - } - break; - case CTRL_VARIATION_SEND: - setChannelDelay(ch, val); - if(!fromGui) { - MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_VARIATION_SEND, val); - _gui->writeEvent(ev); - } - break; - case CTRL_SUSTAIN: - setSustain(ch, val); - break; - case CTRL_VOLUME: - setChannelVol(ch, val*(MAXCHANNELVOLUME/127)); - applyChannelAmp(ch); - if(!fromGui) { - MidiPlayEvent - ev(0, ch, ME_CONTROLLER, CTRL_CHANNELVOLUME, getChannelVol(ch)); - _gui->writeEvent(ev); - } - break; - case CTRL_ALL_SOUNDS_OFF: - resetVoices(); - default: - break; - } - } - return false; -} - -//--------------------------------------------------------- -// getPatchName -//--------------------------------------------------------- - -const char* DeicsOnze::getPatchName(int ch, int val, int) const { - if(_global.channel[ch].isEnable) { - Preset* p_preset; - int hbank = (val & 0xff0000) >> 16; - int lbank = (val & 0xff00) >> 8; - if (hbank > 127) - hbank = 0; - if (lbank > 127) - lbank = 0; - if (lbank == 127) // drum HACK - lbank = 128; - int prog = val & 0x7f; - char* tempName="INITVOICE"; - p_preset=_set->findPreset(hbank, lbank, prog); - if (p_preset) tempName=const_cast(p_preset->name.c_str()); - return tempName; - } - return " "; -} - -//--------------------------------------------------------- -// getPatchInfo -//--------------------------------------------------------- -const MidiPatch* DeicsOnze::getPatchInfo(int /*ch*/, const MidiPatch* p) const { - Preset* preset = NULL; - Subcategory* sub = NULL; - Category* cat = NULL; - if(p) { - _patch.hbank = p->hbank; - _patch.lbank = p->lbank; - _patch.prog = p->prog; - switch(p->typ) { - case MP_TYPE_HBANK : - sub = findSubcategory(_patch.hbank, _patch.lbank); - if(sub) { - _patch.name = sub->_subcategoryName.c_str(); - _patch.typ = MP_TYPE_LBANK; - return &_patch; - } - else { - if(_patch.lbank + 1 < LBANK_NBR) { - _patch.lbank++; - return getPatchInfo(0, &_patch); - } - else { - _patch.prog = PROG_NBR - 1; //hack to go faster - _patch.typ = 0; - return getPatchInfo(0, &_patch); - } - } - break; - case MP_TYPE_LBANK : - preset = findPreset(_patch.hbank, _patch.lbank, _patch.prog); - _patch.typ = 0; - if(preset) { - _patch.name = preset->name.c_str(); - return &_patch; - } - else return getPatchInfo(0, &_patch); - break; - default : - if(_patch.prog + 1 < PROG_NBR) { - _patch.prog++; - preset = findPreset(_patch.hbank, _patch.lbank, _patch.prog); - if(preset) { - _patch.name = preset->name.c_str(); - return &_patch; - } - else return getPatchInfo(0, &_patch); - } - else { - _patch.prog = 0; - if(_patch.lbank + 1 < LBANK_NBR) { - _patch.lbank++; - _patch.typ = MP_TYPE_HBANK; - return getPatchInfo(0, &_patch); - } - else { - _patch.lbank = 0; - if(_patch.hbank + 1 < HBANK_NBR) { - _patch.hbank++; - _patch.typ = MP_TYPE_HBANK; - cat = findCategory(_patch.hbank); - if(cat) { - _patch.name = cat->_categoryName.c_str(); - return &_patch; - } - return getPatchInfo(0, &_patch); - } - else return NULL; - } - } - } - } - else { - _patch.typ = MP_TYPE_HBANK; - _patch.hbank = 0; - _patch.lbank = 0; - _patch.prog = 0; - cat = findCategory(_patch.hbank); - if(cat) { - _patch.name = cat->_categoryName.c_str(); - return &_patch; - } - else { - _patch.hbank++; - return getPatchInfo(0, &_patch); - } - } -} - -//--------------------------------------------------------- -// getControllerInfo -/*! - \fn SimpleSynth::getControllerInfo - \brief Called from host to collect info about which controllers - the synth supports - \param index current controller number - \param name pointer where name is stored - \param controller int pointer where muse controller number is stored - \param min int pointer where controller min value is stored - \param max int pointer where controller max value is stored - \return 0 when done, otherwise return next desired controller index -*/ -//--------------------------------------------------------- -int DeicsOnze::getControllerInfo(int index, const char** name, - int* controller, int* min, int* max) -{ - if (index >= nbrCtrl) { - return 0; - } - - *name = _ctrl[index].name.c_str(); - *controller = _ctrl[index].num; - *min = _ctrl[index].min; - *max = _ctrl[index].max; - return (index +1); -} - -//--------------------------------------------------------- -// playNote -// process note on -//--------------------------------------------------------- -bool DeicsOnze::playNote(int ch, int pitch, int velo) { - int newVoice; - int nO2V; - int p2V; - double tempTargetFreq; - if(_global.channel[ch].isEnable) { - if(velo==0) {//Note off - p2V=pitchOn2Voice(ch, pitch); - //printf("Note Off : pitchOn2Voice = %d\n", p2V); - if(p2V<_global.channel[ch].nbrVoices) { - if(_global.channel[ch].sustain) - _global.channel[ch].voices[p2V].isSustained = true; - else { - _global.channel[ch].voices[p2V].keyOn = false; - _global.channel[ch].lastVoiceKeyOff = p2V; - _global.channel[ch].lastVoiceKeyOn.remove(p2V); - if(_preset[ch]->function.mode == MONO && existsKeyOn(ch) - && _global.channel[ch].voices[p2V].isOn) { - newVoice = _global.channel[ch].lastVoiceKeyOn.back(); - //portamento - if(_preset[ch]->function.portamentoTime!=0) { - _global.channel[ch].voices[newVoice].hasAttractor = true; - _global.channel[ch].voices[newVoice].attractor = - getAttractor(_preset[ch]->function.portamentoTime, - _global.deiSampleRate); - } - else _global.channel[ch].voices[newVoice].hasAttractor = false; - //feedback - _global.channel[ch].voices[newVoice].sampleFeedback = - _global.channel[ch].voices[p2V].sampleFeedback; - //on/off - _global.channel[ch].voices[p2V].isOn = false; - _global.channel[ch].voices[newVoice].isOn = true; - //per op - for(int i = 0; i < NBROP; i++) { - _global.channel[ch].voices[newVoice].op[i].index = - _global.channel[ch].voices[p2V].op[i].index; - _global.channel[ch].voices[newVoice].op[i].envState = - _global.channel[ch].voices[p2V].op[i].envState; - _global.channel[ch].voices[newVoice].op[i].envIndex = - _global.channel[ch].voices[p2V].op[i].envIndex; - _global.channel[ch].voices[newVoice].op[i].envInct = - _global.channel[ch].voices[p2V].op[i].envInct; - _global.channel[ch].voices[newVoice].op[i].envLevel = - _global.channel[ch].voices[p2V].op[i].envLevel; - _global.channel[ch].voices[newVoice].op[i].coefVLevel = - _global.channel[ch].voices[p2V].op[i].coefVLevel; - if(_global.channel[ch].voices[newVoice].hasAttractor) - _global.channel[ch].voices[newVoice].op[i].inct = - _global.channel[ch].voices[p2V].op[i].inct; - } - } - else { - setPitchEnvRelease(ch, p2V); - for(int i=0; ifunction.portamentoTime!=0 - && _global.channel[ch].isLastNote && - (_preset[ch]->function.portamento==FULL) || - (_preset[ch]->function.portamento==FINGER && existsKeyOn(ch))) { - _global.channel[ch].voices[newVoice].hasAttractor = true; - _global.channel[ch].voices[newVoice].attractor = - getAttractor(_preset[ch]->function.portamentoTime, - _global.deiSampleRate); - } - else _global.channel[ch].voices[newVoice].hasAttractor = false; - - if(_preset[ch]->lfo.sync) _global.channel[ch].lfoIndex=0; - - _global.channel[ch].lfoDelayIndex = - (_preset[ch]->lfo.delay==0?(double)(RESOLUTION/4):0.0); - _global.channel[ch].delayPassed = false; - - //-------------- - //PITCH ENVELOPE - //-------------- - if(isPitchEnv(&_preset[ch]->pitchEg)) { - _global.channel[ch].voices[newVoice].pitchEnvState = PHASE1; - _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase1 = - getPitchEnvCoefInct(_preset[ch]->pitchEg.pl1); - _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase2 = - getPitchEnvCoefInct(_preset[ch]->pitchEg.pl2); - _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase3 = - getPitchEnvCoefInct(_preset[ch]->pitchEg.pl3); - _global.channel[ch].voices[newVoice].pitchEnvCoefInct = - _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase1; - _global.channel[ch].voices[newVoice].pitchEnvCoefInctInct = - getPitchEnvCoefInctInct(_preset[ch]->pitchEg.pl1, - _preset[ch]->pitchEg.pl2, - _preset[ch]->pitchEg.pr1, - _global.deiSampleRate); - } - else { - _global.channel[ch].voices[newVoice].pitchEnvState = OFF_PE; - _global.channel[ch].voices[newVoice].pitchEnvCoefInct = 1.0; - } - //per operator - for(int i=0; isensitivity.keyVelocity[i]) - *note2Amp((double) (pitch+_preset[ch]->function.transpose), - _preset[ch]->scaling.level[i]); - _global.channel[ch].voices[newVoice].op[i].amp = - outLevel2Amp(_preset[ch]->outLevel[i]) - *_global.channel[ch].voices[newVoice].op[i].ampVeloNote - * brightness2Amp(ch, i); - //---------------- - //INDEX & ENVELOPE - //---------------- - //if index get 0.0, it means that the offset is 0 - if(existsKeyOn(ch)) { - int lastVoice = _global.channel[ch].lastVoiceKeyOn.back(); - if(_preset[ch]->function.mode == MONO) { - _global.channel[ch].voices[newVoice].op[i].index = - _global.channel[ch].voices[lastVoice].op[i].index; - _global.channel[ch].voices[newVoice].sampleFeedback = - _global.channel[ch].voices[lastVoice].sampleFeedback; - _global.channel[ch].voices[newVoice].op[i].envState = - _global.channel[ch].voices[lastVoice].op[i].envState; - _global.channel[ch].voices[newVoice].op[i].envIndex = - _global.channel[ch].voices[lastVoice].op[i].envIndex; - _global.channel[ch].voices[newVoice].op[i].envInct = - _global.channel[ch].voices[lastVoice].op[i].envInct; - _global.channel[ch].voices[newVoice].op[i].envLevel = - _global.channel[ch].voices[lastVoice].op[i].envLevel; - _global.channel[ch].voices[newVoice].op[i].coefVLevel = - _global.channel[ch].voices[lastVoice].op[i].coefVLevel; - _global.channel[ch].voices[lastVoice].isOn = false; - } - else { - _global.channel[ch].voices[newVoice].op[i].index = 0.0; - _global.channel[ch].voices[newVoice].sampleFeedback = 0.0; - _global.channel[ch].voices[newVoice].op[i].envState = ATTACK; - _global.channel[ch].voices[newVoice].op[i].envIndex = 0.0; - setEnvAttack(ch, newVoice, i); - } - } - else { - _global.channel[ch].voices[newVoice].op[i].index = 0.0; - _global.channel[ch].voices[newVoice].sampleFeedback = 0.0; - _global.channel[ch].voices[newVoice].op[i].envState = ATTACK; - _global.channel[ch].voices[newVoice].op[i].envIndex = 0.0; - setEnvAttack(ch, newVoice, i); - if(_preset[ch]->function.mode == MONO && - _global.channel[ch].isLastNote) { - _global.channel[ch].voices[_global.channel[ch].lastVoiceKeyOff] - .isOn = false; - } - } - - //---- - //FREQ - //---- - //the frequence for each operator is calculated - //and is used later to calculate inct - tempTargetFreq = - (pitch2freq((double)getChannelDetune(ch) - /(double)MAXCHANNELDETUNE) - /LOWERNOTEFREQ)* - (_preset[ch]->frequency[i].isFix? - _preset[ch]->frequency[i].freq: - (_preset[ch]->frequency[i].ratio - *pitch2freq((double)(pitch+_preset[ch]->function.transpose) - +(double)_preset[ch]->detune[i]*COEFDETUNE))); - //---- - //INCT - //---- - //compute inct - _global.channel[ch].voices[newVoice].op[i].targetInct = - (double)RESOLUTION / ( _global.deiSampleRate / tempTargetFreq ); - if(_global.channel[ch].voices[newVoice].hasAttractor && - !_preset[ch]->frequency[i].isFix) - _global.channel[ch].voices[newVoice].op[i].inct = - _global.channel[ch].lastInc[i]; - else _global.channel[ch].voices[newVoice].op[i].inct = - _global.channel[ch].voices[newVoice].op[i].targetInct; - } - //-------------------- - //some initializations - //-------------------- - _global.channel[ch].voices[newVoice].keyOn = true; - _global.channel[ch].voices[newVoice].isSustained = false; - _global.channel[ch].voices[newVoice].isOn = true; - _global.channel[ch].voices[newVoice].pitch = pitch; - _global.channel[ch].isLastNote = true; - _global.channel[ch].lastVoiceKeyOn.push_back(newVoice); - for(int k = 0; k < NBROP; k++) - _global.channel[ch].lastInc[k] = - _global.channel[ch].voices[newVoice].op[k].inct; - return false; - } - } - return false; -} - -//--------------------------------------------------------- -// plusMod -// add two doubles modulo RESOLUTION -//--------------------------------------------------------- -inline double plusMod(double x, double y) { - double res; - res=x+y; - if (res>=0) while (res >= (double)RESOLUTION) res-=(double)RESOLUTION; - else while (res < 0) res+=(double)RESOLUTION; - return res; -} - - -//--------------------------------------------------------- -// write -// synthesize n samples into buffer+offset -//--------------------------------------------------------- -void DeicsOnze::process(float** buffer, int offset, int n) { - //Process messages from the gui - while (_gui->fifoSize()) { - MidiPlayEvent ev = _gui->readEvent(); - if (ev.type() == ME_SYSEX) { - sysex(ev.len(), ev.data(), true); - sendEvent(ev); - } - else if (ev.type() == ME_CONTROLLER) { - setController(ev.channel(), ev.dataA(), ev.dataB(), true); - sendEvent(ev); - } - } - float* leftOutput = buffer[0] + offset; - float* rightOutput = buffer[1] + offset; - - float sample[MAXNBRVOICES]; - float tempLeftOutput; - float tempRightOutput; - float tempChannelOutput; - float tempChannelLeftOutput; - float tempChannelRightOutput; - float tempIncChannel; //for optimization - float sampleOp[NBROP]; - for(int i = 0; i < NBROP; i++) sampleOp[i] = 0.0; - float ampOp[NBROP]; - for(int i = 0; i < n; i++) { - if(_global.qualityCounter == 0) { - tempLeftOutput = 0.0; - tempRightOutput = 0.0; - _global.lastInputLeftChorusSample = 0.0; - _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; - if(_global.channel[c].isEnable) { - //lfo, trick : we use the first quater of the wave W2 - lfoUpdate(_preset[c], &_global.channel[c], waveTable[W2]); - - //optimization - tempIncChannel = - _global.channel[c].lfoCoefInct * _global.channel[c].pitchBendCoef; - - //per voice - for(int j=0; j<_global.channel[c].nbrVoices; j++) { - if (_global.channel[c].voices[j].isOn) { - //portamento - portamentoUpdate(&_global.channel[c], - &_global.channel[c].voices[j]); - //pitch envelope - pitchEnvelopeUpdate(&_global.channel[c].voices[j], - &_preset[c]->pitchEg, _global.deiSampleRate); - //per op - for(int k=0; ksensitivity.ampOn[k]? - _global.channel[c].lfoAmp:1.0) - *env2AmpR(_global.deiSampleRate, waveTable[W2], - _preset[c]->eg[k], - &_global.channel[c].voices[j].op[k]); - } - switch(_preset[c]->algorithm) { - case FIRST : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)plusMod(_global.channel[c].voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)plusMod(_global.channel[c].voices[j].op[1].index, - (float)RESOLUTION*sampleOp[2])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION*sampleOp[1])]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case SECOND : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)_global.channel[c].voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)plusMod(_global.channel[c].voices[j].op[1].index, - (float)RESOLUTION - *(sampleOp[2]+sampleOp[3])/2.0)]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION - *sampleOp[1])]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case THIRD : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)_global.channel[c].voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)plusMod(_global.channel[c].voices[j].op[1].index, - (float)RESOLUTION*sampleOp[2])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION - *(sampleOp[3]+sampleOp[1])/2.0)]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case FOURTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)plusMod(_global.channel[c].voices[j].op[2].index, - (float)RESOLUTION - *sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)_global.channel[c].voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION - *(sampleOp[1]+sampleOp[2])/2.0)]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case FIFTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)plusMod(_global.channel[c].voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)_global.channel[c].voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION*sampleOp[1])]; - - sample[j]=(sampleOp[0]+sampleOp[2])/2.0;///COEFLEVEL; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF - ||_global.channel[c].voices[j].op[2].envState!=OFF); - break; - case SIXTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)plusMod(_global.channel[c].voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)plusMod(_global.channel[c].voices[j].op[1].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)plusMod(_global.channel[c].voices[j].op[0].index, - (float)RESOLUTION*sampleOp[3])]; - - sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case SEVENTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)plusMod(_global.channel[c].voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)_global.channel[c].voices[j].op[1].index]; - sampleOp[0]=ampOp[0]*waveTable[_preset[c]->oscWave[0]] - [(int)_global.channel[c].voices[j].op[0].index]; - - sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF); - break; - case EIGHTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset[c]->oscWave[3]] - [(int)plusMod(_global.channel[c].voices[j].op[3].index, - (float)RESOLUTION - *_global.channel[c].voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset[c]->oscWave[2]] - [(int)_global.channel[c].voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset[c]->oscWave[1]] - [(int)_global.channel[c].voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset[c]->oscWave[0]] - [(int)_global.channel[c].voices[j].op[0].index]; - - sample[j]= - (sampleOp[0]+sampleOp[1]+sampleOp[2]+sampleOp[3]) - /4.0; - - _global.channel[c].voices[j].isOn = - (_global.channel[c].voices[j].op[0].envState!=OFF - || _global.channel[c].voices[j].op[1].envState!=OFF - || _global.channel[c].voices[j].op[2].envState!=OFF - || _global.channel[c].voices[j].op[3].envState!=OFF); - break; - default : printf("Error : No algorithm"); - break; - } - - _global.channel[c].voices[j].volume= - ampOp[0]+ampOp[1]+ampOp[2]+ampOp[3]; - - _global.channel[c].voices[j].sampleFeedback = - sampleOp[3]*_global.channel[c].feedbackAmp; - - tempChannelOutput += sample[j]; - } - } - //printf("left out = %f, temp out = %f, left amp = %f\n", - //tempLeftOutput, tempChannelOutput, _global.channel[c].ampLeft); - - tempChannelLeftOutput = tempChannelOutput*_global.channel[c].ampLeft; - tempChannelRightOutput=tempChannelOutput*_global.channel[c].ampRight; - - if(_global.isChorusActivated) { - _global.lastInputLeftChorusSample += tempChannelLeftOutput * - _global.channel[c].chorusAmount; - _global.lastInputRightChorusSample += tempChannelRightOutput * - _global.channel[c].chorusAmount; - } - if(_global.isReverbActivated) { - _global.lastInputLeftReverbSample += tempChannelLeftOutput * - _global.channel[c].reverbAmount; - _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; - } - } - _global.lastLeftSample = tempLeftOutput * _global.masterVolume; - _global.lastRightSample = tempRightOutput * _global.masterVolume; - } - leftOutput[i] += _global.lastLeftSample; - rightOutput[i] += _global.lastRightSample; - - if(_global.isChorusActivated) { - tempInputChorus[0][i] = _global.lastInputLeftChorusSample; - tempInputChorus[1][i] = _global.lastInputRightChorusSample; - } - if(_global.isReverbActivated) { - 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; - } - //apply Filter - if(_global.filter) _dryFilter->process(leftOutput, rightOutput, n); - //Chorus - if(_pluginIChorus && _global.isChorusActivated) { - //apply Filter - if(_global.filter) _chorusFilter->process(tempOutputChorus[0], - tempOutputChorus[1], n); - //apply Chorus - _pluginIChorus->apply(n, 2, tempInputChorus, tempOutputChorus); - for(int i = 0; i < n; i++) { - leftOutput[i] += - tempOutputChorus[0][i] * _global.chorusReturn * _global.masterVolume; - rightOutput[i] += - tempOutputChorus[1][i] * _global.chorusReturn * _global.masterVolume; - } - } - //Reverb - if(_pluginIReverb && _global.isReverbActivated) { - //apply Filter - if(_global.filter) _reverbFilter->process(tempOutputReverb[0], - tempOutputReverb[1], n); - //apply Reverb - _pluginIReverb->apply(n, 2, tempInputReverb, tempOutputReverb); - for(int i = 0; i < n; i++) { - leftOutput[i] += - tempOutputReverb[0][i] * _global.reverbReturn * _global.masterVolume; - rightOutput[i] += - tempOutputReverb[1][i] * _global.reverbReturn * _global.masterVolume; - } - } - //Delay - if(_pluginIDelay && _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; - } - } -} - - -//--------------------------------------------------------- -// inst -//--------------------------------------------------------- - -class QWidget; - -static Mess* instantiate(int sr, const char*) -{ - DeicsOnze* deicsonze = new DeicsOnze(); - deicsonze->setSampleRate(sr); - return deicsonze; -} - -extern "C" { - static MESS descriptor = { - "DeicsOnze", - "DeicsOnze FM DX11/TX81Z emulator", - "0.5.5", // version string - MESS_MAJOR_VERSION, MESS_MINOR_VERSION, - instantiate - }; - // We must compile with -fvisibility=hidden to avoid namespace - // conflicts with global variables. - // Only visible symbol is "mess_descriptor". - // (TODO: all plugins should be compiled this way) - - __attribute__ ((visibility("default"))) - const MESS* mess_descriptor() { return &descriptor; } -} - diff --git a/muse2/synti/deicsonze2/deicsonze.h b/muse2/synti/deicsonze2/deicsonze.h deleted file mode 100644 index c462cfcd..00000000 --- a/muse2/synti/deicsonze2/deicsonze.h +++ /dev/null @@ -1,603 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// -// -// -// Copyright (c) 2004-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 __DEICSONZE_H -#define __DEICSONZE_H - -#include - -#include "deicsonzepreset.h" -#include "deicsonzegui.h" -#include "deicsonzeplugin.h" -#include "deicsonzefilter.h" -#include "libsynti/mess.h" -#include "muse/plugin.h" - -#define DEICSONZESTR "deicsonze" - -#define MAXPITCHBENDVALUE 8191 - -#define RESOLUTION 96000 - -#define MAXFXBUFFERSIZE 48000 -#define NBRFXINPUTS 2 -#define NBRFXOUTPUTS 2 - -#define NBRCTRLS 127 - -#define NBRPRESETS 128 - -#define LOWERNOTEFREQ 8.176 - -#define DB0LEVEL 90 - -#define LENGTHNAME 20 -#define LENGTHCATEGORY 20 -#define LENGTHSUBCATEGORY 20 - -#define MAXVELO 127 -#define MAXVOLUME 100.0 -#define MAXSTRLENGTHINITSETPATH 256 -#define MAXSTRLENGTHBACKGROUNDPIXPATH 256 -#define MAXSTRLENGTHFXLIB 256 -#define MAXSTRLENGTHFXLABEL 256 - -#define DB_MIN 25.0 - -//coef determined by ear to sound like the YAMAHA DX11 -#define COEFFEEDBACK 0.3 -#define COEFPLFO(x) (x==0?0.0:(x==1?0.06:(x==2?0.12:(x==3?0.25:(x==4?0.5:(x==5?0.9:(x==6?3.9:7.9))))))) //return pitch amplitude with respect to sensitivity pitch -#define COEFALFO(x) (x==0?0.0:(x==1?0.4:(x==2?0.9:1.0))) -#define MAX(x,y) (x2.0, 90->1.0, 80->0.5 ... -//--------------------------------------------------------- -inline double outLevel2Amp(int ol); - -//--------------------------------------------------------- -// level2amp, -// 255->0dB->1.0, 0->-27dB->0 -//--------------------------------------------------------- -inline double level2amp(int l); - -//--------------------------------------------------------- -// amp2level -// 1.0->0dB->255, 0->-27dB->0 -//--------------------------------------------------------- -inline int amp2level(double amp); - -//--------------------------------------------------------- -// amp2lowlevel -// 1.0->0dB->127, 0->-27dB->0 -//--------------------------------------------------------- -inline int amp2lowlevel(double amp); - -//--------------------------------------------------------- -// lowlevel2amp, -// 127->0dB->1.0, 0->-27dB->0 -//--------------------------------------------------------- -inline double lowlevel2amp(int l); - -//--------------------------------------------------------- -// envAR2s -// return the time in second of the ATTACK duration -//--------------------------------------------------------- -inline double envAR2s(int ar); - -//--------------------------------------------------------- -// coefAttack -// convert the attack value to a coef for envInct -//--------------------------------------------------------- -inline double coefAttack(unsigned char attack); - -//--------------------------------------------------------- -// envRR2coef -// return the coefficient for the exponential decrease -// with respect to rr and sampleRate, sr -//--------------------------------------------------------- -inline double envRR2coef(int rr, double sr, unsigned char release); - -//-------------------------------------------------------- -// DeicsOnzeCtrl -//-------------------------------------------------------- -struct DeicsOnzeCtlr -{ - std::string name; - int num; - int min, max; -}; - -//--------------------------------------------------------- -// EnvState -//--------------------------------------------------------- - -enum EnvState{ - ATTACK, - DECAY, - SUSTAIN, - RELEASE, - OFF -}; - -//--------------------------------------------------------- -// OpVoice -//--------------------------------------------------------- - -struct OpVoice { - double index; - double inct; - double targetInct; //used if portamento - double amp; //between 0 and 1 - double ampVeloNote; //keeps the ratio amplitude from velo2AmpR and note2Amp - //in order to change independently the output level - //after pressing the note - EnvState envState; - double envIndex; - double envInct; - double envLevel; - double coefVLevel; -}; - -//--------------------------------------------------------- -// PitchEnvState -//--------------------------------------------------------- -enum PitchEnvState{ - PHASE1, - PHASE2, - RELEASE_PE, - OFF_PE -}; - -//--------------------------------------------------------- -// Voice -//--------------------------------------------------------- - -struct Voice { - bool hasAttractor;//true iff the voice has an attractor (portamento occuring) - double attractor; //contains some coeficent for portamento TODO - PitchEnvState pitchEnvState; - double pitchEnvCoefInct; - double pitchEnvCoefInctPhase1; - double pitchEnvCoefInctPhase2; - double pitchEnvCoefInctPhase3; - double pitchEnvCoefInctRelease; - double pitchEnvCoefInctInct; - bool isOn; - bool keyOn; - bool isSustained; - int pitch; //number of the note - double volume; - OpVoice op[NBROP]; - float sampleFeedback; -}; - -//--------------------------------------------------------- -// Channel -//--------------------------------------------------------- -struct Channel { - bool isEnable; - float ampLeft; - float ampRight; - int volume; //0 to 255 - int pan; //TODO -63 +64 or -127 +128 - int modulation;//0 to 127 - int detune;//-31 to 31 - int brightness; //0 to 4095 - int attack; //0 to 127 - int release; //0 to 127 - float feedbackAmp; - float lfoFreq; - float lfoPitch; - float lfoMaxCoefInct; - float lfoCoefInct; - float lfoCoefInctInct; - unsigned int lfoIndex; - unsigned int lfoMaxIndex; - float lfoMaxAmp; - float lfoMaxDAmp; - float lfoAmp; - float lfoCoefAmp; - double lfoDelayIndex; - double lfoDelayInct; - double lfoDelayMaxIndex; - bool delayPassed; - bool sustain; - double pitchBendCoef;//speed coef to read the sample - unsigned char nbrVoices; - Voice voices[MAXNBRVOICES]; - double lastInc[NBROP]; - std::list lastVoiceKeyOn; //stack of the voice number - int lastVoiceKeyOff; - bool isLastNote; - //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 -}; - -//--------------------------------------------------------- -// Global -//--------------------------------------------------------- -enum Quality { - high, - middle, - low, - ultralow -}; - -struct Global { - float masterVolume; - Quality quality; //high, middle, low - int qualityCounter; //counter to skip some sample depending on quality - int qualityCounterTop; //number of sample - 1 to skip - double deiSampleRate; //depending on quality deicsOnze sample rate varies - bool filter; //low passe filter used when the sampling is low - int fontSize; - float lastLeftSample; - float lastRightSample; - float lastInputLeftChorusSample; - 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; -}; - -//--------------------------------------------------------- -// DeicsOnze : DX11 emulator -//--------------------------------------------------------- - -class DeicsOnze : public Mess { - DeicsOnzeGui* _gui; - - static int useCount; - static float waveTable[NBRWAVES][RESOLUTION]; - - private: - void parseInitData(int length, const unsigned char* data); - void loadConfiguration(QString fileName); - - public: - float** tempInputChorus; - float** tempOutputChorus; - float** tempInputReverb; - float** tempOutputReverb; - float** tempInputDelay; - float** tempOutputDelay; - - float* getSinusWaveTable(); - - int nbrCtrl; - - QString _initSetPath; - bool _isInitSet; - QString _backgroundPixPath; - bool _isBackgroundPix; - bool _saveOnlyUsed; - bool _saveConfig; - DeicsOnzeCtlr _ctrl[NBRCTRLS]; - Global _global; - Preset* _preset[NBRCHANNELS]; - Preset* _initialPreset; - - //FX - PluginI* _pluginIReverb; - PluginI* _pluginIChorus; - PluginI* _pluginIDelay; - - void initPluginReverb(Plugin*); - void initPluginChorus(Plugin*); - void initPluginDelay(Plugin*); - - void setReverbParam(int i, double val); - double getReverbParam(int i); - void setChorusParam(int i, double val); - double getChorusParam(int i); - void setDelayBPM(float val); - void setDelayBeatRatio(float val); - void setDelayFeedback(float val); - void setDelayLFOFreq(float val); - void setDelayLFODepth(float val); - void setDelayDryWet(float val); - float getDelayBPM(); - float getDelayBeatRatio(); - float getDelayFeedback(); - float getDelayLFOFreq(); - float getDelayLFODepth(); - - //Filter - LowFilter* _dryFilter; - LowFilter* _chorusFilter; - LowFilter* _reverbFilter; - LowFilter* _delayFilter; - - mutable MidiPatch _patch; - mutable int _numPatchProg; //used by getPatchInfo - - //preset tree - Set* _set; - - void setSampleRate(int sr); - Preset* findPreset(int hbank, int lbank, int prog) const; - Subcategory* findSubcategory(int hbank, int lbank) const; - Category* findCategory(int hbank) const; - void initCtrls(); - void initGlobal(); - void initChannels(); - void initChannel(int c); - void resetVoices(); //when panic is pressed - void initVoice(int c, int v); - void initVoices(int c); - void setPreset(int c); - void setFeedback(int c); - void setLfo(int c); - void setOutLevel(int c, int k); //set the output level of the op k - void setOutLevel(int c); //do the same for all operators - void setEnvAttack(int c, int v, int k); //set envInct of voice v and op k - void setEnvAttack(int c, int k); //do the same for all voices of operator k - void setEnvAttack(int c); //do the same for all voices all operators - void setEnvRelease(int c, int v, int k); //set coefVLevel of voice v and op k - void setEnvRelease(int c, int k); //do the same for all voices of operator k - void setEnvRelease(int c); //do the same for all voices all operators - void setPitchEnvRelease(int c, int v); - void setQuality(Quality q); - void setFilter(bool f); - double brightness2Amp(int c, int k); //get the brightness of the operator k - void loadSutulaPresets(); - void loadSet(QString s); - int noteOff2Voice(int c); //return the first free voice - int minVolu2Voice(int c); - int pitchOn2Voice(int c, int pitch); - void programSelect(int c, int hbank, int lbank, int prog); - bool existsKeyOn(int ch); - void setNbrVoices(int c, int nv); - void setMasterVol(int v); - void setChannelEnable(int c, bool e); - void setChannelVol(int c, int v); - void setChannelPan(int c, int v); - void applyChannelAmp(int c); - void setChannelDetune(int c, int d); - void setChannelBrightness(int c, int b); - void setChannelModulation(int c, int m); - void setChannelAttack(int c, int a); - 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; - bool getFilter(void) const; - int getChannelVol(int c) const; - int getChannelPan(int c) const; - int getChannelDetune(int c) const; - int getChannelBrightness(int c) const; - int getChannelModulation(int c) const; - int getChannelAttack(int c) const; - 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); - - void readConfiguration(QDomNode qdn); - void writeConfiguration(Xml* xml); - - bool setController(int ch, int ctrl, int val, bool fromGui); - virtual bool setController(int ch, int ctrl, int val); - bool sysex(int length, const unsigned char* data, bool fromGui); - virtual bool sysex(int length, const unsigned char* data); - - virtual const char* getPatchName(int ch, int number, int) const; - virtual const MidiPatch* getPatchInfo(int, const MidiPatch *) const; - - virtual int getControllerInfo(int arg1, const char** arg2, - int* arg3, int* arg4, int* arg5); - virtual void getInitData(int* length, const unsigned char** data); - virtual bool playNote(int channel, int pitch, int velo); - virtual void process(float** buffer, int offset, int n); - - // GUI interface routines - virtual bool hasGui() const { return true; } - virtual bool guiVisible() const; - virtual void showGui(bool); - virtual void getGeometry(int* x, int* y, int* w, int* h) const; - virtual void setGeometry(int, int, int, int); - - DeicsOnze(); - ~DeicsOnze(); -}; - - -#endif /* __DEICSONZE_H */ diff --git a/muse2/synti/deicsonze2/deicsonze2.cpp b/muse2/synti/deicsonze2/deicsonze2.cpp new file mode 100644 index 00000000..6a4bc5ff --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2.cpp @@ -0,0 +1,4361 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// +// +// +// Copyright (c) 2004-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 +#include + +// #include + +#include "muse/midi.h" +#include "libsynti/mess.h" +#include "muse/plugin.h" +#include "muse/midictrl.h" +#include "deicsonze2.h" +#include "config.h" + +#define ABS(x) (x>=0?x:-x) + + +float DeicsOnze2::waveTable[NBRWAVES][RESOLUTION]; +int DeicsOnze2::useCount = 0; + +//--------------------------------------------------------- +// DeicsOnze2 +//--------------------------------------------------------- + +DeicsOnze2::DeicsOnze2() : Mess(2) { + if (useCount++ == 0) { + // create sinus wave table, W1 + for(int i = 0; i < RESOLUTION; i++) + waveTable[W1][i] = + (float)(sin((i * 2.0 * M_PI) / (double)RESOLUTION)); + // create sinus*abs(sinus) wave table, W2 + for(int i = 0; i < RESOLUTION; i++){ + double t = (i * 2.0 * M_PI) / (double)RESOLUTION; + waveTable[W2][i] = (float)(ABS(sin(t))*sin(t));} + // create halfsinus_ wave table, W3 + for(int i = 0; i < RESOLUTION; i++) + waveTable[W3][i] = (float) + (ihide(); // to avoid flicker during MusE startup + // TODO _gui->setWindowTitle(QString("DeicsOnze2")); + + //FX + Plugin* p; + p = plugins.find("freeverb", "freeverb1"); + _pluginIReverb = NULL; + if(p) initPluginReverb(p); + _pluginIChorus = NULL; + p = plugins.find("doublechorus", "doublechorus1"); + if(p) initPluginChorus(p); + _pluginIDelay = NULL; + p = plugins.find("pandelay", "pandelay"); + if(p) initPluginDelay(p); + + //Filter + _dryFilter = new LowFilter(); + _chorusFilter = new LowFilter(); + _reverbFilter = new LowFilter(); + _delayFilter = new LowFilter(); + + //Load configuration + QString defaultConf = + (QString(getenv("HOME")) + QString("/." DEICSONZESTR ".dco")); + FILE* f; + f = fopen(defaultConf.ascii(), "r"); + if(f) { + fclose(f); + loadConfiguration(defaultConf); + } + + //load Set + _set=new Set("Initial Bank"); + if(_isInitSet) loadSet(_initSetPath); + + //loadSutulaPresets(); + + _initialPreset = new + Preset(new Subcategory(new Category(NULL, "NONE", 0), "NONE", 0), 0); + for(int c = 0; c < NBRCHANNELS; c++) { + _preset[c]=_initialPreset; + setPreset(c); + } + //update display gui + //update mastervol + unsigned char dataMasterVol[2]; + dataMasterVol[0]=SYSEX_MASTERVOL; + dataMasterVol[1]=getMasterVol(); + MidiPlayEvent evSysexMasterVol(0, ME_SYSEX, + (const unsigned char*)dataMasterVol, + 2); + _gui->writeEvent(evSysexMasterVol); + //update return fx + unsigned char *dataReverbRet = new unsigned char[2]; + dataReverbRet[0]=SYSEX_REVERBRETURN; + dataReverbRet[1]=(unsigned char)getReverbReturn(); + MidiPlayEvent evReverbRet(0,ME_SYSEX,(const unsigned char*)dataReverbRet, 2); + _gui->writeEvent(evReverbRet); + unsigned char *dataChorusRet = new unsigned char[2]; + dataChorusRet[0]=SYSEX_CHORUSRETURN; + dataChorusRet[1]=(unsigned char)getChorusReturn(); + MidiPlayEvent 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()); + MidiPlayEvent 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; + dataFontSize[1]=(unsigned char)_global.fontSize; + MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); + _gui->writeEvent(evFontSize); + //display load preset + unsigned char dataUpdateGuiSet[1]; + dataUpdateGuiSet[0]=SYSEX_UPDATESETGUI; + MidiPlayEvent evSysexUpdateGuiSet(0, ME_SYSEX, + (const unsigned char*)dataUpdateGuiSet, + 1); + _gui->writeEvent(evSysexUpdateGuiSet); +} + +//--------------------------------------------------------- +// ~DeicsOnze2 +//--------------------------------------------------------- + +DeicsOnze2::~DeicsOnze2() +{ + //if (--useCount == 0) + //delete[] sine_table; + //dealloc temp buffers chorus and reverb + for(int i = 0; i < NBRFXINPUTS; i++) free(tempInputChorus[i]); + free(tempInputChorus); + 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); +} + +//--------------------------------------------------------- +// getSinusWaveTable +//--------------------------------------------------------- +float* DeicsOnze2::getSinusWaveTable() { + return waveTable[W1]; +} + +//--------------------------------------------------------- +// guiVisible +//--------------------------------------------------------- +bool DeicsOnze2::guiVisible() const +{ + return _gui->isVisible(); +} + +//--------------------------------------------------------- +// showGui +//--------------------------------------------------------- +void DeicsOnze2::showGui(bool val) +{ + _gui->setShown(val); +} + +//--------------------------------------------------------- +// getGeometry +//--------------------------------------------------------- + +void DeicsOnze2::getGeometry(int* x, int* y, int* w, int* h) const { + QPoint pos(_gui->pos()); + QSize size(_gui->size()); + *x = pos.x(); + *y = pos.y(); + *w = size.width(); + *h = size.height(); +} + +void DeicsOnze2::setSampleRate(int sr) { + Mess::setSampleRate(sr); + _dryFilter->setSamplerate(sr); + _chorusFilter->setSamplerate(sr); + _reverbFilter->setSamplerate(sr); + _delayFilter->setSamplerate(sr); + setQuality(_global.quality); +} + +//--------------------------------------------------------- +// setGeometry +//--------------------------------------------------------- + +void DeicsOnze2::setGeometry(int x, int y, int w, int h) { + _gui->resize(QSize(w, h)); + _gui->move(QPoint(x, y)); +} + +//--------------------------------------------------------- +// initCtrls +//--------------------------------------------------------- +void DeicsOnze2::initCtrls() { + int i=0; + for(int k=0; kfindPreset(hbank, lbank, prog); +} +Subcategory* DeicsOnze2::findSubcategory(int hbank, int lbank) const { + return _set->findSubcategory(hbank, lbank); +} +Category* DeicsOnze2::findCategory(int hbank) const { + return _set->findCategory(hbank); +} +//--------------------------------------------------------- +// isPitchEnv +// return true iff all levels are in the middle +//--------------------------------------------------------- +inline bool isPitchEnv(PitchEg* pe) { + return(pe->pl1 != 50 || pe->pl2 != 50 || pe->pl3 != 50); +} +//--------------------------------------------------------- +// getPitchEnvCoefInct +// returns the coefInct according to level pl +//--------------------------------------------------------- +inline double getPitchEnvCoefInct(int pl) { + /* + pl = 0 <--> -4oct, pl = 50 <--> 0oct, pl = 100 <--> 4oct + + y = a * exp((pl - 50)/b) + 1.0 = a*exp(0) ==> a = 1.0 + 8.0 = exp(50/b) ==> log 8.0 = 50/b ==> b = 50/log(8.0) + */ + double b = 50.0/log(8.0); + return exp((pl-50.0)/b); +} + +//--------------------------------------------------------- +// getPitchEnvCoefInctInct +//--------------------------------------------------------- +inline double getPitchEnvCoefInctInct(int pl1, int pl2, int pr, double sr) { + //TODO : depending on the sampleRate + int a = pr; + double c = 1.0 + COEFPITCHENV*((double)(a*a)+1.0); + double inctInct = exp(log(c)*48000.0/sr); + if(pl1pl2) + return(1.0/inctInct); + else return 1.0; +} + +//--------------------------------------------------------- +// existsKeyOn +//--------------------------------------------------------- +bool DeicsOnze2::existsKeyOn(int ch) { + return !_global.channel[ch].lastVoiceKeyOn.empty(); +} + +//--------------------------------------------------------- +// note2Amp +// return the Amp of a note depending on the level scaling +//--------------------------------------------------------- +inline double note2Amp(double note, int ls) +{ + if(ls==0) return(1.0); + else return((noteMAXNBRVOICES?MAXNBRVOICES:(nv<1?1:nv)); + //we assume that any voices + //that is not included in the active voices is properly initialized + for(int v=nv; v<_global.channel[c].nbrVoices; v++) + initVoice(c, v); + _global.channel[c].nbrVoices=nv; +} + +//---------------------------------------------------------------- +// setMasterVol +//---------------------------------------------------------------- +void DeicsOnze2::setMasterVol(int mv) { + _global.masterVolume=level2amp(mv); //watch out that MAXMASTERVOLUME==255 +} +//---------------------------------------------------------------- +// setChannelEnable +//---------------------------------------------------------------- +void DeicsOnze2::setChannelEnable(int c, bool e) { + _global.channel[c].isEnable = e; + setLfo(c); +} + +//---------------------------------------------------------------- +// setChannelVol +//---------------------------------------------------------------- +void DeicsOnze2::setChannelVol(int c, int v) { + _global.channel[c].volume = v; +} + +void DeicsOnze2::applyChannelAmp(int c) { + _global.channel[c].ampLeft = + level2amp(_global.channel[c].volume) + * ((double)(MAXCHANNELPAN - _global.channel[c].pan) + /(double)(2*MAXCHANNELPAN)); + _global.channel[c].ampRight = + level2amp(_global.channel[c].volume) + * ((double)(MAXCHANNELPAN + _global.channel[c].pan) + /(double)(2*MAXCHANNELPAN)); +} + +//---------------------------------------------------------------- +// setChannelPan +//---------------------------------------------------------------- +void DeicsOnze2::setChannelPan(int c, int p) { + _global.channel[c].pan = p; +} +//---------------------------------------------------------------- +// setChannelDetune +//---------------------------------------------------------------- +void DeicsOnze2::setChannelDetune(int c, int p) { + _global.channel[c].detune = p; +} +//---------------------------------------------------------------- +// setChannelBrightness +//---------------------------------------------------------------- +void DeicsOnze2::setChannelBrightness(int c, int b) { + _global.channel[c].brightness = b; +} +//---------------------------------------------------------------- +// setChannelModulation +//---------------------------------------------------------------- +void DeicsOnze2::setChannelModulation(int c, int m) { + _global.channel[c].modulation = m; +} +//---------------------------------------------------------------- +// setChannelAttack +//---------------------------------------------------------------- +void DeicsOnze2::setChannelAttack(int c, int a) { + _global.channel[c].attack = a; +} +//---------------------------------------------------------------- +// setChannelRelease +//---------------------------------------------------------------- +void DeicsOnze2::setChannelRelease(int c, int r) { + _global.channel[c].release = r; +} +//---------------------------------------------------------------- +// setChannelReverb +//---------------------------------------------------------------- +void DeicsOnze2::setChannelReverb(int c, int r) { + _global.channel[c].reverbAmount = (float)lowlevel2amp(r); +} +//---------------------------------------------------------------- +// setChannelChorus +//---------------------------------------------------------------- +void DeicsOnze2::setChannelChorus(int c, int val) { + _global.channel[c].chorusAmount = (float)lowlevel2amp(val); +} +//---------------------------------------------------------------- +// setChannelDelay +//---------------------------------------------------------------- +void DeicsOnze2::setChannelDelay(int c, int val) { + _global.channel[c].delayAmount = (float)lowlevel2amp(val); +} + +//---------------------------------------------------------------- +// setChorusReturn +//---------------------------------------------------------------- +void DeicsOnze2::setChorusReturn(int val) { + _global.chorusReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 +} + +//---------------------------------------------------------------- +// setReverbReturn +//---------------------------------------------------------------- +void DeicsOnze2::setReverbReturn(int val) { + _global.reverbReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 +} + +//---------------------------------------------------------------- +// setDelayReturn +//---------------------------------------------------------------- +void DeicsOnze2::setDelayReturn(int val) { + _global.delayReturn = 2.0*(float)level2amp(val); //beware MAXFXRETURN==255 +} + +//---------------------------------------------------------------- +// getNbrVoices +//---------------------------------------------------------------- +int DeicsOnze2::getNbrVoices(int c) const { + return(_global.channel[c].nbrVoices); +} +//---------------------------------------------------------------- +// getMasterVol +//---------------------------------------------------------------- +int DeicsOnze2::getMasterVol(void) const { + return(amp2level(_global.masterVolume)); +} +//---------------------------------------------------------------- +// getFilter +//---------------------------------------------------------------- +bool DeicsOnze2::getFilter(void) const { + return _global.filter; +} +//---------------------------------------------------------------- +// getChannelEnable +//---------------------------------------------------------------- +bool DeicsOnze2::getChannelEnable(int c) const { + return _global.channel[c].isEnable; +} + +//---------------------------------------------------------------- +// getChannelVol +//---------------------------------------------------------------- +int DeicsOnze2::getChannelVol(int c) const { //TODO : to see if correct + //return((int)(MAX(_global.channel[c].ampLeft, _global.channel[c].ampRight) + //*(double)MAXCHANNELVOLUME)); + return(_global.channel[c].volume); +} +//---------------------------------------------------------------- +// getChannelPan +//---------------------------------------------------------------- +int DeicsOnze2::getChannelPan(int c) const { + return(_global.channel[c].pan); +} +//---------------------------------------------------------------- +// setChannelDetune +//---------------------------------------------------------------- +int DeicsOnze2::getChannelDetune(int c) const { + return _global.channel[c].detune; +} +//---------------------------------------------------------------- +// getChannelBrightness +//---------------------------------------------------------------- +int DeicsOnze2::getChannelBrightness(int c) const { + return(_global.channel[c].brightness); +} +//---------------------------------------------------------------- +// getChannelModulation +//---------------------------------------------------------------- +int DeicsOnze2::getChannelModulation(int c) const { + return(_global.channel[c].modulation); +} +//---------------------------------------------------------------- +// getChannelAttack +//---------------------------------------------------------------- +int DeicsOnze2::getChannelAttack(int c) const { + return(_global.channel[c].attack); +} +//---------------------------------------------------------------- +// getChannelRelease +//---------------------------------------------------------------- +int DeicsOnze2::getChannelRelease(int c) const { + return(_global.channel[c].release); +} +//---------------------------------------------------------------- +// getChannelReverb +//---------------------------------------------------------------- +int DeicsOnze2::getChannelReverb(int c) const { + return(amp2lowlevel(_global.channel[c].reverbAmount)); +} +//---------------------------------------------------------------- +// getChannelChorus +//---------------------------------------------------------------- +int DeicsOnze2::getChannelChorus(int c) const { + return(amp2lowlevel(_global.channel[c].chorusAmount)); +} +//---------------------------------------------------------------- +// getChannelDelay +//---------------------------------------------------------------- +int DeicsOnze2::getChannelDelay(int c) const { + return(amp2lowlevel(_global.channel[c].delayAmount)); +} +//---------------------------------------------------------------- +// getChorusReturn +//---------------------------------------------------------------- +int DeicsOnze2::getChorusReturn() const { + return(amp2level(_global.chorusReturn/2.0)); +} +//---------------------------------------------------------------- +// getReverbReturn +//---------------------------------------------------------------- +int DeicsOnze2::getReverbReturn() const { + return(amp2level(_global.reverbReturn/2.0)); +} +//---------------------------------------------------------------- +// getReverbReturn +//---------------------------------------------------------------- +int DeicsOnze2::getDelayReturn() const { + return(amp2level(_global.delayReturn/2.0)); +} + +//---------------------------------------------------------------- +// setLfo +//---------------------------------------------------------------- +void DeicsOnze2::setLfo(int c/*channel*/) +{ + double x; + x=(double)_preset[c]->lfo.speed; + // lfoSpeed to Hz, obtained by fitting the actual curve by a polynomial + _global.channel[c].lfoFreq = + -1.9389e-08*x*x*x*x*x+2.8826e-06*x*x*x*x-9.0316e-05*x*x*x + +4.7453e-03*x*x-1.2295e-02*x+7.0347e-02;//a revoir + //Pitch LFO + _global.channel[c].lfoMaxIndex = + (_global.channel[c].lfoFreq==0?0:(int)((1.0/_global.channel[c].lfoFreq) + *(double)_global.deiSampleRate)); + double totalpDepth = + ((double)_preset[c]->lfo.pModDepth + + (((double)_global.channel[c].modulation)/127.0) + * ((double)(MAXPMODDEPTH - _preset[c]->lfo.pModDepth)) + )/(double)MAXPMODDEPTH; + _global.channel[c].lfoPitch = + totalpDepth * (COEFPLFO(_preset[c]->sensitivity.pitch)); + //Amplitude LFO + double totalaDepth = + ((double)_preset[c]->lfo.aModDepth + + (((double)_global.channel[c].modulation)/127.0) + * ((double)(MAXAMODDEPTH - _preset[c]->lfo.aModDepth)) + )/(double)MAXAMODDEPTH; + _global.channel[c].lfoMaxAmp = + totalaDepth * (COEFALFO(_preset[c]->sensitivity.amplitude)); + //index is concidered on the half of the frequency of the LFO + _global.channel[c].lfoDelayMaxIndex = + delay2Time(_preset[c]->lfo.delay)*_global.channel[c].lfoFreq*2; + _global.channel[c].lfoDelayInct = + (double)(RESOLUTION/4)/_global.channel[c].lfoDelayMaxIndex; + + //update the actuall values controlling the modulation now + if(_global.channel[c].lfoDelayIndex<(double)(RESOLUTION/4)) { + double delayCoef = + (double)waveTable[W2][(int)_global.channel[c].lfoDelayIndex]; + _global.channel[c].lfoMaxCoefInct = + exp((log(2.0)/12.0)*_global.channel[c].lfoPitch*delayCoef); + _global.channel[c].lfoCoefInctInct = + exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch*delayCoef) + /_global.channel[c].lfoMaxIndex)); + _global.channel[c].lfoMaxDAmp = delayCoef*_global.channel[c].lfoMaxAmp; + } + else + if(_global.channel[c].delayPassed) { + _global.channel[c].lfoMaxCoefInct = + exp((log(2.0)/12.0)*_global.channel[c].lfoPitch); + _global.channel[c].lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*_global.channel[c].lfoPitch) + /_global.channel[c].lfoMaxIndex)); + _global.channel[c].lfoMaxDAmp=_global.channel[c].lfoMaxAmp; + } +} + +//----------------------------------------------------------------- +// setOutLevel +//----------------------------------------------------------------- +void DeicsOnze2::setOutLevel(int c, int k) { + for(int v=0; v<_global.channel[c].nbrVoices; v++) { + if(_global.channel[c].voices[v].op[k].envState!=OFF) { + _global.channel[c].voices[v].op[k].amp = + outLevel2Amp(_preset[c]->outLevel[k]) + * _global.channel[c].voices[v].op[k].ampVeloNote + * brightness2Amp(c, k); + } + } +} +void DeicsOnze2::setOutLevel(int c) { + for(int k=0; keg[k].ar==0?0: + (double)(RESOLUTION/4)/(envAR2s(_preset[c]->eg[k].ar) + *_global.deiSampleRate)) + *coefAttack(_global.channel[c].attack); +} +void DeicsOnze2::setEnvAttack(int c, int k) { + for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvAttack(c, v, k); +} +void DeicsOnze2::setEnvAttack(int c) { + for(int k=0; keg[k].rr, _global.deiSampleRate, + _global.channel[c].release); +} +void DeicsOnze2::setEnvRelease(int c, int k) { + for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvRelease(c, v, k); +} +void DeicsOnze2::setEnvRelease(int c) { + for(int k=0; kpitchEg)) { + if(_global.channel[c].voices[v].pitchEnvCoefInct + > _global.channel[c].voices[v].pitchEnvCoefInctPhase1) { + _global.channel[c].voices[v].pitchEnvCoefInctInct = + getPitchEnvCoefInctInct(1, 0, _preset[c]->pitchEg.pr3, + _global.deiSampleRate); + _global.channel[c].voices[v].pitchEnvState = RELEASE_PE; + } + else if(_global.channel[c].voices[v].pitchEnvCoefInct + < _global.channel[c].voices[v].pitchEnvCoefInctPhase1) { + _global.channel[c].voices[v].pitchEnvCoefInctInct = + getPitchEnvCoefInctInct(0, 1, _preset[c]->pitchEg.pr3, + _global.deiSampleRate); + _global.channel[c].voices[v].pitchEnvState = RELEASE_PE; + } + else { + _global.channel[c].voices[v].pitchEnvCoefInctInct = 1.0; + _global.channel[c].voices[v].pitchEnvState = OFF_PE; + } + } +} + +//----------------------------------------------------------------- +// setQuality +//----------------------------------------------------------------- +void DeicsOnze2::setQuality(Quality q) { + _global.quality = q; + switch(q) { + case high : + _global.qualityCounterTop = 1; + break; + case middle : + _global.qualityCounterTop = 2; + break; + case low : + _global.qualityCounterTop = 4; + break; + case ultralow : + _global.qualityCounterTop = 6; + break; + default : printf("Error switch setQuality : out of value\n"); + break; + } + //calculate _global.deiSampleRate + _global.deiSampleRate = (double)sampleRate() + / (double)_global.qualityCounterTop; + _global.qualityCounter = 0; + //update lfo to consider the new samplerate + for(int c = 0; c < 16; c++) if(_global.channel[c].isEnable) setLfo(c); + //update the cutoffs of the filters + _dryFilter->setCutoff(_global.deiSampleRate/4.0); + _reverbFilter->setCutoff(_global.deiSampleRate/4.0); + _chorusFilter->setCutoff(_global.deiSampleRate/4.0); + _delayFilter->setCutoff(_global.deiSampleRate/4.0); +} + +//----------------------------------------------------------------- +// setFilter +//----------------------------------------------------------------- +void DeicsOnze2::setFilter(bool f) { + _global.filter = f; +} +//----------------------------------------------------------------- +// brightness2Amp +//----------------------------------------------------------------- +double DeicsOnze2::brightness2Amp(int c, int k) { + if( + (k==1 && (_preset[c]->algorithm!=SIXTH || _preset[c]->algorithm!=SEVENTH + || _preset[c]->algorithm!=EIGHTH)) + || + (k==2 && (_preset[c]->algorithm==FIRST || _preset[c]->algorithm==SECOND + || _preset[c]->algorithm==THIRD || _preset[c]->algorithm==FOURTH)) + || + (k==3 && (_preset[c]->algorithm!=EIGHTH)) + ) { + double x = 2.0*(double)_global.channel[c].brightness + / (double)MAXFINEBRIGHTNESS; + double square_x = x*x; + return(square_x*x); + } + else return(1.0); +} +//----------------------------------------------------------------- +// setFeedback +//----------------------------------------------------------------- +void DeicsOnze2::setFeedback(int c) { + _global.channel[c].feedbackAmp = + COEFFEEDBACK*exp(log(2)*(double)(_preset[c]->feedback-MAXFEEDBACK)); +} + +//----------------------------------------------------------------- +// setPreset +//----------------------------------------------------------------- + +void DeicsOnze2::setPreset(int c) { + setFeedback(c); + setLfo(c); + setEnvAttack(c); + setEnvRelease(c); + setOutLevel(c); +} + + +inline double coarseFine2Ratio(int c,int f) { + double tab[64][16]= + { + {0.50,0.56,0.62,0.68,0.75,0.81,0.87,0.93,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, + {0.71,0.79,0.88,0.96,1.05,1.14,1.23,1.32,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, + {0.78,0.88,0.98,1.07,1.17,1.27,1.37,1.47,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, + {0.87,0.97,1.08,1.18,1.29,1.40,1.51,1.62,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, + {1.00,1.06,1.12,1.18,1.25,1.31,1.37,1.43,1.50,1.56,1.62,1.68,1.75,1.81,1.87,1.93}, + {1.41,1.49,1.58,1.67,1.76,1.85,1.93,2.02,2.11,2.20,2.29,2.37,2.46,2.55,2.64,2.73}, + {1.57,1.66,1.76,1.86,1.96,2.06,2.15,2.25,2.35,2.45,2.55,2.64,2.74,2.84,2.94,3.04}, + {1.73,1.83,1.94,2.05,2.16,2.27,2.37,2.48,2.59,2.70,2.81,2.91,3.02,3.13,3.24,3.35}, + {2.00,2.06,2.12,2.18,2.25,2.31,2.37,2.43,2.50,2.56,2.62,2.68,2.75,2.81,2.87,2.93}, + {2.82,2.90,2.99,3.08,3.17,3.26,3.34,3.43,3.52,3.61,3.70,3.78,3.87,3.96,4.05,3.14}, + {3.00,3.06,3.12,3.18,3.25,3.31,3.37,3.43,3.50,3.56,3.62,3.68,3.75,3.81,3.87,3.93} , + {3.14,3.23,3.33,3.43,3.53,3.63,3.72,3.82,3.92,4.02,4.12,4.21,4.31,4.41,4.51,4.61}, + {3.46,3.56,3.67,3.78,3.89,4.00,4.10,4.21,4.32,4.43,4.54,4.64,4.75,4.86,4.97,5.08}, + {4.00,4.06,4.12,4.18,4.25,4.31,4.37,4.43,4.50,4.56,4.62,4.68,4.75,4.81,4.87,4.93}, + {4.24,4.31,4.40,4.49,4.58,4.67,4.75,4.84,4.93,5.02,5.11,5.19,5.28,5.37,5.46,5.55}, + {4.71,4.80,4.90,5.00,5.10,5.20,5.29,5.39,5.49,5.59,5.69,5.78,5.88,5.98,6.08,6.18}, + {5.00,5.06,5.12,5.18,5.25,5.31,5.37,5.43,5.50,5.56,5.62,5.68,5.75,5.81,5.87,5.93}, + {5.19,5.29,5.40,5.51,5.62,5.73,5.83,5.94,6.05,6.16,6.27,6.37,6.48,6.59,6.70,6.81}, + {5.65,5.72,5.81,5.90,5.99,6.08,6.16,6.25,6.34,6.43,6.52,6.60,6.69,6.78,6.87,6.96}, + {6.00,6.06,6.12,6.18,6.25,6.31,6.37,6.43,6.50,6.56,6.62,6.68,6.75,6.81,6.87,6.93}, + {6.28,6.37,6.47,6.57,6.67,6.77,6.86,6.96,7.06,7.16,7.26,7.35,7.45,7.55,7.65,7.75}, + {6.92,7.02,7.13,7.24,7.35,7.46,7.56,7.67,7.78,7.89,8.00,8.10,8.21,8.32,8.43,8.54}, + {7.00,7.06,7.12,7.18,7.25,7.31,7.37,7.43,7.50,7.56,7.62,7.68,7.75,7.81,7.87,7.93}, + {7.07,7.13,7.22,7.31,7.40,7.49,7.57,7.66,7.75,7.84,7.93,8.01,8.10,8.19,8.28,8.37}, + {7.85,7.94,8.04,8.14,8.24,8.34,8.43,8.53,8.63,8.73,8.83,8.92,9.02,9.12,9.22,9.32}, + {8.00,8.06,8.12,8.18,8.25,8.31,8.37,8.43,8.50,8.56,8.62,8.68,8.75,8.81,8.87,8.93}, + {8.48,8.54,8.63,8.72,8.81,8.90,8.98,9.07,9.16,9.25,9.34,9.42,9.51,9.60,9.69,9.78}, + {8.65,8.75,8.86,8.97,9.08,9.19,9.29,9.40,9.51,9.62,9.73,9.83,9.94,10.05,10.16,10.27}, + {9.00,9.06,9.12,9.18,9.25,9.31,9.37,9.43,9.50,9.56,9.62,9.68,9.75,9.81,9.87,9.93}, + {9.42,9.51,9.61,9.71,9.81,9.91,10.00,10.10,10.20,10.30,10.40,10.49,10.59,10.69,10.79,10.89}, + {9.89,9.95,10.04,10.13,10.22,10.31,10.39,10.48,10.57,10.66,10.75,10.83,10.92,11.01,11.10,11.19}, + {10.00,10.06,10.12,10.18,10.25,10.31,10.37,10.43,10.50,10.56,10.62,10.68,10.75,10.81,10.87,10.93}, + {10.38,10.48,10.59,10.70,10.81,10.92,11.02,11.13,11.24,11.35,11.46,11.56,11.67,11.78,11.89,12.00}, + {10.99,11.08,11.18,11.28,11.38,11.48,11.57,11.67,11.77,11.87,11.97,12.06,12.16,12.26,12.36,12.46}, + {11.00,11.06,11.12,11.18,11.25,11.31,11.37,11.43,11.50,11.56,11.62,11.68,11.75,11.81,11.87,11.93}, + {11.30,11.36,11.45,11.54,11.63,11.72,11.80,11.89,11.98,12.07,12.16,12.24,12.33,12.42,12.51,12.60}, + {12.00,12.06,12.12,12.18,12.25,12.31,12.37,12.43,12.50,12.56,12.62,12.68,12.75,12.81,12.87,12.93}, + {12.11,12.21,12.32,12.43,12.54,12.65,12.75,12.86,12.97,13.08,13.19,13.29,13.40,13.51,13.62,13.73}, + {12.56,12.65,12.75,12.85,12.95,13.05,13.14,13.24,13.34,13.44,13.54,13.63,13.73,13.83,13.93,14.03}, + {12.72,12.77,12.86,12.95,13.04,13.13,13.21,13.30,13.39,13.48,13.57,13.65,13.74,13.83,13.92,14.01}, + {13.00,13.06,13.12,13.18,13.25,13.31,13.37,13.43,13.50,13.56,13.62,13.68,13.75,13.81,13.87,13.93}, + {13.84,13.94,14.05,14.16,14.27,14.38,14.48,14.59,14.70,14.81,14.92,15.02,15.13,15.24,15.35,15.46}, + {14.00,14.06,14.12,14.18,14.25,14.31,14.37,14.43,14.50,14.56,14.62,14.68,14.75,14.81,14.87,14.93}, + {14.10,14.18,14.27,14.36,14.45,14.54,14.62,14.71,14.80,14.89,14.98,15.06,15.15,15.24,15.33,15.42}, + {14.13,14.22,14.32,14.42,14.52,14.62,14.71,14.81,14.91,15.01,15.11,15.20,15.30,15.40,15.50,15.60}, + {15.00,15.06,15.12,15.18,15.25,15.31,15.37,15.43,15.50,15.56,15.62,15.68,15.75,15.81,15.87,15.93}, + {15.55,15.59,15.68,15.77,15.86,15.95,16.03,16.12,16.21,16.30,16.39,16.47,16.56,16.65,16.74,16.83}, + {15.57,15.67,15.78,15.89,16.00,16.11,16.21,16.32,16.43,16.54,16.65,16.75,16.86,16.97,17.08,17.19}, + {15.70,15.79,15.89,15.99,16.09,16.19,16.28,16.38,16.48,16.58,16.68,16.77,16.87,16.97,17.07,17.17}, + {16.96,17.00,17.09,17.18,17.27,17.36,17.44,17.53,17.62,17.71,17.80,17.88,17.97,18.06,18.15,18.24}, + {17.27,17.36,17.46,17.56,17.66,17.76,17.85,17.95,18.05,18.15,18.25,18.34,18.44,18.54,18.64,18.74}, + {17.30,17.40,17.51,17.62,17.73,17.84,17.94,18.05,18.16,18.27,18.38,18.48,18.59,18.70,18.81,18.92}, + {18.37,18.41,18.50,18.59,18.68,18.77,18.85,18.94,19.03,19.12,19.21,19.29,19.38,19.47,19.56,19.65}, + {18.84,18.93,19.03,19.13,19.23,19.33,19.42,19.52,19.62,19.72,19.82,19.91,20.01,20.11,20.21,20.31}, + {19.03,19.13,19.24,19.35,19.46,19.57,19.67,19.78,19.89,20.00,20.11,20.21,20.32,20.43,20.54,20.65}, + {19.78,19.82,19.91,20.00,20.09,20.18,20.26,20.35,20.44,20.53,20.62,20.70,20.79,20.88,20.97,21.06}, + {20.41,20.50,20.60,20.70,20.80,20.90,20.99,21.09,21.19,21.29,21.39,21.48,21.58,21.68,21.78,21.88}, + {20.76,20.86,20.97,21.08,21.19,21.30,21.40,21.51,21.62,21.73,21.84,21.94,22.05,22.16,22.27,22.38}, + {21.20,21.23,21.32,21.41,21.50,21.59,21.67,21.76,21.85,21.94,22.03,22.11,22.20,22.29,22.38,22.47}, + {21.98,22.07,22.17,22.17,22.37,22.47,22.56,22.66,22.76,22.86,22.96,23.05,23.15,23.25,23.35,23.45}, + {22.49,22.59,22.70,22.81,22.92,23.03,23.13,13.24,13.35,13.46,13.57,13.67,13.78,13.89,24.00,24.11}, + {23.55,23.64,23.74,23.84,23.94,24.04,24.13,24.23,24.33,24.43,24.53,24.62,24.72,24.82,24.92,25.02}, + {24.22,24.32,24.43,24.54,24.65,24.76,24.86,24.97,25.08,25.19,25.30,25.40,25.51,25.62,25.73,25.84}, + {25.95,26.05,26.16,26.27,26.38,26.49,26.59,26.70,26.81,26.92,27.03,27.13,27.24,27.35,27.46,27.57} + }; + return(tab[c][f]); +} + +//--------------------------------------------------------------- +// loadSet +//--------------------------------------------------------------- +void DeicsOnze2::loadSet(QString fileName) { + // read the XML file and create DOM tree + if(!fileName.isEmpty()) { + QFile deicsonzeFile(fileName); + if(!deicsonzeFile.open(QIODevice::ReadOnly)) { + printf("Critical Error Cannot open file %s\n", + fileName.toAscii().data()); + return; + } + QDomDocument domTree; + if (!domTree.setContent(&deicsonzeFile )) { + printf("Critical Error Parsing error for file %s\n", + fileName.toAscii().data()); + deicsonzeFile.close(); + return; + } + deicsonzeFile.close(); + + QDomNode node = domTree.documentElement(); + while (!node.isNull()) { + QDomElement e = node.toElement(); + if (e.isNull()) + continue; + if (e.tagName() == "deicsOnzeSet") { + QString version = e.attribute(QString("version")); + if (version == "1.0") { + for(int c = 0; c_categoryVector.empty()) + delete(*_set->_categoryVector.begin()); + _set->readSet(node.firstChild()); + //display load preset + unsigned char dataUpdateGuiSet[1]; + dataUpdateGuiSet[0]=SYSEX_UPDATESETGUI; + MidiPlayEvent evSysexUpdateGuiSet(0, ME_SYSEX, + (const unsigned char*)dataUpdateGuiSet, + 1); + _gui->writeEvent(evSysexUpdateGuiSet); + } + else printf("unsupported *.dei file version %s\n", + version.toLatin1().data()); + } + else printf("DeicsOnze2: %s not supported\n", + e.tagName().toLatin1().data()); + node = node.nextSibling(); + } + } +} +//--------------------------------------------------------------- +// loadSutulaPreset +//--------------------------------------------------------------- + +void DeicsOnze2::loadSutulaPresets() +{ + FILE* file; + int v; + int crs[NBROP], fin[NBROP]; //coarse ratio, fine ratio + char s[500]; + char sname[LENGTHNAME+1]; + char scategory[LENGTHCATEGORY+1]; + char ssubcategory[LENGTHSUBCATEGORY+1]; + int k; + int nhBank, nlBank, nPreset; + Preset* presetTemp; + Subcategory* subcategoryTemp = NULL; + Category* categoryTemp = NULL; + + if(!_set) _set=new Set("Sutula Bank"); + + nhBank=0; + nlBank=0; + nPreset=0; + + //QString presetPath(INSTPREFIX); + //presetPath += "/share/" PACKAGEVERSION "/presets/deicsonze2/ARCH_ALIN"; + + QString presetPath("/home/a-lin/sources/svnMusEDev/lmuse/muse/synti/deicsonze2/ARCH_ALIN"); + + file = fopen (presetPath.toLatin1().data(), "rt"); + if (file == NULL) { + printf("can't open "); + printf(presetPath.toLatin1().data()); + printf("\n"); + } + else + { + while(fgets(s, 500, file) && !strstr(s, "** Source:")) + { + if (strstr(s,"* CATEGORY")) + { + sscanf(s, "* CATEGORY %s", scategory); + categoryTemp=new Category(_set, scategory,0); + } + if (strstr(s,"* SUBCATEGORY")) + { + sscanf(s, "* SUBCATEGORY %s", ssubcategory); + subcategoryTemp=new Subcategory(categoryTemp,ssubcategory,0); + nlBank++; + } + } + while(!feof(file)) + { + + presetTemp=new Preset(subcategoryTemp); + // Fill the preset + //OP.4 to OP.1 + for(int kaka=(NBROP-1); kaka>=0; kaka--) + { + k=(kaka==2?1:(kaka==1?2:kaka)); + + fscanf(file, "%x", &v);//0 + presetTemp->eg[k].ar=v; + fscanf(file, "%x", &v);//1 + presetTemp->eg[k].d1r=v; + fscanf(file, "%x", &v);//2 + presetTemp->eg[k].d2r=v; + fscanf(file, "%x", &v);//3 + presetTemp->eg[k].rr=v; + fscanf(file, "%x", &v);//4 + presetTemp->eg[k].d1l=v; + fscanf(file, "%x", &v);//5 + presetTemp->scaling.level[k]=v; + fscanf(file, "%x", &v);//6 + presetTemp->sensitivity.keyVelocity[k]= + v & 0x7; + presetTemp->sensitivity.egBias[k]= + (v & 0x38)>>3; + presetTemp->sensitivity.ampOn[k]= + (v & 0x40)>>6; + fscanf(file, "%x", &v);//7 + presetTemp->outLevel[k]=v; + fscanf(file, "%x", &v);//8 + crs[k]=v; + fscanf(file, "%x", &v);//9 + presetTemp->detune[k]=(v & 0x7)-3; + presetTemp->scaling.rate[k]=(v & 0x18)>>3; + } + fscanf(file, "%x", &v);//40 + presetTemp->algorithm= + ((v & 0x7)==0?FIRST: + ((v & 0x7)==1?SECOND: + ((v & 0x7)==2?THIRD: + ((v & 0x7)==3?FOURTH: + ((v & 0x7)==4?FIFTH: + ((v & 0x7)==5?SIXTH: + ((v & 0x7)==6?SEVENTH:EIGHTH))))))); + presetTemp->feedback=(v & 0x38)>>3; + presetTemp->lfo.sync=(v & 0x40)>>6; + fscanf(file, "%x", &v);//41 + presetTemp->lfo.speed=v; + fscanf(file, "%x", &v);//42 + presetTemp->lfo.delay=v; + fscanf(file, "%x", &v);//43 + presetTemp->lfo.pModDepth=v; + fscanf(file, "%x", &v);//44 + presetTemp->lfo.aModDepth=v; + fscanf(file, "%x", &v);//45 + presetTemp->lfo.wave= + ((v & 0x3)==0?SAWUP: + ((v & 0x3)==1?SQUARE: + ((v & 0x3)==2?TRIANGL:SHOLD))); + presetTemp->sensitivity.amplitude=(v & 0xc)>>2; + presetTemp->sensitivity.pitch=(v & 0x70)>>4; + fscanf(file, "%x", &v);//46 + presetTemp->function.transpose=v-24; + fscanf(file, "%x", &v);//47 + presetTemp->function.pBendRange=v; + fscanf(file, "%x", &v);//48 + presetTemp->function.portamento= + ((v & 0x1)==0?FULL:FINGER); + presetTemp->function.footSw= + ((v & 0x4)==0?SUS:POR); + presetTemp->function.mode= + ((v & 0x8)==0?POLY:MONO); + fscanf(file, "%x", &v);//49 + presetTemp->function.portamentoTime=v; + fscanf(file, "%x", &v);//50 + presetTemp->function.fcVolume=v; + fscanf(file, "%x", &v);//51 + presetTemp->function.mwPitch=v; + fscanf(file, "%x", &v);//52 + presetTemp->function.mwAmplitude=v; + fscanf(file, "%x", &v);//53 + presetTemp->function.bcPitch=v; + fscanf(file, "%x", &v);//54 + presetTemp->function.bcAmplitude=v; + fscanf(file, "%x", &v);//55 + presetTemp->function.bcPitchBias=v; + fscanf(file, "%x", &v);//56 + presetTemp->function.bcEgBias=v; + for(int l=0; l<10; l++) + { + fscanf(file, "%x", &v);//57 to 66 + sname[l]=(char)v; + } + sname[10]='\0'; + presetTemp->name=sname; + fscanf(file, "%x", &v);//67 + presetTemp->pitchEg.pr1=v; + fscanf(file, "%x", &v);//68 + presetTemp->pitchEg.pr2=v; + fscanf(file, "%x", &v);//69 + presetTemp->pitchEg.pr3=v; + fscanf(file, "%x", &v);//70 + presetTemp->pitchEg.pl1=v; + fscanf(file, "%x", &v);//71 + presetTemp->pitchEg.pl1=v; + fscanf(file, "%x", &v);//72 + presetTemp->pitchEg.pl1=v; + for(int kaka=(NBROP-1); kaka>=0; kaka--) + { + k=(kaka==2?1:(kaka==1?2:kaka)); + + fscanf(file, "%x", &v);//73, 75, 77, 79 + presetTemp->frequency[k].isFix=(v & 0x8)>>3; + presetTemp->frequency[k].freq=((v & 0x7)==0?8:(v & 0x7)*16); + presetTemp->eg[k].egShift= + (((v & 0x30)>>4)==0?VOF: + (((v & 0x30)>>4)==1?V48: + (((v & 0x30)>>4)==2?V24:V12))); + fscanf(file, "%x", &v);//74, 76, 78, 80 + fin[k]=v & 0xF; + presetTemp->frequency[k].freq+=fin[k]; + presetTemp->frequency[k].ratio= + coarseFine2Ratio(crs[k],fin[k]); + presetTemp->oscWave[k]= + (((v & 0x70)>>4)==0?W1: + (((v & 0x70)>>4)==1?W2: + (((v & 0x70)>>4)==2?W3: + (((v & 0x70)>>4)==3?W4: + (((v & 0x70)>>4)==4?W5: + (((v & 0x70)>>4)==5?W6: + (((v & 0x70)>>4)==6?W7:W8))))))); + } + fscanf(file, "%x", &v);//81 + presetTemp->function.reverbRate=v; + fscanf(file, "%x", &v);//82 + presetTemp->function.fcPitch=v; + fscanf(file, "%x", &v);//83 + presetTemp->function.fcAmplitude=v; + //presetTemp->globalDetune=0; + presetTemp->prog=nPreset; + // End of filling the preset + + nPreset++; + while(fgets(s, 500, file) && !strstr(s, "** Source:")) + { + if (strstr(s,"* CATEGORY")) + { + sscanf(s, "* CATEGORY %s", scategory); + nhBank++; + categoryTemp=new Category(_set,scategory,nhBank); + nlBank=0; + } + if (strstr(s,"* SUBCATEGORY")) + { + sscanf(s, "* SUBCATEGORY %s", ssubcategory); + subcategoryTemp=new + Subcategory(categoryTemp,ssubcategory,nlBank); + nlBank++; + nPreset=0; + } + } + } + } + fclose(file); +} + +//--------------------------------------------------------- +// minVolu2Voice +// return the number of the voice which is the least aloud +// and is not is the ATTACK state +//--------------------------------------------------------- +int DeicsOnze2::minVolu2Voice(int c) { + int minVoice=0; + double min=MAXVOLUME; + for(int i=0; i<_global.channel[c].nbrVoices; i++) + { + min=((min>_global.channel[c].voices[i].volume + && _global.channel[c].voices[i].op[0].envState!=ATTACK + && _global.channel[c].voices[i].op[1].envState!=ATTACK + && _global.channel[c].voices[i].op[2].envState!=ATTACK + && _global.channel[c].voices[i].op[3].envState!=ATTACK)? + _global.channel[c].voices[i].volume:min); + minVoice=(min==_global.channel[c].voices[i].volume?i:minVoice); + } + return minVoice; +} + +//--------------------------------------------------------- +// noteOff2Voice +// return the number of one off voice, MAXNBRVOICES otherwise +//--------------------------------------------------------- +int DeicsOnze2::noteOff2Voice(int c) { + int offVoice=MAXNBRVOICES; + for(int i=0; i<_global.channel[c].nbrVoices; i++) + offVoice = (_global.channel[c].voices[i].isOn + || _global.channel[c].voices[i].keyOn? + offVoice:i); + return offVoice; +} + +//--------------------------------------------------------- +// pitchOn2Voice +// return the number of the voice which has the input +// pitch and is keyOn +//--------------------------------------------------------- +int DeicsOnze2::pitchOn2Voice(int c, int pitch) { + int pitchVoice=MAXNBRVOICES; + for(int i=0; i<_global.channel[c].nbrVoices; i++) { + if(_global.channel[c].voices[i].pitch== + pitch && _global.channel[c].voices[i].keyOn + && !_global.channel[c].voices[i].isSustained) { + pitchVoice = i; + return pitchVoice; + } + } + return pitchVoice; +} + +//--------------------------------------------------------- +// getAttractor +//--------------------------------------------------------- +inline double getAttractor(int portamentoTime, double sr) { + /* some explanations + + c(48000) = c > 1 + + f_sr(0) = 1000, f_sr(t) = 2000 + + f_sr*2(0) = 1000, f_sr*2(t*2) = 2000 + + f_sr(t) = exp(t*ln(c(sr))) * 1000 + + 2000 = exp(t*ln(c(48000))) * 1000 + + 2000 = exp(t*2*ln(c(48000*2))) * 1000 + + t*ln(c(48000)) = t*2*ln(c(48000*2)) + + c(48000*m) = exp(ln(c)/m) + + sr = 48000*m + */ + double c; + c = 1.0 + COEFPORTA/(double)(portamentoTime*portamentoTime); + return(exp(log(c)*48000.0/sr)); +} + +//--------------------------------------------------------- +// pitch2freq +//--------------------------------------------------------- +inline double pitch2freq(double p) { + return(LOWERNOTEFREQ*exp(p*log(2.0)/12.0)); +} + +//--------------------------------------------------------- +// lfoUpdate +// update the coefficent which multiplies the current inct +// in order to +// get the right current frequency with respect to the lfo +// update the coefficent which multiplies the amplitude. +//--------------------------------------------------------- +inline void lfoUpdate(Preset* p, Channel* p_c, float* wt) { + double delayCoef; + + //Manage LFO delay + if(!p_c->delayPassed) { + if(p_c->lfoIndex==0 || p_c->lfoIndex==p_c->lfoMaxIndex/2) { + if(p_c->lfoDelayIndex<(double)(RESOLUTION/4)) { + delayCoef=(double)wt[(int)p_c->lfoDelayIndex]; + p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch*delayCoef); + p_c->lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*p_c->lfoPitch*delayCoef)/p_c->lfoMaxIndex)); + p_c->lfoDelayIndex+=p_c->lfoDelayInct; + p_c->lfoMaxDAmp=delayCoef*p_c->lfoMaxAmp; + } + else { + p_c->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_c->lfoPitch); + p_c->lfoCoefInctInct= + exp((log(2.0)/12.0)*((2*p_c->lfoPitch)/p_c->lfoMaxIndex)); + p_c->delayPassed=true; + p_c->lfoMaxDAmp=p_c->lfoMaxAmp; + } + } + } + switch(p->lfo.wave) { + case SAWUP : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=1.0/(p_c->lfoMaxCoefInct); + p_c->lfoCoefAmp=p_c->lfoMaxDAmp/(double)p_c->lfoMaxIndex; + p_c->lfoAmp=1.0; + } + else { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + break; + case SQUARE : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0; + } + if(p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { + p_c->lfoCoefInct=1.0/p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0-p_c->lfoMaxDAmp; + } + break; + case TRIANGL : + if(p_c->lfoIndex==0) { + p_c->lfoCoefInct=1.0; + p_c->lfoCoefAmp=p_c->lfoMaxDAmp + /(double)(p_c->lfoMaxIndex/2); + p_c->lfoAmp=1.0-p_c->lfoMaxDAmp/2.0; + } + else if(p_c->lfoIndex<(p_c->lfoMaxIndex/4)) { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + else if(p_c->lfoIndex<((3*p_c->lfoMaxIndex)/4)) { + p_c->lfoCoefInct/=p_c->lfoCoefInctInct; + p_c->lfoAmp+=p_c->lfoCoefAmp; + } + else if(p_c->lfoIndexlfoMaxIndex) { + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; + } + break; + case SHOLD : + if(p_c->lfoIndex==0||p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { + double r;//uniform random between -1.0 and 1.0 + r = (double)(2*rand()-RAND_MAX)/(double)RAND_MAX; + p_c->lfoCoefInct=(r>=0.0?1.0+r*(p_c->lfoMaxCoefInct-1.0) + :1.0/(1.0-r*(p_c->lfoMaxCoefInct-1.0))); + p_c->lfoAmp=1.0-(r/2.0+0.5)*p_c->lfoMaxDAmp; + } + break; + default : printf("Error : lfo wave does not exist\n"); + break; + } + p_c->lfoIndex=(p_c->lfoIndexlfoMaxIndex?p_c->lfoIndex+1:0); +} + +//--------------------------------------------------------- +// portamento update +//--------------------------------------------------------- +inline void portamentoUpdate(Channel* p_c, Voice* p_v) { + double inctTemp; + bool allTargetReached; + if(p_v->hasAttractor) { + allTargetReached = true; + for(int k = 0; kop[k].inct < p_v->op[k].targetInct) { + inctTemp = p_v->op[k].inct * p_v->attractor; + if(inctTemp < p_v->op[k].targetInct) { + allTargetReached = false; + p_v->op[k].inct = inctTemp; + } + else p_v->op[k].inct = p_v->op[k].targetInct; + } + else if(p_v->op[k].inct > p_v->op[k].targetInct) { + inctTemp = p_v->op[k].inct / p_v->attractor; + if(inctTemp > p_v->op[k].targetInct) { + allTargetReached = false; + p_v->op[k].inct = inctTemp; + } + else p_v->op[k].inct = p_v->op[k].targetInct; + } + p_c->lastInc[k] = p_v->op[k].inct; + } + if(allTargetReached) p_v->hasAttractor = false; + } +} + + +//--------------------------------------------------------- +// pitchEnvelopeUpdate +//--------------------------------------------------------- +inline void pitchEnvelopeUpdate(Voice* v, PitchEg* pe, double sr) { + if(v->pitchEnvState != OFF_PE) { + switch(v->pitchEnvState) { + case PHASE1 : + if( //change to phase2 + (v->pitchEnvCoefInctInct == 1.0) + || (v->pitchEnvCoefInctInct > 1.0 && + v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase2) + || (v->pitchEnvCoefInctInct < 1.0 && + v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase2) + ) { + v->pitchEnvState = PHASE2; + v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl2); + v->pitchEnvCoefInctInct = + getPitchEnvCoefInctInct(pe->pl2, pe->pl3, pe->pr2, sr); + } + else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; + break; + case PHASE2 : + if( //change to off (temporarely) + (v->pitchEnvCoefInctInct == 1.0) + || (v->pitchEnvCoefInctInct > 1.0 && + v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase3) + || (v->pitchEnvCoefInctInct < 1.0 && + v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase3) + ) { + v->pitchEnvState = OFF_PE; + v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl3); + v->pitchEnvCoefInctInct = 1.0; + } + else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; + break; + case RELEASE_PE : + if( //change to release2 + (v->pitchEnvCoefInctInct == 1.0) + || (v->pitchEnvCoefInctInct > 1.0 && + v->pitchEnvCoefInct > v->pitchEnvCoefInctPhase1) + || (v->pitchEnvCoefInctInct < 1.0 && + v->pitchEnvCoefInct < v->pitchEnvCoefInctPhase1) + ) { + v->pitchEnvState = OFF_PE; + v->pitchEnvCoefInct = getPitchEnvCoefInct(pe->pl1); + v->pitchEnvCoefInctInct = 1.0; + } + else v->pitchEnvCoefInct *= v->pitchEnvCoefInctInct; + break; + case OFF_PE : + //do nothing, should not appear anyway + break; + default : + printf("Error switch pitchEnvelopeUpdate, no such case\n"); + break; + } + } +} + +//--------------------------------------------------------- +// outLevel2Amp, Amp for amplitude //between 0.0 and 2.0 or more +// 100->2.0, 90->1.0, 80->0.5 ... +//--------------------------------------------------------- +inline double outLevel2Amp(int ol) { + double a; + double b; + a = log(2)/10.0; + b = -a*DB0LEVEL; + return exp(a*(double)ol+b); +} + +//--------------------------------------------------------- +// lowlevel2amp, +// 127->0dB->1.0, 0->-25dB->0 +//--------------------------------------------------------- +inline double lowlevel2amp(int l) { + double a, b, c, db; + if(l==0) return 0.0; + else { + a = DB_MIN/127.0; + b = -DB_MIN; + db = a*l+b; + c = -log(2)/3; + return exp(-c*db); + } +} + +//--------------------------------------------------------- +// level2amp, +// 255->0dB->1.0, 0->-25dB->0 +//--------------------------------------------------------- +inline double level2amp(int l) { + double a, b, c, db; + if(l==0) return 0.0; + else { + a = DB_MIN/255.0; + b = -DB_MIN; + db = a*l+b; + c = -log(2.0)/3.0; + return exp(-c*db); + } +} + +//--------------------------------------------------------- +// amp2level +// 1.0->0dB->255, 0->-25dB->0 +//--------------------------------------------------------- +inline int amp2level(double amp){ + double a, b, c; + a = 255.0/DB_MIN; + b = 255.0; + c = log(2.0)/3.0; + return (int)(a*(log(amp)/c)+b); +} + +//--------------------------------------------------------- +// amp2lowlevel +// 1.0->0dB->127, 0->-25dB->0 +//--------------------------------------------------------- +inline int amp2lowlevel(double amp){ + double a, b, c; + a = 127.0/DB_MIN; + b = 127.0; + c = log(2.0)/3.0; + return (int)(a*(log(amp)/c)+b); +} + +//--------------------------------------------------------- +// velo2RAmp, AmpR between 0.0 and 1.0 +// return an amplitude ratio with respect to _preset->sensitivity.keyVelocity +//--------------------------------------------------------- +inline double velo2AmpR(int velo, int kvs) { + double lev; + lev = exp(-log(2)*kvs); + return (lev+(1.0-lev)*((double)velo/(double)MAXVELO)); +} + +//--------------------------------------------------------- +// envAR2s +// return the time in second of the ATTACK duration +//--------------------------------------------------------- +inline double envAR2s(int ar) { + //determined using the fitting feature of gnuplot + return 10.4423*exp(-0.353767*ar); +} + +//--------------------------------------------------------- +// envD1R2coef +// return the coefficient for the exponential decrease +// with respect to d1r and sampleRate, sr +//--------------------------------------------------------- +inline double envD1R2coef(int d1r, double sr) { + double dt;//such that amp(t+dt)=amp(t)/2 + double alpha;//such that amp(t)=exp(alpha*t) + + if(d1r==0) return 1.0; + else + { + //dt has been determined with the fitting function of gnuplot + dt=9.80715*exp(-0.356053*(double)d1r); + + //amp(0)=1 + //amp(t+dt)=amp(t)/2 + //amp(t)=exp(alpha*t) + //amp(t+mt) + //following the above equational system we found : + alpha=-log(2)/dt; + return exp(alpha/sr); + } +} + +//--------------------------------------------------------- +// coefRelease +// convert the release value to a coef for coefVLevel +//--------------------------------------------------------- +inline double coefRelease(unsigned char release) { + double x = COEFGRELEASE*(double)release/(double)MIDRELEASE+1.0-COEFGRELEASE; + double square_x = x*x; + return(1.0/(square_x*x)); +} + +//--------------------------------------------------------- +// envRR2coef +// return the coefficient for the exponential decrease +// with respect to rr and sampleRate, sr +//--------------------------------------------------------- +inline double envRR2coef(int rr, double sr, unsigned char release) { + double dt;//such that amp(t+dt)=amp(t)/2 + double alpha;//such that amp(t)=exp(alpha*t) + + //dt has been determined with the fitting function of gnuplot + dt=7.06636*exp(-0.697606*(double)rr); + + dt*=coefRelease(release); + //printf("demi life = %e\n", dt); + //amp(0)=1 + //amp(t+dt)=amp(t)/2 + //amp(t)=exp(alpha*t) + //amp(t+mt) + //following the above equational system we found : + alpha=-log(2)/dt; + return exp(alpha/sr); +} + +//--------------------------------------------------------- +// coefAttack +// convert the attack value to a coef for envInct +//--------------------------------------------------------- +inline double coefAttack(unsigned char attack) { + double x = COEFGATTACK*(double)attack/(double)MIDATTACK + 1.0-COEFGATTACK; + double square_x = x*x; + return(square_x*square_x*x); +} + +//--------------------------------------------------------- +// env2RAmp +// return the amplitude ratio with respect to an envelope and an +// envelope state, making evoluate the envelope +// sr is the sample rate and st the sine_table +//--------------------------------------------------------- +inline double env2AmpR(double sr, float* wt, Eg eg, OpVoice* p_opVoice) { + switch(p_opVoice->envState) { + case ATTACK: + p_opVoice->envIndex+=p_opVoice->envInct; + if (p_opVoice->envIndex<(RESOLUTION/4)) { + p_opVoice->envLevel=wt[(int)p_opVoice->envIndex]; + } + else { + p_opVoice->envState=DECAY; + p_opVoice->envLevel=1.0; + p_opVoice->coefVLevel=envD1R2coef(eg.d1r, sr); + } + return p_opVoice->envLevel; + break; + case DECAY: + if (p_opVoice->envLevel>((double)eg.d1l/(double)MAXD1L)+COEFERRDECSUS) { + p_opVoice->envLevel*=p_opVoice->coefVLevel; + } + else { + p_opVoice->envState=SUSTAIN; + p_opVoice->envLevel=((double)eg.d1l/(double)MAXD1L); + p_opVoice->coefVLevel=envD1R2coef(eg.d2r, sr);//probably the same + } + return p_opVoice->envLevel; + break; + case SUSTAIN: + if (p_opVoice->envLevel>COEFERRSUSREL) { + p_opVoice->envLevel*=p_opVoice->coefVLevel; + } + else { + p_opVoice->envState=OFF; + p_opVoice->envLevel=0.0; + } + return p_opVoice->envLevel; + break; + case RELEASE: + if (p_opVoice->envLevel > COEFERRSUSREL) { + p_opVoice->envLevel*=p_opVoice->coefVLevel; + } + else { + p_opVoice->envState=OFF; + p_opVoice->envLevel=0.0; + } + return p_opVoice->envLevel; + break; + case OFF: return 0.0; + break; + default: printf("Error case envelopeState"); + break; + } + return p_opVoice->envLevel; +} + +//--------------------------------------------------------- +// programSelect +//--------------------------------------------------------- + +void DeicsOnze2::programSelect(int c, int hbank, int lbank, int prog) { + Preset* foundPreset; + foundPreset=findPreset(hbank, lbank, prog); + if (foundPreset) _preset[c]=foundPreset; + else { + _preset[c]=_initialPreset; + _preset[c]->prog=prog; + _preset[c]->_subcategory->_lbank=lbank; //TODO : real link + _preset[c]->_subcategory->_category->_hbank=hbank; + } + setPreset(c); +} + +//--------------------------------------------------------- +// setModulation +//--------------------------------------------------------- +void DeicsOnze2::setModulation(int c, int val) { + _global.channel[c].modulation = (unsigned char) val; + setLfo(c); +} +//--------------------------------------------------------- +// setPitchBendCoef +//--------------------------------------------------------- +void DeicsOnze2::setPitchBendCoef(int c, int val) { + _global.channel[c].pitchBendCoef = + exp(log(2)*((double)_preset[c]->function.pBendRange + /(double)MAXPBENDRANGE) + *((double)val/(double)MAXPITCHBENDVALUE)); +} + +//--------------------------------------------------------- +// setSustain +//--------------------------------------------------------- +void DeicsOnze2::setSustain(int c, int val) { + _global.channel[c].sustain=(val>64); + if(!_global.channel[c].sustain) + for(int i=0; i<_global.channel[c].nbrVoices; i++) + if(_global.channel[c].voices[i].isSustained) { + for(int j=0; jwriteEvent(evNbrVoices); + }*/ + //channelNum + /* + if(qdEl.tagName()==CHANNELNUMSTR) { + _global.channelNum = (qdEl.text()==ALLSTR?-1:qdEl.text().toInt()-1); + unsigned char *dataChannelNum = new unsigned char[2]; + dataChannelNum[0]=SYSEX_CHANNELNUM; + dataChannelNum[1]=(unsigned char)_global.channelNum; + MidiPlayEvent + evChannelNum(0, ME_SYSEX, (const unsigned char*)dataChannelNum, 2); + _gui->writeEvent(evChannelNum); + }*/ + //quality + if(qdEl.tagName()==QUALITYSTR) { + _global.quality = (qdEl.text()==HIGHSTR?high: + (qdEl.text()==MIDDLESTR?middle: + (qdEl.text()==LOWSTR?low:ultralow))); + setQuality(_global.quality); + unsigned char *dataQuality = new unsigned char[2]; + dataQuality[0]=SYSEX_QUALITY; + dataQuality[1]=(unsigned char)_global.quality; + MidiPlayEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); + _gui->writeEvent(evQuality); + } + //filter + if(qdEl.tagName()==FILTERSTR) { + setFilter(qdEl.text()==YESSTRDEI?true:false); + unsigned char *dataFilter = new unsigned char[2]; + dataFilter[0]=SYSEX_FILTER; + dataFilter[1]=(unsigned char)getFilter(); + MidiPlayEvent evFilter(0, ME_SYSEX, (const unsigned char*)dataFilter, 2); + _gui->writeEvent(evFilter); + } + //font size + if(qdEl.tagName()==FONTSIZESTR) { + _global.fontSize = qdEl.text().toInt(); + unsigned char *dataFontSize = new unsigned char[2]; + dataFontSize[0]=SYSEX_FONTSIZE; + dataFontSize[1]=(unsigned char)_global.fontSize; + MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); + _gui->writeEvent(evFontSize); + } + //saveConfig + if(qdEl.tagName()==SAVECONFIGSTR) { + _saveConfig = (qdEl.text()==YESSTRDEI?true:false); + unsigned char *dataSaveConfig = new unsigned char[2]; + dataSaveConfig[0]=SYSEX_SAVECONFIG; + dataSaveConfig[1]=(unsigned char)_saveConfig; + MidiPlayEvent + evSaveConfig(0, ME_SYSEX, (const unsigned char*)dataSaveConfig, 2); + _gui->writeEvent(evSaveConfig); + } + //saveOnlyUsed + if(qdEl.tagName()==SAVEONLYUSEDSTR) { + _saveOnlyUsed = (qdEl.text()==YESSTRDEI?true:false); + unsigned char *dataSaveOnlyUsed = new unsigned char[2]; + dataSaveOnlyUsed[0]=SYSEX_SAVEONLYUSED; + dataSaveOnlyUsed[1]=(unsigned char)_saveOnlyUsed; + MidiPlayEvent + evSaveOnlyUsed(0, ME_SYSEX, (const unsigned char*)dataSaveOnlyUsed, 2); + _gui->writeEvent(evSaveOnlyUsed); + } + //colors + if(qdEl.tagName()==TEXTCOLORSTR) textColor = readColor(qdn); + if(qdEl.tagName()==BACKGROUNDCOLORSTR) backgroundColor = readColor(qdn); + if(qdEl.tagName()==EDITTEXTCOLORSTR) editTextColor = readColor(qdn); + if(qdEl.tagName()==EDITBACKGROUNDCOLORSTR) + editBackgroundColor = readColor(qdn); + + //must insert load image, later + + //load init set + if(qdEl.tagName()==ISINITSETSTR) { + _isInitSet = (qdEl.text()==YESSTRDEI?true:false); + unsigned char *dataIsInitSet = new unsigned char[2]; + dataIsInitSet[0]=SYSEX_ISINITSET; + dataIsInitSet[1]=(unsigned char)_isInitSet; + MidiPlayEvent + evIsInitSet(0, ME_SYSEX, (const unsigned char*)dataIsInitSet, 2); + _gui->writeEvent(evIsInitSet); + } + if(qdEl.tagName()==INITSETPATHSTR) { + _initSetPath = qdEl.text(); + unsigned char *dataInitSetPath = + new unsigned char[1+MAXSTRLENGTHINITSETPATH]; + dataInitSetPath[0]=SYSEX_INITSETPATH; + strncpy((char*)&dataInitSetPath[1], _initSetPath.toLatin1().data(), + MAXSTRLENGTHINITSETPATH); + MidiPlayEvent + evInitSetPath(0, ME_SYSEX, (const unsigned char*)dataInitSetPath, + 1+MAXSTRLENGTHINITSETPATH); + _gui->writeEvent(evInitSetPath); + } + //load background pix + if(qdEl.tagName()==ISBACKGROUNDPIXSTR) { + _isBackgroundPix = (qdEl.text()==YESSTRDEI?true:false); + unsigned char *dataIsBackgroundPix = new unsigned char[2]; + dataIsBackgroundPix[0]=SYSEX_ISBACKGROUNDPIX; + dataIsBackgroundPix[1]=(unsigned char)_isBackgroundPix; + MidiPlayEvent + evIsBackgroundPix(0, ME_SYSEX, + (const unsigned char*)dataIsBackgroundPix, 2); + _gui->writeEvent(evIsBackgroundPix); + } + if(qdEl.tagName()==BACKGROUNDPIXPATHSTR) { + _backgroundPixPath = qdEl.text(); + unsigned char *dataBackgroundPixPath = + new unsigned char[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; + dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; + strncpy((char*)&dataBackgroundPixPath[1], + _backgroundPixPath.toLatin1().data(), + MAXSTRLENGTHBACKGROUNDPIXPATH); + MidiPlayEvent + evBackgroundPixPath(0, ME_SYSEX, + (const unsigned char*)dataBackgroundPixPath, + 1+MAXSTRLENGTHBACKGROUNDPIXPATH); + _gui->writeEvent(evBackgroundPixPath); + } + qdn = qdn.nextSibling(); + } + //send colors + unsigned char dataColorGui[COLORSYSEXLENGTH+1]; + dataColorGui[0]=SYSEX_COLORGUI; + dataColorGui[1]=(unsigned char)textColor.red(); + dataColorGui[2]=(unsigned char)textColor.green(); + dataColorGui[3]=(unsigned char)textColor.blue(); + dataColorGui[4]=(unsigned char)backgroundColor.red(); + dataColorGui[5]=(unsigned char)backgroundColor.green(); + dataColorGui[6]=(unsigned char)backgroundColor.blue(); + dataColorGui[7]=(unsigned char)editTextColor.red(); + dataColorGui[8]=(unsigned char)editTextColor.green(); + dataColorGui[9]=(unsigned char)editTextColor.blue(); + dataColorGui[10]=(unsigned char)editBackgroundColor.red(); + dataColorGui[11]=(unsigned char)editBackgroundColor.green(); + dataColorGui[12]=(unsigned char)editBackgroundColor.blue(); + MidiPlayEvent evSysexColor(0, ME_SYSEX, (const unsigned char*)dataColorGui, + COLORSYSEXLENGTH+1); + _gui->writeEvent(evSysexColor); +} + +//----------------------------------------------------------- +// loadConfiguration +//----------------------------------------------------------- +void DeicsOnze2::loadConfiguration(QString fileName) { + // read the XML file and create DOM tree + if(!fileName.isEmpty()) { + QFile confFile(fileName); + if(!confFile.open(QIODevice::ReadOnly)) { + printf("Critical Error. Cannot open file %s\n", + fileName.toAscii().data()); + return; + } + QDomDocument domTree; + if (!domTree.setContent(&confFile )) { + printf("Critical Error. Parsing error for file %s\n", + fileName.toAscii().data()); + confFile.close(); + return; + } + + confFile.close(); + + QDomNode node = domTree.documentElement(); + while (!node.isNull()) { + QDomElement e = node.toElement(); + if (e.isNull()) + continue; + if (e.tagName() == DEICSONZECONFIGURATIONSTR) { + QString version = e.attribute(QString("version")); + if (version == "1.0") { + readConfiguration(node.firstChild()); + } + else printf("unsupported *.dco file version %s\n", + version.toLatin1().data()); + } + else printf("DeicsOnze2: %s not supported\n", + e.tagName().toLatin1().data()); + node = node.nextSibling(); + } + } +} + +//--------------------------------------------------------- +// writeConfiguration +//--------------------------------------------------------- +void DeicsOnze2::writeConfiguration(AL::Xml* xml) { + QString str; + xml->stag("deicsOnzeConfiguation version=\"1.0\""); + //xml->intTag(NBRVOICESSTR, (int)_global.nbrVoices); + //xml->strTag(CHANNELNUMSTR, (_global.channelNum==-1?ALLSTR: + // str.setNum(_global.channelNum+1))); + xml->tag(QUALITYSTR, QString((_global.quality==high?HIGHSTR: + (_global.quality==middle?MIDDLESTR: + (_global.quality==low?LOWSTR:ULTRALOWSTR))))); + xml->tag(FILTERSTR, QString(getFilter()==true?YESSTRDEI:NOSTRDEI)); + xml->tag(FONTSIZESTR, _global.fontSize); + xml->tag(SAVECONFIGSTR, QString((_saveConfig?YESSTRDEI:NOSTRDEI))); + xml->tag(SAVEONLYUSEDSTR, QString((_saveOnlyUsed?YESSTRDEI:NOSTRDEI))); + xml->tag(TEXTCOLORSTR, + reinterpret_cast(*_gui->tColor)); + xml->tag(BACKGROUNDCOLORSTR, + reinterpret_cast(*_gui->bColor)); + xml->tag(EDITTEXTCOLORSTR, + reinterpret_cast(*_gui->etColor)); + xml->tag(EDITBACKGROUNDCOLORSTR, + reinterpret_cast(*_gui->ebColor)); + xml->tag(ISINITSETSTR, QString((_isInitSet?YESSTRDEI:NOSTRDEI))); + xml->tag(INITSETPATHSTR, QString(_initSetPath)); + xml->tag(ISBACKGROUNDPIXSTR, QString((_isBackgroundPix?YESSTRDEI:NOSTRDEI))); + xml->tag(BACKGROUNDPIXPATHSTR, _backgroundPixPath); + + xml->etag(DEICSONZECONFIGURATIONSTR); +} + +//--------------------------------------------------------- +// getInitData +//--------------------------------------------------------- +void DeicsOnze2::getInitData(int* length, const unsigned char** data) { + + //write the set in a temporary file and in a QByteArray + QTemporaryFile file; + file.open(); + AL::Xml* xml=new AL::Xml(&file); + xml->header(); + _set->writeSet(xml, _saveOnlyUsed); + file.reset(); //seek the start of the file + QByteArray ba = file.readAll(); + file.close(); + + //compress the QByteArray at default rate + QByteArray baComp = qCompress(ba); + + //save the set + *length = NUM_CONFIGLENGTH + + (_pluginIReverb?sizeof(float)*_pluginIReverb->plugin()->parameter():0) + + (_pluginIChorus?sizeof(float)*_pluginIChorus->plugin()->parameter():0) + + baComp.size(); + + unsigned char* buffer = new unsigned char[*length]; + //save init data + buffer[0]=SYSEX_INIT_DATA; + buffer[1]=SYSEX_INIT_DATA_VERSION; + //save global data + buffer[NUM_MASTERVOL] = (unsigned char) getMasterVol(); + for(int c = 0; c < NBRCHANNELS; c++) { + buffer[NUM_CHANNEL_ENABLE + c] = (unsigned char) getChannelEnable(c); + buffer[NUM_CHANNEL_VOL + c] = (unsigned char) getChannelVol(c); + buffer[NUM_CHANNEL_PAN + c] = (unsigned char) getChannelPan(c); + int b = getChannelBrightness(c); + buffer[NUM_CHANNEL_BRIGHTNESS + 2*c] = (unsigned char) (b%256); + buffer[NUM_CHANNEL_BRIGHTNESS + 2*c + 1] = (unsigned char) (b/256); + buffer[NUM_CHANNEL_MODULATION + c] = + (unsigned char) getChannelModulation(c); + buffer[NUM_CHANNEL_DETUNE + c] = + (unsigned char) getChannelDetune(c) + MAXCHANNELDETUNE; + buffer[NUM_CHANNEL_ATTACK + c] = (unsigned char) getChannelAttack(c); + 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; + buffer[NUM_CURRENTHBANK + c] = + (unsigned char) _preset[c]->_subcategory->_category->_hbank; + buffer[NUM_NBRVOICES + c] = (unsigned char) getNbrVoices(c); + } + buffer[NUM_SAVEONLYUSED]=(unsigned char) _saveOnlyUsed; + buffer[NUM_SAVECONFIG]=(unsigned char) _saveConfig; + //save config data + if(_saveConfig) { + buffer[NUM_QUALITY]=(unsigned char)_global.quality; + buffer[NUM_FILTER]=(unsigned char)getFilter(); + buffer[NUM_FONTSIZE]=(unsigned char)_global.fontSize; + buffer[NUM_RED_TEXT]=(unsigned char)_gui->tColor->Qt::red(); + buffer[NUM_GREEN_TEXT]=(unsigned char)_gui->tColor->Qt::green(); + buffer[NUM_BLUE_TEXT]=(unsigned char)_gui->tColor->Qt::blue(); + buffer[NUM_RED_BACKGROUND]=(unsigned char)_gui->bColor->Qt::red(); + buffer[NUM_GREEN_BACKGROUND]=(unsigned char)_gui->bColor->Qt::green(); + buffer[NUM_BLUE_BACKGROUND]=(unsigned char)_gui->bColor->Qt::blue(); + buffer[NUM_RED_EDITTEXT]=(unsigned char)_gui->etColor->Qt::red(); + buffer[NUM_GREEN_EDITTEXT]=(unsigned char)_gui->etColor->Qt::green(); + buffer[NUM_BLUE_EDITTEXT]=(unsigned char)_gui->etColor->Qt::blue(); + buffer[NUM_RED_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::red(); + buffer[NUM_GREEN_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::green(); + buffer[NUM_BLUE_EDITBACKGROUND]=(unsigned char)_gui->ebColor->Qt::blue(); + buffer[NUM_ISINITSET]=(unsigned char)_isInitSet; + strncpy((char*)&buffer[NUM_INITSETPATH], + _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); + buffer[NUM_ISBACKGROUNDPIX]=(unsigned char)_isBackgroundPix; + strncpy((char*)&buffer[NUM_BACKGROUNDPIXPATH], + _backgroundPixPath.toLatin1().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]= + (_pluginIReverb?(unsigned char)_pluginIReverb->plugin()->parameter() : 0); + strncpy((char*)&buffer[NUM_REVERB_LIB], + (_pluginIReverb? + _pluginIReverb->plugin()->lib().toLatin1().data() : "\0"), + MAXSTRLENGTHFXLIB); + strncpy((char*)&buffer[NUM_REVERB_LABEL], + (_pluginIReverb? + _pluginIReverb->plugin()->label().toLatin1().data() : "\0"), + MAXSTRLENGTHFXLABEL); + //chorus + buffer[NUM_IS_CHORUS_ON]=(unsigned char)_global.isChorusActivated; + buffer[NUM_CHORUS_RETURN]=(unsigned char)getChorusReturn(); + buffer[NUM_CHORUS_PARAM_NBR]= + (_pluginIChorus?(unsigned char)_pluginIChorus->plugin()->parameter() : 0); + strncpy((char*)&buffer[NUM_CHORUS_LIB], + (_pluginIChorus? + _pluginIChorus->plugin()->lib().toLatin1().data() : "\0"), + MAXSTRLENGTHFXLIB); + strncpy((char*)&buffer[NUM_CHORUS_LABEL], + (_pluginIChorus? + _pluginIChorus->plugin()->label().toLatin1().data() : "\0"), + 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 < (int)buffer[NUM_REVERB_PARAM_NBR]; i++) { + float val = (float)getReverbParam(i); + memcpy(&buffer[NUM_CONFIGLENGTH + sizeof(float)*i], &val, sizeof(float)); + } + //chorus + for(int i = 0; i < (int)buffer[NUM_CHORUS_PARAM_NBR]; i++) { + float val = (float)getChorusParam(i); + memcpy(&buffer[NUM_CONFIGLENGTH + + sizeof(float)*(int)buffer[NUM_REVERB_PARAM_NBR] + + sizeof(float)*i], &val, sizeof(float)); + } + //delay + float delayfloat; + delayfloat = getDelayBPM(); + memcpy(&buffer[NUM_DELAY_BPM], &delayfloat, 4); + delayfloat = getDelayBeatRatio(); + memcpy(&buffer[NUM_DELAY_BEATRATIO], &delayfloat, sizeof(float)); + delayfloat = getDelayFeedback(); + memcpy(&buffer[NUM_DELAY_FEEDBACK], &delayfloat, sizeof(float)); + delayfloat = getDelayLFOFreq(); + memcpy(&buffer[NUM_DELAY_LFO_FREQ], &delayfloat, sizeof(float)); + delayfloat = getDelayLFODepth(); + memcpy(&buffer[NUM_DELAY_LFO_DEPTH], &delayfloat, sizeof(float)); + + //save set data + int offset = + NUM_CONFIGLENGTH + + sizeof(float)*(int)buffer[NUM_REVERB_PARAM_NBR] + + sizeof(float)*(int)buffer[NUM_CHORUS_PARAM_NBR]; + for(int i = offset; i < *length; i++) + buffer[i]=(unsigned char)baComp.at(i - offset); + + *data=buffer; +} +//--------------------------------------------------------- +// parseInitData +//--------------------------------------------------------- +void DeicsOnze2::parseInitData(int length, const unsigned char* data) { + if(data[1]==SYSEX_INIT_DATA_VERSION) { + //load global parameters + //master volume + setMasterVol(data[NUM_MASTERVOL]); + unsigned char *dataMasterVol = new unsigned char[2]; + dataMasterVol[0]=SYSEX_MASTERVOL; + dataMasterVol[1]=(unsigned char) getMasterVol(); + MidiPlayEvent + evMasterVol(0, ME_SYSEX, (const unsigned char*)dataMasterVol, 2); + _gui->writeEvent(evMasterVol); + //channel configuration + for(int c = 0; c < NBRCHANNELS; c++) { + //isEnable + setChannelEnable(c, data[NUM_CHANNEL_ENABLE + c]); + MidiPlayEvent + evChEnable(0, c, ME_CONTROLLER, + CTRL_CHANNELENABLE, data[NUM_CHANNEL_ENABLE + c]); + _gui->writeEvent(evChEnable); + //nbrVoices + setNbrVoices(c, data[NUM_NBRVOICES + c]); + MidiPlayEvent + evNbrVoices(0,c,ME_CONTROLLER,CTRL_NBRVOICES, data[NUM_NBRVOICES + c]); + _gui->writeEvent(evNbrVoices); + //channel volume + setChannelVol(c, data[NUM_CHANNEL_VOL + c]); + MidiPlayEvent + evChVol(0, c, ME_CONTROLLER, + CTRL_CHANNELVOLUME, data[NUM_CHANNEL_VOL + c]); + _gui->writeEvent(evChVol); + //channel pan + setChannelPan(c, data[NUM_CHANNEL_PAN + c]); + MidiPlayEvent + evChPan(0, c, ME_CONTROLLER, CTRL_CHANNELPAN, + data[NUM_CHANNEL_PAN + c]); + _gui->writeEvent(evChPan); + if(getChannelEnable(c)) applyChannelAmp(c); + //channel detune + setChannelDetune(c, data[NUM_CHANNEL_DETUNE + c]-MAXCHANNELDETUNE); + MidiPlayEvent + evChDetune(0, c, ME_CONTROLLER, CTRL_CHANNELDETUNE, + data[NUM_CHANNEL_DETUNE + c]-MAXCHANNELDETUNE); + _gui->writeEvent(evChDetune); + //channel brightness + setChannelBrightness(c, + data[NUM_CHANNEL_BRIGHTNESS + 2*c] + + data[NUM_CHANNEL_BRIGHTNESS + 2*c + 1] * 256); + MidiPlayEvent + evChBrightness(0, c, ME_CONTROLLER, + CTRL_FINEBRIGHTNESS, getChannelBrightness(c)); + _gui->writeEvent(evChBrightness); + //channel modulation + setChannelModulation(c, data[NUM_CHANNEL_MODULATION + c]); + MidiPlayEvent + evChMod(0, c, ME_CONTROLLER, + CTRL_MODULATION, data[NUM_CHANNEL_MODULATION + c]); + _gui->writeEvent(evChMod); + //channel attack + setChannelAttack(c, data[NUM_CHANNEL_ATTACK + c]); + MidiPlayEvent + evChAttack(0, c, ME_CONTROLLER, + CTRL_ATTACK_TIME, data[NUM_CHANNEL_ATTACK + c]); + _gui->writeEvent(evChAttack); + //channel release + setChannelRelease(c, data[NUM_CHANNEL_RELEASE + c]); + MidiPlayEvent + evChRelease(0, c, ME_CONTROLLER, + CTRL_RELEASE_TIME, data[NUM_CHANNEL_RELEASE + c]); + _gui->writeEvent(evChRelease); + //channel reverb + setChannelReverb(c, data[NUM_CHANNEL_REVERB + c]); + MidiPlayEvent + evChReverb(0, c, ME_CONTROLLER, + CTRL_REVERB_SEND, data[NUM_CHANNEL_REVERB + c]); + _gui->writeEvent(evChReverb); + //channel chorus + setChannelChorus(c, data[NUM_CHANNEL_CHORUS + c]); + MidiPlayEvent + 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]); + MidiPlayEvent + evChDelay(0, c, ME_CONTROLLER, + CTRL_VARIATION_SEND, data[NUM_CHANNEL_DELAY + c]); + _gui->writeEvent(evChDelay); + } + //load configuration + _saveConfig = (bool)data[NUM_SAVECONFIG]; + unsigned char *dataSaveConfig = new unsigned char[2]; + dataSaveConfig[0]=SYSEX_SAVECONFIG; + dataSaveConfig[1]=(unsigned char)_saveConfig; + MidiPlayEvent + evSaveConfig(0, ME_SYSEX, (const unsigned char*)dataSaveConfig, 2); + _gui->writeEvent(evSaveConfig); + if(_saveConfig) { + //saveOnlyUsed + _saveOnlyUsed = (bool)data[NUM_SAVEONLYUSED]; + unsigned char *dataSaveOnlyUsed = new unsigned char[2]; + dataSaveOnlyUsed[0]=SYSEX_SAVEONLYUSED; + dataSaveOnlyUsed[1]=(unsigned char)_saveOnlyUsed; + MidiPlayEvent + evSaveOnlyUsed(0, ME_SYSEX, (const unsigned char*)dataSaveOnlyUsed, 2); + _gui->writeEvent(evSaveOnlyUsed); + //colors + unsigned char dataColorGui[COLORSYSEXLENGTH+1]; + dataColorGui[0]=SYSEX_COLORGUI; + for (int i=0; iwriteEvent(evSysexColor); + //quality + unsigned char dataQuality[2]; + dataQuality[0]=SYSEX_QUALITY; + dataQuality[1]=data[NUM_QUALITY]; + setQuality((Quality)data[NUM_QUALITY]); + MidiPlayEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); + _gui->writeEvent(evQuality); + //filter + unsigned char dataFilter[2]; + dataFilter[0]=SYSEX_FILTER; + dataFilter[1]=data[NUM_FILTER]; + setFilter((bool)data[NUM_FILTER]); + MidiPlayEvent evFilter(0, ME_SYSEX, (const unsigned char*)dataFilter, 2); + _gui->writeEvent(evFilter); + //font size + unsigned char dataFontSize[2]; + dataFontSize[0]=SYSEX_FONTSIZE; + dataFontSize[1]=data[NUM_FONTSIZE]; + MidiPlayEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); + _gui->writeEvent(evFontSize); + //load init set + unsigned char dataIsInitSet[2]; + dataIsInitSet[0]=SYSEX_ISINITSET; + dataIsInitSet[1]=data[NUM_ISINITSET]; + MidiPlayEvent evIsInitSet(0, ME_SYSEX, + (const unsigned char*)dataIsInitSet, 2); + _gui->writeEvent(evIsInitSet); + unsigned char dataInitSetPath[1+MAXSTRLENGTHINITSETPATH]; + dataInitSetPath[0]=SYSEX_INITSETPATH; + for(int a = 0; a < MAXSTRLENGTHINITSETPATH; a++) + dataInitSetPath[a+1] = data[a+NUM_INITSETPATH]; + MidiPlayEvent evInitSetPath(0,ME_SYSEX,(const unsigned char*)dataInitSetPath, + 1+MAXSTRLENGTHINITSETPATH); + _gui->writeEvent(evInitSetPath); + //load background pix + unsigned char dataIsBackgroundPix[2]; + dataIsBackgroundPix[0]=SYSEX_ISBACKGROUNDPIX; + dataIsBackgroundPix[1]=data[NUM_ISBACKGROUNDPIX]; + MidiPlayEvent evIsBackgroundPix(0, ME_SYSEX, + (const unsigned char*)dataIsBackgroundPix, 2); + _gui->writeEvent(evIsBackgroundPix); + unsigned char dataBackgroundPixPath[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; + dataBackgroundPixPath[0]=SYSEX_BACKGROUNDPIXPATH; + for(int a = 0; a < MAXSTRLENGTHBACKGROUNDPIXPATH; a++) + dataBackgroundPixPath[a+1] = data[a+NUM_BACKGROUNDPIXPATH]; + MidiPlayEvent evBackgroundPixPath(0,ME_SYSEX, + (const unsigned char*)dataBackgroundPixPath, + 1+MAXSTRLENGTHBACKGROUNDPIXPATH); + _gui->writeEvent(evBackgroundPixPath); + } + else _gui->saveConfigCheckBox->setChecked(false); + //load FX + //reverb + _global.isReverbActivated = (bool)data[NUM_IS_REVERB_ON]; + unsigned char *dataReverbAct = new unsigned char[2]; + dataReverbAct[0]=SYSEX_REVERBACTIV; + dataReverbAct[1]=(unsigned char)_global.isReverbActivated; + MidiPlayEvent evReverbAct(0,ME_SYSEX,(const unsigned char*)dataReverbAct, 2); + _gui->writeEvent(evReverbAct); + setReverbReturn((int)data[NUM_REVERB_RETURN]); + unsigned char *dataReverbRet = new unsigned char[2]; + dataReverbRet[0]=SYSEX_REVERBRETURN; + dataReverbRet[1]=(unsigned char)getReverbReturn(); + MidiPlayEvent evReverbRet(0,ME_SYSEX,(const unsigned char*)dataReverbRet, 2); + _gui->writeEvent(evReverbRet); + Plugin* p; + p = plugins.find((const char*)&data[NUM_REVERB_LIB], + (const char*)&data[NUM_REVERB_LABEL]); + if(p) { + initPluginReverb(p); + for(int i = 0; i < _pluginIReverb->plugin()->parameter(); i++) { + float val; + memcpy(&val, &data[NUM_CONFIGLENGTH + sizeof(float)*i], sizeof(float)); + setReverbParam(i, (double)val); + } + char dataBuildRev; + dataBuildRev = SYSEX_BUILDGUIREVERB; + MidiPlayEvent evSysexBuildRev(0,ME_SYSEX, + (const unsigned char*)&dataBuildRev, 1); + _gui->writeEvent(evSysexBuildRev); + } + else _pluginIReverb = NULL; + //chorus + _global.isChorusActivated = (bool)data[NUM_IS_CHORUS_ON]; + unsigned char *dataChorusAct = new unsigned char[2]; + dataChorusAct[0]=SYSEX_CHORUSACTIV; + dataChorusAct[1]=(unsigned char)_global.isChorusActivated; + MidiPlayEvent evChorusAct(0,ME_SYSEX,(const unsigned char*)dataChorusAct, 2); + _gui->writeEvent(evChorusAct); + setChorusReturn((int)data[NUM_CHORUS_RETURN]); + unsigned char *dataChorusRet = new unsigned char[2]; + dataChorusRet[0]=SYSEX_CHORUSRETURN; + dataChorusRet[1]=(unsigned char)getChorusReturn(); + MidiPlayEvent evChorusRet(0,ME_SYSEX,(const unsigned char*)dataChorusRet, 2); + _gui->writeEvent(evChorusRet); + p = plugins.find((const char*)&data[NUM_CHORUS_LIB], + (const char*)&data[NUM_CHORUS_LABEL]); + if(p) { + initPluginChorus(p); + for(int i = 0; i < _pluginIChorus->plugin()->parameter(); i++) { + float val; + memcpy(&val, &data[NUM_CONFIGLENGTH + + sizeof(float)*(int)data[NUM_REVERB_PARAM_NBR] + + sizeof(float)*i], + sizeof(float)); + setChorusParam(i, (double)val); + } + char dataBuildCho; + dataBuildCho = SYSEX_BUILDGUICHORUS; + MidiPlayEvent evSysexBuildCho(0,ME_SYSEX, + (const unsigned char*)&dataBuildCho, 1); + _gui->writeEvent(evSysexBuildCho); + } + else _pluginIChorus = NULL; + //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; + MidiPlayEvent 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(); + MidiPlayEvent evDelayRet(0,ME_SYSEX,(const unsigned char*)dataDelayRet, 2); + _gui->writeEvent(evDelayRet); + //initPluginDelay(plugins.find("pandelay", "pandelay")); + float delayfloat; + memcpy(&delayfloat, &data[NUM_DELAY_BPM], sizeof(float)); + setDelayBPM(delayfloat); + char dataDelayBPM[sizeof(float)+1]; + dataDelayBPM[0] = SYSEX_DELAYBPM; + memcpy(&dataDelayBPM[1], &delayfloat, sizeof(float)); + MidiPlayEvent evSysexDelayBPM(0,ME_SYSEX, + (const unsigned char*)dataDelayBPM, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayBPM); + memcpy(&delayfloat, &data[NUM_DELAY_BEATRATIO], sizeof(float)); + setDelayBeatRatio(delayfloat); + char dataDelayBeatRatio[sizeof(float)+1]; + dataDelayBeatRatio[0] = SYSEX_DELAYBEATRATIO; + memcpy(&dataDelayBeatRatio[1], &delayfloat, sizeof(float)); + MidiPlayEvent evSysexDelayBeatRatio(0,ME_SYSEX, + (const unsigned char*)dataDelayBeatRatio, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayBeatRatio); + memcpy(&delayfloat, &data[NUM_DELAY_FEEDBACK], sizeof(float)); + setDelayFeedback(delayfloat); + char dataDelayFeedback[sizeof(float)+1]; + dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; + memcpy(&dataDelayFeedback[1], &delayfloat, sizeof(float)); + MidiPlayEvent evSysexDelayFeedback(0,ME_SYSEX, + (const unsigned char*)dataDelayFeedback, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayFeedback); + memcpy(&delayfloat, &data[NUM_DELAY_LFO_FREQ], sizeof(float)); + setDelayLFOFreq(delayfloat); + char dataDelayLFOFreq[sizeof(float)+1]; + dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; + memcpy(&dataDelayLFOFreq[1], &delayfloat, sizeof(float)); + MidiPlayEvent evSysexDelayLFOFreq(0,ME_SYSEX, + (const unsigned char*)dataDelayLFOFreq, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayLFOFreq); + memcpy(&delayfloat, &data[NUM_DELAY_LFO_DEPTH], sizeof(float)); + setDelayLFODepth(delayfloat); + char dataDelayLFODepth[sizeof(float)+1]; + dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; + memcpy(&dataDelayLFODepth[1], &delayfloat, sizeof(float)); + MidiPlayEvent evSysexDelayLFODepth(0,ME_SYSEX, + (const unsigned char*)dataDelayLFODepth, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayLFODepth); + + //load the set compressed + int offset = + NUM_CONFIGLENGTH + + sizeof(float)*(int)data[NUM_REVERB_PARAM_NBR] + + sizeof(float)*(int)data[NUM_CHORUS_PARAM_NBR]; + QByteArray baComp = QByteArray((const char*)&data[offset], length-offset); + + //uncompress the set + QByteArray baUncomp = qUncompress(baComp); + + //save the set in a temporary file and + // read the XML file and create DOM tree + QTemporaryFile file; + file.open(); + file.write(baUncomp); + QDomDocument domTree; + file.reset(); //seek the start of the file + domTree.setContent(&file); + file.close(); + QDomNode node = domTree.documentElement(); + + while (!node.isNull()) { + QDomElement e = node.toElement(); + if (e.isNull()) + continue; + if (e.tagName() == "deicsOnzeSet") { + QString version = e.attribute(QString("version")); + if (version == "1.0") { + for(int c = 0; c < NBRCHANNELS; c++) _preset[c]=_initialPreset; + //read the set + if((bool)data[NUM_SAVEONLYUSED]) { + //printf("Mini\n"); + //updateSaveOnlyUsed(true); + } + else { + //printf("Huge\n"); + while(!_set->_categoryVector.empty()) + delete(*_set->_categoryVector.begin()); + //updateSaveOnlyUsed(false); + } + _set->readSet(node.firstChild()); + //display load preset + //setSet(); + } + else printf("Wrong set version : %s\n", + version.toLatin1().data()); + } + node = node.nextSibling(); + } + //send sysex to the gui to load the set (actually not because it doesn't + //work -the code is just zapped in the middle???-, so it is done above + //int dL=2+baUncomp.size(); + int dL = 2; + char dataSend[dL]; + dataSend[0]=SYSEX_LOADSET; + dataSend[1]=data[NUM_SAVEONLYUSED]; + //for(int i=2; iwriteEvent(evSysex); + + //select programs per channel + for(int c = 0; c < NBRCHANNELS; c++) { + int hbank=(int)data[NUM_CURRENTHBANK+c]; + int lbank=(int)data[NUM_CURRENTLBANK+c]; + int prog=(int)data[NUM_CURRENTPROG+c]; + programSelect(c, hbank, lbank, prog); + int val=prog+(lbank<<8)+(hbank<<16); + MidiPlayEvent evProgSel(0, c, ME_CONTROLLER, CTRL_PROGRAM, val); + _gui->writeEvent(evProgSel); + } + + } +} +//--------------------------------------------------------- +// sysex +//--------------------------------------------------------- +bool DeicsOnze2::sysex(int length, const unsigned char* data) { + sysex(length, data, false); + return false; +} +bool DeicsOnze2::sysex(int length, const unsigned char* data, bool fromGui) { + int cmd=data[0]; + int index; + float f; + switch(cmd) { + case SYSEX_INIT_DATA: + parseInitData(length, data); + break; + case SYSEX_MASTERVOL: + setMasterVol((int)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + //case SYSEX_CHANNELNUM: + //_global.channelNum = (char)data[1]; + //if(!fromGui) { + // MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + // _gui->writeEvent(evSysex); + //} + //break; + case SYSEX_QUALITY: + setQuality((Quality)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_FILTER: + setFilter((bool)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_FONTSIZE: + _global.fontSize = (int)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_SAVECONFIG: + _saveConfig = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_SAVEONLYUSED: + _saveOnlyUsed = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_ISINITSET: + _isInitSet = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_INITSETPATH: + _initSetPath = (char*)&data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_ISBACKGROUNDPIX: + _isBackgroundPix = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_BACKGROUNDPIXPATH: + _backgroundPixPath = (char*)&data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_PANIC: + resetVoices(); + break; + case SYSEX_CHORUSACTIV: + _global.isChorusActivated = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_CHORUSPARAM: + index = (int)data[1]; + memcpy(&f, &data[2], sizeof(float)); + setChorusParam(index, (double)f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_REVERBACTIV: + _global.isReverbActivated = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_REVERBPARAM: + index = (int)data[1]; + memcpy(&f, &data[2], sizeof(float)); + setReverbParam(index, (double)f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYACTIV: + _global.isDelayActivated = (bool)data[1]; + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_CHORUSRETURN: + setChorusReturn((int)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_REVERBRETURN: + setReverbReturn((int)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYRETURN: + setDelayReturn((int)data[1]); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_SELECTREVERB: + Plugin* pluginReverb; + memcpy(&pluginReverb, &data[1], sizeof(Plugin*)); + initPluginReverb(pluginReverb); + break; + case SYSEX_SELECTCHORUS: + Plugin* pluginChorus; + memcpy(&pluginChorus, &data[1], sizeof(Plugin*)); + initPluginChorus(pluginChorus); + break; + case SYSEX_DELAYBPM: + memcpy(&f, &data[1], sizeof(float)); + setDelayBPM(f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYBEATRATIO: + memcpy(&f, &data[1], sizeof(float)); + setDelayBeatRatio(f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYFEEDBACK: + memcpy(&f, &data[1], sizeof(float)); + setDelayFeedback(f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYLFOFREQ: + memcpy(&f, &data[1], sizeof(float)); + setDelayLFOFreq(f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_DELAYLFODEPTH: + memcpy(&f, &data[1], sizeof(float)); + setDelayLFODepth(f); + if(!fromGui) { + MidiPlayEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + default: + break; + } + return false; +} +//--------------------------------------------------------- +// setController +//--------------------------------------------------------- +bool DeicsOnze2::setController(int channel, int id, int val) { + setController(channel, id, val, false); + return false; +} +bool DeicsOnze2::setController(int ch, int ctrl, int val, bool fromGui) { + int deiPan, k=0; + if(_global.channel[ch].isEnable || ctrl==CTRL_CHANNELENABLE) { + if(ctrl>=CTRL_AR && ctrlCTRL_PL3 && ctrlsetIsUsed(true); + _preset[ch]->eg[k].ar=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AR+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_D1R: + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d1r=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D1R+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_D2R: + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d2r=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D2R+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_RR: + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].rr=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_RR+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_D1L: + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d1l=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_D1L+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_LS: + _preset[ch]->setIsUsed(true); + _preset[ch]->scaling.level[k]=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_LS+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_RS: + _preset[ch]->setIsUsed(true); + _preset[ch]->scaling.rate[k]=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_RS+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_EBS: + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.egBias[k]=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_EBS+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_AME: + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.ampOn[k]=val==1; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AME+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_KVS: + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.keyVelocity[k]=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_KVS+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_OUT: + _preset[ch]->setIsUsed(true); + _preset[ch]->outLevel[k]=val; + setOutLevel(k); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_OUT+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_RATIO: + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].ratio=((double)val)/100.0; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER, + CTRL_RATIO+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_DET: + _preset[ch]->setIsUsed(true); + _preset[ch]->detune[k]=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_DET+k*DECAPAR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_ALG: + _preset[ch]->setIsUsed(true); + _preset[ch]->algorithm=(Algorithm)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ALG,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FEEDBACK: + _preset[ch]->setIsUsed(true); + _preset[ch]->feedback=val; + setFeedback(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FEEDBACK,val); + _gui->writeEvent(ev); + } + break; + case CTRL_SPEED: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.speed=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SPEED,val); + _gui->writeEvent(ev); + } + break; + case CTRL_DELAY: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.delay=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_DELAY,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PMODDEPTH: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.pModDepth=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODDEPTH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_AMODDEPTH: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.aModDepth=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AMODDEPTH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_SYNC: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.sync=val==1; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SYNC,val); + _gui->writeEvent(ev); + } + break; + case CTRL_WAVE: + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.wave=(Wave)val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_WAVE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PMODSENS: + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.pitch=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODSENS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_AMS: + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.amplitude=val; + setLfo(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_AMS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_TRANSPOSE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.transpose=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_TRANSPOSE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_POLYMODE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mode=(Mode)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_POLYMODE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PBENDRANGE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.pBendRange=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PBENDRANGE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PORTAMODE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.portamento=(Portamento)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTAMODE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PORTATIME: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.portamentoTime=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTATIME,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FCVOLUME: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcVolume=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCVOLUME,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FSW: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.footSw=(FootSw)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FSW,val); + _gui->writeEvent(ev); + } + break; + case CTRL_MWPITCH: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mwPitch=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_MWPITCH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_MWAMPLITUDE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mwAmplitude=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_MWAMPLITUDE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_BCPITCH: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcPitch=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_BCAMPLITUDE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcAmplitude=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCAMPLITUDE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_BCPITCHBIAS: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcPitchBias=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCHBIAS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_BCEGBIAS: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcEgBias=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_BCEGBIAS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_ATPITCH: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atPitch=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_ATAMPLITUDE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atAmplitude=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATAMPLITUDE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_ATPITCHBIAS: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atPitchBias=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCHBIAS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_ATEGBIAS: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atEgBias=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_ATEGBIAS,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PR1: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr1=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PR2: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr2=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PR3: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr3=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PR3,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PL1: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl1=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL1,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PL2: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl2=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_PL3: + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl3=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_PL3,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FIX: + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].isFix=val==1; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FIX+k*DECAPAR2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FIXRANGE: + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].freq=((double)val)/100.0; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER, + CTRL_FIXRANGE+k*DECAPAR2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_OSW: + _preset[ch]->setIsUsed(true); + _preset[ch]->oscWave[k]=(OscWave)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_OSW+k*DECAPAR2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_SHFT: + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].egShift=(egShiftValue)val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_SHFT+k*DECAPAR2,val); + _gui->writeEvent(ev); + } + break; + case CTRL_REVERBRATE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.reverbRate=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_REVERBRATE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FCPITCH: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcPitch=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCPITCH,val); + _gui->writeEvent(ev); + } + break; + case CTRL_FCAMPLITUDE: + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcAmplitude=val; + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_FCAMPLITUDE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELENABLE: + setChannelEnable(ch, (bool)val); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELENABLE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELDETUNE: + _preset[ch]->setIsUsed(true); + setChannelDetune(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELDETUNE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELVOLUME: + setChannelVol(ch, val); + applyChannelAmp(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELVOLUME,val); + _gui->writeEvent(ev); + } + break; + case CTRL_NBRVOICES: + setNbrVoices(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_NBRVOICES, val); + _gui->writeEvent(ev); + } + break; + case CTRL_PROGRAM: { + int hbank = (val & 0xff0000) >> 16; + int lbank = (val & 0xff00) >> 8; + int prog = val & 0x7f; + if (hbank > 127) // map "dont care" to 0 + hbank = 0; + if (lbank > 127) + lbank = 0; + programSelect(ch, hbank, lbank, prog); + _preset[ch]->setIsUsed(true);//TODO : not sure to put that + if(!fromGui) { + MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_PROGRAM, val); + _gui->writeEvent(ev); + } + } break; + case CTRL_MODULATION: + setModulation(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_MODULATION, val); + _gui->writeEvent(ev); + } + break; + case CTRL_PITCH: + setPitchBendCoef(ch, val); + break; + case CTRL_PANPOT: + _preset[ch]->setIsUsed(true); + deiPan = val*2*MAXCHANNELPAN/127-MAXCHANNELPAN; + setChannelPan(ch, deiPan); + applyChannelAmp(ch); + if(!fromGui) { + MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, deiPan); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELPAN: + _preset[ch]->setIsUsed(true); + setChannelPan(ch, val); + applyChannelAmp(ch); + if(!fromGui) { + MidiPlayEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, val); + _gui->writeEvent(ev); + } + break; + case CTRL_FINEBRIGHTNESS: + _preset[ch]->setIsUsed(true); + setChannelBrightness(ch, val); + setOutLevel(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_FINEBRIGHTNESS, val); + _gui->writeEvent(ev); + } + break; + case CTRL_BRIGHTNESS: + _preset[ch]->setIsUsed(true); + setChannelBrightness(ch, val*(MIDFINEBRIGHTNESS/MIDBRIGHTNESS)); + setOutLevel(ch); + if(!fromGui) { + MidiPlayEvent + ev(0,ch,ME_CONTROLLER,CTRL_FINEBRIGHTNESS,getChannelBrightness(ch)); + _gui->writeEvent(ev); + } + break; + case CTRL_ATTACK_TIME: + _preset[ch]->setIsUsed(true); + setChannelAttack(ch, val); + setEnvAttack(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_ATTACK_TIME, val); + _gui->writeEvent(ev); + } + break; + case CTRL_RELEASE_TIME: + _preset[ch]->setIsUsed(true); + setChannelRelease(ch, val); + setEnvRelease(ch); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_RELEASE_TIME, val); + _gui->writeEvent(ev); + } + break; + case CTRL_REVERB_SEND: + setChannelReverb(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_REVERB_SEND, val); + _gui->writeEvent(ev); + } + break; + case CTRL_CHORUS_SEND: + setChannelChorus(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_CHORUS_SEND, val); + _gui->writeEvent(ev); + } + break; + case CTRL_VARIATION_SEND: + setChannelDelay(ch, val); + if(!fromGui) { + MidiPlayEvent ev(0,ch, ME_CONTROLLER, CTRL_VARIATION_SEND, val); + _gui->writeEvent(ev); + } + break; + case CTRL_SUSTAIN: + setSustain(ch, val); + break; + case CTRL_VOLUME: + setChannelVol(ch, val*(MAXCHANNELVOLUME/127)); + applyChannelAmp(ch); + if(!fromGui) { + MidiPlayEvent + ev(0, ch, ME_CONTROLLER, CTRL_CHANNELVOLUME, getChannelVol(ch)); + _gui->writeEvent(ev); + } + break; + case CTRL_ALL_SOUNDS_OFF: + resetVoices(); + default: + break; + } + } + return false; +} + +//--------------------------------------------------------- +// getPatchName +//--------------------------------------------------------- + +const char* DeicsOnze2::getPatchName(int ch, int val, int) const { + if(_global.channel[ch].isEnable) { + Preset* p_preset; + int hbank = (val & 0xff0000) >> 16; + int lbank = (val & 0xff00) >> 8; + if (hbank > 127) + hbank = 0; + if (lbank > 127) + lbank = 0; + if (lbank == 127) // drum HACK + lbank = 128; + int prog = val & 0x7f; + char* tempName="INITVOICE"; + p_preset=_set->findPreset(hbank, lbank, prog); + if (p_preset) tempName=const_cast(p_preset->name.c_str()); + return tempName; + } + return " "; +} + +//--------------------------------------------------------- +// getPatchInfo +//--------------------------------------------------------- +const MidiPatch* DeicsOnze2::getPatchInfo(int /*ch*/, const MidiPatch* p) const { + Preset* preset = NULL; + Subcategory* sub = NULL; + Category* cat = NULL; + if(p) { + _patch.hbank = p->hbank; + _patch.lbank = p->lbank; + _patch.prog = p->prog; + switch(p->typ) { + case MP_TYPE_HBANK : + sub = findSubcategory(_patch.hbank, _patch.lbank); + if(sub) { + _patch.name = sub->_subcategoryName.c_str(); + _patch.typ = MP_TYPE_LBANK; + return &_patch; + } + else { + if(_patch.lbank + 1 < LBANK_NBR) { + _patch.lbank++; + return getPatchInfo(0, &_patch); + } + else { + _patch.prog = PROG_NBR - 1; //hack to go faster + _patch.typ = 0; + return getPatchInfo(0, &_patch); + } + } + break; + case MP_TYPE_LBANK : + preset = findPreset(_patch.hbank, _patch.lbank, _patch.prog); + _patch.typ = 0; + if(preset) { + _patch.name = preset->name.c_str(); + return &_patch; + } + else return getPatchInfo(0, &_patch); + break; + default : + if(_patch.prog + 1 < PROG_NBR) { + _patch.prog++; + preset = findPreset(_patch.hbank, _patch.lbank, _patch.prog); + if(preset) { + _patch.name = preset->name.c_str(); + return &_patch; + } + else return getPatchInfo(0, &_patch); + } + else { + _patch.prog = 0; + if(_patch.lbank + 1 < LBANK_NBR) { + _patch.lbank++; + _patch.typ = MP_TYPE_HBANK; + return getPatchInfo(0, &_patch); + } + else { + _patch.lbank = 0; + if(_patch.hbank + 1 < HBANK_NBR) { + _patch.hbank++; + _patch.typ = MP_TYPE_HBANK; + cat = findCategory(_patch.hbank); + if(cat) { + _patch.name = cat->_categoryName.c_str(); + return &_patch; + } + return getPatchInfo(0, &_patch); + } + else return NULL; + } + } + } + } + else { + _patch.typ = MP_TYPE_HBANK; + _patch.hbank = 0; + _patch.lbank = 0; + _patch.prog = 0; + cat = findCategory(_patch.hbank); + if(cat) { + _patch.name = cat->_categoryName.c_str(); + return &_patch; + } + else { + _patch.hbank++; + return getPatchInfo(0, &_patch); + } + } +} + +//--------------------------------------------------------- +// getControllerInfo +/*! + \fn SimpleSynth::getControllerInfo + \brief Called from host to collect info about which controllers + the synth supports + \param index current controller number + \param name pointer where name is stored + \param controller int pointer where muse controller number is stored + \param min int pointer where controller min value is stored + \param max int pointer where controller max value is stored + \return 0 when done, otherwise return next desired controller index +*/ +//--------------------------------------------------------- +int DeicsOnze2::getControllerInfo(int index, const char** name, + int* controller, int* min, int* max) +{ + if (index >= nbrCtrl) { + return 0; + } + + *name = _ctrl[index].name.c_str(); + *controller = _ctrl[index].num; + *min = _ctrl[index].min; + *max = _ctrl[index].max; + return (index +1); +} + +//--------------------------------------------------------- +// playNote +// process note on +//--------------------------------------------------------- +bool DeicsOnze2::playNote(int ch, int pitch, int velo) { + int newVoice; + int nO2V; + int p2V; + double tempTargetFreq; + if(_global.channel[ch].isEnable) { + if(velo==0) {//Note off + p2V=pitchOn2Voice(ch, pitch); + //printf("Note Off : pitchOn2Voice = %d\n", p2V); + if(p2V<_global.channel[ch].nbrVoices) { + if(_global.channel[ch].sustain) + _global.channel[ch].voices[p2V].isSustained = true; + else { + _global.channel[ch].voices[p2V].keyOn = false; + _global.channel[ch].lastVoiceKeyOff = p2V; + _global.channel[ch].lastVoiceKeyOn.remove(p2V); + if(_preset[ch]->function.mode == MONO && existsKeyOn(ch) + && _global.channel[ch].voices[p2V].isOn) { + newVoice = _global.channel[ch].lastVoiceKeyOn.back(); + //portamento + if(_preset[ch]->function.portamentoTime!=0) { + _global.channel[ch].voices[newVoice].hasAttractor = true; + _global.channel[ch].voices[newVoice].attractor = + getAttractor(_preset[ch]->function.portamentoTime, + _global.deiSampleRate); + } + else _global.channel[ch].voices[newVoice].hasAttractor = false; + //feedback + _global.channel[ch].voices[newVoice].sampleFeedback = + _global.channel[ch].voices[p2V].sampleFeedback; + //on/off + _global.channel[ch].voices[p2V].isOn = false; + _global.channel[ch].voices[newVoice].isOn = true; + //per op + for(int i = 0; i < NBROP; i++) { + _global.channel[ch].voices[newVoice].op[i].index = + _global.channel[ch].voices[p2V].op[i].index; + _global.channel[ch].voices[newVoice].op[i].envState = + _global.channel[ch].voices[p2V].op[i].envState; + _global.channel[ch].voices[newVoice].op[i].envIndex = + _global.channel[ch].voices[p2V].op[i].envIndex; + _global.channel[ch].voices[newVoice].op[i].envInct = + _global.channel[ch].voices[p2V].op[i].envInct; + _global.channel[ch].voices[newVoice].op[i].envLevel = + _global.channel[ch].voices[p2V].op[i].envLevel; + _global.channel[ch].voices[newVoice].op[i].coefVLevel = + _global.channel[ch].voices[p2V].op[i].coefVLevel; + if(_global.channel[ch].voices[newVoice].hasAttractor) + _global.channel[ch].voices[newVoice].op[i].inct = + _global.channel[ch].voices[p2V].op[i].inct; + } + } + else { + setPitchEnvRelease(ch, p2V); + for(int i=0; ifunction.portamentoTime!=0 + && _global.channel[ch].isLastNote && + (_preset[ch]->function.portamento==FULL) || + (_preset[ch]->function.portamento==FINGER && existsKeyOn(ch))) { + _global.channel[ch].voices[newVoice].hasAttractor = true; + _global.channel[ch].voices[newVoice].attractor = + getAttractor(_preset[ch]->function.portamentoTime, + _global.deiSampleRate); + } + else _global.channel[ch].voices[newVoice].hasAttractor = false; + + if(_preset[ch]->lfo.sync) _global.channel[ch].lfoIndex=0; + + _global.channel[ch].lfoDelayIndex = + (_preset[ch]->lfo.delay==0?(double)(RESOLUTION/4):0.0); + _global.channel[ch].delayPassed = false; + + //-------------- + //PITCH ENVELOPE + //-------------- + if(isPitchEnv(&_preset[ch]->pitchEg)) { + _global.channel[ch].voices[newVoice].pitchEnvState = PHASE1; + _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase1 = + getPitchEnvCoefInct(_preset[ch]->pitchEg.pl1); + _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase2 = + getPitchEnvCoefInct(_preset[ch]->pitchEg.pl2); + _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase3 = + getPitchEnvCoefInct(_preset[ch]->pitchEg.pl3); + _global.channel[ch].voices[newVoice].pitchEnvCoefInct = + _global.channel[ch].voices[newVoice].pitchEnvCoefInctPhase1; + _global.channel[ch].voices[newVoice].pitchEnvCoefInctInct = + getPitchEnvCoefInctInct(_preset[ch]->pitchEg.pl1, + _preset[ch]->pitchEg.pl2, + _preset[ch]->pitchEg.pr1, + _global.deiSampleRate); + } + else { + _global.channel[ch].voices[newVoice].pitchEnvState = OFF_PE; + _global.channel[ch].voices[newVoice].pitchEnvCoefInct = 1.0; + } + //per operator + for(int i=0; isensitivity.keyVelocity[i]) + *note2Amp((double) (pitch+_preset[ch]->function.transpose), + _preset[ch]->scaling.level[i]); + _global.channel[ch].voices[newVoice].op[i].amp = + outLevel2Amp(_preset[ch]->outLevel[i]) + *_global.channel[ch].voices[newVoice].op[i].ampVeloNote + * brightness2Amp(ch, i); + //---------------- + //INDEX & ENVELOPE + //---------------- + //if index get 0.0, it means that the offset is 0 + if(existsKeyOn(ch)) { + int lastVoice = _global.channel[ch].lastVoiceKeyOn.back(); + if(_preset[ch]->function.mode == MONO) { + _global.channel[ch].voices[newVoice].op[i].index = + _global.channel[ch].voices[lastVoice].op[i].index; + _global.channel[ch].voices[newVoice].sampleFeedback = + _global.channel[ch].voices[lastVoice].sampleFeedback; + _global.channel[ch].voices[newVoice].op[i].envState = + _global.channel[ch].voices[lastVoice].op[i].envState; + _global.channel[ch].voices[newVoice].op[i].envIndex = + _global.channel[ch].voices[lastVoice].op[i].envIndex; + _global.channel[ch].voices[newVoice].op[i].envInct = + _global.channel[ch].voices[lastVoice].op[i].envInct; + _global.channel[ch].voices[newVoice].op[i].envLevel = + _global.channel[ch].voices[lastVoice].op[i].envLevel; + _global.channel[ch].voices[newVoice].op[i].coefVLevel = + _global.channel[ch].voices[lastVoice].op[i].coefVLevel; + _global.channel[ch].voices[lastVoice].isOn = false; + } + else { + _global.channel[ch].voices[newVoice].op[i].index = 0.0; + _global.channel[ch].voices[newVoice].sampleFeedback = 0.0; + _global.channel[ch].voices[newVoice].op[i].envState = ATTACK; + _global.channel[ch].voices[newVoice].op[i].envIndex = 0.0; + setEnvAttack(ch, newVoice, i); + } + } + else { + _global.channel[ch].voices[newVoice].op[i].index = 0.0; + _global.channel[ch].voices[newVoice].sampleFeedback = 0.0; + _global.channel[ch].voices[newVoice].op[i].envState = ATTACK; + _global.channel[ch].voices[newVoice].op[i].envIndex = 0.0; + setEnvAttack(ch, newVoice, i); + if(_preset[ch]->function.mode == MONO && + _global.channel[ch].isLastNote) { + _global.channel[ch].voices[_global.channel[ch].lastVoiceKeyOff] + .isOn = false; + } + } + + //---- + //FREQ + //---- + //the frequence for each operator is calculated + //and is used later to calculate inct + tempTargetFreq = + (pitch2freq((double)getChannelDetune(ch) + /(double)MAXCHANNELDETUNE) + /LOWERNOTEFREQ)* + (_preset[ch]->frequency[i].isFix? + _preset[ch]->frequency[i].freq: + (_preset[ch]->frequency[i].ratio + *pitch2freq((double)(pitch+_preset[ch]->function.transpose) + +(double)_preset[ch]->detune[i]*COEFDETUNE))); + //---- + //INCT + //---- + //compute inct + _global.channel[ch].voices[newVoice].op[i].targetInct = + (double)RESOLUTION / ( _global.deiSampleRate / tempTargetFreq ); + if(_global.channel[ch].voices[newVoice].hasAttractor && + !_preset[ch]->frequency[i].isFix) + _global.channel[ch].voices[newVoice].op[i].inct = + _global.channel[ch].lastInc[i]; + else _global.channel[ch].voices[newVoice].op[i].inct = + _global.channel[ch].voices[newVoice].op[i].targetInct; + } + //-------------------- + //some initializations + //-------------------- + _global.channel[ch].voices[newVoice].keyOn = true; + _global.channel[ch].voices[newVoice].isSustained = false; + _global.channel[ch].voices[newVoice].isOn = true; + _global.channel[ch].voices[newVoice].pitch = pitch; + _global.channel[ch].isLastNote = true; + _global.channel[ch].lastVoiceKeyOn.push_back(newVoice); + for(int k = 0; k < NBROP; k++) + _global.channel[ch].lastInc[k] = + _global.channel[ch].voices[newVoice].op[k].inct; + return false; + } + } + return false; +} + +//--------------------------------------------------------- +// plusMod +// add two doubles modulo RESOLUTION +//--------------------------------------------------------- +inline double plusMod(double x, double y) { + double res; + res=x+y; + if (res>=0) while (res >= (double)RESOLUTION) res-=(double)RESOLUTION; + else while (res < 0) res+=(double)RESOLUTION; + return res; +} + + +//--------------------------------------------------------- +// write +// synthesize n samples into buffer+offset +//--------------------------------------------------------- +void DeicsOnze2::process(float** buffer, int offset, int n) { + //Process messages from the gui + while (_gui->fifoSize()) { + MidiPlayEvent ev = _gui->readEvent(); + if (ev.type() == ME_SYSEX) { + sysex(ev.len(), ev.data(), true); + sendEvent(ev); + } + else if (ev.type() == ME_CONTROLLER) { + setController(ev.channel(), ev.dataA(), ev.dataB(), true); + sendEvent(ev); + } + } + float* leftOutput = buffer[0] + offset; + float* rightOutput = buffer[1] + offset; + + float sample[MAXNBRVOICES]; + float tempLeftOutput; + float tempRightOutput; + float tempChannelOutput; + float tempChannelLeftOutput; + float tempChannelRightOutput; + float tempIncChannel; //for optimization + float sampleOp[NBROP]; + for(int i = 0; i < NBROP; i++) sampleOp[i] = 0.0; + float ampOp[NBROP]; + for(int i = 0; i < n; i++) { + if(_global.qualityCounter == 0) { + tempLeftOutput = 0.0; + tempRightOutput = 0.0; + _global.lastInputLeftChorusSample = 0.0; + _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; + if(_global.channel[c].isEnable) { + //lfo, trick : we use the first quater of the wave W2 + lfoUpdate(_preset[c], &_global.channel[c], waveTable[W2]); + + //optimization + tempIncChannel = + _global.channel[c].lfoCoefInct * _global.channel[c].pitchBendCoef; + + //per voice + for(int j=0; j<_global.channel[c].nbrVoices; j++) { + if (_global.channel[c].voices[j].isOn) { + //portamento + portamentoUpdate(&_global.channel[c], + &_global.channel[c].voices[j]); + //pitch envelope + pitchEnvelopeUpdate(&_global.channel[c].voices[j], + &_preset[c]->pitchEg, _global.deiSampleRate); + //per op + for(int k=0; ksensitivity.ampOn[k]? + _global.channel[c].lfoAmp:1.0) + *env2AmpR(_global.deiSampleRate, waveTable[W2], + _preset[c]->eg[k], + &_global.channel[c].voices[j].op[k]); + } + switch(_preset[c]->algorithm) { + case FIRST : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)plusMod(_global.channel[c].voices[j].op[2].index, + (float)RESOLUTION*sampleOp[3])]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)plusMod(_global.channel[c].voices[j].op[1].index, + (float)RESOLUTION*sampleOp[2])]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION*sampleOp[1])]; + + sample[j]=sampleOp[0];///COEFLEVEL; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case SECOND : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)_global.channel[c].voices[j].op[2].index]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)plusMod(_global.channel[c].voices[j].op[1].index, + (float)RESOLUTION + *(sampleOp[2]+sampleOp[3])/2.0)]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION + *sampleOp[1])]; + + sample[j]=sampleOp[0];///COEFLEVEL; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case THIRD : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)_global.channel[c].voices[j].op[2].index]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)plusMod(_global.channel[c].voices[j].op[1].index, + (float)RESOLUTION*sampleOp[2])]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION + *(sampleOp[3]+sampleOp[1])/2.0)]; + + sample[j]=sampleOp[0];///COEFLEVEL; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case FOURTH : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)plusMod(_global.channel[c].voices[j].op[2].index, + (float)RESOLUTION + *sampleOp[3])]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)_global.channel[c].voices[j].op[1].index]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION + *(sampleOp[1]+sampleOp[2])/2.0)]; + + sample[j]=sampleOp[0];///COEFLEVEL; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case FIFTH : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)plusMod(_global.channel[c].voices[j].op[2].index, + (float)RESOLUTION*sampleOp[3])]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)_global.channel[c].voices[j].op[1].index]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION*sampleOp[1])]; + + sample[j]=(sampleOp[0]+sampleOp[2])/2.0;///COEFLEVEL; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF + ||_global.channel[c].voices[j].op[2].envState!=OFF); + break; + case SIXTH : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)plusMod(_global.channel[c].voices[j].op[2].index, + (float)RESOLUTION*sampleOp[3])]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)plusMod(_global.channel[c].voices[j].op[1].index, + (float)RESOLUTION*sampleOp[3])]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)plusMod(_global.channel[c].voices[j].op[0].index, + (float)RESOLUTION*sampleOp[3])]; + + sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case SEVENTH : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)plusMod(_global.channel[c].voices[j].op[2].index, + (float)RESOLUTION*sampleOp[3])]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)_global.channel[c].voices[j].op[1].index]; + sampleOp[0]=ampOp[0]*waveTable[_preset[c]->oscWave[0]] + [(int)_global.channel[c].voices[j].op[0].index]; + + sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF); + break; + case EIGHTH : + sampleOp[3]=ampOp[3] + *waveTable[_preset[c]->oscWave[3]] + [(int)plusMod(_global.channel[c].voices[j].op[3].index, + (float)RESOLUTION + *_global.channel[c].voices[j].sampleFeedback)]; + sampleOp[2]=ampOp[2] + *waveTable[_preset[c]->oscWave[2]] + [(int)_global.channel[c].voices[j].op[2].index]; + sampleOp[1]=ampOp[1] + *waveTable[_preset[c]->oscWave[1]] + [(int)_global.channel[c].voices[j].op[1].index]; + sampleOp[0]=ampOp[0] + *waveTable[_preset[c]->oscWave[0]] + [(int)_global.channel[c].voices[j].op[0].index]; + + sample[j]= + (sampleOp[0]+sampleOp[1]+sampleOp[2]+sampleOp[3]) + /4.0; + + _global.channel[c].voices[j].isOn = + (_global.channel[c].voices[j].op[0].envState!=OFF + || _global.channel[c].voices[j].op[1].envState!=OFF + || _global.channel[c].voices[j].op[2].envState!=OFF + || _global.channel[c].voices[j].op[3].envState!=OFF); + break; + default : printf("Error : No algorithm"); + break; + } + + _global.channel[c].voices[j].volume= + ampOp[0]+ampOp[1]+ampOp[2]+ampOp[3]; + + _global.channel[c].voices[j].sampleFeedback = + sampleOp[3]*_global.channel[c].feedbackAmp; + + tempChannelOutput += sample[j]; + } + } + //printf("left out = %f, temp out = %f, left amp = %f\n", + //tempLeftOutput, tempChannelOutput, _global.channel[c].ampLeft); + + tempChannelLeftOutput = tempChannelOutput*_global.channel[c].ampLeft; + tempChannelRightOutput=tempChannelOutput*_global.channel[c].ampRight; + + if(_global.isChorusActivated) { + _global.lastInputLeftChorusSample += tempChannelLeftOutput * + _global.channel[c].chorusAmount; + _global.lastInputRightChorusSample += tempChannelRightOutput * + _global.channel[c].chorusAmount; + } + if(_global.isReverbActivated) { + _global.lastInputLeftReverbSample += tempChannelLeftOutput * + _global.channel[c].reverbAmount; + _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; + } + } + _global.lastLeftSample = tempLeftOutput * _global.masterVolume; + _global.lastRightSample = tempRightOutput * _global.masterVolume; + } + leftOutput[i] += _global.lastLeftSample; + rightOutput[i] += _global.lastRightSample; + + if(_global.isChorusActivated) { + tempInputChorus[0][i] = _global.lastInputLeftChorusSample; + tempInputChorus[1][i] = _global.lastInputRightChorusSample; + } + if(_global.isReverbActivated) { + 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; + } + //apply Filter + if(_global.filter) _dryFilter->process(leftOutput, rightOutput, n); + //Chorus + if(_pluginIChorus && _global.isChorusActivated) { + //apply Filter + if(_global.filter) _chorusFilter->process(tempOutputChorus[0], + tempOutputChorus[1], n); + //apply Chorus + _pluginIChorus->apply(n, 2, tempInputChorus, tempOutputChorus); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputChorus[0][i] * _global.chorusReturn * _global.masterVolume; + rightOutput[i] += + tempOutputChorus[1][i] * _global.chorusReturn * _global.masterVolume; + } + } + //Reverb + if(_pluginIReverb && _global.isReverbActivated) { + //apply Filter + if(_global.filter) _reverbFilter->process(tempOutputReverb[0], + tempOutputReverb[1], n); + //apply Reverb + _pluginIReverb->apply(n, 2, tempInputReverb, tempOutputReverb); + for(int i = 0; i < n; i++) { + leftOutput[i] += + tempOutputReverb[0][i] * _global.reverbReturn * _global.masterVolume; + rightOutput[i] += + tempOutputReverb[1][i] * _global.reverbReturn * _global.masterVolume; + } + } + //Delay + if(_pluginIDelay && _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; + } + } +} + + +//--------------------------------------------------------- +// inst +//--------------------------------------------------------- + +class QWidget; + +static Mess* instantiate(int sr, const char*) +{ + DeicsOnze2* deicsonze2 = new DeicsOnze2(); + deicsonze2->setSampleRate(sr); + return deicsonze2; +} + +extern "C" { + static MESS descriptor = { + "DeicsOnze2", + "DeicsOnze2 FM DX11/TX81Z emulator", + "0.5.5", // version string + MESS_MAJOR_VERSION, MESS_MINOR_VERSION, + instantiate + }; + // We must compile with -fvisibility=hidden to avoid namespace + // conflicts with global variables. + // Only visible symbol is "mess_descriptor". + // (TODO: all plugins should be compiled this way) + + __attribute__ ((visibility("default"))) + const MESS* mess_descriptor() { return &descriptor; } +} + diff --git a/muse2/synti/deicsonze2/deicsonze2.h b/muse2/synti/deicsonze2/deicsonze2.h new file mode 100644 index 00000000..486b64cd --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2.h @@ -0,0 +1,603 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// +// +// +// Copyright (c) 2004-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 __DEICSONZE2_H +#define __DEICSONZE2_H + +#include + +#include "deicsonze2preset.h" +#include "deicsonze2gui.h" +#include "deicsonze2plugin.h" +#include "deicsonze2filter.h" +#include "libsynti/mess.h" +#include "muse/plugin.h" + +#define DEICSONZE2STR "deicsonze2" + +#define MAXPITCHBENDVALUE 8191 + +#define RESOLUTION 96000 + +#define MAXFXBUFFERSIZE 48000 +#define NBRFXINPUTS 2 +#define NBRFXOUTPUTS 2 + +#define NBRCTRLS 127 + +#define NBRPRESETS 128 + +#define LOWERNOTEFREQ 8.176 + +#define DB0LEVEL 90 + +#define LENGTHNAME 20 +#define LENGTHCATEGORY 20 +#define LENGTHSUBCATEGORY 20 + +#define MAXVELO 127 +#define MAXVOLUME 100.0 +#define MAXSTRLENGTHINITSETPATH 256 +#define MAXSTRLENGTHBACKGROUNDPIXPATH 256 +#define MAXSTRLENGTHFXLIB 256 +#define MAXSTRLENGTHFXLABEL 256 + +#define DB_MIN 25.0 + +//coef determined by ear to sound like the YAMAHA DX11 +#define COEFFEEDBACK 0.3 +#define COEFPLFO(x) (x==0?0.0:(x==1?0.06:(x==2?0.12:(x==3?0.25:(x==4?0.5:(x==5?0.9:(x==6?3.9:7.9))))))) //return pitch amplitude with respect to sensitivity pitch +#define COEFALFO(x) (x==0?0.0:(x==1?0.4:(x==2?0.9:1.0))) +#define MAX(x,y) (x2.0, 90->1.0, 80->0.5 ... +//--------------------------------------------------------- +inline double outLevel2Amp(int ol); + +//--------------------------------------------------------- +// level2amp, +// 255->0dB->1.0, 0->-27dB->0 +//--------------------------------------------------------- +inline double level2amp(int l); + +//--------------------------------------------------------- +// amp2level +// 1.0->0dB->255, 0->-27dB->0 +//--------------------------------------------------------- +inline int amp2level(double amp); + +//--------------------------------------------------------- +// amp2lowlevel +// 1.0->0dB->127, 0->-27dB->0 +//--------------------------------------------------------- +inline int amp2lowlevel(double amp); + +//--------------------------------------------------------- +// lowlevel2amp, +// 127->0dB->1.0, 0->-27dB->0 +//--------------------------------------------------------- +inline double lowlevel2amp(int l); + +//--------------------------------------------------------- +// envAR2s +// return the time in second of the ATTACK duration +//--------------------------------------------------------- +inline double envAR2s(int ar); + +//--------------------------------------------------------- +// coefAttack +// convert the attack value to a coef for envInct +//--------------------------------------------------------- +inline double coefAttack(unsigned char attack); + +//--------------------------------------------------------- +// envRR2coef +// return the coefficient for the exponential decrease +// with respect to rr and sampleRate, sr +//--------------------------------------------------------- +inline double envRR2coef(int rr, double sr, unsigned char release); + +//-------------------------------------------------------- +// DeicsOnze2Ctrl +//-------------------------------------------------------- +struct DeicsOnze2Ctlr +{ + std::string name; + int num; + int min, max; +}; + +//--------------------------------------------------------- +// EnvState +//--------------------------------------------------------- + +enum EnvState{ + ATTACK, + DECAY, + SUSTAIN, + RELEASE, + OFF +}; + +//--------------------------------------------------------- +// OpVoice +//--------------------------------------------------------- + +struct OpVoice { + double index; + double inct; + double targetInct; //used if portamento + double amp; //between 0 and 1 + double ampVeloNote; //keeps the ratio amplitude from velo2AmpR and note2Amp + //in order to change independently the output level + //after pressing the note + EnvState envState; + double envIndex; + double envInct; + double envLevel; + double coefVLevel; +}; + +//--------------------------------------------------------- +// PitchEnvState +//--------------------------------------------------------- +enum PitchEnvState{ + PHASE1, + PHASE2, + RELEASE_PE, + OFF_PE +}; + +//--------------------------------------------------------- +// Voice +//--------------------------------------------------------- + +struct Voice { + bool hasAttractor;//true iff the voice has an attractor (portamento occuring) + double attractor; //contains some coeficent for portamento TODO + PitchEnvState pitchEnvState; + double pitchEnvCoefInct; + double pitchEnvCoefInctPhase1; + double pitchEnvCoefInctPhase2; + double pitchEnvCoefInctPhase3; + double pitchEnvCoefInctRelease; + double pitchEnvCoefInctInct; + bool isOn; + bool keyOn; + bool isSustained; + int pitch; //number of the note + double volume; + OpVoice op[NBROP]; + float sampleFeedback; +}; + +//--------------------------------------------------------- +// Channel +//--------------------------------------------------------- +struct Channel { + bool isEnable; + float ampLeft; + float ampRight; + int volume; //0 to 255 + int pan; //TODO -63 +64 or -127 +128 + int modulation;//0 to 127 + int detune;//-31 to 31 + int brightness; //0 to 4095 + int attack; //0 to 127 + int release; //0 to 127 + float feedbackAmp; + float lfoFreq; + float lfoPitch; + float lfoMaxCoefInct; + float lfoCoefInct; + float lfoCoefInctInct; + unsigned int lfoIndex; + unsigned int lfoMaxIndex; + float lfoMaxAmp; + float lfoMaxDAmp; + float lfoAmp; + float lfoCoefAmp; + double lfoDelayIndex; + double lfoDelayInct; + double lfoDelayMaxIndex; + bool delayPassed; + bool sustain; + double pitchBendCoef;//speed coef to read the sample + unsigned char nbrVoices; + Voice voices[MAXNBRVOICES]; + double lastInc[NBROP]; + std::list lastVoiceKeyOn; //stack of the voice number + int lastVoiceKeyOff; + bool isLastNote; + //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 +}; + +//--------------------------------------------------------- +// Global +//--------------------------------------------------------- +enum Quality { + high, + middle, + low, + ultralow +}; + +struct Global { + float masterVolume; + Quality quality; //high, middle, low + int qualityCounter; //counter to skip some sample depending on quality + int qualityCounterTop; //number of sample - 1 to skip + double deiSampleRate; //depending on quality deicsOnze sample rate varies + bool filter; //low passe filter used when the sampling is low + int fontSize; + float lastLeftSample; + float lastRightSample; + float lastInputLeftChorusSample; + 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; +}; + +//--------------------------------------------------------- +// DeicsOnze2 : DX11 emulator +//--------------------------------------------------------- + +class DeicsOnze2 : public Mess { + DeicsOnze2Gui* _gui; + + static int useCount; + static float waveTable[NBRWAVES][RESOLUTION]; + + private: + void parseInitData(int length, const unsigned char* data); + void loadConfiguration(QString fileName); + + public: + float** tempInputChorus; + float** tempOutputChorus; + float** tempInputReverb; + float** tempOutputReverb; + float** tempInputDelay; + float** tempOutputDelay; + + float* getSinusWaveTable(); + + int nbrCtrl; + + QString _initSetPath; + bool _isInitSet; + QString _backgroundPixPath; + bool _isBackgroundPix; + bool _saveOnlyUsed; + bool _saveConfig; + DeicsOnze2Ctlr _ctrl[NBRCTRLS]; + Global _global; + Preset* _preset[NBRCHANNELS]; + Preset* _initialPreset; + + //FX + PluginI* _pluginIReverb; + PluginI* _pluginIChorus; + PluginI* _pluginIDelay; + + void initPluginReverb(Plugin*); + void initPluginChorus(Plugin*); + void initPluginDelay(Plugin*); + + void setReverbParam(int i, double val); + double getReverbParam(int i); + void setChorusParam(int i, double val); + double getChorusParam(int i); + void setDelayBPM(float val); + void setDelayBeatRatio(float val); + void setDelayFeedback(float val); + void setDelayLFOFreq(float val); + void setDelayLFODepth(float val); + void setDelayDryWet(float val); + float getDelayBPM(); + float getDelayBeatRatio(); + float getDelayFeedback(); + float getDelayLFOFreq(); + float getDelayLFODepth(); + + //Filter + LowFilter* _dryFilter; + LowFilter* _chorusFilter; + LowFilter* _reverbFilter; + LowFilter* _delayFilter; + + mutable MidiPatch _patch; + mutable int _numPatchProg; //used by getPatchInfo + + //preset tree + Set* _set; + + void setSampleRate(int sr); + Preset* findPreset(int hbank, int lbank, int prog) const; + Subcategory* findSubcategory(int hbank, int lbank) const; + Category* findCategory(int hbank) const; + void initCtrls(); + void initGlobal(); + void initChannels(); + void initChannel(int c); + void resetVoices(); //when panic is pressed + void initVoice(int c, int v); + void initVoices(int c); + void setPreset(int c); + void setFeedback(int c); + void setLfo(int c); + void setOutLevel(int c, int k); //set the output level of the op k + void setOutLevel(int c); //do the same for all operators + void setEnvAttack(int c, int v, int k); //set envInct of voice v and op k + void setEnvAttack(int c, int k); //do the same for all voices of operator k + void setEnvAttack(int c); //do the same for all voices all operators + void setEnvRelease(int c, int v, int k); //set coefVLevel of voice v and op k + void setEnvRelease(int c, int k); //do the same for all voices of operator k + void setEnvRelease(int c); //do the same for all voices all operators + void setPitchEnvRelease(int c, int v); + void setQuality(Quality q); + void setFilter(bool f); + double brightness2Amp(int c, int k); //get the brightness of the operator k + void loadSutulaPresets(); + void loadSet(QString s); + int noteOff2Voice(int c); //return the first free voice + int minVolu2Voice(int c); + int pitchOn2Voice(int c, int pitch); + void programSelect(int c, int hbank, int lbank, int prog); + bool existsKeyOn(int ch); + void setNbrVoices(int c, int nv); + void setMasterVol(int v); + void setChannelEnable(int c, bool e); + void setChannelVol(int c, int v); + void setChannelPan(int c, int v); + void applyChannelAmp(int c); + void setChannelDetune(int c, int d); + void setChannelBrightness(int c, int b); + void setChannelModulation(int c, int m); + void setChannelAttack(int c, int a); + 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; + bool getFilter(void) const; + int getChannelVol(int c) const; + int getChannelPan(int c) const; + int getChannelDetune(int c) const; + int getChannelBrightness(int c) const; + int getChannelModulation(int c) const; + int getChannelAttack(int c) const; + 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); + + void readConfiguration(QDomNode qdn); + void writeConfiguration(Xml* xml); + + bool setController(int ch, int ctrl, int val, bool fromGui); + virtual bool setController(int ch, int ctrl, int val); + bool sysex(int length, const unsigned char* data, bool fromGui); + virtual bool sysex(int length, const unsigned char* data); + + virtual const char* getPatchName(int ch, int number, int) const; + virtual const MidiPatch* getPatchInfo(int, const MidiPatch *) const; + + virtual int getControllerInfo(int arg1, const char** arg2, + int* arg3, int* arg4, int* arg5); + virtual void getInitData(int* length, const unsigned char** data); + virtual bool playNote(int channel, int pitch, int velo); + virtual void process(float** buffer, int offset, int n); + + // GUI interface routines + virtual bool hasGui() const { return true; } + virtual bool guiVisible() const; + virtual void showGui(bool); + virtual void getGeometry(int* x, int* y, int* w, int* h) const; + virtual void setGeometry(int, int, int, int); + + DeicsOnze2(); + ~DeicsOnze2(); +}; + + +#endif /* __DEICSONZE2_H */ diff --git a/muse2/synti/deicsonze2/deicsonze2filter.cpp b/muse2/synti/deicsonze2/deicsonze2filter.cpp new file mode 100644 index 00000000..c80d3526 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2filter.cpp @@ -0,0 +1,67 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// deicsonzefilter.cpp +// +// +// Copyright (c) 2004-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 "deicsonzefilter.h" + +LowFilter::LowFilter() { + _li = 0.0; + _ri = 0.0; + _lo = 0.0; + _ro = 0.0; +} + +void LowFilter::setSamplerate(int sr) { + _samplerate = sr; +} + +void LowFilter::setCutoff(double cut) { + _cutoff = cut; + float w = 2.0 * (float)_samplerate; + float fCut = _cutoff * 2.0 * M_PI; + float norm = 1.0 / (fCut + w); + _a = fCut * norm; + _b = (w - fCut) * norm; +} + +void LowFilter::process(float* leftSamples, float* rightSamples, unsigned n) { + float cl, cr; + for(unsigned i = 0; i < n; i++) { + cl = leftSamples[i]; + cr = rightSamples[i]; + + leftSamples[i] = _a * (cl + _li) + _b * _lo; + rightSamples[i] = _a * (cr + _ri) + _b * _ro; + + _li = cl; + _ri = cr; + _lo = leftSamples[i]; + _ro = rightSamples[i]; + } +} + diff --git a/muse2/synti/deicsonze2/deicsonze2filter.h b/muse2/synti/deicsonze2/deicsonze2filter.h new file mode 100644 index 00000000..1d2cf6ff --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2filter.h @@ -0,0 +1,59 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// deicsonzefilter.h +// +// +// Copyright (c) 2004-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 __DEICSONZE2FILTER_H +#define __DEICSONZE2FILTER_H + +#include + +class LowFilter { + private: + int _samplerate; + + double _cutoff; //frequency cutoff + float _a; + float _b; + + float _li; //last left input sample + float _ri; //last right input sample + float _lo; //last left output sample + float _ro; //last right output sample + public: + LowFilter(); + ~LowFilter() {} + + void setSamplerate(int sr); + void setCutoff(double cut); + //int getSamplerate(); + //double getCutoff(); + + void process(float* leftSamples, float* RightSamples, unsigned n); +}; + +#endif /* __DEICSONZE2FILTER_H */ diff --git a/muse2/synti/deicsonze2/deicsonze2gui.cpp b/muse2/synti/deicsonze2/deicsonze2gui.cpp new file mode 100644 index 00000000..e69de29b diff --git a/muse2/synti/deicsonze2/deicsonze2gui.h b/muse2/synti/deicsonze2/deicsonze2gui.h new file mode 100644 index 00000000..3836fc9a --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2gui.h @@ -0,0 +1,571 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// deicsonzegui.h +// +// +// Copyright (c) 2004-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 __DEICSONZE2GUI_H +#define __DEICSONZE2GUI_H + +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +#include "deicsonze2.h" + +#include "deicsonze2preset.h" +#include "deicsonze2guibase.h" +//#include "ui_deicsonze2gui.h" +#include "libsynti/gui.h" +//#include "awl/floatentry.h" +//#include "awl/slider.h" +//#include "awl/checkbox.h" + +//using Awl::FloatEntry; +//using Awl::Slider; +//using Awl::CheckBox; + +//Envelope Gui constants +#define XOFFSET 2 +#define YOFFSET 2 +#define PENWIDTH 2 +#define DOTWIDTH 3 +#define DRAGWIDTH 6 //size of the mousetracking threshold +//pitch envelope constants +#define WALLWIDTH 6 +#define PR1WIDTH (width()/3-9) +#define PR2WIDTH PR1WIDTH +#define PR3WIDTH PR1WIDTH +#define PL1HEIGHT (height()-4) +#define PL2HEIGHT PL1HEIGHT +#define PL3HEIGHT PL1HEIGHT +#define MAXPWIDTH PR1WIDTH+WALLWIDTH+PR2WIDTH+WALLWIDTH+PR3WIDTH+WALLWIDTH+PR1WIDTH +#define MAXPHEIGHT PL1HEIGHT +#define STEPVALUE 10 +//amplitude envelope constants +#define ARWIDTH (width()/4-1) +#define D1RWIDTH ARWIDTH +#define D1LHEIGHT (height()-2) +#define D2RWIDTH ARWIDTH +#define RRWIDTH ARWIDTH +#define MAXWIDTH ARWIDTH+D1RWIDTH+D1RWIDTH+RRWIDTH +#define MAXHEIGHT D1LHEIGHT + +//COLOR +#define TCOLOR QColor(0, 0, 0) //text color +#define BCOLOR QColor(210, 180, 90) //background color +#define ETCOLOR QColor(0, 150, 0) //edit text color +#define EBCOLOR QColor(255, 255, 30) //edit background color + +class DeicsOnze2; +class QFramePitchEnvelope; +class QFrameEnvelope; + +class QTreeCategory:public Q3ListViewItem { + public: + Category* _category; + QTreeCategory(Q3ListView* p, QString shbank, QString l, Category* c) + :Q3ListViewItem(p) { + setText(0, shbank); + setText(1, l); + _category=c; + }; +}; + +class QTreeSubcategory:public Q3ListViewItem { + public: + Subcategory* _subcategory; + QTreeSubcategory(Q3ListView* p, QString slbank, + QString l, Subcategory* s) + :Q3ListViewItem(p) { + setText(0, slbank); + setText(1, l); + _subcategory=s; + }; +}; + +class QTreePreset:public Q3ListViewItem { + public: + Preset* _preset; + QTreePreset(Q3ListView* pa, QString sprog, QString l, Preset* p) + :Q3ListViewItem(pa) { + setText(0, sprog); + setText(1, l); + _preset=p; + }; +}; + +//--------------------------------------------------------- +// DeicsOnze2Gui +//--------------------------------------------------------- +class DeicsOnze2Gui : public QDialog, public DeicsOnze2GuiBase, public MessGui { + bool _enabledPreset; + + QFramePitchEnvelope* pitchEnvelopeGraph; + QFrameEnvelope* envelopeGraph[NBROP]; + + QWidget* _chorusSuperWidget; + QWidget* _reverbSuperWidget; + std::vector _chorusSliderVector; + // TODO std::vector _chorusFloatEntryVector; + // TODO std::vector _chorusCheckBoxVector; + std::vector _reverbSliderVector; + // TODO std::vector _reverbFloatEntryVector; + // TODO std::vector _reverbCheckBoxVector; + + Q_OBJECT + QString lastDir; + private slots: + void readMessage(int); + void setEnabledChannel(bool); + void setChangeChannel(int); + void setPanic(); + void setResCtrl(); + void setNbrVoices(int); + void setSaveOnlyUsed(bool); + void setSaveOnlyUsedComp(bool); + void setSaveConfig(bool); +// void setMidiInCh(int); //to change + void setQuality(const QString&); + void setFilter(bool); + void setFontSize(int); + void saveConfiguration(); + void saveDefaultConfiguration(); + void loadConfiguration(); + void loadConfiguration(QString s); + //load init set + void setIsInitSet(bool); + void setInitSetPath(const QString&); + void setBrowseInitSetPath(); + //load init set + void setIsBackgroundPix(bool); + void setBackgroundPixPath(const QString&); + void setBrowseBackgroundPixPath(); + //FX + void setChorusActiv(bool a); + void setChannelChorus(int c); + void setChorusReturn(int al); + void setSelectChorusPlugin(); + void setReverbCheckBox(double v, int i); + void setChorusCheckBox(double v, int i); + void setReverbActiv(bool a); + void setChannelReverb(int r); + void setReverbReturn(int val); + void setSelectReverbPlugin(); + void setReverbFloatEntry(double v, int i); + void setReverbSlider(double v, int i); + void setChorusFloatEntry(double v, int i); + void setChorusSlider(double v, int i); + //quick edit + void setChannelVolKnob(double val); + void setChannelPan(double val); + void setBrightnessKnob(double val); + void setModulationKnob(double val); + void setDetuneKnob(double val); + void setAttackKnob(double val); + void setReleaseKnob(double val); + //Color + void setRedColor(int); + void setGreenColor(int); + void setBlueColor(int); + // TODO void setRGBSliders(QListWidgetItem*); + void setTextColor(const QColor &); + void setBackgroundColor(const QColor &); + void setEditTextColor(const QColor &); + void setEditBackgroundColor(const QColor &); + //New Delete Load Save + void deleteSetDialog(); + void loadSetDialog(); + void saveSetDialog(); + void deleteCategoryDialog(); + void newCategoryDialog(); + void loadCategoryDialog(); + void saveCategoryDialog(); + void deleteSubcategoryDialog(); + void newSubcategoryDialog(); + void loadSubcategoryDialog(); + void saveSubcategoryDialog(); + void newPresetDialog(); + void loadPresetDialog(); + void deletePresetDialog(); + void savePresetDialog(); + //popupMenu + void categoryPopupMenu(const QPoint&); + void subcategoryPopupMenu(const QPoint&); + void presetPopupMenu(const QPoint&); + //Preset and bank + void setPresetName(const QString&); + void setSubcategoryName(const QString&); + void setCategoryName(const QString&); + void setHBank(int); + void setLBank(int); + void setProg(int); + //Global + void setMasterVolKnob(double); + void setMasterVol(int); + void setFeedback(int); + void setLfoWave(int); + void setLfoSpeed(int); + void setLfoDelay(int); + void setLfoPModDepth(int); + void setLfoPitchSens(int); + void setLfoAModDepth(int); + void setLfoAmpSens(int); + void setTranspose(int); + void setChannelDetune(int); + void setAlgorithm(int); + void setPitchBendRange(int); + //Pitch Envelope + void setPL1(int); + void setPL2(int); + void setPL3(int); + void setPR1(int); + void setPR2(int); + void setPR3(int); + //Function + void setFcVolume(int); + void setFcPitch(int); + void setFcAmplitude(int); + void setMwPitch(int); + void setMwAmplitude(int); + void setBcPitch(int); + void setBcAmplitude(int); + void setBcPitchBias(int); + void setBcEgBias(int); + void setAtPitch(int); + void setAtAmplitude(int); + void setAtPitchBias(int); + void setAtEgBias(int); + void setReverbRate(int); + void setPolyMode(int); + void setPortFingerFull(int); + void setPortaTime(int); + //envelope + void setAR1(int val); + void setD1R1(int val); + void setD1L1(int val); + void setD2R1(int val); + void setRR1(int val); + void setAR2(int val); + void setD1R2(int val); + void setD1L2(int val); + void setD2R2(int val); + void setRR2(int val); + void setAR3(int val); + void setD1R3(int val); + void setD1L3(int val); + void setD2R3(int val); + void setRR3(int val); + void setAR4(int val); + void setD1R4(int val); + void setD1L4(int val); + void setD2R4(int val); + void setRR4(int val); + //scaling + void setLS1(int val); + void setRS1(int val); + void setLS2(int val); + void setRS2(int val); + void setLS3(int val); + void setRS3(int val); + void setLS4(int val); + void setRS4(int val); + //vol + void setVol1(int val); + void setVol2(int val); + void setVol3(int val); + void setVol4(int val); + //Ratio and Frequency + void setCoarseRatio1(int val); + void setFineRatio1(int val); + void setFreq1(int val); + void setFix1(bool f); + void setCoarseRatio2(int val); + void setFineRatio2(int val); + void setFreq2(int val); + void setFix2(bool f); + void setCoarseRatio3(int val); + void setFineRatio3(int val); + void setFreq3(int val); + void setFix3(bool f); + void setCoarseRatio4(int val); + void setFineRatio4(int val); + void setFreq4(int val); + void setFix4(bool f); + //Sensitivity + void setAME1(bool val); + void setEBS1(int val); + void setKVS1(int val); + void setAME2(bool val); + void setEBS2(int val); + void setKVS2(int val); + void setAME3(bool val); + void setEBS3(int val); + void setKVS3(int val); + void setAME4(bool val); + void setEBS4(int val); + void setKVS4(int val); + //detune + void setDET1(int val); + void setDET2(int val); + void setDET3(int val); + void setDET4(int val); + //WaveForm + void setWaveForm1(int); + void setWaveForm2(int); + void setWaveForm3(int); + void setWaveForm4(int); + //Delay + void setActivDelay(bool); + void setDelayReturn(int); + void setChannelDelay(int); + //void setDelayTime(int); + void setDelayBPM(double); + void setDelayBeatRatio(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*); + // TODO void setCategory(QTreeWidgetItem*); + void setSubcategory(Subcategory*); + // TODO void setSubcategory(QTreeWidgetItem*); + // TODO void setPreset(QTreeWidgetItem*); + public: + virtual void processEvent(const MidiPlayEvent&); + void updateSelectPreset(int hbank, int lbank, int prog); + //update the gui + void setEnabledPreset(bool b); + void updateChannelCheckBox(bool b); + void updateEnabledChannel(bool e);//put enabled the display concerning channel and preset + void updateChannelEnable(bool e);//update channel enable + void updateMasterVolume(int val); + void updateNbrVoices(int val); + //void updateMidiInCh(int val); //to change + void updateQuality(int val); + void updateFilter(bool f); + void updateFontSize(int fs); + void applyFontSize(int fs); + void updateSaveOnlyUsed(bool); + void updateSaveConfig(bool); + //FX + void updateChorusActiv(bool a); + void updateChannelChorus(int c); + void updateChorusReturn(int r); + void updateReverbActiv(bool a); + void updateChannelReverb(int r); + 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(float plf); + void updateDelayBPM(float dt); + void updateDelayBeatRatio(float dt); + void updateDelayFeedback(float df); + void updateDelayPanLFODepth(float dpd); + void addPluginCheckBox(int index, QString text, bool toggled, + QWidget* parent, Q3GridLayout* grid, bool isReverb); + void addPluginIntSlider(int index, QString text, double min, double max, + double val, QWidget* parent, Q3GridLayout* grid, + bool isReverb); + void addPluginSlider(int index, QString text, bool isLog, double min, + double max, double val, QWidget* parent, + Q3GridLayout* grid, bool isReverb); + void buildGuiReverb(); + void buildGuiChorus(); + void updateReverbSlider(double v, int i); + void updateReverbFloatEntry(double v, int i); + void updateChorusSlider(double v, int i); + void updateChorusFloatEntry(double v, int i); + //update load init set + void updateInitSetCheckBox(bool); + void updateInitSetPath(QString); + //update background pix + void updateBackgroundPixCheckBox(bool); + void updateBackgroundPixPath(QString); + void applyBackgroundPix(); + //update quick edit + void updateChannelPan(int val); + void updateBrightness(int val); + void updateModulation(int val); + void updateAttack(int val); + void updateRelease(int val); + void updateQuickEdit(); + //update pitch envelope + void updatePL1(int val); + void updatePL2(int val); + void updatePL3(int val); + void updatePR1(int val); + void updatePR2(int val); + void updatePR3(int val); + //update function + void updateFcVolume(int val); + void updateFcPitch(int val); + void updateFcAmplitude(int val); + void updateMwPitch(int val); + void updateMwAmplitude(int val); + void updateBcPitch(int val); + void updateBcAmplitude(int val); + void updateBcPitchBias(int val); + void updateBcEgBias(int val); + void updateAtPitch(int val); + void updateAtAmplitude(int val); + void updateAtPitchBias(int val); + void updateAtEgBias(int val); + //void updateReverbRate(int val); + //update envelope + void updateAR(int op, int val); + void updateD1R(int op, int val); + void updateD2R(int op, int val); + void updateRR(int op, int val); + void updateD1L(int op, int val); + //update scale + void updateLS(int op, int val); + void updateRS(int op, int val); + void updateEBS(int op, int val); + void updateAME(int op, bool val); + void updateKVS(int op, int val); + void updateOUT(int op, int val); + void updateRATIO(int op, int val); + void updateDET(int op, int val); + //update global + void updateALG(int val); + void updateFEEDBACK(int val); + void updateSPEED(int val); + void updateDELAY(int val); + void updatePMODDEPTH(int val); + void updateAMODDEPTH(int val); + void updateSYNC(bool val); + void updateWAVE(int val); + void updatePMODSENS(int val); + void updateAMS(int val); + void updateTRANSPOSE(int val); + void updatePOLYMODE(int val); + void updatePBENDRANGE(int val); + void updatePORTAMODE(int val); + void updatePORTATIME(int val); + void updateFIX(int op, bool val); + void updateFIXRANGE(int op, int val); + void updateOSW(int op, int val); + void updateSHFT(int op, int val); + void updateChannelDetune(int val); + void updateChannelDetuneKnob(int val); + //void updateChannelDetuneSlider(int val); + void updateChannelVolume(int val); + void updateCategoryName(QString cn, bool enable); + void updateSubcategoryName(QString sn, bool enable); + void updatePresetName(QString pn, bool enable); + void updatePresetName(QString pn); + void updateHBank(int hbank, bool enable); + void updateLBank(int lbank, bool enable); + void updateProg(int prog, bool enable); + void updatePreset(Preset* p); + void updatePreset(void); //update gui following the current preset + //void updateCurrentChannel(); //update gui channel attributes + QString num3Digits(int); + DeicsOnze2Gui(DeicsOnze2*); + + int _currentChannel; + + QColor* tColor; //text color + QColor* bColor; //background color + QColor* etColor;//edit text color + QColor* ebColor;//edit background color + QColor* curColor;//current color + + DeicsOnze2* _deicsonze2; +}; + +class QFramePitchEnvelope:private Q3Frame { + QPoint startlinkP1, //first point + P1linkP2, //point linking P1 to P2 + P2linkP3, //point linking P2 to P3 + P3linkEnd; //point linking P3 to End + bool isStartlinkP1Edit; + bool isP1linkP2Edit; + bool isP2linkP3Edit; + bool isP3linkEndEdit; + public: + DeicsOnze2Gui* _deicsOnze2Gui; + QFramePitchEnvelope(QWidget* parent, DeicsOnze2Gui* dog):Q3Frame(parent){ + _deicsOnze2Gui = dog; + isStartlinkP1Edit=false; + isP1linkP2Edit=false; + isP2linkP3Edit=false; + isP3linkEndEdit=false; + }; + void env2Points(int pl1, int pl2, int pl3, int pr1, int pr2, int pr3); + void updateEnv(void) {update();}; + protected: + void paintEvent(QPaintEvent* e); + void mouseMoveEvent(QMouseEvent* e); + void mousePressEvent(QMouseEvent * e); + void mouseReleaseEvent(QMouseEvent * e); +}; + +class QFrameEnvelope:private Q3Frame { + unsigned char op; //operator number, between 0 and 3 + QPoint startlinkAR, //first point + ARlinkD1, //point linking AR to D1 + D1linkD2, //point linking D1 to D2 + D2linkRR, //point linking D2 to RR + RRlinkEnd; //last point + bool isARlinkD1Edit; + bool isD1linkD2Edit; + bool isD2linkRREdit; + bool isRRlinkEndEdit; + public: + DeicsOnze2Gui* _deicsonze2Gui; + QFrameEnvelope(QWidget* parent, DeicsOnze2Gui* dog, unsigned char k):Q3Frame(parent){ + _deicsonze2Gui = dog; + isARlinkD1Edit=false; + isD1linkD2Edit=false; + isD2linkRREdit=false; + isRRlinkEndEdit=false; + op = k; + //setGeometry(XOFFSET, YOFFSET, XOFFSET+MAXWIDTH, MAXHEIGHT); + //setMouseTracking(true); + }; + void env2Points(int ar, int d1r, int d1l, int d2r, int rr); + void updateEnv(void) {update();}; + protected: + void paintEvent(QPaintEvent* e); + void mouseMoveEvent(QMouseEvent* e); + void mousePressEvent(QMouseEvent * e); + void mouseReleaseEvent(QMouseEvent * e); +}; + +#endif /* __DEICSONZE2GUI_H */ diff --git a/muse2/synti/deicsonze2/deicsonze2gui.ui b/muse2/synti/deicsonze2/deicsonze2gui.ui new file mode 100644 index 00000000..6b91cf49 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2gui.ui @@ -0,0 +1,10237 @@ + + Nil Geisweiller + DeicsOnzeGuiBase + + + + 0 + 0 + 728 + 568 + + + + DeicsOnze + + + false + + + false + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + ArrowCursor + + + + + + false + + + QTabWidget::Rounded + + + 0 + + + + &Preset + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + false + + + Program numerous + + + 1 + + + 128 + + + + + + + false + + + INITVOICE + + + 12 + + + + + + + Qt::CustomContextMenu + + + false + + + + LBank + + + + + Subcategory + + + + + + + + false + + + Bank numerous + + + 1 + + + 128 + + + + + + + false + + + NONE + + + 12 + + + + + + + false + + + NONE + + + 12 + + + + + + + false + + + Bank numerous + + + 1 + + + 128 + + + + + + + Qt::CustomContextMenu + + + Qt::LeftToRight + + + false + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 1 + + + 0 + + + false + + + true + + + 2 + + + + HBank + + + + + Category + + + + + + + + Qt::CustomContextMenu + + + false + + + + Prog + + + + + Preset + + + + + + + + + Sans Serif + 8 + 50 + false + false + false + false + + + + QFrame::NoFrame + + + QFrame::Plain + + + DeicsOnze v0.5.5 Copyright (c) 2004-2006 Nil Geisweiller. Published under GPL licence. + + + + + + + + &Global + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Pitch Envelope + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + PL3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PL2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PL1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PR1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PR2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PR3 + + + + + + + PointingHandCursor + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + Pitch modulation depth + + + 99 + + + 2 + + + 50 + + + + + + + Pitch modulation depth + + + 99 + + + 2 + + + 50 + + + + + + + Pitch modulation depth + + + 99 + + + 2 + + + 50 + + + + + + + Pitch modulation depth + + + 99 + + + 3 + + + 0 + + + + + + + Pitch modulation depth + + + 99 + + + 3 + + + 0 + + + + + + + Pitch modulation depth + + + 99 + + + 3 + + + 0 + + + + + + + + + + LFO + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + PointingHandCursor + + + LFO Sync + + + + + + + Pitch modulation sensitivity + + + 7 + + + + + + + PointingHandCursor + + + Pitch Modulation Sensitivity + + + 7 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + LFO Delay + + + 99 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + LFO delay + + + 99 + + + + + + + LFO speed + + + 99 + + + + + + + Amplitude modulation depth + + + 99 + + + + + + + Pitch modulation depth + + + 99 + + + + + + + Amplitude modulation sensitivity + + + 7 + + + + + + + PointingHandCursor + + + Amplitude Modulation Sensitivity + + + 3 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AMS + + + + + + + PointingHandCursor + + + LFO Waveform + + + + 38 + 16 + + + + + + + + pics/sawUp.png + + + + + + + + pics/square.png + + + + + + + + pics/triangl.png + + + + + + + + pics/SHold.png + + + + + + + + PointingHandCursor + + + Pitch Modulation Depth + + + 99 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PMD + + + + + + + PointingHandCursor + + + LFO Speed + + + 99 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Pitch Modulation Depth + + + 99 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AMD + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Speed + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Delay + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PMS + + + + + + + + + + true + + + Modulation Matrix + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + PointingHandCursor + + + Modulation Matrix + + + <b>Algorithm 1</b> : <i>Op 1</i> modulated by <i>Op 2</i> modulated by <i>Op 3</i> modulated by <i>Op 4</i><br> +<b>Algorithm 2</b> : <i>Op 1</i> modulated by <i>Op 2</i> modulated by both <i>Op 3</i> and <i>Op 4</i><br> +<b>Algorithm 3</b> : <i>Op 1</i> modulated by both <i>Op 4</i> and <i>Op 2</i> modulated by <i>Op 3</i><br> +<b>Algorithm 4</b> : <i>Op 1</i> modulated by both <i>Op 2</i> and <i>Op 3</i> modulated by <i>Op 4</i><br> +<b>Algorithm 5</b> : (<i>Op 1</i> modulated by <i>Op 2</i>) add to (<i>Op 3</i> modulated by <i>Op 4</i>) <br> +<b>Algorithm 6</b> : addition of the three <i>Op 1, 2, 3</i> all modulated by <i>Op 4</i><br> +<b>Algorithm 7</b> : addition of the three <i>Op 1, 2, 3</i> with <i>Op 3</i> modulated by <i>Op 4</i><br> +<b>Algorithm 8</b> : addition of the four <i>Op 1, 2, 3, 4</i> + + + + 160 + 32 + + + + + + + + pics/algo1.png + + + + + + + + pics/algo3.png + + + + + + + + pics/algo3.png + + + + + + + + pics/algo4.png + + + + + + + + pics/algo5.png + + + + + + + + pics/algo6.png + + + + + + + + pics/algo7.png + + + + + + + + pics/algo8.png + + + + + + + + + + + + + + Op4 Feedback + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + PointingHandCursor + + + Feedback level of the operator 4 + + + 7 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + Feedback level of the operator 4 + + + 7 + + + + + + + + + + Transpose + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + PointingHandCursor + + + Transpose + + + -24 + + + 24 + + + 1 + + + Qt::Horizontal + + + + + + + Transpose + + + -24 + + + 99 + + + + + + + + + + + Op &1 + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Scaling 1 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + LS1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RS1 + + + + + + + PointingHandCursor + + + Rate Scaling + + + Attack Rate of the operator 1 + + + 3 + + + 1 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + PointingHandCursor + + + Level Scaling + + + Attack Rate of the operator 1 + + + 99 + + + 1 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + Level Scaling + + + 99 + + + + + + + Rate Scaling + + + 3 + + + + + + + + + + Amplitude Envelope 1 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + RR1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1R1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1L1 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D2R1 + + + + + + + Release Rate + + + 15 + + + + + + + 2° Decay Rate + + + 31 + + + + + + + 1° Decay Level + + + 15 + + + + + + + 1° Decay Rate + + + 31 + + + + + + + Attack Rate + + + 31 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AR1 + + + + + + + + 0 + 0 + + + + PointingHandCursor + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + + + Detune, OSCWave, EGShift 1 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + DET1 + + + + + + + Detune + + + -3 + + + 3 + + + + + + + PointingHandCursor + + + Detune + + + Attack Rate of the operator 1 + + + -3 + + + 3 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + false + + + PointingHandCursor + + + EG Shift + + + + 96dB + + + + + 48dB + + + + + 24dB + + + + + 12dB + + + + + + + + PointingHandCursor + + + Wave form + + + Wave form 1 = <i>sin(<b>t</b>)</i><br> +Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> +Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> +Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> +Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> +Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> + + + + 48 + 16 + + + + + + + + pics/wave1.png + + + + + + + + pics/wave2.png + + + + + + + + pics/wave3.png + + + + + + + + pics/wave4.png + + + + + + + + pics/wave5.png + + + + + + + + pics/wave6.png + + + + + + + + pics/wave7.png + + + + + + + + pics/wave8.png + + + + + + + + + + + Sensitivity 1 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + KVS1 + + + + + + + PointingHandCursor + + + Amplitude Modulation Enable + + + AME1 + + + + + + + Keyboard Velocity Sensitivity + + + 7 + + + + + + + PointingHandCursor + + + false + + + Key Velocity Sensitivity + + + 7 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + EBS1 + + + + + + + PointingHandCursor + + + EG Bias Sensitivity + + + 7 + + + 1 + + + 1 + + + Qt::Horizontal + + + + + + + Eg Bias Sensitivity + + + 7 + + + + + + + + + + Frequency 1 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + QFrame::Box + + + QFrame::Sunken + + + Coarse 1 + + + + + + + Coarse Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Fine 1 + + + + + + + Fine Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Freq 1 + + + + + + + false + + + Fixed Frequency + + + 32000 + + + + + + + true + + + PointingHandCursor + + + Toggle Fix Frequency + + + FIX + + + + + + + + + + OUT 1 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + Output Volume + + + 99 + + + + + + + PointingHandCursor + + + Volume + + + + + + 99 + + + 1 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + + + + + Op &2 + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Amplitude Envelope 2 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + Attack Rate + + + 31 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1R2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1L2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D2R2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RR2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AR2 + + + + + + + Release Rate + + + 15 + + + + + + + 2° Decay Rate + + + 31 + + + + + + + 1° Decay Level + + + 15 + + + + + + + 1° Decay Rate + + + 31 + + + + + + + + 0 + 0 + + + + PointingHandCursor + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + + + Frequency 2 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + QFrame::Box + + + QFrame::Sunken + + + Coarse 2 + + + + + + + Coarse Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Fine 2 + + + + + + + Fine Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Freq 2 + + + + + + + false + + + Fixed Frequency + + + 32000 + + + + + + + true + + + PointingHandCursor + + + Toggle Fix Frequency + + + FIX + + + + + + + + + + Scaling 2 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + LS2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RS2 + + + + + + + PointingHandCursor + + + Level Scaling + + + Attack Rate of the operator 1 + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + 1 + + + + + + + PointingHandCursor + + + Rate Scaling + + + Attack Rate of the operator 1 + + + 3 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + Level Scaling + + + 99 + + + + + + + Rate Scaling + + + 3 + + + + + + + + + + OUT 2 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + Output Volume + + + 99 + + + + + + + PointingHandCursor + + + Volume + + + + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + + + + Detune, OSCWave, EGShift 2 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + DET2 + + + + + + + Detune + + + -3 + + + 3 + + + + + + + PointingHandCursor + + + Detune + + + Attack Rate of the operator 1 + + + -3 + + + 3 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + false + + + PointingHandCursor + + + EG Shift + + + + 96dB + + + + + 48dB + + + + + 24dB + + + + + 12dB + + + + + + + + PointingHandCursor + + + Wave form + + + Wave form 1 = <i>sin(<b>t</b>)</i><br> +Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> +Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> +Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> +Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> +Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> + + + + 48 + 16 + + + + + + + + pics/wave1.png + + + + + + + + pics/wave2.png + + + + + + + + pics/wave3.png + + + + + + + + pics/wave4.png + + + + + + + + pics/wave5.png + + + + + + + + pics/wave6.png + + + + + + + + pics/wave7.png + + + + + + + + pics/wave8.png + + + + + + + + + + + Sensitivity 2 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + EBS2 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + KVS2 + + + + + + + PointingHandCursor + + + Amplitude Modulation Enable + + + AME2 + + + + + + + PointingHandCursor + + + false + + + Key Velocity Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Keyboard Velocity Sensitivity + + + 7 + + + + + + + PointingHandCursor + + + EG Bias Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Eg Bias Sensitivity + + + 7 + + + + + + + + + + + Op &3 + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Amplitude Envelope 3 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + Attack Rate + + + 31 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1R3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1L3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D2R3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RR3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AR3 + + + + + + + Release Rate + + + 15 + + + + + + + 2° Decay Rate + + + 31 + + + + + + + 1° Decay Level + + + 15 + + + + + + + 1° Decay Rate + + + 31 + + + + + + + + 0 + 0 + + + + PointingHandCursor + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + + + Scaling 3 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + LS3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RS3 + + + + + + + PointingHandCursor + + + Level Scaling + + + Attack Rate of the operator 1 + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + PointingHandCursor + + + Rate Scaling + + + Attack Rate of the operator 1 + + + 3 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + Level Scaling + + + 99 + + + + + + + Rate Scaling + + + 3 + + + + + + + + + + OUT 3 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + Output Volume + + + 99 + + + + + + + PointingHandCursor + + + Volume + + + + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + + + + Frequency 3 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + QFrame::Box + + + QFrame::Sunken + + + Coarse 3 + + + + + + + ArrowCursor + + + Coarse Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Fine 3 + + + + + + + ArrowCursor + + + Fine Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Freq 3 + + + + + + + false + + + Fixed Frequency + + + 32000 + + + + + + + true + + + PointingHandCursor + + + Toggle Fix Frequency + + + FIX + + + + + + + + + + Detune, OSCWave, EGShift 3 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + DET3 + + + + + + + Detune + + + -3 + + + 3 + + + + + + + PointingHandCursor + + + Detune + + + Attack Rate of the operator 1 + + + -3 + + + 3 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + false + + + PointingHandCursor + + + EG Shift + + + + 96dB + + + + + 48dB + + + + + 24dB + + + + + 12dB + + + + + + + + PointingHandCursor + + + Wave form + + + Wave form 1 = <i>sin(<b>t</b>)</i><br> +Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> +Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> +Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> +Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> +Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> + + + + 48 + 16 + + + + + + + + pics/wave1.png + + + + + + + + pics/wave2.png + + + + + + + + pics/wave3.png + + + + + + + + pics/wave4.png + + + + + + + + pics/wave5.png + + + + + + + + pics/wave6.png + + + + + + + + pics/wave7.png + + + + + + + + pics/wave8.png + + + + + + + + + + + Sensitivity 3 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + EBS3 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + KVS3 + + + + + + + PointingHandCursor + + + Amplitude Modulation Enable + + + AME3 + + + + + + + PointingHandCursor + + + false + + + Key Velocity Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Keyboard Velocity Sensitivity + + + 7 + + + + + + + PointingHandCursor + + + EG Bias Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Eg Bias Sensitivity + + + 7 + + + + + + + + + + + Op &4 + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + amplitude Envelope 4 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + Attack Rate + + + 31 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + AR4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1R4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D1L4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + D2R4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RR4 + + + + + + + Release Rate + + + 15 + + + + + + + 2° Decay Rate + + + 31 + + + + + + + 1° Decay Level + + + 15 + + + + + + + 1° Decay Rate + + + 31 + + + + + + + + 0 + 0 + + + + PointingHandCursor + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + + + Frequency 4 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + QFrame::Box + + + QFrame::Sunken + + + Coarse 4 + + + + + + + Coarse Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Fine 4 + + + + + + + Fine Ratio + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Freq 4 + + + + + + + false + + + Fixed Frequency + + + 32000 + + + + + + + true + + + PointingHandCursor + + + Toggle Fix Frequency + + + FIX + + + + + + + + + + Scaling 4 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + LS4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + RS4 + + + + + + + PointingHandCursor + + + Level Scaling + + + Attack Rate of the operator 1 + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + PointingHandCursor + + + Rate Scaling + + + Attack Rate of the operator 1 + + + 3 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + Level Scaling + + + 99 + + + + + + + Rate Scaling + + + 3 + + + + + + + + + + OUT 4 + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + Output Volume + + + 99 + + + + + + + PointingHandCursor + + + Volume + + + + + + 99 + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + + + + Detune, OSCWave, EGShift 4 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + DET4 + + + + + + + Detune + + + -3 + + + 3 + + + + + + + PointingHandCursor + + + Detune + + + Attack Rate of the operator 1 + + + -3 + + + 3 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + false + + + PointingHandCursor + + + EG Shift + + + + 96dB + + + + + 48dB + + + + + 24dB + + + + + 12dB + + + + + + + + PointingHandCursor + + + Wave form + + + Wave form 1 = <i>sin(<b>t</b>)</i><br> +Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> +Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> +Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> +Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> +Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> +Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> + + + + 48 + 16 + + + + + + + + pics/wave1.png + + + + + + + + pics/wave2.png + + + + + + + + pics/wave3.png + + + + + + + + pics/wave4.png + + + + + + + + pics/wave5.png + + + + + + + + pics/wave6.png + + + + + + + + pics/wave7.png + + + + + + + + pics/wave8.png + + + + + + + + + + + Sensitivity 4 + + + + 10 + + + 10 + + + 10 + + + 10 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + EBS4 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + KVS4 + + + + + + + PointingHandCursor + + + Amplitude Modulation Enable + + + AME4 + + + + + + + PointingHandCursor + + + false + + + Key Velocity Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Keyboard Velocity Sensitivity + + + 7 + + + + + + + PointingHandCursor + + + EG Bias Sensitivity + + + 7 + + + 1 + + + Qt::Horizontal + + + + + + + Eg Bias Sensitivity + + + 7 + + + + + + + + + + + &Func + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + 16777215 + 80 + + + + Delay Pan Depth + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + 48 + 16777215 + + + + + + + + + + + + + + + 16777215 + 80 + + + + Delay Pan LFO Freq + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 1.137891684385393 + + + 0.100000000000000 + + + 10.000000000000000 + + + true + + + + + + + + 48 + 16777215 + + + + 0.100000000000000 + + + 10.000000000000000 + + + + + + + + + + + 16777215 + 80 + + + + Delay Ch Send Level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 127 + + + + + + + PointingHandCursor + + + Channel Chorus + + + 127 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Feedback + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 0.000000000000000 + + + -1.000000000000000 + + + + + + + + 48 + 16777215 + + + + -1.000000000000000 + + + + + + + + + + + 16777215 + 80 + + + + Delay On/Off, Return Level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + PointingHandCursor + + + On + + + + + + + 255 + + + 128 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Delay Beat Ratio + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 1.000000000000000 + + + 0.125000000000000 + + + 2.000000000000000 + + + + + + + + 48 + 16777215 + + + + 0.010000000000000 + + + 2.000000000000000 + + + + + + + + + + + 16777215 + 80 + + + + Delay BPM + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 100.000000000000000 + + + 60.000000000000000 + + + 255.000000000000000 + + + + + + + + 48 + 16777215 + + + + 6 + + + 60.000000000000000 + + + 255.000000000000000 + + + + + + + + + + 0 + + + + Foot Control + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Pitch Bend Range + + + 99 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Amplitude + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Volume + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + + Modulation Wheel + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Pitch Bend Range + + + 99 + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + Pitch Bend Range + + + 99 + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Amplitude + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch + + + + + + + + Breath Control + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 50 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + Pitch Bend Range + + + 50 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch Bias + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Envelope Bias + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Amplitude + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + + After Touch + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch + + + + + + + Pitch Bend Range + + + 99 + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + Pitch Bend Range + + + 50 + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 50 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + Pitch Bend Range + + + 99 + + + + + + + Pitch Bend Range + + + 99 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Pitch Bias + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Amplitude + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Envelope Bias + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + + + + + Phony Mode + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + true + + + PointingHandCursor + + + + POLY + + + + + MONO + + + + + + + + + + + Pitch Bend Range + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + PointingHandCursor + + + Pitch Bend Range + + + 0 + + + 12 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + Pitch Bend Range + + + 12 + + + + + + + + + + Potamento + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + true + + + PointingHandCursor + + + Portamento Mode + + + + FINGER + + + + + FULL + + + + + + + + QFrame::Box + + + QFrame::Sunken + + + PT + + + + + + + true + + + PointingHandCursor + + + Portamento Time + + + 0 + + + 99 + + + 1 + + + 0 + + + Qt::Horizontal + + + + + + + true + + + Portamento Time + + + 99 + + + + + + + + + + + C&horus + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Chorus Parameters + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + + + + 16777215 + 80 + + + + Channel send level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 127 + + + + + + + PointingHandCursor + + + Channel Chorus + + + 127 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + On/Off and Return level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + PointingHandCursor + + + On + + + + + + + 255 + + + 128 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Select LADSPA plugin + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Change plugin + + + + + + + true + + + + + + + + + + + &Reverb + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + 16777215 + 80 + + + + On/Off and Return level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + PointingHandCursor + + + On + + + + + + + 255 + + + 128 + + + Qt::Horizontal + + + + + + + + + + + 16777215 + 80 + + + + Select LADSPA plugin + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Change plugin + + + + + + + true + + + + + + + + + + + 16777215 + 80 + + + + Channel send level + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 127 + + + + + + + PointingHandCursor + + + Channel Chorus + + + 127 + + + Qt::Horizontal + + + + + + + + + + Reverb Parameters + + + + + + + + &Config + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Font Size + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + 1 + + + 32 + + + 9 + + + + + + + + + + Quality + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + true + + + + High + + + + + Middle + + + + + Low + + + + + Ultra low + + + + + + + + true + + + Filter + + + + + + + + + + Save Mode (into the song) + + + + 6 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + PointingHandCursor + + + Save only the used presets + + + true + + + + + + + PointingHandCursor + + + Save the entire set + + + + + + + PointingHandCursor + + + Save the configuration + + + true + + + + + + + + + + Configuration File + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + true + + + Save... + + + + + + + true + + + Load... + + + + + + + Save as default + + + + + + + + + + Colors + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + + 0 + 20 + + + + true + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + Text + + + + + Background + + + + + Edit Text + + + + + Edit Background + + + + + + + + Red + + + 255 + + + + + + + PointingHandCursor + + + Blue + + + 255 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Green + + + 255 + + + Qt::Horizontal + + + + + + + PointingHandCursor + + + Red + + + Qt::LeftToRight + + + 255 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + Blue + + + 255 + + + + + + + Green + + + 255 + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Blue + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Green + + + + + + + QFrame::Box + + + QFrame::Sunken + + + Red + + + + + + + + + + Set Path + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + Image in the background : + + + false + + + + + + + 128 + + + + + + + false + + + Browse... + + + + + + + 128 + + + + + + + Browse... + + + + + + + Load the set at the initialization : + + + true + + + + + + + + + + + + + + + 1000 + 20 + + + + + + + + + 0 + 0 + 0 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 0 + 0 + 0 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 121 + 125 + 121 + + + + + + + 255 + 255 + 255 + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + Sans Serif + 10 + 75 + false + true + false + false + + + + Set Brightness, Detune, Attack and Release of the current channel to default + + + Res. Ctrl + + + + + + + + 1000 + 20 + + + + + + + + + 0 + 0 + 0 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 0 + 0 + 0 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 237 + 237 + 237 + + + + + + + 231 + 231 + 231 + + + + + + + 121 + 125 + 121 + + + + + + + 166 + 166 + 166 + + + + + + + 121 + 125 + 121 + + + + + + + 255 + 255 + 255 + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 0 + + + + + + + 121 + 125 + 121 + + + + + + + 207 + 207 + 207 + + + + + + + 0 + 0 + 255 + + + + + + + 255 + 0 + 255 + + + + + + + 231 + 231 + 231 + + + + + + + + + Sans Serif + 10 + 75 + false + true + false + false + + + + Cut all notes off + + + Panic! + + + + + + + + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + true + + + Number of Voices + + + 1 + + + 64 + + + 8 + + + + + + + QFrame::StyledPanel + + + Number of voices + + + Qt::AlignCenter + + + + + + + Enable + + + true + + + + + + + 1 + + + 16 + + + + + + + QFrame::StyledPanel + + + Channel + + + Qt::AlignCenter + + + + + + + + + + QFrame::StyledPanel + + + Vol + + + Qt::AlignCenter + + + + + + + + 40 + 40 + + + + -28.144332654385916 + + + 0.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + false + + + + + + + + 96 + 16 + + + + Channel Ctrl + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + PointingHandCursor + + + 0.000000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + false + + + + + + + QFrame::StyledPanel + + + Release + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + + + + + QFrame::StyledPanel + + + Attack + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + + + + + QFrame::StyledPanel + + + Detune + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + + + + + QFrame::StyledPanel + + + Brightness + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + + + + + QFrame::StyledPanel + + + Modulation + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + + + + + QFrame::StyledPanel + + + Pan + + + Qt::AlignCenter + + + + + + + QFrame::StyledPanel + + + Volume + + + Qt::AlignCenter + + + + + + + + 32 + 32 + + + + PointingHandCursor + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.200000000000000 + + + 270 + + + 6 + + + + + + + + + + + + Awl::VolKnob + Awl::Knob +
awl/volknob.h
+
+ + Awl::Knob + QWidget +
awl/knob.h
+
+ + Awl::FloatEntry + QLineEdit +
awl/floatentry.h
+
+
+ + deicsOnzeTabWidget + presetLineEdit + feedbackSlider + LFOSyncCheckBox + PModSensSlider + LFOWaveComboBox + AModSensSlider + PModDepthSlider + AModDepthSlider + LFOSpeedSlider + LFODelaySlider + algorithmComboBox + LS1Slider + RS1Slider + OUT1Slider + Fix1CheckBox + AME1CheckBox + EBS1Slider + DET1Slider + KVS1Slider + WaveForm1ComboBox + EGS1ComboBox + LS2Slider + RS2Slider + OUT2Slider + AME2CheckBox + EBS2Slider + DET2Slider + KVS2Slider + WaveForm2ComboBox + EGS2ComboBox + LS3Slider + RS3Slider + OUT3Slider + AME3CheckBox + EBS3Slider + DET3Slider + KVS3Slider + WaveForm3ComboBox + EGS3ComboBox + LS4Slider + RS4Slider + OUT4Slider + AME4CheckBox + EBS4Slider + DET4Slider + KVS4Slider + WaveForm4ComboBox + EGS4ComboBox + subcategoryLineEdit + categoryLineEdit + lbankSpinBox + progSpinBox + feedbackSpinBox + PModSensSpinBox + AModSensSpinBox + PModDepthSpinBox + AModDepthSpinBox + LFOSpeedSpinBox + LFODelaySpinBox + CoarseRatio1SpinBox + FineRatio1SpinBox + Freq1SpinBox + LS1SpinBox + RS1SpinBox + OUT1SpinBox + EBS1SpinBox + KVS1SpinBox + DET1SpinBox + AR1SpinBox + D1R1SpinBox + D1L1SpinBox + D2R1SpinBox + RR1SpinBox + Fix2CheckBox + Freq2SpinBox + CoarseRatio2SpinBox + FineRatio2SpinBox + LS2SpinBox + RS2SpinBox + OUT2SpinBox + EBS2SpinBox + KVS2SpinBox + DET2SpinBox + AR2SpinBox + D1R2SpinBox + D1L2SpinBox + D2R2SpinBox + RR2SpinBox + Fix3CheckBox + CoarseRatio3SpinBox + FineRatio3SpinBox + Freq3SpinBox + AR3SpinBox + D1R3SpinBox + D1L3SpinBox + D2R3SpinBox + RR3SpinBox + LS3SpinBox + RS3SpinBox + OUT3SpinBox + EBS3SpinBox + KVS3SpinBox + DET3SpinBox + Fix4CheckBox + CoarseRatio4SpinBox + FineRatio4SpinBox + Freq4SpinBox + LS4SpinBox + RS4SpinBox + OUT4SpinBox + EBS4SpinBox + KVS4SpinBox + DET4SpinBox + AR4SpinBox + D1R4SpinBox + D1L4SpinBox + D2R4SpinBox + RR4SpinBox + + + + + feedbackSlider + valueChanged(int) + feedbackSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + feedbackSpinBox + valueChanged(int) + feedbackSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + PModSensSlider + valueChanged(int) + PModSensSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + PModSensSpinBox + valueChanged(int) + PModSensSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + AModSensSlider + valueChanged(int) + AModSensSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + AModSensSpinBox + valueChanged(int) + AModSensSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + PModDepthSpinBox + valueChanged(int) + PModDepthSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + AModDepthSpinBox + valueChanged(int) + AModDepthSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + LFOSpeedSlider + valueChanged(int) + LFOSpeedSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + LFOSpeedSpinBox + valueChanged(int) + LFOSpeedSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + LFODelaySlider + valueChanged(int) + LFODelaySpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + LFODelaySpinBox + valueChanged(int) + LFODelaySlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + PModDepthSlider + valueChanged(int) + PModDepthSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + Fix1CheckBox + toggled(bool) + Freq1SpinBox + setEnabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix1CheckBox + toggled(bool) + FineRatio1SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix1CheckBox + toggled(bool) + CoarseRatio1SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + OUT1Slider + valueChanged(int) + OUT1SpinBox + setValue(int) + + + 66 + 109 + + + 96 + 109 + + + + + OUT1SpinBox + valueChanged(int) + OUT1Slider + setValue(int) + + + 96 + 109 + + + 66 + 109 + + + + + LS1Slider + valueChanged(int) + LS1SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + LS1SpinBox + valueChanged(int) + LS1Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS1Slider + valueChanged(int) + RS1SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS1SpinBox + valueChanged(int) + RS1Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET1Slider + valueChanged(int) + DET1SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET1SpinBox + valueChanged(int) + DET1Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS1Slider + valueChanged(int) + EBS1SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS1SpinBox + valueChanged(int) + EBS1Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS1Slider + valueChanged(int) + KVS1SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS1SpinBox + valueChanged(int) + KVS1Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + Fix2CheckBox + toggled(bool) + Freq2SpinBox + setEnabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix2CheckBox + toggled(bool) + FineRatio2SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix2CheckBox + toggled(bool) + CoarseRatio2SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + OUT2SpinBox + valueChanged(int) + OUT2Slider + setValue(int) + + + 96 + 109 + + + 66 + 109 + + + + + LS2Slider + valueChanged(int) + LS2SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + LS2SpinBox + valueChanged(int) + LS2Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS2Slider + valueChanged(int) + RS2SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS2SpinBox + valueChanged(int) + RS2Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET2Slider + valueChanged(int) + DET2SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET2SpinBox + valueChanged(int) + DET2Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS2SpinBox + valueChanged(int) + EBS2Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS2Slider + valueChanged(int) + EBS2SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS2Slider + valueChanged(int) + KVS2SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS2SpinBox + valueChanged(int) + KVS2Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + Fix3CheckBox + toggled(bool) + Freq3SpinBox + setEnabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix3CheckBox + toggled(bool) + FineRatio3SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix3CheckBox + toggled(bool) + CoarseRatio3SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + OUT3Slider + valueChanged(int) + OUT3SpinBox + setValue(int) + + + 66 + 109 + + + 96 + 109 + + + + + OUT3SpinBox + valueChanged(int) + OUT3Slider + setValue(int) + + + 96 + 109 + + + 66 + 109 + + + + + LS3Slider + valueChanged(int) + LS3SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + LS3SpinBox + valueChanged(int) + LS3Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS3Slider + valueChanged(int) + RS3SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS3SpinBox + valueChanged(int) + RS3Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET3Slider + valueChanged(int) + DET3SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET3SpinBox + valueChanged(int) + DET3Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS3Slider + valueChanged(int) + EBS3SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS3SpinBox + valueChanged(int) + EBS3Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS3Slider + valueChanged(int) + KVS3SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS3SpinBox + valueChanged(int) + KVS3Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + Fix4CheckBox + toggled(bool) + Freq4SpinBox + setEnabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix4CheckBox + toggled(bool) + FineRatio4SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + Fix4CheckBox + toggled(bool) + CoarseRatio4SpinBox + setDisabled(bool) + + + 110 + 109 + + + 110 + 109 + + + + + OUT4Slider + valueChanged(int) + OUT4SpinBox + setValue(int) + + + 66 + 109 + + + 96 + 109 + + + + + OUT4SpinBox + valueChanged(int) + OUT4Slider + setValue(int) + + + 96 + 109 + + + 66 + 109 + + + + + LS4Slider + valueChanged(int) + LS4SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + LS4SpinBox + valueChanged(int) + LS4Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS4Slider + valueChanged(int) + RS4SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + RS4SpinBox + valueChanged(int) + RS4Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET4Slider + valueChanged(int) + DET4SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + DET4SpinBox + valueChanged(int) + DET4Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS4Slider + valueChanged(int) + EBS4SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + EBS4SpinBox + valueChanged(int) + EBS4Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS4Slider + valueChanged(int) + KVS4SpinBox + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + KVS4SpinBox + valueChanged(int) + KVS4Slider + setValue(int) + + + 110 + 109 + + + 110 + 109 + + + + + redSlider + valueChanged(int) + redSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + redSpinBox + valueChanged(int) + redSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + greenSlider + valueChanged(int) + greenSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + greenSpinBox + valueChanged(int) + greenSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + blueSlider + valueChanged(int) + blueSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + blueSpinBox + valueChanged(int) + blueSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + fcVolumeSlider + valueChanged(int) + fcVolumeSpinBox + setValue(int) + + + 285 + 155 + + + 494 + 158 + + + + + fcVolumeSpinBox + valueChanged(int) + fcVolumeSlider + setValue(int) + + + 494 + 158 + + + 285 + 155 + + + + + fcPitchSlider + valueChanged(int) + fcPitchSpinBox + setValue(int) + + + 285 + 180 + + + 494 + 177 + + + + + fcPitchSpinBox + valueChanged(int) + fcPitchSlider + setValue(int) + + + 494 + 177 + + + 285 + 180 + + + + + fcAmplitudeSpinBox + valueChanged(int) + fcAmplitudeSlider + setValue(int) + + + 494 + 216 + + + 285 + 219 + + + + + fcAmplitudeSlider + valueChanged(int) + fcAmplitudeSpinBox + setValue(int) + + + 285 + 219 + + + 494 + 216 + + + + + pitchBendRangeSlider + valueChanged(int) + pitchBendRangeSpinBox + setValue(int) + + + 486 + 483 + + + 538 + 486 + + + + + pitchBendRangeSpinBox + valueChanged(int) + pitchBendRangeSlider + setValue(int) + + + 538 + 486 + + + 486 + 483 + + + + + PortamentoTimeSlider + valueChanged(int) + PortamentoTimeSpinBox + setValue(int) + + + 293 + 483 + + + 345 + 486 + + + + + PortamentoTimeSpinBox + valueChanged(int) + PortamentoTimeSlider + setValue(int) + + + 345 + 486 + + + 293 + 483 + + + + + mwPitchSlider + valueChanged(int) + mwPitchSpinBox + setValue(int) + + + 224 + 168 + + + 539 + 171 + + + + + mwAmplitudeSpinBox + valueChanged(int) + mwAmplitudeSlider + setValue(int) + + + 539 + 223 + + + 224 + 220 + + + + + mwAmplitudeSlider + valueChanged(int) + mwAmplitudeSpinBox + setValue(int) + + + 224 + 220 + + + 539 + 223 + + + + + mwPitchSpinBox + valueChanged(int) + mwPitchSlider + setValue(int) + + + 539 + 171 + + + 224 + 168 + + + + + bcPitchSlider + valueChanged(int) + bcPitchSpinBox + setValue(int) + + + 248 + 147 + + + 539 + 150 + + + + + bcAmplitudeSlider + valueChanged(int) + bcAmplitudeSpinBox + setValue(int) + + + 248 + 178 + + + 539 + 181 + + + + + bcPitchBiasSlider + valueChanged(int) + bcPitchBiasSpinBox + setValue(int) + + + 248 + 209 + + + 539 + 212 + + + + + bcEgBiasSlider + valueChanged(int) + bcEgBiasSpinBox + setValue(int) + + + 248 + 240 + + + 539 + 243 + + + + + bcPitchSpinBox + valueChanged(int) + bcPitchSlider + setValue(int) + + + 539 + 150 + + + 248 + 147 + + + + + bcEgBiasSpinBox + valueChanged(int) + bcEgBiasSlider + setValue(int) + + + 539 + 243 + + + 248 + 240 + + + + + atPitchSlider + valueChanged(int) + atPitchSpinBox + setValue(int) + + + 248 + 147 + + + 539 + 150 + + + + + atAmplitudeSpinBox + valueChanged(int) + atAmplitudeSlider + setValue(int) + + + 539 + 181 + + + 248 + 178 + + + + + atAmplitudeSlider + valueChanged(int) + atAmplitudeSpinBox + setValue(int) + + + 248 + 178 + + + 539 + 181 + + + + + atPitchBiasSlider + valueChanged(int) + atPitchBiasSpinBox + setValue(int) + + + 248 + 209 + + + 539 + 212 + + + + + atPitchBiasSpinBox + valueChanged(int) + atPitchBiasSlider + setValue(int) + + + 539 + 212 + + + 248 + 209 + + + + + atEgBiasSlider + valueChanged(int) + atEgBiasSpinBox + setValue(int) + + + 248 + 240 + + + 539 + 243 + + + + + atPitchSpinBox + valueChanged(int) + atPitchSlider + setValue(int) + + + 539 + 150 + + + 248 + 147 + + + + + atEgBiasSpinBox + valueChanged(int) + atEgBiasSlider + setValue(int) + + + 539 + 243 + + + 248 + 240 + + + + + bcPitchSpinBox + valueChanged(int) + bcPitchSlider + setValue(int) + + + 539 + 150 + + + 248 + 147 + + + + + bcAmplitudeSpinBox + valueChanged(int) + bcAmplitudeSlider + setValue(int) + + + 539 + 181 + + + 248 + 178 + + + + + bcPitchBiasSpinBox + valueChanged(int) + bcPitchBiasSlider + setValue(int) + + + 539 + 212 + + + 248 + 209 + + + + + bcEgBiasSpinBox + valueChanged(int) + bcEgBiasSlider + setValue(int) + + + 539 + 243 + + + 248 + 240 + + + + + OUT2Slider + valueChanged(int) + OUT2SpinBox + setValue(int) + + + 66 + 109 + + + 96 + 109 + + + + + chChorusSlider + valueChanged(int) + chChorusSpinBox + setValue(int) + + + 487 + 149 + + + 539 + 152 + + + + + chChorusSpinBox + valueChanged(int) + chChorusSlider + setValue(int) + + + 539 + 152 + + + 487 + 149 + + + + + chReverbSlider + valueChanged(int) + chReverbSpinBox + setValue(int) + + + 487 + 149 + + + 539 + 152 + + + + + chReverbSpinBox + valueChanged(int) + chReverbSlider + setValue(int) + + + 539 + 152 + + + 487 + 149 + + + + + transposeSlider + valueChanged(int) + transposeSpinBox + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + transposeSpinBox + valueChanged(int) + transposeSlider + setValue(int) + + + 111 + 114 + + + 111 + 114 + + + + + chDelaySlider + valueChanged(int) + chDelaySpinBox + setValue(int) + + + 351 + 319 + + + 403 + 322 + + + + + chDelaySpinBox + valueChanged(int) + chDelaySlider + setValue(int) + + + 403 + 322 + + + 351 + 319 + + + + + delayPanLFOFreqKnob + valueChanged(double,int) + delayPanLFOFreqFloatentry + setValue(double) + + + 477 + 308 + + + 498 + 308 + + + + + delayPanLFOFreqFloatentry + valueChanged(double,int) + delayPanLFOFreqKnob + setValue(double) + + + 497 + 319 + + + 477 + 326 + + + + + delayBPMKnob + valueChanged(double,int) + delayBPMFloatentry + setValue(double) + + + 84 + 389 + + + 104 + 393 + + + + + delayBPMFloatentry + valueChanged(double,int) + delayBPMKnob + setValue(double) + + + 121 + 404 + + + 78 + 409 + + + + + delayBeatRatioKnob + valueChanged(double,int) + delayBeatRatioFloatentry + setValue(double) + + + 212 + 386 + + + 252 + 392 + + + + + delayBeatRatioFloatentry + valueChanged(double,int) + delayBeatRatioKnob + setValue(double) + + + 271 + 398 + + + 228 + 411 + + + + + delayFeedbackKnob + valueChanged(double,int) + delayFeedbackFloatentry + setValue(double) + + + 347 + 388 + + + 368 + 393 + + + + + delayFeedbackFloatentry + valueChanged(double,int) + delayFeedbackKnob + setValue(double) + + + 379 + 405 + + + 352 + 409 + + + + + delayPanLFODepthKnob + valueChanged(double,int) + delayPanLFODepthFloatentry + setValue(double) + + + 464 + 387 + + + 507 + 396 + + + + + delayPanLFODepthFloatentry + valueChanged(double,int) + delayPanLFODepthKnob + setValue(double) + + + 518 + 407 + + + 471 + 409 + + + + +
diff --git a/muse2/synti/deicsonze2/deicsonze2guibase.h b/muse2/synti/deicsonze2/deicsonze2guibase.h new file mode 100644 index 00000000..49eb4e10 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2guibase.h @@ -0,0 +1,312 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'deicsonze2guibase.ui' +** +** Created: Thu Dec 24 07:50:17 2009 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#ifndef DEICSONZE2GUIBASE_H +#define DEICSONZE2GUIBASE_H + +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include + +class Q3VBoxLayout; +class Q3HBoxLayout; +class Q3GridLayout; +class QSpacerItem; +class QTabWidget; +class QWidget; +class QPushButton; +class Q3GroupBox; +class QLineEdit; +class Q3ListView; +class Q3ListViewItem; +class QSpinBox; +class QLabel; +class QSlider; +class QComboBox; +class QCheckBox; + +class DeicsOnze2GuiBase : public QDialog +{ + Q_OBJECT + +public: + DeicsOnze2GuiBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); + ~DeicsOnze2GuiBase(); + + QTabWidget* deicsOnzeTabWidget; + QWidget* TabPage; + QPushButton* loadPushButton; + QPushButton* savePushButton; + Q3GroupBox* nameGroupBox; + QLineEdit* nameLineEdit; + Q3GroupBox* subcategoryGroupBox; + QLineEdit* subcategoryLineEdit; + Q3GroupBox* categoryGroupBox; + QLineEdit* categoryLineEdit; + QPushButton* deletePushButton; + Q3ListView* categoryListView; + Q3ListView* subcategoryListView; + Q3ListView* presetsListView; + QPushButton* newPushButton; + Q3GroupBox* bankGroupBox; + QSpinBox* bankSpinBox; + Q3GroupBox* progGroupBox; + QSpinBox* progSpinBox; + QLabel* presentTextLAbel; + QWidget* TabPage_2; + Q3GroupBox* masterVolGroupBox; + QSlider* masterVolSlider; + QSpinBox* MasterVolumeSpinBox; + Q3GroupBox* FeedbackGroupBox; + QSpinBox* feedbackSpinBox; + QSlider* feedbackSlider; + Q3GroupBox* functionGroupBox; + QComboBox* polyMonoComboBox; + QLabel* PitchBendRangeLabel; + QSlider* PitchBendRangeSlider; + QSpinBox* pitchBendRangeSpinBox; + Q3GroupBox* LFOGroupBox; + QLabel* PModSensLabel; + QLabel* PModDepthLabel; + QLabel* AModDepthLabel; + QLabel* LFOSpeedLabel; + QLabel* LFODelayLabel; + QLabel* AModSensLabel; + QComboBox* LFOWaveComboBox; + QCheckBox* LFOSyncCheckBox; + QSlider* AModSensSlider; + QSlider* PModSensSlider; + QSpinBox* PMSSpinBox; + QSpinBox* AMSSpinBox; + QSlider* PModDepthSlider; + QSlider* AModDepthSlider; + QSlider* LFOSpeedSlider; + QSpinBox* LFOSpeedSpinBox; + QSlider* LFODelaySlider; + QSpinBox* LFODelaySpinBox; + QSpinBox* PModDepthSpinBox; + QSpinBox* AModDepthSpinBox; + Q3GroupBox* transposeGroupBox; + QSlider* transposeSlider; + QSpinBox* transposeSpinBox; + QSlider* globalDetuneSlider; + QSpinBox* globalDetuneSpinBox; + QComboBox* algorithmComboBox; + QWidget* tab; + Q3GroupBox* Frequency1groupBox; + QCheckBox* Fix1CheckBox; + QLabel* CoarseRatio1Label; + QLabel* FineRatio1Label; + QLabel* Freq1Label; + QSpinBox* CoarseRatio1SpinBox; + QSpinBox* FineRatio1SpinBox; + QSpinBox* Freq1SpinBox; + Q3GroupBox* Env1GroupBox; + QLabel* RR1Label; + QLabel* D1R1Label; + QLabel* D1L1Label; + QLabel* D2R1Label; + QSlider* D1L1Slider; + QSlider* D2R1Slider; + QSlider* D1R1Slider; + QSlider* RR1Slider; + QLabel* AR1Label; + QSpinBox* D1R1SpinBox; + QSpinBox* D1L1SpinBox; + QSpinBox* D2R1SpinBox; + QSpinBox* RR1SpinBox; + QSlider* AR1Slider; + QSpinBox* AR1SpinBox; + Q3GroupBox* Scaling1GroupBox; + QLabel* LS1Label; + QLabel* RS1Label; + QSlider* LS1Slider; + QSlider* RS1Slider; + QSpinBox* LS1SpinBox; + QSpinBox* RS1SpinBox; + Q3GroupBox* Vol1groupBox; + QSlider* Vol1Slider; + QSpinBox* Vol1SpinBox; + Q3GroupBox* sensitivity1groupBox; + QLabel* EGS1Label; + QLabel* KVS1Label; + QCheckBox* AME1CheckBox; + QSlider* KVS1Slider; + QSlider* EBS1Slider; + QSpinBox* KVS1SpinBox; + QSpinBox* EBS1SpinBox; + Q3GroupBox* DetWaveEGS1GroupBox; + QComboBox* WaveForm1ComboBox; + QLabel* DET1Label; + QComboBox* EGQ1ComboBox; + QSlider* DET1Slider; + QSpinBox* DET1SpinBox; + QWidget* tab_2; + Q3GroupBox* Frequency2groupBox; + QCheckBox* Fix2CheckBox; + QLabel* Freq2Label; + QLabel* FineRatio2Label; + QLabel* CoarseRatio2Label; + QSpinBox* CoarseRatio2SpinBox; + QSpinBox* FineRatio2SpinBox; + QSpinBox* Freq2SpinBox; + Q3GroupBox* Env2GroupBox; + QLabel* AR2Label; + QLabel* RR2Label; + QLabel* D2R2Label; + QLabel* D1L2Label; + QLabel* D1R2Label; + QSlider* AR2Slider; + QSlider* D1R2Slider; + QSlider* D1L2Slider; + QSlider* D2R2Slider; + QSlider* RR2Slider; + QSpinBox* D1R2SpinBox; + QSpinBox* D1L2SpinBox; + QSpinBox* D2R2SpinBox; + QSpinBox* RR2SpinBox; + QSpinBox* AR2SpinBox; + Q3GroupBox* Scaling2GroupBox; + QLabel* LS2Label; + QLabel* RS2Label; + QSlider* LS2Slider; + QSlider* RS2Slider; + QSpinBox* LS2SpinBox; + QSpinBox* RS2SpinBox; + Q3GroupBox* Vol2groupBox; + QSlider* Vol2Slider; + QSpinBox* Vol2SpinBox; + Q3GroupBox* sensitivity2groupBox; + QLabel* EGS2Label; + QLabel* KVS2Label; + QCheckBox* AME2CheckBox; + QSlider* KVS2Slider; + QSlider* EBS2Slider; + QSpinBox* EBS2SpinBox; + QSpinBox* KVS2SpinBox; + Q3GroupBox* DetWaveEGS2GroupBox; + QSlider* DET2Slider; + QLabel* DET2Label; + QComboBox* WaveForm2ComboBox; + QComboBox* EGS2comboBox; + QSpinBox* DET2SpinBox; + QWidget* TabPage_3; + Q3GroupBox* Frequency3groupBox; + QCheckBox* Fix3CheckBox; + QLabel* CoarseRatio3Label; + QLabel* FineRatio3Label; + QLabel* Freq3Label; + QSpinBox* CoarseRatio3SpinBox; + QSpinBox* FineRatio3SpinBox; + QSpinBox* Freq3SpinBox; + Q3GroupBox* Env3GroupBox; + QLabel* RR3Label; + QLabel* D2R3Label; + QLabel* D1L3Label; + QLabel* D1R3Label; + QLabel* AR3Label; + QSlider* AR3Slider; + QSlider* D1R3Slider; + QSlider* D1L3Slider; + QSlider* D2R3Slider; + QSlider* RR3Slider; + QSpinBox* D1R3SpinBox; + QSpinBox* D1L3SpinBox; + QSpinBox* D2R3SpinBox; + QSpinBox* RR3SpinBox; + QSpinBox* AR3SpinBox; + Q3GroupBox* Scaling3GroupBox; + QLabel* LS3Label; + QLabel* RS3Label; + QSlider* LS3Slider; + QSlider* RS3Slider; + QSpinBox* LS3SpinBox; + QSpinBox* RS3SpinBox; + Q3GroupBox* Vol3groupBox; + QSlider* Vol3Slider; + QSpinBox* Vol3SpinBox; + Q3GroupBox* sensitivity3groupBox; + QLabel* EGS3Label; + QLabel* KVS3Label; + QCheckBox* AME3CheckBox; + QSlider* KVS3Slider; + QSlider* EBS3Slider; + QSpinBox* EBS3SpinBox; + QSpinBox* KVS3SpinBox; + Q3GroupBox* DetWaveEGS3GroupBox; + QComboBox* WaveForm3ComboBox; + QComboBox* EGS3comboBox; + QLabel* DET3Label; + QSlider* DET3Slider; + QSpinBox* DET3SpinBox; + QWidget* TabPage_4; + Q3GroupBox* Frequency4groupBox; + QLabel* CoarseRatio4Label; + QLabel* FineRatio4Label; + QLabel* Freq4Label; + QCheckBox* Fix4CheckBox; + QSpinBox* FineRatio4SpinBox; + QSpinBox* Freq4SpinBox; + QSpinBox* CoarseRatio4SpinBox; + Q3GroupBox* Scaling4GroupBox; + QLabel* LS4Label; + QLabel* RS4Label; + QSlider* LS4Slider; + QSlider* RS4Slider; + QSpinBox* RS4SpinBox; + QSpinBox* LS4SpinBox; + Q3GroupBox* Env4GroupBox; + QSlider* AR4Slider; + QLabel* AR4Label; + QLabel* RR4Label; + QLabel* D2R4Label; + QSlider* D2R4Slider; + QSlider* D1L4Slider; + QLabel* D1L4Label; + QLabel* D1R4Label; + QSlider* D1R4Slider; + QSlider* RR4Slider; + QSpinBox* D1R4SpinBox; + QSpinBox* D1L4SpinBox; + QSpinBox* D2R4SpinBox; + QSpinBox* RR4SpinBox; + QSpinBox* AR4SpinBox; + Q3GroupBox* Vol4groupBox; + QSlider* Vol4Slider; + QSpinBox* Vol4SpinBox; + Q3GroupBox* sensitivity4groupBox; + QLabel* EGS4Label; + QLabel* KVS4Label; + QCheckBox* AME4CheckBox; + QSlider* KVS4Slider; + QSlider* EBS4Slider; + QSpinBox* KVS4SpinBox; + QSpinBox* EBS4SpinBox; + Q3GroupBox* DetWaveEGS4GroupBox; + QSlider* DET4Slider; + QLabel* DET4Label; + QComboBox* WaveForm4ComboBox; + QComboBox* EGS4comboBox; + QSpinBox* DET4SpinBox; + +protected: + +protected slots: + virtual void languageChange(); + +private: + QPixmap image0; + +}; + +#endif // DEICSONZE2GUIBASE_H diff --git a/muse2/synti/deicsonze2/deicsonze2plugin.cpp b/muse2/synti/deicsonze2/deicsonze2plugin.cpp new file mode 100644 index 00000000..fd73ea94 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2plugin.cpp @@ -0,0 +1,502 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// +// +// +// Copyright (c) 2004-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 "deicsonzeplugin.h" +#include "muse/plugin.h" +//#include "plugingui.h" +#include "muse/ctrl.h" +#include "muse/fastlog.h" +#include "muse/midi.h" +//Added by qt3to4: +#include +#include +//#include "awl/floatentry.h" +//#include "awl/slider.h" +//#include "awl/checkbox.h" + +//using Awl::FloatEntry; +//using Awl::Slider; +//using Awl::CheckBox; + +class PluginDialog; + +void DeicsOnze2::initPluginReverb(Plugin* pluginReverb) { + //init plugin + if(_pluginIReverb) delete(_pluginIReverb); + _pluginIReverb = new PluginI(NULL); + + _pluginIReverb->initPluginInstance(pluginReverb, 2); + + for(int i = 0; i < pluginReverb->parameter(); i++) { + Ctrl* c = new Ctrl(); + c->setCurVal((float)pluginReverb->defaultValue(i)); + _pluginIReverb->setControllerList(c); + //setReverbParam(i, pluginReverb->defaultValue(i)); + } + + //send build gui to the gui + char data; + data = SYSEX_BUILDGUIREVERB; + MidiEvent evSysex(0,ME_SYSEX,(const unsigned char*)&data, 1); + _gui->writeEvent(evSysex); +} + +void DeicsOnze2::initPluginChorus(Plugin* pluginChorus) { + if(_pluginIChorus) delete(_pluginIChorus); + _pluginIChorus = new PluginI(NULL); + + _pluginIChorus->initPluginInstance(pluginChorus, 2); + + for(int i = 0; i < pluginChorus->parameter(); i++) { + Ctrl* c = new Ctrl(); + c->setCurVal((float)pluginChorus->defaultValue(i)); + _pluginIChorus->setControllerList(c); + //setChorusParam(i, pluginChorus->defaultValue(i)); +} + + //send build gui to the gui + char data; + data = SYSEX_BUILDGUICHORUS; + MidiEvent evSysex(0,ME_SYSEX,(const unsigned char*)&data, 1); + _gui->writeEvent(evSysex); +} + +void DeicsOnze2::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(1); + + float f; + char dataDelayBPM[sizeof(float)+1]; + dataDelayBPM[0] = SYSEX_DELAYBPM; + f = getDelayBPM(); + memcpy(&dataDelayBPM[1], &f, sizeof(float)); + MidiEvent evSysexDelayBPM(0,ME_SYSEX, + (const unsigned char*)dataDelayBPM, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayBPM); + char dataDelayBeatRatio[sizeof(float)+1]; + dataDelayBeatRatio[0] = SYSEX_DELAYBEATRATIO; + f = getDelayBeatRatio(); + memcpy(&dataDelayBeatRatio[1], &f, sizeof(float)); + MidiEvent evSysexDelayBeatRatio(0,ME_SYSEX, + (const unsigned char*)dataDelayBeatRatio, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayBeatRatio); + char dataDelayFeedback[sizeof(float)+1]; + dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; + f = getDelayFeedback(); + memcpy(&dataDelayFeedback[1], &f, sizeof(float)); + MidiEvent evSysexDelayFeedback(0,ME_SYSEX, + (const unsigned char*)dataDelayFeedback, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayFeedback); + char dataDelayLFOFreq[sizeof(float)+1]; + dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; + f = getDelayLFOFreq(); + memcpy(&dataDelayLFOFreq[1], &f, sizeof(float)); + MidiEvent evSysexDelayLFOFreq(0,ME_SYSEX, + (const unsigned char*)dataDelayLFOFreq, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayLFOFreq); + char dataDelayLFODepth[sizeof(float)+1]; + dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; + f = getDelayLFODepth(); + memcpy(&dataDelayLFODepth, &f, sizeof(float)+1); + MidiEvent evSysexDelayLFODepth(0,ME_SYSEX, + (const unsigned char*)dataDelayLFODepth, + sizeof(float)+1); + _gui->writeEvent(evSysexDelayLFODepth); +} + +void DeicsOnze2::setReverbParam(int index, double val) { + if(_pluginIReverb) _pluginIReverb->controller(index)->setCurVal((float)val); + else printf("Warning : no DeicsOnze2 reverb loaded\n"); +} +void DeicsOnze2::setChorusParam(int index, double val) { + if(_pluginIChorus) _pluginIChorus->controller(index)->setCurVal((float)val); + else printf("Warning : no DeicsOnze2 chorus loaded\n"); +} + +double DeicsOnze2::getReverbParam(int index) { + if(_pluginIReverb) return _pluginIReverb->controller(index)->curVal().f; + else { + return 0.0; + printf("Warning : no DeicsOnze2 reverb loaded\n"); + } +} + +double DeicsOnze2::getChorusParam(int index) { + if(_pluginIChorus) return _pluginIChorus->controller(index)->curVal().f; + else { + return 0.0; + printf("Warning : no DeicsOnze2 chorus loaded\n"); + } +} + +void DeicsOnze2Gui::addPluginCheckBox(int index, QString text, bool toggled, + QWidget* parent, Q3GridLayout* grid, + bool isReverb) { + CheckBox* cb = new CheckBox(parent); + cb->setId(index); + cb->setText(text); + cb->setChecked(toggled); + grid->addWidget(cb, index, 0); + //push on vectors + if(isReverb) { + _reverbSliderVector.push_back(NULL); + _reverbFloatEntryVector.push_back(NULL); + _reverbCheckBoxVector.push_back(cb); + } + else { + _chorusSliderVector.push_back(NULL); + _chorusFloatEntryVector.push_back(NULL); + _chorusCheckBoxVector.push_back(cb); + } + //connect slots + if(isReverb) { + connect(cb, SIGNAL(valueChanged(double, int)), + this, SLOT(setReverbCheckBox(double, int))); + } + else { + connect(cb, SIGNAL(valueChanged(double, int)), + this, SLOT(setChorusCheckBox(double, int))); + } +} + +void DeicsOnze2Gui::addPluginIntSlider(int index, QString text, double min, + double max, double val, QWidget* parent, + Q3GridLayout* grid, bool isReverb) { + addPluginSlider(index, text, false, min, max, val, parent, grid, isReverb); +} + +void DeicsOnze2Gui::addPluginSlider(int index, QString text, bool isLog, + double min, double max, double val, + QWidget* parent, Q3GridLayout* grid, + bool isReverb) { + QLabel* l = new QLabel(text, parent); + grid->addWidget(l, index, 0); + FloatEntry* f = new FloatEntry(parent); + f->setValue(val); + f->setMinValue(min); + f->setMaxValue(max); + f->setMaximumWidth(72); + grid->addWidget(f, index, 1); + Slider* s = new Slider(parent); + s->setId(index); + s->setLog(isLog); + s->setLogRange(min, max); + s->setValue(val); + s->setOrientation(Qt::Horizontal); + //s->setFixedHeight(h); + s->setLineStep((min-max)/100.0); + s->setPageStep((min-max)/10.0); + grid->addWidget(s, index, 2); + //push on vectors + if(isReverb) { + _reverbSliderVector.push_back(s); + _reverbFloatEntryVector.push_back(f); + _reverbCheckBoxVector.push_back(NULL); + } + else { + _chorusSliderVector.push_back(s); + _chorusFloatEntryVector.push_back(f); + _chorusCheckBoxVector.push_back(NULL); + } + //connect slots + if(isReverb) { + connect(f, SIGNAL(valueChanged(double, int)), + this, SLOT(setReverbFloatEntry(double, int))); + connect(s, SIGNAL(valueChanged(double, int)), + this, SLOT(setReverbSlider(double, int))); + } + else { + connect(f, SIGNAL(valueChanged(double, int)), + this, SLOT(setChorusFloatEntry(double, int))); + connect(s, SIGNAL(valueChanged(double, int)), + this, SLOT(setChorusSlider(double, int))); + } +} + +void DeicsOnze2Gui::buildGuiReverb() { + PluginI* plugI = _deicsOnze->_pluginIReverb; + QString name = plugI->name(); + name.resize(name.size()-2); + updateLadspaReverbLineEdit(name); + //build super layout + if(parametersReverbGroupBox->layout()) + delete(parametersReverbGroupBox->layout()); + Q3GridLayout* superLayout = new Q3GridLayout(parametersReverbGroupBox); + parametersReverbGroupBox->setLayout(superLayout); + //build super widget + if(_reverbSuperWidget) delete(_reverbSuperWidget); + _reverbSuperWidget = new QWidget(parametersReverbGroupBox); + superLayout->addWidget(_reverbSuperWidget); + //build grid + Q3GridLayout* grid = new Q3GridLayout(_reverbSuperWidget); + _reverbSuperWidget->setLayout(grid); + grid->setSpacing(0); + //init vectors + if(!_reverbSliderVector.empty()) _reverbSliderVector.clear(); + if(!_reverbFloatEntryVector.empty()) _reverbFloatEntryVector.clear(); + if(!_reverbCheckBoxVector.empty()) _reverbCheckBoxVector.clear(); + //build sliders + for(int i = 0; i < plugI->plugin()->parameter(); i++) { + double min, max, val; + plugI->range(i, &min, &max); + val = _deicsOnze->getReverbParam(i); + if(plugI->isBool(i)) + addPluginCheckBox(i, plugI->getParameterName(i), val > 0.0, + _reverbSuperWidget, grid, true); + else if(plugI->isInt(i)) { + addPluginIntSlider(i, plugI->getParameterName(i), rint(min), rint(max), + rint(val), _reverbSuperWidget, grid, true); + } + else { + addPluginSlider(i, plugI->getParameterName(i), plugI->isLog(i), + min, max, val, _reverbSuperWidget, grid, true); + } + } + //update colors of the new sliders (and the whole gui actually) + setEditTextColor(reinterpret_cast(*etColor)); + setEditBackgroundColor(reinterpret_cast(*ebColor)); +} + +void DeicsOnze2Gui::buildGuiChorus() { + PluginI* plugI = _deicsOnze->_pluginIChorus; + QString name = plugI->name(); + name.resize(name.size()-2); + updateLadspaChorusLineEdit(name); + //build super layout + if(parametersChorusGroupBox->layout()) + delete(parametersChorusGroupBox->layout()); + Q3GridLayout* superLayout = new Q3GridLayout(parametersChorusGroupBox); + parametersChorusGroupBox->setLayout(superLayout); + //build super widget + if(_chorusSuperWidget) delete(_chorusSuperWidget); + _chorusSuperWidget = new QWidget(parametersChorusGroupBox); + superLayout->addWidget(_chorusSuperWidget); + //build grid + Q3GridLayout* grid = new Q3GridLayout(_chorusSuperWidget); + _chorusSuperWidget->setLayout(grid); + grid->setSpacing(2); + //init vectors + if(!_chorusSliderVector.empty()) _chorusSliderVector.clear(); + if(!_chorusFloatEntryVector.empty()) _chorusFloatEntryVector.clear(); + if(!_chorusCheckBoxVector.empty()) _chorusCheckBoxVector.clear(); + //build sliders + for(int i = 0; i < plugI->plugin()->parameter(); i++) { + double min, max, val; + plugI->range(i, &min, &max); + val = _deicsOnze->getChorusParam(i); + if(plugI->isBool(i)) + addPluginCheckBox(i, plugI->getParameterName(i), val > 0.0, + _chorusSuperWidget, grid, false); + else if(plugI->isInt(i)) { + addPluginIntSlider(i, plugI->getParameterName(i), rint(min), rint(max), + rint(val), _chorusSuperWidget, grid, false); + } + else { + addPluginSlider(i, plugI->getParameterName(i), plugI->isLog(i), + min, max, val, _chorusSuperWidget, grid, false); + } + } + //update colors of the new sliders (and the whole gui actually) + setEditTextColor(reinterpret_cast(*etColor)); + setEditBackgroundColor(reinterpret_cast(*ebColor)); +} + +//setReverbCheckBox is used, by the way, to send the value +//of the parameter because it sends a double and does not +//change any thing +void DeicsOnze2Gui::setReverbCheckBox(double v, int i) { + float f = (float)v; + unsigned char* message = new unsigned char[2+sizeof(float)]; + message[0]=SYSEX_REVERBPARAM; + if(i<256) { + message[1]=(unsigned char)i; + memcpy(&message[2], &f, sizeof(float)); + sendSysex(message, 2+sizeof(float)); + } + else printf("setReverbCheckBox Error : cannot send controller upper than 225\n"); +} + +//setChorusCheckBox is used, by the way, to send the value +//of the parameter because it sends a double and does not +//change any thing +void DeicsOnze2Gui::setChorusCheckBox(double v, int i) { + float f = (float)v; + unsigned char* message = new unsigned char[2+sizeof(float)]; + message[0]=SYSEX_CHORUSPARAM; + if(i<256) { + message[1]=(unsigned char)i; + memcpy(&message[2], &f, sizeof(float)); + sendSysex(message, 2+sizeof(float)); + } + else printf("setChorusCheckBox Error : cannot send controller upper than 225\n"); +} + +void DeicsOnze2Gui::setReverbFloatEntry(double v, int i) { + if(_deicsOnze->_pluginIReverb) { + if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v); + updateReverbFloatEntry(v, i); + updateReverbSlider(v, i); + setReverbCheckBox(v, i); //because this send the SYSEX + } + else printf("Warning : no DeicsOnze2 reverb loaded\n"); +} +void DeicsOnze2Gui::setReverbSlider(double v, int i) { + if(_deicsOnze->_pluginIReverb) { + if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v); + updateReverbFloatEntry(v, i); + updateReverbSlider(v, i); + setReverbCheckBox(v, i); //because this send the SYSEX + } + else printf("Warning : no DeicsOnze2 reverb loaded\n"); +} +void DeicsOnze2Gui::setChorusFloatEntry(double v, int i) { + if(_deicsOnze->_pluginIReverb) { + if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v); + updateChorusFloatEntry(v, i); + updateChorusSlider(v, i); + setChorusCheckBox(v, i); //because this send the SYSEX + } + else printf("Warning : no DeicsOnze2 chorus loaded\n"); +} +void DeicsOnze2Gui::setChorusSlider(double v, int i) { + if(_deicsOnze->_pluginIReverb) { + if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v); + updateChorusSlider(v, i); + updateChorusFloatEntry(v, i); + setChorusCheckBox(v, i); //because this send the SYSEX + } + else printf("Warning : no DeicsOnze2 chorus loaded\n"); +} + +//updates +void DeicsOnze2Gui::updateReverbSlider(double v, int i) { + if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) { + _reverbSliderVector[i]->blockSignals(true); + _reverbSliderVector[i]->setValue(v); + _reverbSliderVector[i]->blockSignals(false); + } +} +void DeicsOnze2Gui::updateReverbFloatEntry(double v, int i) { + if(i < (int)_reverbFloatEntryVector.size() && _reverbFloatEntryVector[i]) { + _reverbFloatEntryVector[i]->blockSignals(true); + _reverbFloatEntryVector[i]->setValue(v); + _reverbFloatEntryVector[i]->blockSignals(false); + } +} +void DeicsOnze2Gui::updateChorusSlider(double v, int i) { + if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) { + _chorusSliderVector[i]->blockSignals(true); + _chorusSliderVector[i]->setValue(v); + _chorusSliderVector[i]->blockSignals(false); + } +} +void DeicsOnze2Gui::updateChorusFloatEntry(double v, int i) { + if(i < (int)_chorusFloatEntryVector.size() && _chorusFloatEntryVector[i]) { + _chorusFloatEntryVector[i]->blockSignals(true); + _chorusFloatEntryVector[i]->setValue(v); + _chorusFloatEntryVector[i]->blockSignals(false); + } +} + +//------------------------------------------------------------- +// set Delay +//------------------------------------------------------------- +void DeicsOnze2::setDelayBPM(float val) { + if(_pluginIDelay) _pluginIDelay->controller(0)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} +void DeicsOnze2::setDelayBeatRatio(float val) { + if(_pluginIDelay) _pluginIDelay->controller(1)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} +float DeicsOnze2::getDelayBPM() { + if(_pluginIDelay) return _pluginIDelay->controller(0)->curVal().f; + else { + printf("Warning : no DeicsOnze2 delay loaded\n"); + return 0.0; + } +} +float DeicsOnze2::getDelayBeatRatio() { + if(_pluginIDelay) return _pluginIDelay->controller(1)->curVal().f; + else { + printf("Warning : no DeicsOnze2 delay loaded\n"); + return 0.0; + } +} +void DeicsOnze2::setDelayFeedback(float val) { + if(_pluginIDelay) return _pluginIDelay->controller(2)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} +float DeicsOnze2::getDelayFeedback() { + if(_pluginIDelay) return _pluginIDelay->controller(2)->curVal().f; + else { + printf("Warning : no DeicsOnze2 delay loaded\n"); + return 0.0; + } +} +void DeicsOnze2::setDelayLFOFreq(float val) { + if(_pluginIDelay) _pluginIDelay->controller(3)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} +float DeicsOnze2::getDelayLFOFreq() { + if(_pluginIDelay) return _pluginIDelay->controller(3)->curVal().f; + else { + printf("Warning : no DeicsOnze2 delay loaded\n"); + return 0.0; + } +} +void DeicsOnze2::setDelayLFODepth(float val) { + if(_pluginIDelay) _pluginIDelay->controller(4)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} +float DeicsOnze2::getDelayLFODepth() { + if(_pluginIDelay) return _pluginIDelay->controller(4)->curVal().f; + else { + printf("Warning : no DeicsOnze2 delay loaded\n"); + return 0.0; + } +} +void DeicsOnze2::setDelayDryWet(float val) { + if(_pluginIDelay) _pluginIDelay->controller(5)->setCurVal(val); + else printf("Warning : no DeicsOnze2 delay loaded\n"); +} diff --git a/muse2/synti/deicsonze2/deicsonze2plugin.h b/muse2/synti/deicsonze2/deicsonze2plugin.h new file mode 100644 index 00000000..0204933a --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2plugin.h @@ -0,0 +1,40 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// +// +// +// Copyright (c) 2004-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 __DEICSONZE2PLUGIN_H +#define __DEICSONZE2PLUGIN_H + +#include "deicsonze2.h" +#include "deicsonze2gui.h" +#include "plugins/pandelay/pandelaymodel.h" + +class DeicsOnze2; +class DeicsOnze2Gui; + +#endif diff --git a/muse2/synti/deicsonze2/deicsonze2preset.cpp b/muse2/synti/deicsonze2/deicsonze2preset.cpp new file mode 100644 index 00000000..f4ddbb98 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2preset.cpp @@ -0,0 +1,1202 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// deicsonzepreset.cpp +// +// +// Copyright (c) 2004-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 "deicsonzepreset.h" +#include +#include + +#define SET_LEVEL 1 +#define CAT_LEVEL 2 +#define SUB_LEVEL 3 +#define PRE_LEVEL 4 + +//----------------------------------------------------------- +// Constructor destructor +//----------------------------------------------------------- +Preset::Preset() {_subcategory=NULL;_isUsed=false;initPreset();} +Preset::Preset(Subcategory* sub) { + _subcategory=sub; + _isUsed=false; + initPreset(); + if(sub) sub->_presetVector.push_back(this); +} +Preset::Preset(Subcategory* sub, int pr) { + _subcategory=sub; + _isUsed=false; + initPreset(); + prog=pr; + if(sub) sub->_presetVector.push_back(this); +} +Preset::~Preset() { + if(_subcategory) { + std::vector::iterator iB=_subcategory->_presetVector.begin(); + std::vector::iterator iE=_subcategory->_presetVector.end(); + std::vector::iterator iP=std::find(iB, iE, this); + if(iP!=iE) _subcategory->_presetVector.erase(iP); + else printf("Error : preset %s not found\n", name.c_str()); + } +} +//---------------------------------------------------------- +// setIsUsed(bool b) +// set the flag _isUsed and transmit in the parents +//---------------------------------------------------------- +void Preset::setIsUsed(bool b) { + if(!_isUsed) { + _isUsed=b; + if(_subcategory) { + _subcategory->_isUsed=b; + if(_subcategory->_category) { + _subcategory->_category->_isUsed=b; + } + } + } +} +//---------------------------------------------------------- +// getHBankLBankProg +// return the hbank, lbank and prog of the preset +// warning : if there is not subcategory of category +// the value l or h are let unchanged +//---------------------------------------------------------- +void Preset::getHBankLBankProg(int* h, int* l, int* p) { + *p = prog; + if(_subcategory) { + *l = _subcategory->_lbank; + if(_subcategory->_category) *h = _subcategory->_category->_hbank; + } +} +//---------------------------------------------------------- +// linkSubcategory +// links the preset to a subcategory parent and erase itself +// from the last subcategory if not NULL +//---------------------------------------------------------- +void Preset::linkSubcategory(Subcategory* sub) { + if(_subcategory) { + std::vector pv=_subcategory->_presetVector; + std::vector::iterator iP=find(pv.begin(),pv.end(),this); + if(iP!=pv.end()) pv.erase(iP); + else printf("Error linkSubcategory: preset %s not found\n", + name.c_str()); + } + _subcategory=sub; + if(sub) sub->_presetVector.push_back(this); +} +//---------------------------------------------------------- +// linkCategory +// links the subcategory to a category parent and erase itself +// from the last category if not NULL +//---------------------------------------------------------- +void Subcategory::linkCategory(Category* cat) { + if(_category) { + std::vector sv=_category->_subcategoryVector; + std::vector::iterator iS=find(sv.begin(),sv.end(),this); + if(iS!=sv.end()) sv.erase(iS); + else printf("Error linkCategory: preset %s not found\n", + _subcategoryName.c_str()); + } + _category=cat; + if(cat) cat->_subcategoryVector.push_back(this); +} + + +//---------------------------------------------------------- +// linkSet +// links the category to a set parent (there is always only one set) +//---------------------------------------------------------- +void Category::linkSet(Set* s) { + _set=s; + if(s) s->_categoryVector.push_back(this); +} + +//---------------------------------------------------------- +// Subcategory constructor and destruction +//---------------------------------------------------------- +Subcategory::Subcategory() {_category=NULL;} +Subcategory::Subcategory(Category* cat) { + _category=cat; + _isUsed=false; + if(cat) cat->_subcategoryVector.push_back(this); +} +Subcategory::Subcategory(const std::string name) { + _category=NULL; + _isUsed=false; + _subcategoryName=name; +} +Subcategory::Subcategory(Category* cat, const std::string name, int lbank) { + _category=cat; + _isUsed=false; + _subcategoryName=name; + _lbank=lbank; + if(cat) cat->_subcategoryVector.push_back(this); +} +Subcategory::~Subcategory() { + while(!_presetVector.empty()) delete(*_presetVector.begin()); + if(_category) { + std::vector::iterator + iB=_category->_subcategoryVector.begin(); + std::vector::iterator + iE=_category->_subcategoryVector.end(); + std::vector::iterator iS=std::find(iB, iE, this); + if(iS!=iE) _category->_subcategoryVector.erase(iS); + else printf("Error : subcategory %s not found\n", + _subcategoryName.c_str()); + } +} + +//-------------------------------------------------------- +// Category constructor destructor +//-------------------------------------------------------- +Category::Category() {_set=NULL;_isUsed=false;} +Category::Category(Set* s) { + _set=s; + _isUsed=false; + if(s) s->_categoryVector.push_back(this); +} +Category::Category(Set* s,const std::string name, int hbank) { + _set=s; + _isUsed=false; + _categoryName=name; + _hbank=hbank; + if(s) s->_categoryVector.push_back(this); +} +Category::~Category() { + while(!_subcategoryVector.empty()) delete(*_subcategoryVector.begin()); + if(_set) { + std::vector::iterator iB=_set->_categoryVector.begin(); + std::vector::iterator iE=_set->_categoryVector.end(); + std::vector::iterator iC=std::find(iB, iE, this); + if(iC!=iE) _set->_categoryVector.erase(iC); + else printf("Error : category %s not found\n", _categoryName.c_str()); + } +} + +//--------------------------------------------------------- +// initPreset +// put the preset in the initial state as defined by YAMAHA +//--------------------------------------------------------- +void Preset::initPreset() { + //algorithm + algorithm=FIRST; + //feedeback + feedback=0; + //lfo + lfo.wave=TRIANGL; + lfo.speed=35; + lfo.delay=0; + lfo.pModDepth=0; + lfo.aModDepth=0; + lfo.sync=false; + //sensitivity + sensitivity.pitch=6; + sensitivity.amplitude=0; + sensitivity.ampOn[0]=false; + sensitivity.ampOn[1]=false; + sensitivity.ampOn[2]=false; + sensitivity.ampOn[3]=false; + sensitivity.egBias[0]=0; + sensitivity.egBias[1]=0; + sensitivity.egBias[2]=0; + sensitivity.egBias[3]=0; + sensitivity.keyVelocity[0]=0; + sensitivity.keyVelocity[1]=0; + sensitivity.keyVelocity[2]=0; + sensitivity.keyVelocity[3]=0; + //frequency + frequency[0].ratio=1.0; + frequency[1].ratio=1.0; + frequency[2].ratio=1.0; + frequency[3].ratio=1.0; + frequency[0].isFix=false; + frequency[1].isFix=false; + frequency[2].isFix=false; + frequency[3].isFix=false; + frequency[0].freq=255.0; + frequency[1].freq=255.0; + frequency[2].freq=255.0; + frequency[3].freq=255.0; + //oscWave + oscWave[0]=W1; + oscWave[1]=W1; + oscWave[2]=W1; + oscWave[3]=W1; + //detune + detune[0]=0; + detune[1]=0; + detune[2]=0; + detune[3]=0; + //eg + eg[0].ar=31; + eg[1].ar=31; + eg[2].ar=31; + eg[3].ar=31; + eg[0].d1r=31; + eg[1].d1r=31; + eg[2].d1r=31; + eg[3].d1r=31; + eg[0].d1l=15; + eg[1].d1l=15; + eg[2].d1l=15; + eg[3].d1l=15; + eg[0].d2r=0; + eg[1].d2r=0; + eg[2].d2r=0; + eg[3].d2r=0; + eg[0].rr=15; + eg[1].rr=15; + eg[2].rr=15; + eg[3].rr=15; + eg[0].egShift=VOF; + eg[1].egShift=VOF; + eg[2].egShift=VOF; + eg[3].egShift=VOF; + //pitchEg + pitchEg.pr1=99; + pitchEg.pr2=99; + pitchEg.pr3=99; + pitchEg.pl1=50; + pitchEg.pl2=50; + pitchEg.pl3=50; + //outLevel + outLevel[0]=90; + outLevel[1]=0; + outLevel[2]=0; + outLevel[3]=0; + //scaling + scaling.rate[0]=0; + scaling.rate[1]=0; + scaling.rate[2]=0; + scaling.rate[3]=0; + scaling.level[0]=0; + scaling.level[1]=0; + scaling.level[2]=0; + scaling.level[3]=0; + //function + function.transpose=0; + function.mode=POLY; + function.pBendRange=4; + function.portamento=FULL; + function.portamentoTime=0; + function.fcVolume=40; + function.fcPitch=0; + function.fcAmplitude=0; + function.mwPitch=50; + function.mwAmplitude=0; + function.bcPitch=0; + function.bcAmplitude=0; + function.bcPitchBias=0; + function.bcEgBias=0; + function.atPitch=0; + function.atAmplitude=0; + function.atPitchBias=0; + function.atEgBias=0; + function.reverbRate=0; + //globalDetune=0; + //Name + name="INITVOICE"; +} +//--------------------------------------------------------- +// Preset::merge +// copy the preset +//--------------------------------------------------------- +void Preset::merge(Preset* p) { + if(p) { + //algorithm + algorithm=p->algorithm; + //feedeback + feedback=p->feedback; + //lfo + lfo.wave=p->lfo.wave; + lfo.speed=p->lfo.speed; + lfo.delay=p->lfo.delay; + lfo.pModDepth=p->lfo.pModDepth; + lfo.aModDepth=p->lfo.aModDepth; + lfo.sync=p->lfo.sync; + //sensitivity + sensitivity.pitch=p->sensitivity.pitch; + sensitivity.amplitude=p->sensitivity.amplitude; + for(int k=0; ksensitivity.ampOn[k]; + sensitivity.egBias[k]=p->sensitivity.egBias[k]; + sensitivity.keyVelocity[k]=p->sensitivity.keyVelocity[k]; + //frequency + frequency[k].ratio=p->frequency[k].ratio; + frequency[k].isFix=p->frequency[k].isFix; + frequency[k].freq=p->frequency[k].freq; + //oscWave + oscWave[k]=p->oscWave[k]; + //detune + detune[k]=p->detune[k]; + //eg + eg[k].ar=p->eg[k].ar; + eg[k].d1r=p->eg[k].d1r; + eg[k].d1l=p->eg[k].d1l; + eg[k].d2r=p->eg[k].d2r; + eg[k].rr=p->eg[k].rr; + eg[k].egShift=p->eg[k].egShift; + //outLevel + outLevel[k]=p->outLevel[k]; + //scaling + scaling.rate[k]=p->scaling.rate[k]; + scaling.level[k]=p->scaling.level[k]; + } + //pitchEg + pitchEg.pr1=p->pitchEg.pr1; + pitchEg.pr2=p->pitchEg.pr2; + pitchEg.pr3=p->pitchEg.pr3; + pitchEg.pl1=p->pitchEg.pl1; + pitchEg.pl2=p->pitchEg.pl2; + pitchEg.pl3=p->pitchEg.pl3; + //function + function.transpose=p->function.transpose; + function.mode=p->function.mode; + function.pBendRange=p->function.pBendRange; + function.portamento=p->function.portamento; + function.portamentoTime=p->function.portamentoTime; + function.fcVolume=p->function.fcVolume; + function.fcPitch=p->function.fcPitch; + function.fcAmplitude=p->function.fcAmplitude; + function.mwPitch=p->function.mwPitch; + function.mwAmplitude=p->function.mwAmplitude; + function.bcPitch=p->function.bcPitch; + function.bcAmplitude=p->function.bcAmplitude; + function.bcPitchBias=p->function.bcPitchBias; + function.bcEgBias=p->function.bcEgBias; + function.atPitch=p->function.atPitch; + function.atAmplitude=p->function.atAmplitude; + function.atPitchBias=p->function.atPitchBias; + function.atEgBias=p->function.atEgBias; + function.reverbRate=p->function.reverbRate; + //globalDetune=p->globalDetune; + //Name + name=p->name; + } +} +//--------------------------------------------------------- +// findPreset +// return the first preset corresponding of hbank, lbank, prog +//--------------------------------------------------------- +Preset* Subcategory::findPreset(int prog) { + std::vector::iterator pvi; + for(pvi=_presetVector.begin(); pvi!=_presetVector.end(); pvi++) { + if((*pvi)->prog==prog) return(*pvi); + } + return NULL; +} +Preset* Category::findPreset(int lbank, int prog) { + Subcategory* s=findSubcategory(lbank); + if(s) { + Preset* p=s->findPreset(prog); + if(p) return(p); + } + return(NULL); +} +Preset* Set::findPreset(int hbank, int lbank, int prog) { + Category* c=findCategory(hbank); + if(c) { + Preset* p=c->findPreset(lbank, prog); + if(p) return(p); + } + return NULL; +} + +//--------------------------------------------------------- +// isFreeHBank, firstFreeHBank -1 otherwise +//--------------------------------------------------------- +bool Set::isFreeHBank(int hbank) { + if(findCategory(hbank)) return(false); + else return(true); +} +int Set::firstFreeHBank() { + for(int hbank=0; hbank<128; hbank++) if(isFreeHBank(hbank)) return(hbank); + return(-1); +} +//-------------------------------------------------------------- +// Set::merge +//-------------------------------------------------------------- +void Set::merge(Category* c) { + if(isFreeHBank(c->_hbank)) c->linkSet(this); + else { + Category* cFromSet=findCategory(c->_hbank); + cFromSet->_categoryName=c->_categoryName; + for(std::vector::iterator + i=c->_subcategoryVector.begin(); + i!=c->_subcategoryVector.end(); i++) cFromSet->merge(*i); + //delete(c); + } +} + +bool Category::isFreeLBank(int lbank) { + if(findSubcategory(lbank)) return(false); + else return(true); +} +int Category::firstFreeLBank() { + for(int lbank=0; lbank<128; lbank++) if(isFreeLBank(lbank)) return(lbank); + return(-1); +} +//-------------------------------------------------------------- +// Category::merge +//-------------------------------------------------------------- +void Category::merge(Subcategory* s) { + if(isFreeLBank(s->_lbank)) s->linkCategory(this); + else { + Subcategory* sFromCat=findSubcategory(s->_lbank); + sFromCat->_subcategoryName=s->_subcategoryName; + for(std::vector::iterator + i=s->_presetVector.begin(); + i!=s->_presetVector.end(); i++) sFromCat->merge(*i); + //delete(s); + } +} +//--------------------------------------------------------- +// Category::unlink +// unlink the subcategories, so don't delete them when delete +//--------------------------------------------------------- +void Category::unlink() { + while(!_subcategoryVector.empty()) + _subcategoryVector.erase(_subcategoryVector.begin()); +} + +bool Subcategory::isFreeProg(int pr) { + if(findPreset(pr)) return(false); + else return(true); +} +int Subcategory::firstFreeProg() { + for(int pr=0; pr<128; pr++) if(isFreeProg(pr)) return(pr); + return(-1); +} +//--------------------------------------------------------- +// Subcategory::unlink +// unlink the presets, so don't delete them when delete +//--------------------------------------------------------- +void Subcategory::unlink() { + while(!_presetVector.empty()) _presetVector.erase(_presetVector.begin()); +} + +//--------------------------------------------------------- +// findSubcategory +// take hbank and lbank and return the subcategory corresponding, +// NULL if doesn't exist +//--------------------------------------------------------- +Subcategory* Set::findSubcategory(int hbank, int lbank) { + Category* c = findCategory(hbank); + Subcategory* s; + if(c) { + s = c->findSubcategory(lbank); + return s; + } + else return NULL; +} + +//--------------------------------------------------------- +// findCategory +// takes hbank a category and return the first category, +// NULL if doesn't exist +//--------------------------------------------------------- +Category* Set::findCategory(int hbank) { + std::vector::iterator cvi; + for(cvi=_categoryVector.begin(); cvi!=_categoryVector.end(); cvi++) + if((*cvi)->_hbank==hbank) return(*cvi); + return(NULL); +} +//--------------------------------------------------------- +// findSubcategory +// takes lbank a subcategory and return the subcategory +// NULL if doesn't exist +//--------------------------------------------------------- +Subcategory* Category::findSubcategory(int lbank) { + std::vector::iterator svi; + for(svi=_subcategoryVector.begin(); svi!=_subcategoryVector.end(); svi++) + if((*svi)->_lbank==lbank) return(*svi); + return(NULL); +} +//-------------------------------------------------------------- +// Subcategory::merge +//-------------------------------------------------------------- +void Subcategory::merge(Preset* p) { + if(isFreeProg(p->prog)) p->linkSubcategory(this); + else { + Preset* pFromSub=findPreset(p->prog); + pFromSub->merge(p); + } +} + +//--------------------------------------------------------- +// readSet +//--------------------------------------------------------- +void Set::readSet(QDomNode setNode) { + while(!setNode.isNull()) { + QDomElement setEl = setNode.toElement(); + if (setEl.isNull()) + continue; + if (setEl.tagName() == "setName") + _setName=setEl.text().ascii(); + if (setEl.tagName() == "deicsOnzeCategory") { + //load category + QString version = setEl.attribute(QString("version")); + if (version == "1.0") { + Category* lCategory = new Category(); + lCategory->readCategory(setNode.firstChild()); + //printf("Ready to merge!\n"); + merge(lCategory); + } + } + setNode = setNode.nextSibling(); + } +} + +//--------------------------------------------------------- +// writeSet +//--------------------------------------------------------- +void Set::writeSet(Xml* xml, bool onlyUsed) { + xml->tag(0, "deicsOnzeSet version=\"1.0\""); + xml->strTag(SET_LEVEL, "setName", _setName.c_str()); + for(std::vector::iterator i = _categoryVector.begin(); + i != _categoryVector.end(); i++) (*i)->writeCategory(xml, onlyUsed); + xml->etag(0, "deicsOnzeSet"); +} + +//--------------------------------------------------------- +// readCategory +//--------------------------------------------------------- +void Category::readCategory(QDomNode catNode) { + while(!catNode.isNull()) { + QDomElement catEl = catNode.toElement(); + if (catEl.isNull()) + continue; + if (catEl.tagName() == "categoryName") + _categoryName=catEl.text().ascii(); + if (catEl.tagName() == "hbank") + _hbank=catEl.text().toInt(); + if (catEl.tagName() == "deicsOnzeSubcategory") { + //load Subcategory + QString version = catEl.attribute(QString("version")); + if (version == "1.0") { + Subcategory* lSubcategory = new Subcategory(this); + lSubcategory->readSubcategory(catNode.firstChild()); + } + } + catNode = catNode.nextSibling(); + } +} + +//--------------------------------------------------------- +// writeCategory +//--------------------------------------------------------- +void Category::writeCategory(Xml* xml, bool onlyUsed) { + if((!onlyUsed || _isUsed)) { + xml->tag(SET_LEVEL, "deicsOnzeCategory version=\"1.0\""); + xml->strTag(CAT_LEVEL, "categoryName", _categoryName.c_str()); + xml->intTag(CAT_LEVEL, "hbank", _hbank); + for(std::vector::iterator i=_subcategoryVector.begin(); + i!=_subcategoryVector.end(); i++) + (*i)->writeSubcategory(xml, onlyUsed); + xml->etag(SET_LEVEL, "deicsOnzeCategory"); + } +} + +//--------------------------------------------------------- +// readSubcategory +//--------------------------------------------------------- +void Subcategory::readSubcategory(QDomNode subNode) { + while(!subNode.isNull()) { + QDomElement subEl = subNode.toElement(); + if (subEl.isNull()) + continue; + if (subEl.tagName() == "subcategoryName") + _subcategoryName=subEl.text().ascii(); + if (subEl.tagName() == "lbank") + _lbank=subEl.text().toInt(); + if (subEl.tagName() == "deicsOnzePreset") { + //load preset + QString version = subEl.attribute(QString("version")); + if (version == "1.0") { + Preset* lPreset = new Preset(this); + lPreset->readPreset(subNode.firstChild()); + } + } + subNode = subNode.nextSibling(); + } +} + +//--------------------------------------------------------- +// writeSubcategory +//--------------------------------------------------------- +void Subcategory::writeSubcategory(Xml* xml, bool onlyUsed) { + if((!onlyUsed || _isUsed)) { + xml->tag(CAT_LEVEL, "deicsOnzeSubcategory version=\"1.0\""); + xml->strTag(SUB_LEVEL, "subcategoryName", _subcategoryName.c_str()); + xml->intTag(SUB_LEVEL, "lbank", _lbank); + for(std::vector::iterator i=_presetVector.begin(); + i!=_presetVector.end(); i++) (*i)->writePreset(xml, onlyUsed); + xml->etag(CAT_LEVEL, "deicsOnzeSubcategory"); + } +} + +//--------------------------------------------------------- +// readPreset +//--------------------------------------------------------- +void Preset::readPreset(QDomNode presetNode) { + while(!presetNode.isNull()) { + QDomElement presetEl = presetNode.toElement(); + if (presetEl.isNull()) + continue; + //algorithm + if(presetEl.tagName()==ALGSTR) + algorithm=(presetEl.text()=="FIRST"? FIRST: + (presetEl.text()=="SECOND"? SECOND: + (presetEl.text()=="THIRD"? THIRD: + (presetEl.text()=="FOURTH"? FOURTH: + (presetEl.text()=="FIFTH"? FIFTH: + (presetEl.text()=="SIXTH"? SIXTH: + (presetEl.text()=="SEVENTH"? SEVENTH:EIGHTH))))))); + //feedback + else if(presetEl.tagName()==FEEDBACKSTR) + feedback=presetEl.text().toInt(); + //quick edit + //else if(presetEl.tagName()==FINEBRIGHTNESSSTR) + // brightness=presetEl.text().toInt(); + //else if(presetEl.tagName()==MODULATIONSTR) + // modulation=(unsigned char)presetEl.text().toInt(); + //else if(presetEl.tagName()==GLOBALDETUNESTR) + // globalDetune=presetEl.text().toInt(); + //else if(presetEl.tagName()==ATTACKSTR) + // attack=presetEl.text().toInt(); + //else if(presetEl.tagName()==RELEASESTR) + // release=presetEl.text().toInt(); + //lfo + else if(presetEl.tagName()=="lfo") { + QDomNode lfoNode = presetNode.firstChild(); + while(!lfoNode.isNull()) { + QDomElement lfoEl = lfoNode.toElement(); + if (lfoEl.isNull()) + continue; + if(lfoEl.tagName()==WAVESTR) + lfo.wave=(lfoEl.text()=="SAWUP"? SAWUP: + (lfoEl.text()=="SQUARE"? SQUARE: + (lfoEl.text()=="TRIANGL"? TRIANGL:SHOLD))); + else if(lfoEl.tagName()==SPEEDSTR) + lfo.speed=lfoEl.text().toInt(); + else if(lfoEl.tagName()==DELAYSTR) + lfo.delay=lfoEl.text().toInt(); + else if(lfoEl.tagName()==PMODDEPTHSTR) + lfo.pModDepth=lfoEl.text().toInt(); + else if(lfoEl.tagName()==AMODDEPTHSTR) + lfo.aModDepth=lfoEl.text().toInt(); + else if(lfoEl.tagName()==SYNCSTR) + lfo.sync=(lfoEl.text()=="on"? true:false); + lfoNode = lfoNode.nextSibling(); + } + } + //sensitivity + else if(presetEl.tagName()=="sensitivity") { + QDomNode sensitivityNode = presetNode.firstChild(); + while(!sensitivityNode.isNull()) { + QDomElement sensitivityEl = sensitivityNode.toElement(); + if (sensitivityEl.isNull()) + continue; + QString st=sensitivityEl.tagName(); + if(st==PMODSENSSTR) + sensitivity.pitch=sensitivityEl.text().toInt(); + else if(st==AMSSTR) + sensitivity.amplitude=sensitivityEl.text().toInt(); + else if(st.contains(AMESTR, Qt::CaseSensitive)) { + int op = (st.remove(AMESTR, Qt::CaseSensitive)).toInt()-1; + sensitivity.ampOn[op]=(sensitivityEl.text()=="on"? true:false); + } + else if(st.contains(EBSSTR, Qt::CaseSensitive)) { + int op = (st.remove(EBSSTR, Qt::CaseSensitive)).toInt()-1; + sensitivity.egBias[op]=sensitivityEl.text().toInt(); + } + else if(st.contains(KVSSTR, Qt::CaseSensitive)) { + int op = (st.remove(KVSSTR, Qt::CaseSensitive)).toInt()-1; + sensitivity.keyVelocity[op]=sensitivityEl.text().toInt(); + } + sensitivityNode =sensitivityNode.nextSibling(); + } + } + //frequency + else if(presetEl.tagName()=="frequency") { + QDomNode frequencyNode = presetNode.firstChild(); + while(!frequencyNode.isNull()) { + QDomElement frequencyEl = frequencyNode.toElement(); + if (frequencyEl.isNull()) + continue; + QString ft = frequencyEl.tagName(); + if(ft.contains(RATIOSTR, Qt::CaseSensitive)) { + int op = (ft.remove(RATIOSTR, Qt::CaseSensitive)).toInt()-1; + frequency[op].ratio=frequencyEl.text().toDouble(); + } + else if(ft.contains(FIXSTR, Qt::CaseSensitive)) { + int op = (ft.remove(FIXSTR, Qt::CaseSensitive)).toInt()-1; + frequency[op].isFix=(frequencyEl.text()=="yes"?true:false); + } + else if(ft.contains(FIXRANGESTR, Qt::CaseSensitive)) { + int op= (ft.remove(FIXRANGESTR, Qt::CaseSensitive)).toInt()-1; + frequency[op].freq=frequencyEl.text().toDouble(); + } + frequencyNode =frequencyNode.nextSibling(); + } + } + //oscWave + else if(presetEl.tagName().contains(OSWSTR, Qt::CaseSensitive)) { + int op=(presetEl.tagName().remove(OSWSTR, Qt::CaseSensitive)).toInt()-1; + oscWave[op]=(presetEl.text()=="W1"? W1: + (presetEl.text()=="W2"?W2: + (presetEl.text()=="W3"?W3: + (presetEl.text()=="W4"?W4: + (presetEl.text()=="W5"?W5: + (presetEl.text()=="W6"?W6: + (presetEl.text()=="W7"?W7:W8))))))); + + } + //detune + else if(presetEl.tagName().contains(DETSTR, Qt::CaseSensitive)) { + int op=(presetEl.tagName().remove(DETSTR, Qt::CaseSensitive)).toInt()-1; + detune[op]=presetEl.text().toInt(); + } + //eg + else if(presetEl.tagName()=="eg") { + QDomNode egNode = presetNode.firstChild(); + while(!egNode.isNull()) { + QDomElement egEl = egNode.toElement(); + if (egEl.isNull()) + continue; + QString et=egEl.tagName(); + if(et.contains(ARSTR, Qt::CaseSensitive)) { + int op=(et.remove(ARSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].ar=egEl.text().toInt(); + } + else if(et.contains(D1RSTR, Qt::CaseSensitive)) { + int op=(et.remove(D1RSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].d1r=egEl.text().toInt(); + } + else if(et.contains(D1LSTR, Qt::CaseSensitive)) { + int op = (et.remove(D1LSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].d1l=egEl.text().toInt(); + } + else if(et.contains(D2RSTR, Qt::CaseSensitive)) { + int op=(et.remove(D2RSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].d2r=egEl.text().toInt(); + } + else if(et.contains(RRSTR, Qt::CaseSensitive)) { + int op=(et.remove(RRSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].rr=egEl.text().toInt(); + } + else if(et.contains(SHFTSTR, Qt::CaseSensitive)) { + int op=(et.remove(SHFTSTR, Qt::CaseSensitive)).toInt()-1; + eg[op].egShift=(egEl.text()=="VOF"?VOF: + (egEl.text()=="V48"?V48: + (egEl.text()=="V24"?V24:V12))); + } + egNode =egNode.nextSibling(); + } + } + //pitchEg + else if(presetEl.tagName()=="pitchEg") { + QDomNode pitchEgNode = presetNode.firstChild(); + while(!pitchEgNode.isNull()) { + QDomElement pitchEgEl = pitchEgNode.toElement(); + if (pitchEgEl.isNull()) + continue; + QString pt=pitchEgEl.tagName(); + if(pt==PR1STR) pitchEg.pr1=pitchEgEl.text().toInt(); + else if(pt==PR2STR) pitchEg.pr2=pitchEgEl.text().toInt(); + else if(pt==PR3STR) pitchEg.pr3=pitchEgEl.text().toInt(); + else if(pt==PL1STR) pitchEg.pl1=pitchEgEl.text().toInt(); + else if(pt==PL2STR) pitchEg.pl2=pitchEgEl.text().toInt(); + else if(pt==PL3STR) pitchEg.pl3=pitchEgEl.text().toInt(); + pitchEgNode=pitchEgNode.nextSibling(); + } + } + //outLevel + else if(presetEl.tagName().contains(OUTSTR, Qt::CaseSensitive)) { + int op=(presetEl.tagName().remove(OUTSTR, Qt::CaseSensitive)).toInt()-1; + outLevel[op]=presetEl.text().toInt(); + } + //scaling + else if(presetEl.tagName()=="scaling") { + QDomNode scalingNode = presetNode.firstChild(); + while(!scalingNode.isNull()) { + QDomElement scalingEl = scalingNode.toElement(); + if (scalingEl.isNull()) + continue; + QString st=scalingEl.tagName(); + if(st.contains(RSSTR, Qt::CaseSensitive)) { + int op=(st.remove(RSSTR, Qt::CaseSensitive)).toInt()-1; + scaling.rate[op]=scalingEl.text().toInt(); + } + else if(st.contains(LSSTR, Qt::CaseSensitive)) { + int op=(st.remove(LSSTR, Qt::CaseSensitive)).toInt()-1; + scaling.level[op]=scalingEl.text().toInt(); + } + scalingNode =scalingNode.nextSibling(); + } + } + //function + else if(presetEl.tagName()=="function") { + QDomNode functionNode = presetNode.firstChild(); + while(!functionNode.isNull()) { + QDomElement functionEl = functionNode.toElement(); + if (functionEl.isNull()) + continue; + QString ft=functionEl.tagName(); + if(ft==TRANSPOSESTR) + function.transpose=functionEl.text().toInt(); + else if(ft==POLYMODESTR) + function.mode=(functionEl.text()=="POLY"?POLY:MONO); + else if(ft==PBENDRANGESTR) + function.pBendRange=functionEl.text().toInt(); + else if(ft==PORTAMODESTR) + function.portamento= + functionEl.text()=="FINGER"?FINGER:FULL; + else if(ft==PORTATIMESTR) + function.portamentoTime=functionEl.text().toInt(); + else if(ft==FSWSTR) + function.footSw=(functionEl.text()=="POR"?POR:SUS); + else if(ft==FCVOLUMESTR) + function.fcVolume=functionEl.text().toInt(); + else if(ft==FCPITCHSTR) + function.fcPitch=functionEl.text().toInt(); + else if(ft==FCAMPLITUDESTR) + function.fcAmplitude=functionEl.text().toInt(); + else if(ft==MWPITCHSTR) + function.mwPitch=functionEl.text().toInt(); + else if(ft==MWAMPLITUDESTR) + function.mwAmplitude=functionEl.text().toInt(); + else if(ft==BCPITCHSTR) + function.bcPitch=functionEl.text().toInt(); + else if(ft==BCAMPLITUDESTR) + function.bcAmplitude=functionEl.text().toInt(); + else if(ft==BCPITCHBIASSTR) + function.bcPitchBias=functionEl.text().toInt(); + else if(ft==BCEGBIASSTR) + function.bcEgBias=functionEl.text().toInt(); + else if(ft==ATPITCHSTR) + function.atPitch=functionEl.text().toInt(); + else if(ft==ATAMPLITUDESTR) + function.atAmplitude=functionEl.text().toInt(); + else if(ft==ATPITCHBIASSTR) + function.atPitchBias=functionEl.text().toInt(); + else if(ft==ATEGBIASSTR) + function.atEgBias=functionEl.text().toInt(); + else if(ft==REVERBRATESTR) + function.reverbRate=functionEl.text().toInt(); + functionNode=functionNode.nextSibling(); + } + } + //globalDetune + //else if(presetEl.tagName()=="globalDetune") + // globalDetune=presetEl.text().toInt(); + //Names + else if(presetEl.tagName()=="name") + name=presetEl.text().ascii(); + //prog + else if(presetEl.tagName()=="prog") + prog=presetEl.text().toInt(); + presetNode = presetNode.nextSibling(); + } +} + +//--------------------------------------------------------- +// witePreset +//--------------------------------------------------------- +void Preset::writePreset(Xml* xml, bool onlyUsed) { + char s[MAXCHARTAG]; + if((!onlyUsed || _isUsed)) { + xml->tag(SUB_LEVEL, "deicsOnzePreset version=\"1.0\""); + + //algorithm + xml->strTag(PRE_LEVEL, ALGSTR, (algorithm==FIRST? "FIRST": + (algorithm==SECOND? "SECOND": + (algorithm==THIRD? "THIRD": + (algorithm==FOURTH? "FOURTH": + (algorithm==FIFTH? "FIFTH": + (algorithm==SIXTH? "SIXTH": + (algorithm==SEVENTH? "SEVENTH": + "EIGHTH")))))))); + //feedback + xml->uintTag(PRE_LEVEL, FEEDBACKSTR, feedback); + //quick edit + //xml->tag(FINEBRIGHTNESSSTR, brightness); + //xml->tag(MODULATIONSTR, (int)modulation); + //xml->tag(GLOBALDETUNESTR, globalDetune); + //xml->tag(ATTACKSTR, attack); + //xml->tag(RELEASESTR, release); + //lfo + xml->tag(PRE_LEVEL, "lfo"); + xml->strTag(PRE_LEVEL + 1, WAVESTR, + (lfo.wave==SAWUP? "SAWUP": + (lfo.wave==SQUARE? "SQUARE": + (lfo.wave==TRIANGL? "TRIANGL":"SHOLD")))); + xml->uintTag(PRE_LEVEL + 1, SPEEDSTR, lfo.speed); + xml->uintTag(PRE_LEVEL + 1, DELAYSTR, lfo.delay); + xml->uintTag(PRE_LEVEL + 1, PMODDEPTHSTR, lfo.pModDepth); + xml->uintTag(PRE_LEVEL + 1, AMODDEPTHSTR, lfo.aModDepth); + xml->strTag(PRE_LEVEL + 1, SYNCSTR, (lfo.sync==true? "on":"off")); + xml->etag(PRE_LEVEL, "lfo"); + //sensitivity + xml->tag(PRE_LEVEL, "sensitivity"); + xml->uintTag(PRE_LEVEL + 1, PMODSENSSTR, sensitivity.pitch); + xml->uintTag(PRE_LEVEL + 1, AMSSTR, sensitivity.amplitude); + for(int i=0; istrTag(PRE_LEVEL + 1, s, + (sensitivity.ampOn[i]==true? "on":"off")); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, sensitivity.egBias[i]); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, sensitivity.keyVelocity[i]); + } + xml->etag(PRE_LEVEL, "sensitivity"); + //frequency + xml->tag(PRE_LEVEL, "frequency"); + for(int i=0; idoubleTag(PRE_LEVEL + 1, s, frequency[i].ratio); + } + for(int i=0; istrTag(PRE_LEVEL + 1, s, (frequency[i].isFix==true? "yes":"no")); + } + for(int i=0; idoubleTag(PRE_LEVEL + 1, s, frequency[i].freq); + } + xml->etag(PRE_LEVEL, "frequency"); + //oscWave + for(int i=0; istrTag(PRE_LEVEL, s, (oscWave[i]==W1?"W1": + (oscWave[i]==W2?"W2": + (oscWave[i]==W3?"W3": + (oscWave[i]==W4?"W4": + (oscWave[i]==W5?"W5": + (oscWave[i]==W6?"W6": + (oscWave[i]==W7?"W7":"W8")))))))); + } + //detune + for(int i=0; iintTag(PRE_LEVEL, s, detune[i]); + } + //eg + xml->tag(PRE_LEVEL, "eg"); + for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].ar); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d1r); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d1l); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d2r); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].rr); + } + for(int i=0; istrTag(PRE_LEVEL + 1, s, (eg[i].egShift==VOF?"VOF": + (eg[i].egShift==V48?"V48": + (eg[i].egShift==V24?"V24":"V12")))); + } + xml->etag(PRE_LEVEL, "eg"); + //pitchEg + xml->tag(PRE_LEVEL, "pitchEg"); + xml->uintTag(PRE_LEVEL + 1, PR1STR,pitchEg.pr1); + xml->uintTag(PRE_LEVEL + 1, PR2STR,pitchEg.pr2); + xml->uintTag(PRE_LEVEL + 1, PR3STR,pitchEg.pr3); + xml->uintTag(PRE_LEVEL + 1, PL1STR,pitchEg.pl1); + xml->uintTag(PRE_LEVEL + 1, PL2STR,pitchEg.pl2); + xml->uintTag(PRE_LEVEL + 1, PL3STR,pitchEg.pl3); + xml->etag(PRE_LEVEL, "pitchEg"); + //outLevel + for(int i=0; iuintTag(PRE_LEVEL, s, outLevel[i]); + } + //scaling + xml->tag(PRE_LEVEL, "scaling"); + for(int i=0; iuintTag(PRE_LEVEL + 1, s, scaling.rate[i]); + } + for(int i=0; iuintTag(PRE_LEVEL + 1, s, scaling.level[i]); + } + xml->etag(PRE_LEVEL, "scaling"); + //function + xml->tag(PRE_LEVEL, "function"); + xml->intTag(PRE_LEVEL + 1, TRANSPOSESTR, function.transpose); + xml->strTag(PRE_LEVEL + 1, POLYMODESTR, + (function.mode==POLY? "POLY":"MONO")); + xml->uintTag(PRE_LEVEL + 1, PBENDRANGESTR, function.pBendRange); + xml->strTag(PRE_LEVEL + 1, PORTAMODESTR, + (function.portamento==FINGER? "FINGER":"FULL")); + xml->uintTag(PRE_LEVEL + 1, PORTATIMESTR, function.portamentoTime); + xml->strTag(PRE_LEVEL + 1, FSWSTR, (function.footSw==POR? "POR":"SUS")); + xml->uintTag(PRE_LEVEL + 1, FCVOLUMESTR, function.fcVolume); + xml->uintTag(PRE_LEVEL + 1, FCPITCHSTR, function.fcPitch); + xml->uintTag(PRE_LEVEL + 1, FCAMPLITUDESTR, function.fcAmplitude); + xml->uintTag(PRE_LEVEL + 1, MWPITCHSTR, function.mwPitch); + xml->uintTag(PRE_LEVEL + 1, MWAMPLITUDESTR, function.mwAmplitude); + xml->uintTag(PRE_LEVEL + 1, BCPITCHSTR, function.bcPitch); + xml->uintTag(PRE_LEVEL + 1, BCAMPLITUDESTR, function.bcAmplitude); + xml->intTag(PRE_LEVEL + 1, BCPITCHBIASSTR, function.bcPitchBias); + xml->uintTag(PRE_LEVEL + 1, BCEGBIASSTR, function.bcEgBias); + xml->uintTag(PRE_LEVEL + 1, ATPITCHSTR, function.atPitch); + xml->uintTag(PRE_LEVEL + 1, ATAMPLITUDESTR, function.atAmplitude); + xml->intTag(PRE_LEVEL + 1, ATPITCHBIASSTR, function.atPitchBias); + xml->uintTag(PRE_LEVEL + 1, ATEGBIASSTR, function.atEgBias); + xml->intTag(PRE_LEVEL + 1, REVERBRATESTR, function.reverbRate); + xml->etag(PRE_LEVEL, "function"); + //globalDetune + //xml->tag("globalDetune", globalDetune); + //preset name + xml->strTag(PRE_LEVEL, "name", name.c_str()); + //bank prog + xml->intTag(PRE_LEVEL, "prog", prog); + + xml->etag(SUB_LEVEL, "deicsOnzePreset"); + } +} + +//--------------------------------------------------------- +// printPreset +//--------------------------------------------------------- + +void Preset::printPreset() +{ + printf("\n"); + printf("Algorithm : %d, Feedback : %d\n", algorithm, feedback); + printf("LFO : "); + switch(lfo.wave) + { + case(SAWUP) : printf("SAWUP ,"); break; + case(SQUARE) : printf("SQUARE ,"); break; + case(TRIANGL) : printf("TRIANGL ,"); break; + case(SHOLD) : printf("SHOLD ,"); break; + default : printf("No defined, "); break; + } + printf("Speed : %d, Delay : %d, PModD : %d, AModD : %d, ", + lfo.speed, lfo.delay, lfo.pModDepth, lfo.aModDepth); + if(lfo.sync) printf("Sync\n"); else printf("Not Sync\n"); + printf("LFO Pitch Sensitivity : %d, LFO Amplitude Sensitivity : %d\n", + sensitivity.pitch, sensitivity.amplitude); + for(int i=0; i::iterator i=_presetVector.begin(); + i!=_presetVector.end(); i++) (*i)->printPreset(); +} + +void Category::printCategory() { + std::cout << " " << _categoryName << "\n"; + for(unsigned int i=0; i<_subcategoryVector.size(); i++) + _subcategoryVector[i]->printSubcategory(); +} + +void Set::printSet() { + std::cout << _setName << "\n"; + for(unsigned int i=0; i<_categoryVector.size(); i++) + _categoryVector[i]->printCategory(); +} diff --git a/muse2/synti/deicsonze2/deicsonze2preset.h b/muse2/synti/deicsonze2/deicsonze2preset.h new file mode 100644 index 00000000..188e22c9 --- /dev/null +++ b/muse2/synti/deicsonze2/deicsonze2preset.h @@ -0,0 +1,567 @@ +//=========================================================================== +// +// DeicsOnze2 an emulator of the YAMAHA DX11 synthesizer +// +// Version 0.5.5 +// +// deicsonzepreset.h +// +// +// Copyright (c) 2004-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 __DEICSONZE2PRESET_H +#define __DEICSONZE2PRESET_H + +#include +#include + +#include + +#include "muse/xml.h" + +#define NBROP 4 //do not change +#define MAXCHARTAG 64 + +#define PROG_NBR 128 +#define LBANK_NBR 128 +#define HBANK_NBR 128 + +//--------------------------------------------------------- +// define strings of the parameter names for load save and ctrl interface +// number of ctrl +// following the internal DX11 organization (c.f T81Z manual) +//--------------------------------------------------------- +#define CTRLOFFSET 0x100 +#define DECAPAR1 13 +#define ARSTR "AR" +#define ARLONGSTR "AttackRate" +#define CTRL_AR 0+CTRLOFFSET +#define MAXAR 31 +#define D1RSTR "D1R" +#define D1RLONGSTR "Decay1Rate" +#define CTRL_D1R 1+CTRLOFFSET +#define MAXD1R 31 +#define D2RSTR "D2R" +#define D2RLONGSTR "Decay2Rate" +#define CTRL_D2R 2+CTRLOFFSET +#define MAXD2R 31 +#define RRSTR "RR" +#define RRLONGSTR "ReleaseRate" +#define CTRL_RR 3+CTRLOFFSET +#define MAXRR 15 +#define D1LSTR "D1L" +#define D1LLONGSTR "Decay1Level" +#define CTRL_D1L 4+CTRLOFFSET +#define MAXD1L 15 +#define LSSTR "LS" +#define LSLONGSTR "LevelScaling" +#define CTRL_LS 5+CTRLOFFSET +#define MAXLS 99 +#define RSSTR "RS" +#define RSLONGSTR "RateScaling" +#define CTRL_RS 6+CTRLOFFSET +#define MAXRS 3 +#define EBSSTR "EBS" +#define EBSLONGSTR "EGBiasSensitivity" +#define CTRL_EBS 7+CTRLOFFSET +#define MAXEBS 7 +#define AMESTR "AME" +#define AMELONGSTR "AmplitudeModulationEnable" +#define CTRL_AME 8+CTRLOFFSET +#define KVSSTR "KVS" +#define KVSLONGSTR "KeyVelocitySensitivity" +#define CTRL_KVS 9+CTRLOFFSET +#define MAXKVS 7 +#define OUTSTR "OUT" +#define OUTLONGSTR "OperatorOutputLevel" +#define CTRL_OUT 10+CTRLOFFSET +#define MAXOUT 99 +#define RATIOSTR "Ratio" +#define RATIOLONGSTR "Ratio" +#define CTRL_RATIO 11+CTRLOFFSET +#define MAXRATIO 64 +#define DETSTR "DET" +#define DETLONGSTR "Detune" +#define CTRL_DET 12+CTRLOFFSET +#define MAXDET 3 +#define ALGSTR "ALG" +#define ALGLONGSTR "Algorithm" +#define CTRL_ALG 52+CTRLOFFSET +#define MAXALG 7 +#define FEEDBACKSTR "Feedback" +#define CTRL_FEEDBACK 53+CTRLOFFSET +#define MAXFEEDBACK 7 +#define SPEEDSTR "Speed" +#define SPEEDLONGSTR "LFOSpeed" +#define CTRL_SPEED 54+CTRLOFFSET +#define MAXSPEED 99 +#define DELAYSTR "Delay" //TODO LFOD +#define DELAYLONGSTR "LFODelay" +#define CTRL_DELAY 55+CTRLOFFSET +#define MAXDELAY 99 +#define PMODDEPTHSTR "PModDepth" +#define PMODDEPTHLONGSTR "PitchModulationDepth" +#define CTRL_PMODDEPTH 56+CTRLOFFSET +#define MAXPMODDEPTH 99 +#define AMODDEPTHSTR "AModDepth" +#define AMODDEPTHLONGSTR "AmplitudeModulationDepth" +#define CTRL_AMODDEPTH 57+CTRLOFFSET +#define MAXAMODDEPTH 99 +#define SYNCSTR "Sync" +#define SYNCLONGSTR "LFOSync" +#define CTRL_SYNC 58+CTRLOFFSET +#define WAVESTR "Wave" +#define WAVELONGSTR "LFOWave" +#define CTRL_WAVE 59+CTRLOFFSET +#define MAXWAVE 3 +#define PMODSENSSTR "PModSens" +#define PMODSENSLONGSTR "PitchModulationSensitivity" +#define CTRL_PMODSENS 60+CTRLOFFSET +#define MAXPMODSENS 7 +#define AMSSTR "AMS" +#define AMSLONGSTR "AmplitudeModulationSensitivity" +#define CTRL_AMS 61+CTRLOFFSET +#define MAXAMS 3 +#define TRANSPOSESTR "Transpose" +#define CTRL_TRANSPOSE 62+CTRLOFFSET +#define MAXTRANSPOSE 24 +#define POLYMODESTR "PolyMode" +#define CTRL_POLYMODE 63+CTRLOFFSET +#define PBENDRANGESTR "PBendRange" +#define PBENDRANGELONGSTR "PitchBendRange" +#define CTRL_PBENDRANGE 64+CTRLOFFSET +#define MAXPBENDRANGE 12 +#define PORTAMODESTR "PortaMode" +#define PORTAMODELONGSTR "PortamentoMode" +#define CTRL_PORTAMODE 65+CTRLOFFSET +#define PORTATIMESTR "PortaTime" +#define PORTATIMELONGSTR "PortamentoTime" +#define CTRL_PORTATIME 66+CTRLOFFSET +#define MAXPROTATIME 99 +#define FCVOLUMESTR "FCVolume" +#define FCVOLUMELONGSTR "FootControllerVolume" +#define CTRL_FCVOLUME 67+CTRLOFFSET +#define MAXFCVOLUME 99 +#define FSWSTR "FSW" +#define FSWLONGSTR "FootSwitch" +#define CTRL_FSW 68+CTRLOFFSET +#define MAXFSW 99 +#define MWPITCHSTR "MWPitch" +#define MWPITCHLONGSTR "ModulationWheelPitch" +#define CTRL_MWPITCH 71+CTRLOFFSET +#define MAXMWPITCH 99 +#define MWAMPLITUDESTR "MWAmplitude" +#define MWAMPLITUDELONGSTR "ModulationWheelAmplitude" +#define CTRL_MWAMPLITUDE 72+CTRLOFFSET +#define MAXMWAMPLITUDE 99 +#define BCPITCHSTR "BCPitch" +#define BCPITCHLONGSTR "BreathControlPitch" +#define CTRL_BCPITCH 73+CTRLOFFSET +#define MAXBCPITCH 99 +#define BCAMPLITUDESTR "BCAmplitude" +#define BCAMPLITUDELONGSTR "BreathControlAmplitude" +#define CTRL_BCAMPLITUDE 74+CTRLOFFSET +#define MAXBCAMPLITUDE 99 +#define BCPITCHBIASSTR "BCPitchBias" +#define BCPITCHBIASLONGSTR "BreathControlPitchBias" +#define CTRL_BCPITCHBIAS 75+CTRLOFFSET +#define MAXBCPITCHBIAS 50 +#define BCEGBIASSTR "BCEGBias" +#define BCEGBIASLONGSTR "BreathControlEGBias" +#define CTRL_BCEGBIAS 76+CTRLOFFSET +#define MAXBCEGBIAS 99 +#define MIDATTACK 64 +#define ATPITCHSTR "ATPitch" +#define ATPITCHLONGSTR "AfterTouchPitch" +#define CTRL_ATPITCH 77+CTRLOFFSET +#define MAXATPITCH 99 +#define ATAMPLITUDESTR "ATAmplitude" +#define ATAMPLITUDELONGSTR "AfterTouchAmplitude" +#define CTRL_ATAMPLITUDE 78+CTRLOFFSET +#define MAXATAMPLITUDE 99 +#define ATPITCHBIASSTR "ATPitchBias" +#define ATPITCHBIASLONGSTR "AfterTouchPitchBias" +#define CTRL_ATPITCHBIAS 79+CTRLOFFSET +#define MAXATPITCHBIAS 50 +#define ATEGBIASSTR "ATEGBias" +#define ATEGBIASLONGSTR "AfterTouchEGBias" +#define CTRL_ATEGBIAS 80+CTRLOFFSET +#define MAXATEGBIAS 99 +#define PR1STR "PR1" +#define PR1LONGSTR "PitchRateEG1" +#define CTRL_PR1 81+CTRLOFFSET +#define MAXPR 99 +#define PR2STR "PR2" +#define PR2LONGSTR "PitchRateEG2" +#define CTRL_PR2 82+CTRLOFFSET +#define PR3STR "PR3" +#define PR3LONGSTR "PitchRateEG3" +#define CTRL_PR3 83+CTRLOFFSET +#define PL1STR "PL1" +#define PL1LONGSTR "PitchLevelEG1" +#define CTRL_PL1 84+CTRLOFFSET +#define MAXPL 99 +#define PL2STR "PL2" +#define PL2LONGSTR "PitchLevelEG2" +#define CTRL_PL2 85+CTRLOFFSET +#define PL3STR "PL3" +#define PL3LONGSTR "PitchLevelEG3" +#define CTRL_PL3 86+CTRLOFFSET +#define DECAPAR2 5 +#define FIXSTR "FIX" +#define FIXLONGSTR "FixedFrequency" +#define CTRL_FIX 100+CTRLOFFSET +#define FIXRANGESTR "FixRange" +#define FIXRANGELONGSTR "FixedFrequencyRange" +#define CTRL_FIXRANGE 101+CTRLOFFSET +#define MAXFIXRANGE 255 +#define OSWSTR "OSW" +#define OSWLONGSTR "OperatorWaveform" +#define CTRL_OSW 103+CTRLOFFSET +#define MAXOSW 7 +#define SHFTSTR "SHFT" +#define SHFTLONGSTR "EGShift" +#define CTRL_SHFT 104+CTRLOFFSET +#define MAXSHFT 3 +#define REVERBRATESTR "ReverbRate" +#define CTRL_REVERBRATE 120+CTRLOFFSET +#define MAXREVERBRATE 7 +#define FCPITCHSTR "FCPitch" +#define FCPITCHLONGSTR "FootControllerPitch" +#define CTRL_FCPITCH 121+CTRLOFFSET +#define MAXFCPITCH 99 +#define FCAMPLITUDESTR "FCAmplitude" +#define FCAMPLITUDELONGSTR "FootControllerAmplitude" +#define CTRL_FCAMPLITUDE 122+CTRLOFFSET +#define MAXFCAMPLITUDE 99 +#define CHANNELPANSTR "ChannelPan" +#define CTRL_CHANNELPAN 123+CTRLOFFSET +#define MAXCHANNELPAN 127 +#define CHANNELDETUNESTR "ChannelDetune" +#define CTRL_CHANNELDETUNE 124+CTRLOFFSET +#define MAXCHANNELDETUNE 63 +#define CHANNELVOLUMESTR "ChannelVolume" +#define CTRL_CHANNELVOLUME 125+CTRLOFFSET +#define MAXCHANNELVOLUME 255 +#define FINEBRIGHTNESSSTR "FineBrightness" +#define CTRL_FINEBRIGHTNESS 126+CTRLOFFSET +#define MAXFINEBRIGHTNESS 4095 +#define MIDFINEBRIGHTNESS (MAXFINEBRIGHTNESS+1)/2 +#define BRIGHTNESSSTR "Brightness" +#define MAXBRIGHTNESS 127 +#define MIDBRIGHTNESS 64 +#define MAXMODULATION 127 +#define MODULATIONSTR "Modulation" +#define ATTACKSTR "Attack" +#define MAXATTACK 127 +#define MIDATTACK 64 +#define RELEASESTR "Attack" +#define MAXRELEASE 127 +#define MIDRELEASE 64 +#define NBRVOICESSTR "NumberOfVoices" +#define MINNBRVOICES 1 +#define CTRL_NBRVOICES 127+CTRLOFFSET +#define CHANNELENABLESTR "ChannelEnable" +#define MAXCHANNELENABLE 1 +#define MINCHANNELENABLE 0 +#define CTRL_CHANNELENABLE 128+CTRLOFFSET + +class Preset; +class Subcategory; +class Category; +class Set; + +//--------------------------------------------------------- +// Algorithm +//--------------------------------------------------------- + +enum Algorithm { + FIRST, // Op 0 modulated by Op 1 modulated by Op 2 modulated by Op3 + SECOND, // Op 0 modulated by Op 1 modulated by both Op 2 and Op 3 + THIRD, // Op 0 modulated by both Op 3 and Op 1 modulated by Op 2 + FOURTH, // Op 0 modulated by both Op 1 and Op 2 modulated by Op 3 + FIFTH, // (Op 0 modulated by Op 1) add to (Op 2 modulated by Op 3) + SIXTH, // addition of the three Op 0, 1, 2 all modulated by Op 3 + SEVENTH, // addition of the three Op 0, 1, 2 with 2 modulated by Op3 + EIGHTH // addition of the four Op 0, 1, 2, 3 +}; + +//--------------------------------------------------------- +// Wave of the low frequency modulation +//--------------------------------------------------------- +enum Wave { + SAWUP, + SQUARE, + TRIANGL, + SHOLD +}; + +//--------------------------------------------------------- +// Lfo, low frequency modulation +//--------------------------------------------------------- +struct Lfo { + Wave wave; + unsigned char speed; //0 to 99 + unsigned char delay; //0 to 99 + unsigned char pModDepth; //0 to 99 + unsigned char aModDepth; //0 to 99 + bool sync; +}; + +//--------------------------------------------------------- +// Sensitivity +// of the frequency and amplitude of the lfo +// and the key velocity +//--------------------------------------------------------- +struct Sensitivity { + unsigned char pitch; //0 to 7 + unsigned char amplitude; //0 to 3 + bool ampOn[NBROP]; + unsigned char egBias[NBROP]; //O to 7 + unsigned char keyVelocity[NBROP]; //0 to 7 +}; + +//--------------------------------------------------------- +// Frequency +//--------------------------------------------------------- +struct Frequency { + double ratio; + bool isFix; //if isFix no ratio but frequency + double freq; +}; + +//--------------------------------------------------------- +// OscWave +//--------------------------------------------------------- +enum OscWave { + W1, //sine wave + W2, //sine² relative + W3, //half sine + W4, //half sine² relative + W5, + W6, + W7, + W8 +}; + +enum egShiftValue {VOF, V48, V24, V12}; + +//--------------------------------------------------------- +// Eg +// Envelope +//--------------------------------------------------------- +struct Eg { + unsigned char ar; //0 to 31 speed attack + unsigned char d1r; //0 to 31 speed decay + unsigned char d1l; //0 to 15 level sustain + unsigned char d2r; //0 to 31 speed of sustain + unsigned char rr; //1 to 15 + egShiftValue egShift; +}; + +//--------------------------------------------------------- +// PitchEg +//--------------------------------------------------------- +struct PitchEg { + unsigned char pr1;//0 to 99 + unsigned char pr2;//0 to 99 + unsigned char pr3;//0 to 99 + unsigned char pl1;//0 to 99 + unsigned char pl2;//0 to 99 + unsigned char pl3;//0 to 99 +}; + +//--------------------------------------------------------- +// Scaling +//--------------------------------------------------------- +struct Scaling { + unsigned char rate[NBROP];//0 to 3 + unsigned char level[NBROP];//0 to 99 +}; + +//--------------------------------------------------------- +// Mode +//--------------------------------------------------------- +enum Mode { + POLY, + MONO +}; + +//--------------------------------------------------------- +// Portamento +//--------------------------------------------------------- +enum Portamento { + FINGER, + FULL +}; + +//--------------------------------------------------------- +// FootSw +//--------------------------------------------------------- +enum FootSw { + POR, + SUS +}; +//--------------------------------------------------------- +// Function +//--------------------------------------------------------- +struct Function { + int transpose; + Mode mode; + unsigned char pBendRange;//0 to 12 + Portamento portamento; + unsigned char portamentoTime;//0 to 99 + FootSw footSw; + unsigned char fcVolume;//0 to 99 + unsigned char fcPitch;//0 to 99 + unsigned char fcAmplitude;//0 to 99 + unsigned char mwPitch;//0 to 99 + unsigned char mwAmplitude;//0 to 99 + unsigned char bcPitch;//0 to 99 + unsigned char bcAmplitude;//0 to 99 + signed char bcPitchBias;//-50 to 50 + unsigned char bcEgBias;//0 to 99 + unsigned char atPitch;//0 to 99 + unsigned char atAmplitude;//0 to 99 + signed char atPitchBias;//-50 to 50 + unsigned char atEgBias;//0 to 99 + signed char reverbRate;//O=off, 1 to 7 +}; + +//--------------------------------------------------------- +// Preset class +//--------------------------------------------------------- + +class Preset { + public: + Subcategory* _subcategory; //subcategory parent + bool _isUsed; //false if the preset has never been used or modified, + //in this case the preset is not going to be + //save with the project + //Attributes + Algorithm algorithm; + unsigned char feedback; //0 to 7 + Lfo lfo; + Sensitivity sensitivity; + Frequency frequency[NBROP]; + OscWave oscWave[NBROP]; + signed char detune[NBROP]; //-3 to 3 + Eg eg[NBROP]; + PitchEg pitchEg; + unsigned char outLevel[NBROP]; //0 to 99 + Scaling scaling; + Function function; + //int globalDetune; //-31 to 31 //now to the channel + std::string name; + //unsigned char modulation; //0 to 127 + int prog; //0 to 127 + //Methods + void printPreset(); + void initPreset(); + void readPreset(QDomNode qdn); + void writePreset(Xml* xml, bool onlyUsed); + void linkSubcategory(Subcategory* sub); + void merge(Preset* p); //copy the data of p in the preset + void setIsUsed(bool b); //set flag _isUsed and transmit in the parents + void getHBankLBankProg(int* h, int* l, int* p); //return the hbank, lbank and prog of the preset + //Constructor destructor + Preset(); + Preset(Subcategory* sub); + Preset(Subcategory* sub, int prog); + ~Preset(); +}; + +//--------------------------------------------------------------- +// Bank, organized by a tree of category, subcategory, preset +//--------------------------------------------------------------- +class Subcategory { + public: + Category* _category;//parent category + bool _isUsed; //false if the subcategory has never been used or modified, + //in this case the subcategory is not going to be + //save with the project + std::string _subcategoryName; + int _lbank; //0 to 127 + std::vector _presetVector; + Preset* findPreset(int prog); + void readSubcategory(QDomNode subNode); + void writeSubcategory(Xml* xml, bool onlyUsed); + void printSubcategory(); + void linkCategory(Category* cat); + void unlink(); + bool isFreeProg(int prog); + int firstFreeProg(); + void merge(Preset*); + //Constructor destructor + Subcategory(); + Subcategory(Category* cat); + Subcategory(const std::string name); + Subcategory(Category* cat, const std::string name, int lbank); + ~Subcategory(); +}; + +class Category { + public: + Set* _set;//parent set + bool _isUsed; //false if the category has never been used or modified, + //in this case the category is not going to be + //save with the project + std::string _categoryName; + int _hbank; //0 to 127 + std::vector _subcategoryVector; + Subcategory* findSubcategory(int lbank); + Preset* findPreset(int lbank, int prog); + void readCategory(QDomNode catNode); + void writeCategory(Xml* xml, bool onlyUsed); + void printCategory(); + void linkSet(Set* s); + void unlink(); + bool isFreeLBank(int lbank); + int firstFreeLBank(); //return -1 if no free + void merge(Subcategory*); + //Constructor Destructor + Category(); + Category(Set* s); + Category(Set* s,const std::string name, int hbank); + ~Category(); +}; + +class Set { + public: + std::string _setName; + std::vector _categoryVector; + Preset* findPreset(int hbank, int lbank, int prog); + Subcategory* findSubcategory(int hbank, int lbank); + Category* findCategory(int hbank); + void readSet(QDomNode setNode); + void writeSet(Xml* xml, bool onlyUsed); + void printSet(); + bool isFreeHBank(int hbank); + int firstFreeHBank(); + void merge(Category*); + //Constructor Destructor + Set(const std::string name){_setName=name;} + ~Set() { + while(!_categoryVector.empty()) delete(*_categoryVector.begin()); + } +}; + +#endif /* __DEICSONZE2PRESET_H */ diff --git a/muse2/synti/deicsonze2/deicsonzefilter.cpp b/muse2/synti/deicsonze2/deicsonzefilter.cpp deleted file mode 100644 index d4bef946..00000000 --- a/muse2/synti/deicsonze2/deicsonzefilter.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// deicsonzefilter.cpp -// -// -// Copyright (c) 2004-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 "deicsonzefilter.h" - -LowFilter::LowFilter() { - _li = 0.0; - _ri = 0.0; - _lo = 0.0; - _ro = 0.0; -} - -void LowFilter::setSamplerate(int sr) { - _samplerate = sr; -} - -void LowFilter::setCutoff(double cut) { - _cutoff = cut; - float w = 2.0 * (float)_samplerate; - float fCut = _cutoff * 2.0 * M_PI; - float norm = 1.0 / (fCut + w); - _a = fCut * norm; - _b = (w - fCut) * norm; -} - -void LowFilter::process(float* leftSamples, float* rightSamples, unsigned n) { - float cl, cr; - for(unsigned i = 0; i < n; i++) { - cl = leftSamples[i]; - cr = rightSamples[i]; - - leftSamples[i] = _a * (cl + _li) + _b * _lo; - rightSamples[i] = _a * (cr + _ri) + _b * _ro; - - _li = cl; - _ri = cr; - _lo = leftSamples[i]; - _ro = rightSamples[i]; - } -} - diff --git a/muse2/synti/deicsonze2/deicsonzefilter.h b/muse2/synti/deicsonze2/deicsonzefilter.h deleted file mode 100644 index fc92142a..00000000 --- a/muse2/synti/deicsonze2/deicsonzefilter.h +++ /dev/null @@ -1,59 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// deicsonzefilter.h -// -// -// Copyright (c) 2004-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 __DEICSONZEFILTER_H -#define __DEICSONZEFILTER_H - -#include - -class LowFilter { - private: - int _samplerate; - - double _cutoff; //frequency cutoff - float _a; - float _b; - - float _li; //last left input sample - float _ri; //last right input sample - float _lo; //last left output sample - float _ro; //last right output sample - public: - LowFilter(); - ~LowFilter() {} - - void setSamplerate(int sr); - void setCutoff(double cut); - //int getSamplerate(); - //double getCutoff(); - - void process(float* leftSamples, float* RightSamples, unsigned n); -}; - -#endif /* __DEICSONZEFILTER_H */ diff --git a/muse2/synti/deicsonze2/deicsonzegui.cpp b/muse2/synti/deicsonze2/deicsonzegui.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/muse2/synti/deicsonze2/deicsonzegui.h b/muse2/synti/deicsonze2/deicsonzegui.h deleted file mode 100644 index 0fe3345b..00000000 --- a/muse2/synti/deicsonze2/deicsonzegui.h +++ /dev/null @@ -1,571 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// deicsonzegui.h -// -// -// Copyright (c) 2004-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 __DEICSONZEGUI_H -#define __DEICSONZEGUI_H - -#include -//Added by qt3to4: -#include -#include -#include -#include -#include - -#include "deicsonze.h" - -#include "deicsonzepreset.h" -#include "deicsonzeguibase.h" -//#include "ui_deicsonzegui.h" -#include "libsynti/gui.h" -//#include "awl/floatentry.h" -//#include "awl/slider.h" -//#include "awl/checkbox.h" - -//using Awl::FloatEntry; -//using Awl::Slider; -//using Awl::CheckBox; - -//Envelope Gui constants -#define XOFFSET 2 -#define YOFFSET 2 -#define PENWIDTH 2 -#define DOTWIDTH 3 -#define DRAGWIDTH 6 //size of the mousetracking threshold -//pitch envelope constants -#define WALLWIDTH 6 -#define PR1WIDTH (width()/3-9) -#define PR2WIDTH PR1WIDTH -#define PR3WIDTH PR1WIDTH -#define PL1HEIGHT (height()-4) -#define PL2HEIGHT PL1HEIGHT -#define PL3HEIGHT PL1HEIGHT -#define MAXPWIDTH PR1WIDTH+WALLWIDTH+PR2WIDTH+WALLWIDTH+PR3WIDTH+WALLWIDTH+PR1WIDTH -#define MAXPHEIGHT PL1HEIGHT -#define STEPVALUE 10 -//amplitude envelope constants -#define ARWIDTH (width()/4-1) -#define D1RWIDTH ARWIDTH -#define D1LHEIGHT (height()-2) -#define D2RWIDTH ARWIDTH -#define RRWIDTH ARWIDTH -#define MAXWIDTH ARWIDTH+D1RWIDTH+D1RWIDTH+RRWIDTH -#define MAXHEIGHT D1LHEIGHT - -//COLOR -#define TCOLOR QColor(0, 0, 0) //text color -#define BCOLOR QColor(210, 180, 90) //background color -#define ETCOLOR QColor(0, 150, 0) //edit text color -#define EBCOLOR QColor(255, 255, 30) //edit background color - -class DeicsOnze; -class QFramePitchEnvelope; -class QFrameEnvelope; - -class QTreeCategory:public Q3ListViewItem { - public: - Category* _category; - QTreeCategory(Q3ListView* p, QString shbank, QString l, Category* c) - :Q3ListViewItem(p) { - setText(0, shbank); - setText(1, l); - _category=c; - }; -}; - -class QTreeSubcategory:public Q3ListViewItem { - public: - Subcategory* _subcategory; - QTreeSubcategory(Q3ListView* p, QString slbank, - QString l, Subcategory* s) - :Q3ListViewItem(p) { - setText(0, slbank); - setText(1, l); - _subcategory=s; - }; -}; - -class QTreePreset:public Q3ListViewItem { - public: - Preset* _preset; - QTreePreset(Q3ListView* pa, QString sprog, QString l, Preset* p) - :Q3ListViewItem(pa) { - setText(0, sprog); - setText(1, l); - _preset=p; - }; -}; - -//--------------------------------------------------------- -// DeicsOnzeGui -//--------------------------------------------------------- -class DeicsOnzeGui : public QDialog, public DeicsOnzeGuiBase, public MessGui { - bool _enabledPreset; - - QFramePitchEnvelope* pitchEnvelopeGraph; - QFrameEnvelope* envelopeGraph[NBROP]; - - QWidget* _chorusSuperWidget; - QWidget* _reverbSuperWidget; - std::vector _chorusSliderVector; - // TODO std::vector _chorusFloatEntryVector; - // TODO std::vector _chorusCheckBoxVector; - std::vector _reverbSliderVector; - // TODO std::vector _reverbFloatEntryVector; - // TODO std::vector _reverbCheckBoxVector; - - Q_OBJECT - QString lastDir; - private slots: - void readMessage(int); - void setEnabledChannel(bool); - void setChangeChannel(int); - void setPanic(); - void setResCtrl(); - void setNbrVoices(int); - void setSaveOnlyUsed(bool); - void setSaveOnlyUsedComp(bool); - void setSaveConfig(bool); -// void setMidiInCh(int); //to change - void setQuality(const QString&); - void setFilter(bool); - void setFontSize(int); - void saveConfiguration(); - void saveDefaultConfiguration(); - void loadConfiguration(); - void loadConfiguration(QString s); - //load init set - void setIsInitSet(bool); - void setInitSetPath(const QString&); - void setBrowseInitSetPath(); - //load init set - void setIsBackgroundPix(bool); - void setBackgroundPixPath(const QString&); - void setBrowseBackgroundPixPath(); - //FX - void setChorusActiv(bool a); - void setChannelChorus(int c); - void setChorusReturn(int al); - void setSelectChorusPlugin(); - void setReverbCheckBox(double v, int i); - void setChorusCheckBox(double v, int i); - void setReverbActiv(bool a); - void setChannelReverb(int r); - void setReverbReturn(int val); - void setSelectReverbPlugin(); - void setReverbFloatEntry(double v, int i); - void setReverbSlider(double v, int i); - void setChorusFloatEntry(double v, int i); - void setChorusSlider(double v, int i); - //quick edit - void setChannelVolKnob(double val); - void setChannelPan(double val); - void setBrightnessKnob(double val); - void setModulationKnob(double val); - void setDetuneKnob(double val); - void setAttackKnob(double val); - void setReleaseKnob(double val); - //Color - void setRedColor(int); - void setGreenColor(int); - void setBlueColor(int); - // TODO void setRGBSliders(QListWidgetItem*); - void setTextColor(const QColor &); - void setBackgroundColor(const QColor &); - void setEditTextColor(const QColor &); - void setEditBackgroundColor(const QColor &); - //New Delete Load Save - void deleteSetDialog(); - void loadSetDialog(); - void saveSetDialog(); - void deleteCategoryDialog(); - void newCategoryDialog(); - void loadCategoryDialog(); - void saveCategoryDialog(); - void deleteSubcategoryDialog(); - void newSubcategoryDialog(); - void loadSubcategoryDialog(); - void saveSubcategoryDialog(); - void newPresetDialog(); - void loadPresetDialog(); - void deletePresetDialog(); - void savePresetDialog(); - //popupMenu - void categoryPopupMenu(const QPoint&); - void subcategoryPopupMenu(const QPoint&); - void presetPopupMenu(const QPoint&); - //Preset and bank - void setPresetName(const QString&); - void setSubcategoryName(const QString&); - void setCategoryName(const QString&); - void setHBank(int); - void setLBank(int); - void setProg(int); - //Global - void setMasterVolKnob(double); - void setMasterVol(int); - void setFeedback(int); - void setLfoWave(int); - void setLfoSpeed(int); - void setLfoDelay(int); - void setLfoPModDepth(int); - void setLfoPitchSens(int); - void setLfoAModDepth(int); - void setLfoAmpSens(int); - void setTranspose(int); - void setChannelDetune(int); - void setAlgorithm(int); - void setPitchBendRange(int); - //Pitch Envelope - void setPL1(int); - void setPL2(int); - void setPL3(int); - void setPR1(int); - void setPR2(int); - void setPR3(int); - //Function - void setFcVolume(int); - void setFcPitch(int); - void setFcAmplitude(int); - void setMwPitch(int); - void setMwAmplitude(int); - void setBcPitch(int); - void setBcAmplitude(int); - void setBcPitchBias(int); - void setBcEgBias(int); - void setAtPitch(int); - void setAtAmplitude(int); - void setAtPitchBias(int); - void setAtEgBias(int); - void setReverbRate(int); - void setPolyMode(int); - void setPortFingerFull(int); - void setPortaTime(int); - //envelope - void setAR1(int val); - void setD1R1(int val); - void setD1L1(int val); - void setD2R1(int val); - void setRR1(int val); - void setAR2(int val); - void setD1R2(int val); - void setD1L2(int val); - void setD2R2(int val); - void setRR2(int val); - void setAR3(int val); - void setD1R3(int val); - void setD1L3(int val); - void setD2R3(int val); - void setRR3(int val); - void setAR4(int val); - void setD1R4(int val); - void setD1L4(int val); - void setD2R4(int val); - void setRR4(int val); - //scaling - void setLS1(int val); - void setRS1(int val); - void setLS2(int val); - void setRS2(int val); - void setLS3(int val); - void setRS3(int val); - void setLS4(int val); - void setRS4(int val); - //vol - void setVol1(int val); - void setVol2(int val); - void setVol3(int val); - void setVol4(int val); - //Ratio and Frequency - void setCoarseRatio1(int val); - void setFineRatio1(int val); - void setFreq1(int val); - void setFix1(bool f); - void setCoarseRatio2(int val); - void setFineRatio2(int val); - void setFreq2(int val); - void setFix2(bool f); - void setCoarseRatio3(int val); - void setFineRatio3(int val); - void setFreq3(int val); - void setFix3(bool f); - void setCoarseRatio4(int val); - void setFineRatio4(int val); - void setFreq4(int val); - void setFix4(bool f); - //Sensitivity - void setAME1(bool val); - void setEBS1(int val); - void setKVS1(int val); - void setAME2(bool val); - void setEBS2(int val); - void setKVS2(int val); - void setAME3(bool val); - void setEBS3(int val); - void setKVS3(int val); - void setAME4(bool val); - void setEBS4(int val); - void setKVS4(int val); - //detune - void setDET1(int val); - void setDET2(int val); - void setDET3(int val); - void setDET4(int val); - //WaveForm - void setWaveForm1(int); - void setWaveForm2(int); - void setWaveForm3(int); - void setWaveForm4(int); - //Delay - void setActivDelay(bool); - void setDelayReturn(int); - void setChannelDelay(int); - //void setDelayTime(int); - void setDelayBPM(double); - void setDelayBeatRatio(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*); - // TODO void setCategory(QTreeWidgetItem*); - void setSubcategory(Subcategory*); - // TODO void setSubcategory(QTreeWidgetItem*); - // TODO void setPreset(QTreeWidgetItem*); - public: - virtual void processEvent(const MidiPlayEvent&); - void updateSelectPreset(int hbank, int lbank, int prog); - //update the gui - void setEnabledPreset(bool b); - void updateChannelCheckBox(bool b); - void updateEnabledChannel(bool e);//put enabled the display concerning channel and preset - void updateChannelEnable(bool e);//update channel enable - void updateMasterVolume(int val); - void updateNbrVoices(int val); - //void updateMidiInCh(int val); //to change - void updateQuality(int val); - void updateFilter(bool f); - void updateFontSize(int fs); - void applyFontSize(int fs); - void updateSaveOnlyUsed(bool); - void updateSaveConfig(bool); - //FX - void updateChorusActiv(bool a); - void updateChannelChorus(int c); - void updateChorusReturn(int r); - void updateReverbActiv(bool a); - void updateChannelReverb(int r); - 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(float plf); - void updateDelayBPM(float dt); - void updateDelayBeatRatio(float dt); - void updateDelayFeedback(float df); - void updateDelayPanLFODepth(float dpd); - void addPluginCheckBox(int index, QString text, bool toggled, - QWidget* parent, Q3GridLayout* grid, bool isReverb); - void addPluginIntSlider(int index, QString text, double min, double max, - double val, QWidget* parent, Q3GridLayout* grid, - bool isReverb); - void addPluginSlider(int index, QString text, bool isLog, double min, - double max, double val, QWidget* parent, - Q3GridLayout* grid, bool isReverb); - void buildGuiReverb(); - void buildGuiChorus(); - void updateReverbSlider(double v, int i); - void updateReverbFloatEntry(double v, int i); - void updateChorusSlider(double v, int i); - void updateChorusFloatEntry(double v, int i); - //update load init set - void updateInitSetCheckBox(bool); - void updateInitSetPath(QString); - //update background pix - void updateBackgroundPixCheckBox(bool); - void updateBackgroundPixPath(QString); - void applyBackgroundPix(); - //update quick edit - void updateChannelPan(int val); - void updateBrightness(int val); - void updateModulation(int val); - void updateAttack(int val); - void updateRelease(int val); - void updateQuickEdit(); - //update pitch envelope - void updatePL1(int val); - void updatePL2(int val); - void updatePL3(int val); - void updatePR1(int val); - void updatePR2(int val); - void updatePR3(int val); - //update function - void updateFcVolume(int val); - void updateFcPitch(int val); - void updateFcAmplitude(int val); - void updateMwPitch(int val); - void updateMwAmplitude(int val); - void updateBcPitch(int val); - void updateBcAmplitude(int val); - void updateBcPitchBias(int val); - void updateBcEgBias(int val); - void updateAtPitch(int val); - void updateAtAmplitude(int val); - void updateAtPitchBias(int val); - void updateAtEgBias(int val); - //void updateReverbRate(int val); - //update envelope - void updateAR(int op, int val); - void updateD1R(int op, int val); - void updateD2R(int op, int val); - void updateRR(int op, int val); - void updateD1L(int op, int val); - //update scale - void updateLS(int op, int val); - void updateRS(int op, int val); - void updateEBS(int op, int val); - void updateAME(int op, bool val); - void updateKVS(int op, int val); - void updateOUT(int op, int val); - void updateRATIO(int op, int val); - void updateDET(int op, int val); - //update global - void updateALG(int val); - void updateFEEDBACK(int val); - void updateSPEED(int val); - void updateDELAY(int val); - void updatePMODDEPTH(int val); - void updateAMODDEPTH(int val); - void updateSYNC(bool val); - void updateWAVE(int val); - void updatePMODSENS(int val); - void updateAMS(int val); - void updateTRANSPOSE(int val); - void updatePOLYMODE(int val); - void updatePBENDRANGE(int val); - void updatePORTAMODE(int val); - void updatePORTATIME(int val); - void updateFIX(int op, bool val); - void updateFIXRANGE(int op, int val); - void updateOSW(int op, int val); - void updateSHFT(int op, int val); - void updateChannelDetune(int val); - void updateChannelDetuneKnob(int val); - //void updateChannelDetuneSlider(int val); - void updateChannelVolume(int val); - void updateCategoryName(QString cn, bool enable); - void updateSubcategoryName(QString sn, bool enable); - void updatePresetName(QString pn, bool enable); - void updatePresetName(QString pn); - void updateHBank(int hbank, bool enable); - void updateLBank(int lbank, bool enable); - void updateProg(int prog, bool enable); - void updatePreset(Preset* p); - void updatePreset(void); //update gui following the current preset - //void updateCurrentChannel(); //update gui channel attributes - QString num3Digits(int); - DeicsOnzeGui(DeicsOnze*); - - int _currentChannel; - - QColor* tColor; //text color - QColor* bColor; //background color - QColor* etColor;//edit text color - QColor* ebColor;//edit background color - QColor* curColor;//current color - - DeicsOnze* _deicsOnze; -}; - -class QFramePitchEnvelope:private Q3Frame { - QPoint startlinkP1, //first point - P1linkP2, //point linking P1 to P2 - P2linkP3, //point linking P2 to P3 - P3linkEnd; //point linking P3 to End - bool isStartlinkP1Edit; - bool isP1linkP2Edit; - bool isP2linkP3Edit; - bool isP3linkEndEdit; - public: - DeicsOnzeGui* _deicsOnzeGui; - QFramePitchEnvelope(QWidget* parent, DeicsOnzeGui* dog):Q3Frame(parent){ - _deicsOnzeGui = dog; - isStartlinkP1Edit=false; - isP1linkP2Edit=false; - isP2linkP3Edit=false; - isP3linkEndEdit=false; - }; - void env2Points(int pl1, int pl2, int pl3, int pr1, int pr2, int pr3); - void updateEnv(void) {update();}; - protected: - void paintEvent(QPaintEvent* e); - void mouseMoveEvent(QMouseEvent* e); - void mousePressEvent(QMouseEvent * e); - void mouseReleaseEvent(QMouseEvent * e); -}; - -class QFrameEnvelope:private Q3Frame { - unsigned char op; //operator number, between 0 and 3 - QPoint startlinkAR, //first point - ARlinkD1, //point linking AR to D1 - D1linkD2, //point linking D1 to D2 - D2linkRR, //point linking D2 to RR - RRlinkEnd; //last point - bool isARlinkD1Edit; - bool isD1linkD2Edit; - bool isD2linkRREdit; - bool isRRlinkEndEdit; - public: - DeicsOnzeGui* _deicsOnzeGui; - QFrameEnvelope(QWidget* parent, DeicsOnzeGui* dog, unsigned char k):Q3Frame(parent){ - _deicsOnzeGui = dog; - isARlinkD1Edit=false; - isD1linkD2Edit=false; - isD2linkRREdit=false; - isRRlinkEndEdit=false; - op = k; - //setGeometry(XOFFSET, YOFFSET, XOFFSET+MAXWIDTH, MAXHEIGHT); - //setMouseTracking(true); - }; - void env2Points(int ar, int d1r, int d1l, int d2r, int rr); - void updateEnv(void) {update();}; - protected: - void paintEvent(QPaintEvent* e); - void mouseMoveEvent(QMouseEvent* e); - void mousePressEvent(QMouseEvent * e); - void mouseReleaseEvent(QMouseEvent * e); -}; - -#endif /* __DEICSONZEGUI_H */ diff --git a/muse2/synti/deicsonze2/deicsonzegui.ui b/muse2/synti/deicsonze2/deicsonzegui.ui deleted file mode 100644 index 6b91cf49..00000000 --- a/muse2/synti/deicsonze2/deicsonzegui.ui +++ /dev/null @@ -1,10237 +0,0 @@ - - Nil Geisweiller - DeicsOnzeGuiBase - - - - 0 - 0 - 728 - 568 - - - - DeicsOnze - - - false - - - false - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - 0 - 0 - - - - ArrowCursor - - - - - - false - - - QTabWidget::Rounded - - - 0 - - - - &Preset - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - false - - - Program numerous - - - 1 - - - 128 - - - - - - - false - - - INITVOICE - - - 12 - - - - - - - Qt::CustomContextMenu - - - false - - - - LBank - - - - - Subcategory - - - - - - - - false - - - Bank numerous - - - 1 - - - 128 - - - - - - - false - - - NONE - - - 12 - - - - - - - false - - - NONE - - - 12 - - - - - - - false - - - Bank numerous - - - 1 - - - 128 - - - - - - - Qt::CustomContextMenu - - - Qt::LeftToRight - - - false - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 1 - - - 0 - - - false - - - true - - - 2 - - - - HBank - - - - - Category - - - - - - - - Qt::CustomContextMenu - - - false - - - - Prog - - - - - Preset - - - - - - - - - Sans Serif - 8 - 50 - false - false - false - false - - - - QFrame::NoFrame - - - QFrame::Plain - - - DeicsOnze v0.5.5 Copyright (c) 2004-2006 Nil Geisweiller. Published under GPL licence. - - - - - - - - &Global - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Pitch Envelope - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - PL3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PL2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PL1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PR1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PR2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PR3 - - - - - - - PointingHandCursor - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - Pitch modulation depth - - - 99 - - - 2 - - - 50 - - - - - - - Pitch modulation depth - - - 99 - - - 2 - - - 50 - - - - - - - Pitch modulation depth - - - 99 - - - 2 - - - 50 - - - - - - - Pitch modulation depth - - - 99 - - - 3 - - - 0 - - - - - - - Pitch modulation depth - - - 99 - - - 3 - - - 0 - - - - - - - Pitch modulation depth - - - 99 - - - 3 - - - 0 - - - - - - - - - - LFO - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - PointingHandCursor - - - LFO Sync - - - - - - - Pitch modulation sensitivity - - - 7 - - - - - - - PointingHandCursor - - - Pitch Modulation Sensitivity - - - 7 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - LFO Delay - - - 99 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - LFO delay - - - 99 - - - - - - - LFO speed - - - 99 - - - - - - - Amplitude modulation depth - - - 99 - - - - - - - Pitch modulation depth - - - 99 - - - - - - - Amplitude modulation sensitivity - - - 7 - - - - - - - PointingHandCursor - - - Amplitude Modulation Sensitivity - - - 3 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AMS - - - - - - - PointingHandCursor - - - LFO Waveform - - - - 38 - 16 - - - - - - - - pics/sawUp.png - - - - - - - - pics/square.png - - - - - - - - pics/triangl.png - - - - - - - - pics/SHold.png - - - - - - - - PointingHandCursor - - - Pitch Modulation Depth - - - 99 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PMD - - - - - - - PointingHandCursor - - - LFO Speed - - - 99 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Pitch Modulation Depth - - - 99 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AMD - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Speed - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Delay - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PMS - - - - - - - - - - true - - - Modulation Matrix - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - PointingHandCursor - - - Modulation Matrix - - - <b>Algorithm 1</b> : <i>Op 1</i> modulated by <i>Op 2</i> modulated by <i>Op 3</i> modulated by <i>Op 4</i><br> -<b>Algorithm 2</b> : <i>Op 1</i> modulated by <i>Op 2</i> modulated by both <i>Op 3</i> and <i>Op 4</i><br> -<b>Algorithm 3</b> : <i>Op 1</i> modulated by both <i>Op 4</i> and <i>Op 2</i> modulated by <i>Op 3</i><br> -<b>Algorithm 4</b> : <i>Op 1</i> modulated by both <i>Op 2</i> and <i>Op 3</i> modulated by <i>Op 4</i><br> -<b>Algorithm 5</b> : (<i>Op 1</i> modulated by <i>Op 2</i>) add to (<i>Op 3</i> modulated by <i>Op 4</i>) <br> -<b>Algorithm 6</b> : addition of the three <i>Op 1, 2, 3</i> all modulated by <i>Op 4</i><br> -<b>Algorithm 7</b> : addition of the three <i>Op 1, 2, 3</i> with <i>Op 3</i> modulated by <i>Op 4</i><br> -<b>Algorithm 8</b> : addition of the four <i>Op 1, 2, 3, 4</i> - - - - 160 - 32 - - - - - - - - pics/algo1.png - - - - - - - - pics/algo3.png - - - - - - - - pics/algo3.png - - - - - - - - pics/algo4.png - - - - - - - - pics/algo5.png - - - - - - - - pics/algo6.png - - - - - - - - pics/algo7.png - - - - - - - - pics/algo8.png - - - - - - - - - - - - - - Op4 Feedback - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - PointingHandCursor - - - Feedback level of the operator 4 - - - 7 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - Feedback level of the operator 4 - - - 7 - - - - - - - - - - Transpose - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - PointingHandCursor - - - Transpose - - - -24 - - - 24 - - - 1 - - - Qt::Horizontal - - - - - - - Transpose - - - -24 - - - 99 - - - - - - - - - - - Op &1 - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Scaling 1 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - LS1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RS1 - - - - - - - PointingHandCursor - - - Rate Scaling - - - Attack Rate of the operator 1 - - - 3 - - - 1 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - PointingHandCursor - - - Level Scaling - - - Attack Rate of the operator 1 - - - 99 - - - 1 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - Level Scaling - - - 99 - - - - - - - Rate Scaling - - - 3 - - - - - - - - - - Amplitude Envelope 1 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - RR1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1R1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1L1 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D2R1 - - - - - - - Release Rate - - - 15 - - - - - - - 2° Decay Rate - - - 31 - - - - - - - 1° Decay Level - - - 15 - - - - - - - 1° Decay Rate - - - 31 - - - - - - - Attack Rate - - - 31 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AR1 - - - - - - - - 0 - 0 - - - - PointingHandCursor - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - - - Detune, OSCWave, EGShift 1 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - DET1 - - - - - - - Detune - - - -3 - - - 3 - - - - - - - PointingHandCursor - - - Detune - - - Attack Rate of the operator 1 - - - -3 - - - 3 - - - 1 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - false - - - PointingHandCursor - - - EG Shift - - - - 96dB - - - - - 48dB - - - - - 24dB - - - - - 12dB - - - - - - - - PointingHandCursor - - - Wave form - - - Wave form 1 = <i>sin(<b>t</b>)</i><br> -Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> -Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> -Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> -Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> -Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> - - - - 48 - 16 - - - - - - - - pics/wave1.png - - - - - - - - pics/wave2.png - - - - - - - - pics/wave3.png - - - - - - - - pics/wave4.png - - - - - - - - pics/wave5.png - - - - - - - - pics/wave6.png - - - - - - - - pics/wave7.png - - - - - - - - pics/wave8.png - - - - - - - - - - - Sensitivity 1 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - KVS1 - - - - - - - PointingHandCursor - - - Amplitude Modulation Enable - - - AME1 - - - - - - - Keyboard Velocity Sensitivity - - - 7 - - - - - - - PointingHandCursor - - - false - - - Key Velocity Sensitivity - - - 7 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - EBS1 - - - - - - - PointingHandCursor - - - EG Bias Sensitivity - - - 7 - - - 1 - - - 1 - - - Qt::Horizontal - - - - - - - Eg Bias Sensitivity - - - 7 - - - - - - - - - - Frequency 1 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - QFrame::Box - - - QFrame::Sunken - - - Coarse 1 - - - - - - - Coarse Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Fine 1 - - - - - - - Fine Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Freq 1 - - - - - - - false - - - Fixed Frequency - - - 32000 - - - - - - - true - - - PointingHandCursor - - - Toggle Fix Frequency - - - FIX - - - - - - - - - - OUT 1 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - Output Volume - - - 99 - - - - - - - PointingHandCursor - - - Volume - - - - - - 99 - - - 1 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - - - - - Op &2 - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Amplitude Envelope 2 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - Attack Rate - - - 31 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1R2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1L2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D2R2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RR2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AR2 - - - - - - - Release Rate - - - 15 - - - - - - - 2° Decay Rate - - - 31 - - - - - - - 1° Decay Level - - - 15 - - - - - - - 1° Decay Rate - - - 31 - - - - - - - - 0 - 0 - - - - PointingHandCursor - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - - - Frequency 2 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - QFrame::Box - - - QFrame::Sunken - - - Coarse 2 - - - - - - - Coarse Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Fine 2 - - - - - - - Fine Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Freq 2 - - - - - - - false - - - Fixed Frequency - - - 32000 - - - - - - - true - - - PointingHandCursor - - - Toggle Fix Frequency - - - FIX - - - - - - - - - - Scaling 2 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - LS2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RS2 - - - - - - - PointingHandCursor - - - Level Scaling - - - Attack Rate of the operator 1 - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - 1 - - - - - - - PointingHandCursor - - - Rate Scaling - - - Attack Rate of the operator 1 - - - 3 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - Level Scaling - - - 99 - - - - - - - Rate Scaling - - - 3 - - - - - - - - - - OUT 2 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - Output Volume - - - 99 - - - - - - - PointingHandCursor - - - Volume - - - - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - - - - Detune, OSCWave, EGShift 2 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - DET2 - - - - - - - Detune - - - -3 - - - 3 - - - - - - - PointingHandCursor - - - Detune - - - Attack Rate of the operator 1 - - - -3 - - - 3 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - false - - - PointingHandCursor - - - EG Shift - - - - 96dB - - - - - 48dB - - - - - 24dB - - - - - 12dB - - - - - - - - PointingHandCursor - - - Wave form - - - Wave form 1 = <i>sin(<b>t</b>)</i><br> -Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> -Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> -Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> -Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> -Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> - - - - 48 - 16 - - - - - - - - pics/wave1.png - - - - - - - - pics/wave2.png - - - - - - - - pics/wave3.png - - - - - - - - pics/wave4.png - - - - - - - - pics/wave5.png - - - - - - - - pics/wave6.png - - - - - - - - pics/wave7.png - - - - - - - - pics/wave8.png - - - - - - - - - - - Sensitivity 2 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - EBS2 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - KVS2 - - - - - - - PointingHandCursor - - - Amplitude Modulation Enable - - - AME2 - - - - - - - PointingHandCursor - - - false - - - Key Velocity Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Keyboard Velocity Sensitivity - - - 7 - - - - - - - PointingHandCursor - - - EG Bias Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Eg Bias Sensitivity - - - 7 - - - - - - - - - - - Op &3 - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Amplitude Envelope 3 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - Attack Rate - - - 31 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1R3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1L3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D2R3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RR3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AR3 - - - - - - - Release Rate - - - 15 - - - - - - - 2° Decay Rate - - - 31 - - - - - - - 1° Decay Level - - - 15 - - - - - - - 1° Decay Rate - - - 31 - - - - - - - - 0 - 0 - - - - PointingHandCursor - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - - - Scaling 3 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - LS3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RS3 - - - - - - - PointingHandCursor - - - Level Scaling - - - Attack Rate of the operator 1 - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - PointingHandCursor - - - Rate Scaling - - - Attack Rate of the operator 1 - - - 3 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - Level Scaling - - - 99 - - - - - - - Rate Scaling - - - 3 - - - - - - - - - - OUT 3 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - Output Volume - - - 99 - - - - - - - PointingHandCursor - - - Volume - - - - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - - - - Frequency 3 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - QFrame::Box - - - QFrame::Sunken - - - Coarse 3 - - - - - - - ArrowCursor - - - Coarse Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Fine 3 - - - - - - - ArrowCursor - - - Fine Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Freq 3 - - - - - - - false - - - Fixed Frequency - - - 32000 - - - - - - - true - - - PointingHandCursor - - - Toggle Fix Frequency - - - FIX - - - - - - - - - - Detune, OSCWave, EGShift 3 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - DET3 - - - - - - - Detune - - - -3 - - - 3 - - - - - - - PointingHandCursor - - - Detune - - - Attack Rate of the operator 1 - - - -3 - - - 3 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - false - - - PointingHandCursor - - - EG Shift - - - - 96dB - - - - - 48dB - - - - - 24dB - - - - - 12dB - - - - - - - - PointingHandCursor - - - Wave form - - - Wave form 1 = <i>sin(<b>t</b>)</i><br> -Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> -Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> -Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> -Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> -Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> - - - - 48 - 16 - - - - - - - - pics/wave1.png - - - - - - - - pics/wave2.png - - - - - - - - pics/wave3.png - - - - - - - - pics/wave4.png - - - - - - - - pics/wave5.png - - - - - - - - pics/wave6.png - - - - - - - - pics/wave7.png - - - - - - - - pics/wave8.png - - - - - - - - - - - Sensitivity 3 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - EBS3 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - KVS3 - - - - - - - PointingHandCursor - - - Amplitude Modulation Enable - - - AME3 - - - - - - - PointingHandCursor - - - false - - - Key Velocity Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Keyboard Velocity Sensitivity - - - 7 - - - - - - - PointingHandCursor - - - EG Bias Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Eg Bias Sensitivity - - - 7 - - - - - - - - - - - Op &4 - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - amplitude Envelope 4 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - Attack Rate - - - 31 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - AR4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1R4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D1L4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - D2R4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RR4 - - - - - - - Release Rate - - - 15 - - - - - - - 2° Decay Rate - - - 31 - - - - - - - 1° Decay Level - - - 15 - - - - - - - 1° Decay Rate - - - 31 - - - - - - - - 0 - 0 - - - - PointingHandCursor - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - - - Frequency 4 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - QFrame::Box - - - QFrame::Sunken - - - Coarse 4 - - - - - - - Coarse Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Fine 4 - - - - - - - Fine Ratio - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Freq 4 - - - - - - - false - - - Fixed Frequency - - - 32000 - - - - - - - true - - - PointingHandCursor - - - Toggle Fix Frequency - - - FIX - - - - - - - - - - Scaling 4 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - LS4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - RS4 - - - - - - - PointingHandCursor - - - Level Scaling - - - Attack Rate of the operator 1 - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - PointingHandCursor - - - Rate Scaling - - - Attack Rate of the operator 1 - - - 3 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - Level Scaling - - - 99 - - - - - - - Rate Scaling - - - 3 - - - - - - - - - - OUT 4 - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - Output Volume - - - 99 - - - - - - - PointingHandCursor - - - Volume - - - - - - 99 - - - 1 - - - 0 - - - Qt::Vertical - - - - - - - - - - Detune, OSCWave, EGShift 4 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - DET4 - - - - - - - Detune - - - -3 - - - 3 - - - - - - - PointingHandCursor - - - Detune - - - Attack Rate of the operator 1 - - - -3 - - - 3 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - false - - - PointingHandCursor - - - EG Shift - - - - 96dB - - - - - 48dB - - - - - 24dB - - - - - 12dB - - - - - - - - PointingHandCursor - - - Wave form - - - Wave form 1 = <i>sin(<b>t</b>)</i><br> -Wave form 2 = <i>sin(<b>t</b>)*abs(sin(<b>t</b>))</i><br> -Wave form 3 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>) else 0</i><br> -Wave form 4 = <i>if <b>t</b>&#060 pi then sin(<b>t</b>)*abs(sin(<b>t</b>)) else 0</i><br> -Wave form 5 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>) else 0</i><br> -Wave form 6 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 7 = <i>if <b>t</b>&#060 pi then abs(sin(2*<b>t</b>)) else 0</i><br> -Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin(2*<b>t</b>) else 0</i> - - - - 48 - 16 - - - - - - - - pics/wave1.png - - - - - - - - pics/wave2.png - - - - - - - - pics/wave3.png - - - - - - - - pics/wave4.png - - - - - - - - pics/wave5.png - - - - - - - - pics/wave6.png - - - - - - - - pics/wave7.png - - - - - - - - pics/wave8.png - - - - - - - - - - - Sensitivity 4 - - - - 10 - - - 10 - - - 10 - - - 10 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - EBS4 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - KVS4 - - - - - - - PointingHandCursor - - - Amplitude Modulation Enable - - - AME4 - - - - - - - PointingHandCursor - - - false - - - Key Velocity Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Keyboard Velocity Sensitivity - - - 7 - - - - - - - PointingHandCursor - - - EG Bias Sensitivity - - - 7 - - - 1 - - - Qt::Horizontal - - - - - - - Eg Bias Sensitivity - - - 7 - - - - - - - - - - - &Func - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - 16777215 - 80 - - - - Delay Pan Depth - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - 48 - 16777215 - - - - - - - - - - - - - - - 16777215 - 80 - - - - Delay Pan LFO Freq - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 1.137891684385393 - - - 0.100000000000000 - - - 10.000000000000000 - - - true - - - - - - - - 48 - 16777215 - - - - 0.100000000000000 - - - 10.000000000000000 - - - - - - - - - - - 16777215 - 80 - - - - Delay Ch Send Level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 127 - - - - - - - PointingHandCursor - - - Channel Chorus - - - 127 - - - Qt::Horizontal - - - - - - - - - - - 16777215 - 80 - - - - Delay Feedback - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 0.000000000000000 - - - -1.000000000000000 - - - - - - - - 48 - 16777215 - - - - -1.000000000000000 - - - - - - - - - - - 16777215 - 80 - - - - Delay On/Off, Return Level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - PointingHandCursor - - - On - - - - - - - 255 - - - 128 - - - Qt::Horizontal - - - - - - - - - - - 16777215 - 80 - - - - Delay Beat Ratio - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 1.000000000000000 - - - 0.125000000000000 - - - 2.000000000000000 - - - - - - - - 48 - 16777215 - - - - 0.010000000000000 - - - 2.000000000000000 - - - - - - - - - - - 16777215 - 80 - - - - Delay BPM - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 100.000000000000000 - - - 60.000000000000000 - - - 255.000000000000000 - - - - - - - - 48 - 16777215 - - - - 6 - - - 60.000000000000000 - - - 255.000000000000000 - - - - - - - - - - 0 - - - - Foot Control - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Pitch Bend Range - - - 99 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Amplitude - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Volume - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - - Modulation Wheel - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Pitch Bend Range - - - 99 - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 99 - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Amplitude - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch - - - - - - - - Breath Control - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 50 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 50 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch Bias - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Envelope Bias - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Amplitude - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - - After Touch - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch - - - - - - - Pitch Bend Range - - - 99 - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 50 - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 50 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 99 - - - - - - - Pitch Bend Range - - - 99 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Pitch Bias - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Amplitude - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Envelope Bias - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - - - - - Phony Mode - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - true - - - PointingHandCursor - - - - POLY - - - - - MONO - - - - - - - - - - - Pitch Bend Range - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - PointingHandCursor - - - Pitch Bend Range - - - 0 - - - 12 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - Pitch Bend Range - - - 12 - - - - - - - - - - Potamento - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - true - - - PointingHandCursor - - - Portamento Mode - - - - FINGER - - - - - FULL - - - - - - - - QFrame::Box - - - QFrame::Sunken - - - PT - - - - - - - true - - - PointingHandCursor - - - Portamento Time - - - 0 - - - 99 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - true - - - Portamento Time - - - 99 - - - - - - - - - - - C&horus - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Chorus Parameters - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - - - - 16777215 - 80 - - - - Channel send level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 127 - - - - - - - PointingHandCursor - - - Channel Chorus - - - 127 - - - Qt::Horizontal - - - - - - - - - - - 16777215 - 80 - - - - On/Off and Return level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - PointingHandCursor - - - On - - - - - - - 255 - - - 128 - - - Qt::Horizontal - - - - - - - - - - - 16777215 - 80 - - - - Select LADSPA plugin - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Change plugin - - - - - - - true - - - - - - - - - - - &Reverb - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - 16777215 - 80 - - - - On/Off and Return level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - PointingHandCursor - - - On - - - - - - - 255 - - - 128 - - - Qt::Horizontal - - - - - - - - - - - 16777215 - 80 - - - - Select LADSPA plugin - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Change plugin - - - - - - - true - - - - - - - - - - - 16777215 - 80 - - - - Channel send level - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 127 - - - - - - - PointingHandCursor - - - Channel Chorus - - - 127 - - - Qt::Horizontal - - - - - - - - - - Reverb Parameters - - - - - - - - &Config - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Font Size - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - 1 - - - 32 - - - 9 - - - - - - - - - - Quality - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - true - - - - High - - - - - Middle - - - - - Low - - - - - Ultra low - - - - - - - - true - - - Filter - - - - - - - - - - Save Mode (into the song) - - - - 6 - - - 10 - - - 10 - - - 10 - - - 10 - - - - - PointingHandCursor - - - Save only the used presets - - - true - - - - - - - PointingHandCursor - - - Save the entire set - - - - - - - PointingHandCursor - - - Save the configuration - - - true - - - - - - - - - - Configuration File - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - true - - - Save... - - - - - - - true - - - Load... - - - - - - - Save as default - - - - - - - - - - Colors - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - - 0 - 0 - - - - - 0 - 20 - - - - true - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - Text - - - - - Background - - - - - Edit Text - - - - - Edit Background - - - - - - - - Red - - - 255 - - - - - - - PointingHandCursor - - - Blue - - - 255 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Green - - - 255 - - - Qt::Horizontal - - - - - - - PointingHandCursor - - - Red - - - Qt::LeftToRight - - - 255 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - Blue - - - 255 - - - - - - - Green - - - 255 - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Blue - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Green - - - - - - - QFrame::Box - - - QFrame::Sunken - - - Red - - - - - - - - - - Set Path - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - Image in the background : - - - false - - - - - - - 128 - - - - - - - false - - - Browse... - - - - - - - 128 - - - - - - - Browse... - - - - - - - Load the set at the initialization : - - - true - - - - - - - - - - - - - - - 1000 - 20 - - - - - - - - - 0 - 0 - 0 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 0 - 0 - 0 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 121 - 125 - 121 - - - - - - - 255 - 255 - 255 - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - Sans Serif - 10 - 75 - false - true - false - false - - - - Set Brightness, Detune, Attack and Release of the current channel to default - - - Res. Ctrl - - - - - - - - 1000 - 20 - - - - - - - - - 0 - 0 - 0 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 0 - 0 - 0 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 237 - 237 - 237 - - - - - - - 231 - 231 - 231 - - - - - - - 121 - 125 - 121 - - - - - - - 166 - 166 - 166 - - - - - - - 121 - 125 - 121 - - - - - - - 255 - 255 - 255 - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 0 - - - - - - - 121 - 125 - 121 - - - - - - - 207 - 207 - 207 - - - - - - - 0 - 0 - 255 - - - - - - - 255 - 0 - 255 - - - - - - - 231 - 231 - 231 - - - - - - - - - Sans Serif - 10 - 75 - false - true - false - false - - - - Cut all notes off - - - Panic! - - - - - - - - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - true - - - Number of Voices - - - 1 - - - 64 - - - 8 - - - - - - - QFrame::StyledPanel - - - Number of voices - - - Qt::AlignCenter - - - - - - - Enable - - - true - - - - - - - 1 - - - 16 - - - - - - - QFrame::StyledPanel - - - Channel - - - Qt::AlignCenter - - - - - - - - - - QFrame::StyledPanel - - - Vol - - - Qt::AlignCenter - - - - - - - - 40 - 40 - - - - -28.144332654385916 - - - 0.000000000000000 - - - 1.000000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - false - - - - - - - - 96 - 16 - - - - Channel Ctrl - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - 6 - - - - - PointingHandCursor - - - 0.000000000000000 - - - 1.000000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - false - - - - - - - QFrame::StyledPanel - - - Release - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - - - - - QFrame::StyledPanel - - - Attack - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - - - - - QFrame::StyledPanel - - - Detune - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - - - - - QFrame::StyledPanel - - - Brightness - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - - - - - QFrame::StyledPanel - - - Modulation - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - - - - - QFrame::StyledPanel - - - Pan - - - Qt::AlignCenter - - - - - - - QFrame::StyledPanel - - - Volume - - - Qt::AlignCenter - - - - - - - - 32 - 32 - - - - PointingHandCursor - - - 1.000000000000000 - - - 0.100000000000000 - - - 0.200000000000000 - - - 270 - - - 6 - - - - - - - - - - - - Awl::VolKnob - Awl::Knob -
awl/volknob.h
-
- - Awl::Knob - QWidget -
awl/knob.h
-
- - Awl::FloatEntry - QLineEdit -
awl/floatentry.h
-
-
- - deicsOnzeTabWidget - presetLineEdit - feedbackSlider - LFOSyncCheckBox - PModSensSlider - LFOWaveComboBox - AModSensSlider - PModDepthSlider - AModDepthSlider - LFOSpeedSlider - LFODelaySlider - algorithmComboBox - LS1Slider - RS1Slider - OUT1Slider - Fix1CheckBox - AME1CheckBox - EBS1Slider - DET1Slider - KVS1Slider - WaveForm1ComboBox - EGS1ComboBox - LS2Slider - RS2Slider - OUT2Slider - AME2CheckBox - EBS2Slider - DET2Slider - KVS2Slider - WaveForm2ComboBox - EGS2ComboBox - LS3Slider - RS3Slider - OUT3Slider - AME3CheckBox - EBS3Slider - DET3Slider - KVS3Slider - WaveForm3ComboBox - EGS3ComboBox - LS4Slider - RS4Slider - OUT4Slider - AME4CheckBox - EBS4Slider - DET4Slider - KVS4Slider - WaveForm4ComboBox - EGS4ComboBox - subcategoryLineEdit - categoryLineEdit - lbankSpinBox - progSpinBox - feedbackSpinBox - PModSensSpinBox - AModSensSpinBox - PModDepthSpinBox - AModDepthSpinBox - LFOSpeedSpinBox - LFODelaySpinBox - CoarseRatio1SpinBox - FineRatio1SpinBox - Freq1SpinBox - LS1SpinBox - RS1SpinBox - OUT1SpinBox - EBS1SpinBox - KVS1SpinBox - DET1SpinBox - AR1SpinBox - D1R1SpinBox - D1L1SpinBox - D2R1SpinBox - RR1SpinBox - Fix2CheckBox - Freq2SpinBox - CoarseRatio2SpinBox - FineRatio2SpinBox - LS2SpinBox - RS2SpinBox - OUT2SpinBox - EBS2SpinBox - KVS2SpinBox - DET2SpinBox - AR2SpinBox - D1R2SpinBox - D1L2SpinBox - D2R2SpinBox - RR2SpinBox - Fix3CheckBox - CoarseRatio3SpinBox - FineRatio3SpinBox - Freq3SpinBox - AR3SpinBox - D1R3SpinBox - D1L3SpinBox - D2R3SpinBox - RR3SpinBox - LS3SpinBox - RS3SpinBox - OUT3SpinBox - EBS3SpinBox - KVS3SpinBox - DET3SpinBox - Fix4CheckBox - CoarseRatio4SpinBox - FineRatio4SpinBox - Freq4SpinBox - LS4SpinBox - RS4SpinBox - OUT4SpinBox - EBS4SpinBox - KVS4SpinBox - DET4SpinBox - AR4SpinBox - D1R4SpinBox - D1L4SpinBox - D2R4SpinBox - RR4SpinBox - - - - - feedbackSlider - valueChanged(int) - feedbackSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - feedbackSpinBox - valueChanged(int) - feedbackSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - PModSensSlider - valueChanged(int) - PModSensSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - PModSensSpinBox - valueChanged(int) - PModSensSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - AModSensSlider - valueChanged(int) - AModSensSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - AModSensSpinBox - valueChanged(int) - AModSensSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - PModDepthSpinBox - valueChanged(int) - PModDepthSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - AModDepthSpinBox - valueChanged(int) - AModDepthSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - LFOSpeedSlider - valueChanged(int) - LFOSpeedSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - LFOSpeedSpinBox - valueChanged(int) - LFOSpeedSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - LFODelaySlider - valueChanged(int) - LFODelaySpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - LFODelaySpinBox - valueChanged(int) - LFODelaySlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - PModDepthSlider - valueChanged(int) - PModDepthSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - Fix1CheckBox - toggled(bool) - Freq1SpinBox - setEnabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix1CheckBox - toggled(bool) - FineRatio1SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix1CheckBox - toggled(bool) - CoarseRatio1SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - OUT1Slider - valueChanged(int) - OUT1SpinBox - setValue(int) - - - 66 - 109 - - - 96 - 109 - - - - - OUT1SpinBox - valueChanged(int) - OUT1Slider - setValue(int) - - - 96 - 109 - - - 66 - 109 - - - - - LS1Slider - valueChanged(int) - LS1SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - LS1SpinBox - valueChanged(int) - LS1Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS1Slider - valueChanged(int) - RS1SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS1SpinBox - valueChanged(int) - RS1Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET1Slider - valueChanged(int) - DET1SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET1SpinBox - valueChanged(int) - DET1Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS1Slider - valueChanged(int) - EBS1SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS1SpinBox - valueChanged(int) - EBS1Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS1Slider - valueChanged(int) - KVS1SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS1SpinBox - valueChanged(int) - KVS1Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - Fix2CheckBox - toggled(bool) - Freq2SpinBox - setEnabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix2CheckBox - toggled(bool) - FineRatio2SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix2CheckBox - toggled(bool) - CoarseRatio2SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - OUT2SpinBox - valueChanged(int) - OUT2Slider - setValue(int) - - - 96 - 109 - - - 66 - 109 - - - - - LS2Slider - valueChanged(int) - LS2SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - LS2SpinBox - valueChanged(int) - LS2Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS2Slider - valueChanged(int) - RS2SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS2SpinBox - valueChanged(int) - RS2Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET2Slider - valueChanged(int) - DET2SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET2SpinBox - valueChanged(int) - DET2Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS2SpinBox - valueChanged(int) - EBS2Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS2Slider - valueChanged(int) - EBS2SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS2Slider - valueChanged(int) - KVS2SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS2SpinBox - valueChanged(int) - KVS2Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - Fix3CheckBox - toggled(bool) - Freq3SpinBox - setEnabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix3CheckBox - toggled(bool) - FineRatio3SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix3CheckBox - toggled(bool) - CoarseRatio3SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - OUT3Slider - valueChanged(int) - OUT3SpinBox - setValue(int) - - - 66 - 109 - - - 96 - 109 - - - - - OUT3SpinBox - valueChanged(int) - OUT3Slider - setValue(int) - - - 96 - 109 - - - 66 - 109 - - - - - LS3Slider - valueChanged(int) - LS3SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - LS3SpinBox - valueChanged(int) - LS3Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS3Slider - valueChanged(int) - RS3SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS3SpinBox - valueChanged(int) - RS3Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET3Slider - valueChanged(int) - DET3SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET3SpinBox - valueChanged(int) - DET3Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS3Slider - valueChanged(int) - EBS3SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS3SpinBox - valueChanged(int) - EBS3Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS3Slider - valueChanged(int) - KVS3SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS3SpinBox - valueChanged(int) - KVS3Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - Fix4CheckBox - toggled(bool) - Freq4SpinBox - setEnabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix4CheckBox - toggled(bool) - FineRatio4SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - Fix4CheckBox - toggled(bool) - CoarseRatio4SpinBox - setDisabled(bool) - - - 110 - 109 - - - 110 - 109 - - - - - OUT4Slider - valueChanged(int) - OUT4SpinBox - setValue(int) - - - 66 - 109 - - - 96 - 109 - - - - - OUT4SpinBox - valueChanged(int) - OUT4Slider - setValue(int) - - - 96 - 109 - - - 66 - 109 - - - - - LS4Slider - valueChanged(int) - LS4SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - LS4SpinBox - valueChanged(int) - LS4Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS4Slider - valueChanged(int) - RS4SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - RS4SpinBox - valueChanged(int) - RS4Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET4Slider - valueChanged(int) - DET4SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - DET4SpinBox - valueChanged(int) - DET4Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS4Slider - valueChanged(int) - EBS4SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - EBS4SpinBox - valueChanged(int) - EBS4Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS4Slider - valueChanged(int) - KVS4SpinBox - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - KVS4SpinBox - valueChanged(int) - KVS4Slider - setValue(int) - - - 110 - 109 - - - 110 - 109 - - - - - redSlider - valueChanged(int) - redSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - redSpinBox - valueChanged(int) - redSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - greenSlider - valueChanged(int) - greenSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - greenSpinBox - valueChanged(int) - greenSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - blueSlider - valueChanged(int) - blueSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - blueSpinBox - valueChanged(int) - blueSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - fcVolumeSlider - valueChanged(int) - fcVolumeSpinBox - setValue(int) - - - 285 - 155 - - - 494 - 158 - - - - - fcVolumeSpinBox - valueChanged(int) - fcVolumeSlider - setValue(int) - - - 494 - 158 - - - 285 - 155 - - - - - fcPitchSlider - valueChanged(int) - fcPitchSpinBox - setValue(int) - - - 285 - 180 - - - 494 - 177 - - - - - fcPitchSpinBox - valueChanged(int) - fcPitchSlider - setValue(int) - - - 494 - 177 - - - 285 - 180 - - - - - fcAmplitudeSpinBox - valueChanged(int) - fcAmplitudeSlider - setValue(int) - - - 494 - 216 - - - 285 - 219 - - - - - fcAmplitudeSlider - valueChanged(int) - fcAmplitudeSpinBox - setValue(int) - - - 285 - 219 - - - 494 - 216 - - - - - pitchBendRangeSlider - valueChanged(int) - pitchBendRangeSpinBox - setValue(int) - - - 486 - 483 - - - 538 - 486 - - - - - pitchBendRangeSpinBox - valueChanged(int) - pitchBendRangeSlider - setValue(int) - - - 538 - 486 - - - 486 - 483 - - - - - PortamentoTimeSlider - valueChanged(int) - PortamentoTimeSpinBox - setValue(int) - - - 293 - 483 - - - 345 - 486 - - - - - PortamentoTimeSpinBox - valueChanged(int) - PortamentoTimeSlider - setValue(int) - - - 345 - 486 - - - 293 - 483 - - - - - mwPitchSlider - valueChanged(int) - mwPitchSpinBox - setValue(int) - - - 224 - 168 - - - 539 - 171 - - - - - mwAmplitudeSpinBox - valueChanged(int) - mwAmplitudeSlider - setValue(int) - - - 539 - 223 - - - 224 - 220 - - - - - mwAmplitudeSlider - valueChanged(int) - mwAmplitudeSpinBox - setValue(int) - - - 224 - 220 - - - 539 - 223 - - - - - mwPitchSpinBox - valueChanged(int) - mwPitchSlider - setValue(int) - - - 539 - 171 - - - 224 - 168 - - - - - bcPitchSlider - valueChanged(int) - bcPitchSpinBox - setValue(int) - - - 248 - 147 - - - 539 - 150 - - - - - bcAmplitudeSlider - valueChanged(int) - bcAmplitudeSpinBox - setValue(int) - - - 248 - 178 - - - 539 - 181 - - - - - bcPitchBiasSlider - valueChanged(int) - bcPitchBiasSpinBox - setValue(int) - - - 248 - 209 - - - 539 - 212 - - - - - bcEgBiasSlider - valueChanged(int) - bcEgBiasSpinBox - setValue(int) - - - 248 - 240 - - - 539 - 243 - - - - - bcPitchSpinBox - valueChanged(int) - bcPitchSlider - setValue(int) - - - 539 - 150 - - - 248 - 147 - - - - - bcEgBiasSpinBox - valueChanged(int) - bcEgBiasSlider - setValue(int) - - - 539 - 243 - - - 248 - 240 - - - - - atPitchSlider - valueChanged(int) - atPitchSpinBox - setValue(int) - - - 248 - 147 - - - 539 - 150 - - - - - atAmplitudeSpinBox - valueChanged(int) - atAmplitudeSlider - setValue(int) - - - 539 - 181 - - - 248 - 178 - - - - - atAmplitudeSlider - valueChanged(int) - atAmplitudeSpinBox - setValue(int) - - - 248 - 178 - - - 539 - 181 - - - - - atPitchBiasSlider - valueChanged(int) - atPitchBiasSpinBox - setValue(int) - - - 248 - 209 - - - 539 - 212 - - - - - atPitchBiasSpinBox - valueChanged(int) - atPitchBiasSlider - setValue(int) - - - 539 - 212 - - - 248 - 209 - - - - - atEgBiasSlider - valueChanged(int) - atEgBiasSpinBox - setValue(int) - - - 248 - 240 - - - 539 - 243 - - - - - atPitchSpinBox - valueChanged(int) - atPitchSlider - setValue(int) - - - 539 - 150 - - - 248 - 147 - - - - - atEgBiasSpinBox - valueChanged(int) - atEgBiasSlider - setValue(int) - - - 539 - 243 - - - 248 - 240 - - - - - bcPitchSpinBox - valueChanged(int) - bcPitchSlider - setValue(int) - - - 539 - 150 - - - 248 - 147 - - - - - bcAmplitudeSpinBox - valueChanged(int) - bcAmplitudeSlider - setValue(int) - - - 539 - 181 - - - 248 - 178 - - - - - bcPitchBiasSpinBox - valueChanged(int) - bcPitchBiasSlider - setValue(int) - - - 539 - 212 - - - 248 - 209 - - - - - bcEgBiasSpinBox - valueChanged(int) - bcEgBiasSlider - setValue(int) - - - 539 - 243 - - - 248 - 240 - - - - - OUT2Slider - valueChanged(int) - OUT2SpinBox - setValue(int) - - - 66 - 109 - - - 96 - 109 - - - - - chChorusSlider - valueChanged(int) - chChorusSpinBox - setValue(int) - - - 487 - 149 - - - 539 - 152 - - - - - chChorusSpinBox - valueChanged(int) - chChorusSlider - setValue(int) - - - 539 - 152 - - - 487 - 149 - - - - - chReverbSlider - valueChanged(int) - chReverbSpinBox - setValue(int) - - - 487 - 149 - - - 539 - 152 - - - - - chReverbSpinBox - valueChanged(int) - chReverbSlider - setValue(int) - - - 539 - 152 - - - 487 - 149 - - - - - transposeSlider - valueChanged(int) - transposeSpinBox - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - transposeSpinBox - valueChanged(int) - transposeSlider - setValue(int) - - - 111 - 114 - - - 111 - 114 - - - - - chDelaySlider - valueChanged(int) - chDelaySpinBox - setValue(int) - - - 351 - 319 - - - 403 - 322 - - - - - chDelaySpinBox - valueChanged(int) - chDelaySlider - setValue(int) - - - 403 - 322 - - - 351 - 319 - - - - - delayPanLFOFreqKnob - valueChanged(double,int) - delayPanLFOFreqFloatentry - setValue(double) - - - 477 - 308 - - - 498 - 308 - - - - - delayPanLFOFreqFloatentry - valueChanged(double,int) - delayPanLFOFreqKnob - setValue(double) - - - 497 - 319 - - - 477 - 326 - - - - - delayBPMKnob - valueChanged(double,int) - delayBPMFloatentry - setValue(double) - - - 84 - 389 - - - 104 - 393 - - - - - delayBPMFloatentry - valueChanged(double,int) - delayBPMKnob - setValue(double) - - - 121 - 404 - - - 78 - 409 - - - - - delayBeatRatioKnob - valueChanged(double,int) - delayBeatRatioFloatentry - setValue(double) - - - 212 - 386 - - - 252 - 392 - - - - - delayBeatRatioFloatentry - valueChanged(double,int) - delayBeatRatioKnob - setValue(double) - - - 271 - 398 - - - 228 - 411 - - - - - delayFeedbackKnob - valueChanged(double,int) - delayFeedbackFloatentry - setValue(double) - - - 347 - 388 - - - 368 - 393 - - - - - delayFeedbackFloatentry - valueChanged(double,int) - delayFeedbackKnob - setValue(double) - - - 379 - 405 - - - 352 - 409 - - - - - delayPanLFODepthKnob - valueChanged(double,int) - delayPanLFODepthFloatentry - setValue(double) - - - 464 - 387 - - - 507 - 396 - - - - - delayPanLFODepthFloatentry - valueChanged(double,int) - delayPanLFODepthKnob - setValue(double) - - - 518 - 407 - - - 471 - 409 - - - - -
diff --git a/muse2/synti/deicsonze2/deicsonzeguibase.h b/muse2/synti/deicsonze2/deicsonzeguibase.h deleted file mode 100644 index f4209078..00000000 --- a/muse2/synti/deicsonze2/deicsonzeguibase.h +++ /dev/null @@ -1,312 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'deicsonzeguibase.ui' -** -** Created: Thu Dec 24 07:50:17 2009 -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ - -#ifndef DEICSONZEGUIBASE_H -#define DEICSONZEGUIBASE_H - -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include - -class Q3VBoxLayout; -class Q3HBoxLayout; -class Q3GridLayout; -class QSpacerItem; -class QTabWidget; -class QWidget; -class QPushButton; -class Q3GroupBox; -class QLineEdit; -class Q3ListView; -class Q3ListViewItem; -class QSpinBox; -class QLabel; -class QSlider; -class QComboBox; -class QCheckBox; - -class DeicsOnzeGuiBase : public QDialog -{ - Q_OBJECT - -public: - DeicsOnzeGuiBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); - ~DeicsOnzeGuiBase(); - - QTabWidget* deicsOnzeTabWidget; - QWidget* TabPage; - QPushButton* loadPushButton; - QPushButton* savePushButton; - Q3GroupBox* nameGroupBox; - QLineEdit* nameLineEdit; - Q3GroupBox* subcategoryGroupBox; - QLineEdit* subcategoryLineEdit; - Q3GroupBox* categoryGroupBox; - QLineEdit* categoryLineEdit; - QPushButton* deletePushButton; - Q3ListView* categoryListView; - Q3ListView* subcategoryListView; - Q3ListView* presetsListView; - QPushButton* newPushButton; - Q3GroupBox* bankGroupBox; - QSpinBox* bankSpinBox; - Q3GroupBox* progGroupBox; - QSpinBox* progSpinBox; - QLabel* presentTextLAbel; - QWidget* TabPage_2; - Q3GroupBox* masterVolGroupBox; - QSlider* masterVolSlider; - QSpinBox* MasterVolumeSpinBox; - Q3GroupBox* FeedbackGroupBox; - QSpinBox* feedbackSpinBox; - QSlider* feedbackSlider; - Q3GroupBox* functionGroupBox; - QComboBox* polyMonoComboBox; - QLabel* PitchBendRangeLabel; - QSlider* PitchBendRangeSlider; - QSpinBox* pitchBendRangeSpinBox; - Q3GroupBox* LFOGroupBox; - QLabel* PModSensLabel; - QLabel* PModDepthLabel; - QLabel* AModDepthLabel; - QLabel* LFOSpeedLabel; - QLabel* LFODelayLabel; - QLabel* AModSensLabel; - QComboBox* LFOWaveComboBox; - QCheckBox* LFOSyncCheckBox; - QSlider* AModSensSlider; - QSlider* PModSensSlider; - QSpinBox* PMSSpinBox; - QSpinBox* AMSSpinBox; - QSlider* PModDepthSlider; - QSlider* AModDepthSlider; - QSlider* LFOSpeedSlider; - QSpinBox* LFOSpeedSpinBox; - QSlider* LFODelaySlider; - QSpinBox* LFODelaySpinBox; - QSpinBox* PModDepthSpinBox; - QSpinBox* AModDepthSpinBox; - Q3GroupBox* transposeGroupBox; - QSlider* transposeSlider; - QSpinBox* transposeSpinBox; - QSlider* globalDetuneSlider; - QSpinBox* globalDetuneSpinBox; - QComboBox* algorithmComboBox; - QWidget* tab; - Q3GroupBox* Frequency1groupBox; - QCheckBox* Fix1CheckBox; - QLabel* CoarseRatio1Label; - QLabel* FineRatio1Label; - QLabel* Freq1Label; - QSpinBox* CoarseRatio1SpinBox; - QSpinBox* FineRatio1SpinBox; - QSpinBox* Freq1SpinBox; - Q3GroupBox* Env1GroupBox; - QLabel* RR1Label; - QLabel* D1R1Label; - QLabel* D1L1Label; - QLabel* D2R1Label; - QSlider* D1L1Slider; - QSlider* D2R1Slider; - QSlider* D1R1Slider; - QSlider* RR1Slider; - QLabel* AR1Label; - QSpinBox* D1R1SpinBox; - QSpinBox* D1L1SpinBox; - QSpinBox* D2R1SpinBox; - QSpinBox* RR1SpinBox; - QSlider* AR1Slider; - QSpinBox* AR1SpinBox; - Q3GroupBox* Scaling1GroupBox; - QLabel* LS1Label; - QLabel* RS1Label; - QSlider* LS1Slider; - QSlider* RS1Slider; - QSpinBox* LS1SpinBox; - QSpinBox* RS1SpinBox; - Q3GroupBox* Vol1groupBox; - QSlider* Vol1Slider; - QSpinBox* Vol1SpinBox; - Q3GroupBox* sensitivity1groupBox; - QLabel* EGS1Label; - QLabel* KVS1Label; - QCheckBox* AME1CheckBox; - QSlider* KVS1Slider; - QSlider* EBS1Slider; - QSpinBox* KVS1SpinBox; - QSpinBox* EBS1SpinBox; - Q3GroupBox* DetWaveEGS1GroupBox; - QComboBox* WaveForm1ComboBox; - QLabel* DET1Label; - QComboBox* EGQ1ComboBox; - QSlider* DET1Slider; - QSpinBox* DET1SpinBox; - QWidget* tab_2; - Q3GroupBox* Frequency2groupBox; - QCheckBox* Fix2CheckBox; - QLabel* Freq2Label; - QLabel* FineRatio2Label; - QLabel* CoarseRatio2Label; - QSpinBox* CoarseRatio2SpinBox; - QSpinBox* FineRatio2SpinBox; - QSpinBox* Freq2SpinBox; - Q3GroupBox* Env2GroupBox; - QLabel* AR2Label; - QLabel* RR2Label; - QLabel* D2R2Label; - QLabel* D1L2Label; - QLabel* D1R2Label; - QSlider* AR2Slider; - QSlider* D1R2Slider; - QSlider* D1L2Slider; - QSlider* D2R2Slider; - QSlider* RR2Slider; - QSpinBox* D1R2SpinBox; - QSpinBox* D1L2SpinBox; - QSpinBox* D2R2SpinBox; - QSpinBox* RR2SpinBox; - QSpinBox* AR2SpinBox; - Q3GroupBox* Scaling2GroupBox; - QLabel* LS2Label; - QLabel* RS2Label; - QSlider* LS2Slider; - QSlider* RS2Slider; - QSpinBox* LS2SpinBox; - QSpinBox* RS2SpinBox; - Q3GroupBox* Vol2groupBox; - QSlider* Vol2Slider; - QSpinBox* Vol2SpinBox; - Q3GroupBox* sensitivity2groupBox; - QLabel* EGS2Label; - QLabel* KVS2Label; - QCheckBox* AME2CheckBox; - QSlider* KVS2Slider; - QSlider* EBS2Slider; - QSpinBox* EBS2SpinBox; - QSpinBox* KVS2SpinBox; - Q3GroupBox* DetWaveEGS2GroupBox; - QSlider* DET2Slider; - QLabel* DET2Label; - QComboBox* WaveForm2ComboBox; - QComboBox* EGS2comboBox; - QSpinBox* DET2SpinBox; - QWidget* TabPage_3; - Q3GroupBox* Frequency3groupBox; - QCheckBox* Fix3CheckBox; - QLabel* CoarseRatio3Label; - QLabel* FineRatio3Label; - QLabel* Freq3Label; - QSpinBox* CoarseRatio3SpinBox; - QSpinBox* FineRatio3SpinBox; - QSpinBox* Freq3SpinBox; - Q3GroupBox* Env3GroupBox; - QLabel* RR3Label; - QLabel* D2R3Label; - QLabel* D1L3Label; - QLabel* D1R3Label; - QLabel* AR3Label; - QSlider* AR3Slider; - QSlider* D1R3Slider; - QSlider* D1L3Slider; - QSlider* D2R3Slider; - QSlider* RR3Slider; - QSpinBox* D1R3SpinBox; - QSpinBox* D1L3SpinBox; - QSpinBox* D2R3SpinBox; - QSpinBox* RR3SpinBox; - QSpinBox* AR3SpinBox; - Q3GroupBox* Scaling3GroupBox; - QLabel* LS3Label; - QLabel* RS3Label; - QSlider* LS3Slider; - QSlider* RS3Slider; - QSpinBox* LS3SpinBox; - QSpinBox* RS3SpinBox; - Q3GroupBox* Vol3groupBox; - QSlider* Vol3Slider; - QSpinBox* Vol3SpinBox; - Q3GroupBox* sensitivity3groupBox; - QLabel* EGS3Label; - QLabel* KVS3Label; - QCheckBox* AME3CheckBox; - QSlider* KVS3Slider; - QSlider* EBS3Slider; - QSpinBox* EBS3SpinBox; - QSpinBox* KVS3SpinBox; - Q3GroupBox* DetWaveEGS3GroupBox; - QComboBox* WaveForm3ComboBox; - QComboBox* EGS3comboBox; - QLabel* DET3Label; - QSlider* DET3Slider; - QSpinBox* DET3SpinBox; - QWidget* TabPage_4; - Q3GroupBox* Frequency4groupBox; - QLabel* CoarseRatio4Label; - QLabel* FineRatio4Label; - QLabel* Freq4Label; - QCheckBox* Fix4CheckBox; - QSpinBox* FineRatio4SpinBox; - QSpinBox* Freq4SpinBox; - QSpinBox* CoarseRatio4SpinBox; - Q3GroupBox* Scaling4GroupBox; - QLabel* LS4Label; - QLabel* RS4Label; - QSlider* LS4Slider; - QSlider* RS4Slider; - QSpinBox* RS4SpinBox; - QSpinBox* LS4SpinBox; - Q3GroupBox* Env4GroupBox; - QSlider* AR4Slider; - QLabel* AR4Label; - QLabel* RR4Label; - QLabel* D2R4Label; - QSlider* D2R4Slider; - QSlider* D1L4Slider; - QLabel* D1L4Label; - QLabel* D1R4Label; - QSlider* D1R4Slider; - QSlider* RR4Slider; - QSpinBox* D1R4SpinBox; - QSpinBox* D1L4SpinBox; - QSpinBox* D2R4SpinBox; - QSpinBox* RR4SpinBox; - QSpinBox* AR4SpinBox; - Q3GroupBox* Vol4groupBox; - QSlider* Vol4Slider; - QSpinBox* Vol4SpinBox; - Q3GroupBox* sensitivity4groupBox; - QLabel* EGS4Label; - QLabel* KVS4Label; - QCheckBox* AME4CheckBox; - QSlider* KVS4Slider; - QSlider* EBS4Slider; - QSpinBox* KVS4SpinBox; - QSpinBox* EBS4SpinBox; - Q3GroupBox* DetWaveEGS4GroupBox; - QSlider* DET4Slider; - QLabel* DET4Label; - QComboBox* WaveForm4ComboBox; - QComboBox* EGS4comboBox; - QSpinBox* DET4SpinBox; - -protected: - -protected slots: - virtual void languageChange(); - -private: - QPixmap image0; - -}; - -#endif // DEICSONZEGUIBASE_H diff --git a/muse2/synti/deicsonze2/deicsonzeplugin.cpp b/muse2/synti/deicsonze2/deicsonzeplugin.cpp deleted file mode 100644 index 581dad38..00000000 --- a/muse2/synti/deicsonze2/deicsonzeplugin.cpp +++ /dev/null @@ -1,502 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// -// -// -// Copyright (c) 2004-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 "deicsonzeplugin.h" -#include "muse/plugin.h" -//#include "plugingui.h" -#include "muse/ctrl.h" -#include "muse/fastlog.h" -#include "muse/midi.h" -//Added by qt3to4: -#include -#include -//#include "awl/floatentry.h" -//#include "awl/slider.h" -//#include "awl/checkbox.h" - -//using Awl::FloatEntry; -//using Awl::Slider; -//using Awl::CheckBox; - -class PluginDialog; - -void DeicsOnze::initPluginReverb(Plugin* pluginReverb) { - //init plugin - if(_pluginIReverb) delete(_pluginIReverb); - _pluginIReverb = new PluginI(NULL); - - _pluginIReverb->initPluginInstance(pluginReverb, 2); - - for(int i = 0; i < pluginReverb->parameter(); i++) { - Ctrl* c = new Ctrl(); - c->setCurVal((float)pluginReverb->defaultValue(i)); - _pluginIReverb->setControllerList(c); - //setReverbParam(i, pluginReverb->defaultValue(i)); - } - - //send build gui to the gui - char data; - data = SYSEX_BUILDGUIREVERB; - MidiEvent evSysex(0,ME_SYSEX,(const unsigned char*)&data, 1); - _gui->writeEvent(evSysex); -} - -void DeicsOnze::initPluginChorus(Plugin* pluginChorus) { - if(_pluginIChorus) delete(_pluginIChorus); - _pluginIChorus = new PluginI(NULL); - - _pluginIChorus->initPluginInstance(pluginChorus, 2); - - for(int i = 0; i < pluginChorus->parameter(); i++) { - Ctrl* c = new Ctrl(); - c->setCurVal((float)pluginChorus->defaultValue(i)); - _pluginIChorus->setControllerList(c); - //setChorusParam(i, pluginChorus->defaultValue(i)); -} - - //send build gui to the gui - char data; - data = SYSEX_BUILDGUICHORUS; - MidiEvent evSysex(0,ME_SYSEX,(const unsigned char*)&data, 1); - _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(1); - - float f; - char dataDelayBPM[sizeof(float)+1]; - dataDelayBPM[0] = SYSEX_DELAYBPM; - f = getDelayBPM(); - memcpy(&dataDelayBPM[1], &f, sizeof(float)); - MidiEvent evSysexDelayBPM(0,ME_SYSEX, - (const unsigned char*)dataDelayBPM, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayBPM); - char dataDelayBeatRatio[sizeof(float)+1]; - dataDelayBeatRatio[0] = SYSEX_DELAYBEATRATIO; - f = getDelayBeatRatio(); - memcpy(&dataDelayBeatRatio[1], &f, sizeof(float)); - MidiEvent evSysexDelayBeatRatio(0,ME_SYSEX, - (const unsigned char*)dataDelayBeatRatio, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayBeatRatio); - char dataDelayFeedback[sizeof(float)+1]; - dataDelayFeedback[0] = SYSEX_DELAYFEEDBACK; - f = getDelayFeedback(); - memcpy(&dataDelayFeedback[1], &f, sizeof(float)); - MidiEvent evSysexDelayFeedback(0,ME_SYSEX, - (const unsigned char*)dataDelayFeedback, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayFeedback); - char dataDelayLFOFreq[sizeof(float)+1]; - dataDelayLFOFreq[0] = SYSEX_DELAYLFOFREQ; - f = getDelayLFOFreq(); - memcpy(&dataDelayLFOFreq[1], &f, sizeof(float)); - MidiEvent evSysexDelayLFOFreq(0,ME_SYSEX, - (const unsigned char*)dataDelayLFOFreq, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayLFOFreq); - char dataDelayLFODepth[sizeof(float)+1]; - dataDelayLFODepth[0] = SYSEX_DELAYLFODEPTH; - f = getDelayLFODepth(); - memcpy(&dataDelayLFODepth, &f, sizeof(float)+1); - MidiEvent evSysexDelayLFODepth(0,ME_SYSEX, - (const unsigned char*)dataDelayLFODepth, - sizeof(float)+1); - _gui->writeEvent(evSysexDelayLFODepth); -} - -void DeicsOnze::setReverbParam(int index, double val) { - if(_pluginIReverb) _pluginIReverb->controller(index)->setCurVal((float)val); - else printf("Warning : no DeicsOnze reverb loaded\n"); -} -void DeicsOnze::setChorusParam(int index, double val) { - if(_pluginIChorus) _pluginIChorus->controller(index)->setCurVal((float)val); - else printf("Warning : no DeicsOnze chorus loaded\n"); -} - -double DeicsOnze::getReverbParam(int index) { - if(_pluginIReverb) return _pluginIReverb->controller(index)->curVal().f; - else { - return 0.0; - printf("Warning : no DeicsOnze reverb loaded\n"); - } -} - -double DeicsOnze::getChorusParam(int index) { - if(_pluginIChorus) return _pluginIChorus->controller(index)->curVal().f; - else { - return 0.0; - printf("Warning : no DeicsOnze chorus loaded\n"); - } -} - -void DeicsOnzeGui::addPluginCheckBox(int index, QString text, bool toggled, - QWidget* parent, Q3GridLayout* grid, - bool isReverb) { - CheckBox* cb = new CheckBox(parent); - cb->setId(index); - cb->setText(text); - cb->setChecked(toggled); - grid->addWidget(cb, index, 0); - //push on vectors - if(isReverb) { - _reverbSliderVector.push_back(NULL); - _reverbFloatEntryVector.push_back(NULL); - _reverbCheckBoxVector.push_back(cb); - } - else { - _chorusSliderVector.push_back(NULL); - _chorusFloatEntryVector.push_back(NULL); - _chorusCheckBoxVector.push_back(cb); - } - //connect slots - if(isReverb) { - connect(cb, SIGNAL(valueChanged(double, int)), - this, SLOT(setReverbCheckBox(double, int))); - } - else { - connect(cb, SIGNAL(valueChanged(double, int)), - this, SLOT(setChorusCheckBox(double, int))); - } -} - -void DeicsOnzeGui::addPluginIntSlider(int index, QString text, double min, - double max, double val, QWidget* parent, - Q3GridLayout* grid, bool isReverb) { - addPluginSlider(index, text, false, min, max, val, parent, grid, isReverb); -} - -void DeicsOnzeGui::addPluginSlider(int index, QString text, bool isLog, - double min, double max, double val, - QWidget* parent, Q3GridLayout* grid, - bool isReverb) { - QLabel* l = new QLabel(text, parent); - grid->addWidget(l, index, 0); - FloatEntry* f = new FloatEntry(parent); - f->setValue(val); - f->setMinValue(min); - f->setMaxValue(max); - f->setMaximumWidth(72); - grid->addWidget(f, index, 1); - Slider* s = new Slider(parent); - s->setId(index); - s->setLog(isLog); - s->setLogRange(min, max); - s->setValue(val); - s->setOrientation(Qt::Horizontal); - //s->setFixedHeight(h); - s->setLineStep((min-max)/100.0); - s->setPageStep((min-max)/10.0); - grid->addWidget(s, index, 2); - //push on vectors - if(isReverb) { - _reverbSliderVector.push_back(s); - _reverbFloatEntryVector.push_back(f); - _reverbCheckBoxVector.push_back(NULL); - } - else { - _chorusSliderVector.push_back(s); - _chorusFloatEntryVector.push_back(f); - _chorusCheckBoxVector.push_back(NULL); - } - //connect slots - if(isReverb) { - connect(f, SIGNAL(valueChanged(double, int)), - this, SLOT(setReverbFloatEntry(double, int))); - connect(s, SIGNAL(valueChanged(double, int)), - this, SLOT(setReverbSlider(double, int))); - } - else { - connect(f, SIGNAL(valueChanged(double, int)), - this, SLOT(setChorusFloatEntry(double, int))); - connect(s, SIGNAL(valueChanged(double, int)), - this, SLOT(setChorusSlider(double, int))); - } -} - -void DeicsOnzeGui::buildGuiReverb() { - PluginI* plugI = _deicsOnze->_pluginIReverb; - QString name = plugI->name(); - name.resize(name.size()-2); - updateLadspaReverbLineEdit(name); - //build super layout - if(parametersReverbGroupBox->layout()) - delete(parametersReverbGroupBox->layout()); - Q3GridLayout* superLayout = new Q3GridLayout(parametersReverbGroupBox); - parametersReverbGroupBox->setLayout(superLayout); - //build super widget - if(_reverbSuperWidget) delete(_reverbSuperWidget); - _reverbSuperWidget = new QWidget(parametersReverbGroupBox); - superLayout->addWidget(_reverbSuperWidget); - //build grid - Q3GridLayout* grid = new Q3GridLayout(_reverbSuperWidget); - _reverbSuperWidget->setLayout(grid); - grid->setSpacing(0); - //init vectors - if(!_reverbSliderVector.empty()) _reverbSliderVector.clear(); - if(!_reverbFloatEntryVector.empty()) _reverbFloatEntryVector.clear(); - if(!_reverbCheckBoxVector.empty()) _reverbCheckBoxVector.clear(); - //build sliders - for(int i = 0; i < plugI->plugin()->parameter(); i++) { - double min, max, val; - plugI->range(i, &min, &max); - val = _deicsOnze->getReverbParam(i); - if(plugI->isBool(i)) - addPluginCheckBox(i, plugI->getParameterName(i), val > 0.0, - _reverbSuperWidget, grid, true); - else if(plugI->isInt(i)) { - addPluginIntSlider(i, plugI->getParameterName(i), rint(min), rint(max), - rint(val), _reverbSuperWidget, grid, true); - } - else { - addPluginSlider(i, plugI->getParameterName(i), plugI->isLog(i), - min, max, val, _reverbSuperWidget, grid, true); - } - } - //update colors of the new sliders (and the whole gui actually) - setEditTextColor(reinterpret_cast(*etColor)); - setEditBackgroundColor(reinterpret_cast(*ebColor)); -} - -void DeicsOnzeGui::buildGuiChorus() { - PluginI* plugI = _deicsOnze->_pluginIChorus; - QString name = plugI->name(); - name.resize(name.size()-2); - updateLadspaChorusLineEdit(name); - //build super layout - if(parametersChorusGroupBox->layout()) - delete(parametersChorusGroupBox->layout()); - Q3GridLayout* superLayout = new Q3GridLayout(parametersChorusGroupBox); - parametersChorusGroupBox->setLayout(superLayout); - //build super widget - if(_chorusSuperWidget) delete(_chorusSuperWidget); - _chorusSuperWidget = new QWidget(parametersChorusGroupBox); - superLayout->addWidget(_chorusSuperWidget); - //build grid - Q3GridLayout* grid = new Q3GridLayout(_chorusSuperWidget); - _chorusSuperWidget->setLayout(grid); - grid->setSpacing(2); - //init vectors - if(!_chorusSliderVector.empty()) _chorusSliderVector.clear(); - if(!_chorusFloatEntryVector.empty()) _chorusFloatEntryVector.clear(); - if(!_chorusCheckBoxVector.empty()) _chorusCheckBoxVector.clear(); - //build sliders - for(int i = 0; i < plugI->plugin()->parameter(); i++) { - double min, max, val; - plugI->range(i, &min, &max); - val = _deicsOnze->getChorusParam(i); - if(plugI->isBool(i)) - addPluginCheckBox(i, plugI->getParameterName(i), val > 0.0, - _chorusSuperWidget, grid, false); - else if(plugI->isInt(i)) { - addPluginIntSlider(i, plugI->getParameterName(i), rint(min), rint(max), - rint(val), _chorusSuperWidget, grid, false); - } - else { - addPluginSlider(i, plugI->getParameterName(i), plugI->isLog(i), - min, max, val, _chorusSuperWidget, grid, false); - } - } - //update colors of the new sliders (and the whole gui actually) - setEditTextColor(reinterpret_cast(*etColor)); - setEditBackgroundColor(reinterpret_cast(*ebColor)); -} - -//setReverbCheckBox is used, by the way, to send the value -//of the parameter because it sends a double and does not -//change any thing -void DeicsOnzeGui::setReverbCheckBox(double v, int i) { - float f = (float)v; - unsigned char* message = new unsigned char[2+sizeof(float)]; - message[0]=SYSEX_REVERBPARAM; - if(i<256) { - message[1]=(unsigned char)i; - memcpy(&message[2], &f, sizeof(float)); - sendSysex(message, 2+sizeof(float)); - } - else printf("setReverbCheckBox Error : cannot send controller upper than 225\n"); -} - -//setChorusCheckBox is used, by the way, to send the value -//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; - unsigned char* message = new unsigned char[2+sizeof(float)]; - message[0]=SYSEX_CHORUSPARAM; - if(i<256) { - message[1]=(unsigned char)i; - memcpy(&message[2], &f, sizeof(float)); - sendSysex(message, 2+sizeof(float)); - } - else printf("setChorusCheckBox Error : cannot send controller upper than 225\n"); -} - -void DeicsOnzeGui::setReverbFloatEntry(double v, int i) { - if(_deicsOnze->_pluginIReverb) { - if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v); - updateReverbFloatEntry(v, i); - updateReverbSlider(v, i); - setReverbCheckBox(v, i); //because this send the SYSEX - } - else printf("Warning : no DeicsOnze reverb loaded\n"); -} -void DeicsOnzeGui::setReverbSlider(double v, int i) { - if(_deicsOnze->_pluginIReverb) { - if(_deicsOnze->_pluginIReverb->isInt(i)) v = rint(v); - updateReverbFloatEntry(v, i); - updateReverbSlider(v, i); - setReverbCheckBox(v, i); //because this send the SYSEX - } - else printf("Warning : no DeicsOnze reverb loaded\n"); -} -void DeicsOnzeGui::setChorusFloatEntry(double v, int i) { - if(_deicsOnze->_pluginIReverb) { - if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v); - updateChorusFloatEntry(v, i); - updateChorusSlider(v, i); - setChorusCheckBox(v, i); //because this send the SYSEX - } - else printf("Warning : no DeicsOnze chorus loaded\n"); -} -void DeicsOnzeGui::setChorusSlider(double v, int i) { - if(_deicsOnze->_pluginIReverb) { - if(_deicsOnze->_pluginIChorus->isInt(i)) v = rint(v); - updateChorusSlider(v, i); - updateChorusFloatEntry(v, i); - setChorusCheckBox(v, i); //because this send the SYSEX - } - else printf("Warning : no DeicsOnze chorus loaded\n"); -} - -//updates -void DeicsOnzeGui::updateReverbSlider(double v, int i) { - if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) { - _reverbSliderVector[i]->blockSignals(true); - _reverbSliderVector[i]->setValue(v); - _reverbSliderVector[i]->blockSignals(false); - } -} -void DeicsOnzeGui::updateReverbFloatEntry(double v, int i) { - if(i < (int)_reverbFloatEntryVector.size() && _reverbFloatEntryVector[i]) { - _reverbFloatEntryVector[i]->blockSignals(true); - _reverbFloatEntryVector[i]->setValue(v); - _reverbFloatEntryVector[i]->blockSignals(false); - } -} -void DeicsOnzeGui::updateChorusSlider(double v, int i) { - if(i < (int)_reverbSliderVector.size() && _reverbSliderVector[i]) { - _chorusSliderVector[i]->blockSignals(true); - _chorusSliderVector[i]->setValue(v); - _chorusSliderVector[i]->blockSignals(false); - } -} -void DeicsOnzeGui::updateChorusFloatEntry(double v, int i) { - if(i < (int)_chorusFloatEntryVector.size() && _chorusFloatEntryVector[i]) { - _chorusFloatEntryVector[i]->blockSignals(true); - _chorusFloatEntryVector[i]->setValue(v); - _chorusFloatEntryVector[i]->blockSignals(false); - } -} - -//------------------------------------------------------------- -// set Delay -//------------------------------------------------------------- -void DeicsOnze::setDelayBPM(float val) { - if(_pluginIDelay) _pluginIDelay->controller(0)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} -void DeicsOnze::setDelayBeatRatio(float val) { - if(_pluginIDelay) _pluginIDelay->controller(1)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} -float DeicsOnze::getDelayBPM() { - if(_pluginIDelay) return _pluginIDelay->controller(0)->curVal().f; - else { - printf("Warning : no DeicsOnze delay loaded\n"); - return 0.0; - } -} -float DeicsOnze::getDelayBeatRatio() { - if(_pluginIDelay) return _pluginIDelay->controller(1)->curVal().f; - else { - printf("Warning : no DeicsOnze delay loaded\n"); - return 0.0; - } -} -void DeicsOnze::setDelayFeedback(float val) { - if(_pluginIDelay) return _pluginIDelay->controller(2)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} -float DeicsOnze::getDelayFeedback() { - if(_pluginIDelay) return _pluginIDelay->controller(2)->curVal().f; - else { - printf("Warning : no DeicsOnze delay loaded\n"); - return 0.0; - } -} -void DeicsOnze::setDelayLFOFreq(float val) { - if(_pluginIDelay) _pluginIDelay->controller(3)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} -float DeicsOnze::getDelayLFOFreq() { - if(_pluginIDelay) return _pluginIDelay->controller(3)->curVal().f; - else { - printf("Warning : no DeicsOnze delay loaded\n"); - return 0.0; - } -} -void DeicsOnze::setDelayLFODepth(float val) { - if(_pluginIDelay) _pluginIDelay->controller(4)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} -float DeicsOnze::getDelayLFODepth() { - if(_pluginIDelay) return _pluginIDelay->controller(4)->curVal().f; - else { - printf("Warning : no DeicsOnze delay loaded\n"); - return 0.0; - } -} -void DeicsOnze::setDelayDryWet(float val) { - if(_pluginIDelay) _pluginIDelay->controller(5)->setCurVal(val); - else printf("Warning : no DeicsOnze delay loaded\n"); -} diff --git a/muse2/synti/deicsonze2/deicsonzeplugin.h b/muse2/synti/deicsonze2/deicsonzeplugin.h deleted file mode 100644 index d9527e23..00000000 --- a/muse2/synti/deicsonze2/deicsonzeplugin.h +++ /dev/null @@ -1,40 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// -// -// -// Copyright (c) 2004-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 __DEICSONZEPLUGIN_H -#define __DEICSONZEPLUGIN_H - -#include "deicsonze.h" -#include "deicsonzegui.h" -#include "plugins/pandelay/pandelaymodel.h" - -class DeicsOnze; -class DeicsOnzeGui; - -#endif diff --git a/muse2/synti/deicsonze2/deicsonzepreset.cpp b/muse2/synti/deicsonze2/deicsonzepreset.cpp deleted file mode 100644 index 007b0d06..00000000 --- a/muse2/synti/deicsonze2/deicsonzepreset.cpp +++ /dev/null @@ -1,1202 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// deicsonzepreset.cpp -// -// -// Copyright (c) 2004-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 "deicsonzepreset.h" -#include -#include - -#define SET_LEVEL 1 -#define CAT_LEVEL 2 -#define SUB_LEVEL 3 -#define PRE_LEVEL 4 - -//----------------------------------------------------------- -// Constructor destructor -//----------------------------------------------------------- -Preset::Preset() {_subcategory=NULL;_isUsed=false;initPreset();} -Preset::Preset(Subcategory* sub) { - _subcategory=sub; - _isUsed=false; - initPreset(); - if(sub) sub->_presetVector.push_back(this); -} -Preset::Preset(Subcategory* sub, int pr) { - _subcategory=sub; - _isUsed=false; - initPreset(); - prog=pr; - if(sub) sub->_presetVector.push_back(this); -} -Preset::~Preset() { - if(_subcategory) { - std::vector::iterator iB=_subcategory->_presetVector.begin(); - std::vector::iterator iE=_subcategory->_presetVector.end(); - std::vector::iterator iP=std::find(iB, iE, this); - if(iP!=iE) _subcategory->_presetVector.erase(iP); - else printf("Error : preset %s not found\n", name.c_str()); - } -} -//---------------------------------------------------------- -// setIsUsed(bool b) -// set the flag _isUsed and transmit in the parents -//---------------------------------------------------------- -void Preset::setIsUsed(bool b) { - if(!_isUsed) { - _isUsed=b; - if(_subcategory) { - _subcategory->_isUsed=b; - if(_subcategory->_category) { - _subcategory->_category->_isUsed=b; - } - } - } -} -//---------------------------------------------------------- -// getHBankLBankProg -// return the hbank, lbank and prog of the preset -// warning : if there is not subcategory of category -// the value l or h are let unchanged -//---------------------------------------------------------- -void Preset::getHBankLBankProg(int* h, int* l, int* p) { - *p = prog; - if(_subcategory) { - *l = _subcategory->_lbank; - if(_subcategory->_category) *h = _subcategory->_category->_hbank; - } -} -//---------------------------------------------------------- -// linkSubcategory -// links the preset to a subcategory parent and erase itself -// from the last subcategory if not NULL -//---------------------------------------------------------- -void Preset::linkSubcategory(Subcategory* sub) { - if(_subcategory) { - std::vector pv=_subcategory->_presetVector; - std::vector::iterator iP=find(pv.begin(),pv.end(),this); - if(iP!=pv.end()) pv.erase(iP); - else printf("Error linkSubcategory: preset %s not found\n", - name.c_str()); - } - _subcategory=sub; - if(sub) sub->_presetVector.push_back(this); -} -//---------------------------------------------------------- -// linkCategory -// links the subcategory to a category parent and erase itself -// from the last category if not NULL -//---------------------------------------------------------- -void Subcategory::linkCategory(Category* cat) { - if(_category) { - std::vector sv=_category->_subcategoryVector; - std::vector::iterator iS=find(sv.begin(),sv.end(),this); - if(iS!=sv.end()) sv.erase(iS); - else printf("Error linkCategory: preset %s not found\n", - _subcategoryName.c_str()); - } - _category=cat; - if(cat) cat->_subcategoryVector.push_back(this); -} - - -//---------------------------------------------------------- -// linkSet -// links the category to a set parent (there is always only one set) -//---------------------------------------------------------- -void Category::linkSet(Set* s) { - _set=s; - if(s) s->_categoryVector.push_back(this); -} - -//---------------------------------------------------------- -// Subcategory constructor and destruction -//---------------------------------------------------------- -Subcategory::Subcategory() {_category=NULL;} -Subcategory::Subcategory(Category* cat) { - _category=cat; - _isUsed=false; - if(cat) cat->_subcategoryVector.push_back(this); -} -Subcategory::Subcategory(const std::string name) { - _category=NULL; - _isUsed=false; - _subcategoryName=name; -} -Subcategory::Subcategory(Category* cat, const std::string name, int lbank) { - _category=cat; - _isUsed=false; - _subcategoryName=name; - _lbank=lbank; - if(cat) cat->_subcategoryVector.push_back(this); -} -Subcategory::~Subcategory() { - while(!_presetVector.empty()) delete(*_presetVector.begin()); - if(_category) { - std::vector::iterator - iB=_category->_subcategoryVector.begin(); - std::vector::iterator - iE=_category->_subcategoryVector.end(); - std::vector::iterator iS=std::find(iB, iE, this); - if(iS!=iE) _category->_subcategoryVector.erase(iS); - else printf("Error : subcategory %s not found\n", - _subcategoryName.c_str()); - } -} - -//-------------------------------------------------------- -// Category constructor destructor -//-------------------------------------------------------- -Category::Category() {_set=NULL;_isUsed=false;} -Category::Category(Set* s) { - _set=s; - _isUsed=false; - if(s) s->_categoryVector.push_back(this); -} -Category::Category(Set* s,const std::string name, int hbank) { - _set=s; - _isUsed=false; - _categoryName=name; - _hbank=hbank; - if(s) s->_categoryVector.push_back(this); -} -Category::~Category() { - while(!_subcategoryVector.empty()) delete(*_subcategoryVector.begin()); - if(_set) { - std::vector::iterator iB=_set->_categoryVector.begin(); - std::vector::iterator iE=_set->_categoryVector.end(); - std::vector::iterator iC=std::find(iB, iE, this); - if(iC!=iE) _set->_categoryVector.erase(iC); - else printf("Error : category %s not found\n", _categoryName.c_str()); - } -} - -//--------------------------------------------------------- -// initPreset -// put the preset in the initial state as defined by YAMAHA -//--------------------------------------------------------- -void Preset::initPreset() { - //algorithm - algorithm=FIRST; - //feedeback - feedback=0; - //lfo - lfo.wave=TRIANGL; - lfo.speed=35; - lfo.delay=0; - lfo.pModDepth=0; - lfo.aModDepth=0; - lfo.sync=false; - //sensitivity - sensitivity.pitch=6; - sensitivity.amplitude=0; - sensitivity.ampOn[0]=false; - sensitivity.ampOn[1]=false; - sensitivity.ampOn[2]=false; - sensitivity.ampOn[3]=false; - sensitivity.egBias[0]=0; - sensitivity.egBias[1]=0; - sensitivity.egBias[2]=0; - sensitivity.egBias[3]=0; - sensitivity.keyVelocity[0]=0; - sensitivity.keyVelocity[1]=0; - sensitivity.keyVelocity[2]=0; - sensitivity.keyVelocity[3]=0; - //frequency - frequency[0].ratio=1.0; - frequency[1].ratio=1.0; - frequency[2].ratio=1.0; - frequency[3].ratio=1.0; - frequency[0].isFix=false; - frequency[1].isFix=false; - frequency[2].isFix=false; - frequency[3].isFix=false; - frequency[0].freq=255.0; - frequency[1].freq=255.0; - frequency[2].freq=255.0; - frequency[3].freq=255.0; - //oscWave - oscWave[0]=W1; - oscWave[1]=W1; - oscWave[2]=W1; - oscWave[3]=W1; - //detune - detune[0]=0; - detune[1]=0; - detune[2]=0; - detune[3]=0; - //eg - eg[0].ar=31; - eg[1].ar=31; - eg[2].ar=31; - eg[3].ar=31; - eg[0].d1r=31; - eg[1].d1r=31; - eg[2].d1r=31; - eg[3].d1r=31; - eg[0].d1l=15; - eg[1].d1l=15; - eg[2].d1l=15; - eg[3].d1l=15; - eg[0].d2r=0; - eg[1].d2r=0; - eg[2].d2r=0; - eg[3].d2r=0; - eg[0].rr=15; - eg[1].rr=15; - eg[2].rr=15; - eg[3].rr=15; - eg[0].egShift=VOF; - eg[1].egShift=VOF; - eg[2].egShift=VOF; - eg[3].egShift=VOF; - //pitchEg - pitchEg.pr1=99; - pitchEg.pr2=99; - pitchEg.pr3=99; - pitchEg.pl1=50; - pitchEg.pl2=50; - pitchEg.pl3=50; - //outLevel - outLevel[0]=90; - outLevel[1]=0; - outLevel[2]=0; - outLevel[3]=0; - //scaling - scaling.rate[0]=0; - scaling.rate[1]=0; - scaling.rate[2]=0; - scaling.rate[3]=0; - scaling.level[0]=0; - scaling.level[1]=0; - scaling.level[2]=0; - scaling.level[3]=0; - //function - function.transpose=0; - function.mode=POLY; - function.pBendRange=4; - function.portamento=FULL; - function.portamentoTime=0; - function.fcVolume=40; - function.fcPitch=0; - function.fcAmplitude=0; - function.mwPitch=50; - function.mwAmplitude=0; - function.bcPitch=0; - function.bcAmplitude=0; - function.bcPitchBias=0; - function.bcEgBias=0; - function.atPitch=0; - function.atAmplitude=0; - function.atPitchBias=0; - function.atEgBias=0; - function.reverbRate=0; - //globalDetune=0; - //Name - name="INITVOICE"; -} -//--------------------------------------------------------- -// Preset::merge -// copy the preset -//--------------------------------------------------------- -void Preset::merge(Preset* p) { - if(p) { - //algorithm - algorithm=p->algorithm; - //feedeback - feedback=p->feedback; - //lfo - lfo.wave=p->lfo.wave; - lfo.speed=p->lfo.speed; - lfo.delay=p->lfo.delay; - lfo.pModDepth=p->lfo.pModDepth; - lfo.aModDepth=p->lfo.aModDepth; - lfo.sync=p->lfo.sync; - //sensitivity - sensitivity.pitch=p->sensitivity.pitch; - sensitivity.amplitude=p->sensitivity.amplitude; - for(int k=0; ksensitivity.ampOn[k]; - sensitivity.egBias[k]=p->sensitivity.egBias[k]; - sensitivity.keyVelocity[k]=p->sensitivity.keyVelocity[k]; - //frequency - frequency[k].ratio=p->frequency[k].ratio; - frequency[k].isFix=p->frequency[k].isFix; - frequency[k].freq=p->frequency[k].freq; - //oscWave - oscWave[k]=p->oscWave[k]; - //detune - detune[k]=p->detune[k]; - //eg - eg[k].ar=p->eg[k].ar; - eg[k].d1r=p->eg[k].d1r; - eg[k].d1l=p->eg[k].d1l; - eg[k].d2r=p->eg[k].d2r; - eg[k].rr=p->eg[k].rr; - eg[k].egShift=p->eg[k].egShift; - //outLevel - outLevel[k]=p->outLevel[k]; - //scaling - scaling.rate[k]=p->scaling.rate[k]; - scaling.level[k]=p->scaling.level[k]; - } - //pitchEg - pitchEg.pr1=p->pitchEg.pr1; - pitchEg.pr2=p->pitchEg.pr2; - pitchEg.pr3=p->pitchEg.pr3; - pitchEg.pl1=p->pitchEg.pl1; - pitchEg.pl2=p->pitchEg.pl2; - pitchEg.pl3=p->pitchEg.pl3; - //function - function.transpose=p->function.transpose; - function.mode=p->function.mode; - function.pBendRange=p->function.pBendRange; - function.portamento=p->function.portamento; - function.portamentoTime=p->function.portamentoTime; - function.fcVolume=p->function.fcVolume; - function.fcPitch=p->function.fcPitch; - function.fcAmplitude=p->function.fcAmplitude; - function.mwPitch=p->function.mwPitch; - function.mwAmplitude=p->function.mwAmplitude; - function.bcPitch=p->function.bcPitch; - function.bcAmplitude=p->function.bcAmplitude; - function.bcPitchBias=p->function.bcPitchBias; - function.bcEgBias=p->function.bcEgBias; - function.atPitch=p->function.atPitch; - function.atAmplitude=p->function.atAmplitude; - function.atPitchBias=p->function.atPitchBias; - function.atEgBias=p->function.atEgBias; - function.reverbRate=p->function.reverbRate; - //globalDetune=p->globalDetune; - //Name - name=p->name; - } -} -//--------------------------------------------------------- -// findPreset -// return the first preset corresponding of hbank, lbank, prog -//--------------------------------------------------------- -Preset* Subcategory::findPreset(int prog) { - std::vector::iterator pvi; - for(pvi=_presetVector.begin(); pvi!=_presetVector.end(); pvi++) { - if((*pvi)->prog==prog) return(*pvi); - } - return NULL; -} -Preset* Category::findPreset(int lbank, int prog) { - Subcategory* s=findSubcategory(lbank); - if(s) { - Preset* p=s->findPreset(prog); - if(p) return(p); - } - return(NULL); -} -Preset* Set::findPreset(int hbank, int lbank, int prog) { - Category* c=findCategory(hbank); - if(c) { - Preset* p=c->findPreset(lbank, prog); - if(p) return(p); - } - return NULL; -} - -//--------------------------------------------------------- -// isFreeHBank, firstFreeHBank -1 otherwise -//--------------------------------------------------------- -bool Set::isFreeHBank(int hbank) { - if(findCategory(hbank)) return(false); - else return(true); -} -int Set::firstFreeHBank() { - for(int hbank=0; hbank<128; hbank++) if(isFreeHBank(hbank)) return(hbank); - return(-1); -} -//-------------------------------------------------------------- -// Set::merge -//-------------------------------------------------------------- -void Set::merge(Category* c) { - if(isFreeHBank(c->_hbank)) c->linkSet(this); - else { - Category* cFromSet=findCategory(c->_hbank); - cFromSet->_categoryName=c->_categoryName; - for(std::vector::iterator - i=c->_subcategoryVector.begin(); - i!=c->_subcategoryVector.end(); i++) cFromSet->merge(*i); - //delete(c); - } -} - -bool Category::isFreeLBank(int lbank) { - if(findSubcategory(lbank)) return(false); - else return(true); -} -int Category::firstFreeLBank() { - for(int lbank=0; lbank<128; lbank++) if(isFreeLBank(lbank)) return(lbank); - return(-1); -} -//-------------------------------------------------------------- -// Category::merge -//-------------------------------------------------------------- -void Category::merge(Subcategory* s) { - if(isFreeLBank(s->_lbank)) s->linkCategory(this); - else { - Subcategory* sFromCat=findSubcategory(s->_lbank); - sFromCat->_subcategoryName=s->_subcategoryName; - for(std::vector::iterator - i=s->_presetVector.begin(); - i!=s->_presetVector.end(); i++) sFromCat->merge(*i); - //delete(s); - } -} -//--------------------------------------------------------- -// Category::unlink -// unlink the subcategories, so don't delete them when delete -//--------------------------------------------------------- -void Category::unlink() { - while(!_subcategoryVector.empty()) - _subcategoryVector.erase(_subcategoryVector.begin()); -} - -bool Subcategory::isFreeProg(int pr) { - if(findPreset(pr)) return(false); - else return(true); -} -int Subcategory::firstFreeProg() { - for(int pr=0; pr<128; pr++) if(isFreeProg(pr)) return(pr); - return(-1); -} -//--------------------------------------------------------- -// Subcategory::unlink -// unlink the presets, so don't delete them when delete -//--------------------------------------------------------- -void Subcategory::unlink() { - while(!_presetVector.empty()) _presetVector.erase(_presetVector.begin()); -} - -//--------------------------------------------------------- -// findSubcategory -// take hbank and lbank and return the subcategory corresponding, -// NULL if doesn't exist -//--------------------------------------------------------- -Subcategory* Set::findSubcategory(int hbank, int lbank) { - Category* c = findCategory(hbank); - Subcategory* s; - if(c) { - s = c->findSubcategory(lbank); - return s; - } - else return NULL; -} - -//--------------------------------------------------------- -// findCategory -// takes hbank a category and return the first category, -// NULL if doesn't exist -//--------------------------------------------------------- -Category* Set::findCategory(int hbank) { - std::vector::iterator cvi; - for(cvi=_categoryVector.begin(); cvi!=_categoryVector.end(); cvi++) - if((*cvi)->_hbank==hbank) return(*cvi); - return(NULL); -} -//--------------------------------------------------------- -// findSubcategory -// takes lbank a subcategory and return the subcategory -// NULL if doesn't exist -//--------------------------------------------------------- -Subcategory* Category::findSubcategory(int lbank) { - std::vector::iterator svi; - for(svi=_subcategoryVector.begin(); svi!=_subcategoryVector.end(); svi++) - if((*svi)->_lbank==lbank) return(*svi); - return(NULL); -} -//-------------------------------------------------------------- -// Subcategory::merge -//-------------------------------------------------------------- -void Subcategory::merge(Preset* p) { - if(isFreeProg(p->prog)) p->linkSubcategory(this); - else { - Preset* pFromSub=findPreset(p->prog); - pFromSub->merge(p); - } -} - -//--------------------------------------------------------- -// readSet -//--------------------------------------------------------- -void Set::readSet(QDomNode setNode) { - while(!setNode.isNull()) { - QDomElement setEl = setNode.toElement(); - if (setEl.isNull()) - continue; - if (setEl.tagName() == "setName") - _setName=setEl.text().ascii(); - if (setEl.tagName() == "deicsOnzeCategory") { - //load category - QString version = setEl.attribute(QString("version")); - if (version == "1.0") { - Category* lCategory = new Category(); - lCategory->readCategory(setNode.firstChild()); - //printf("Ready to merge!\n"); - merge(lCategory); - } - } - setNode = setNode.nextSibling(); - } -} - -//--------------------------------------------------------- -// writeSet -//--------------------------------------------------------- -void Set::writeSet(Xml* xml, bool onlyUsed) { - xml->tag(0, "deicsOnzeSet version=\"1.0\""); - xml->strTag(SET_LEVEL, "setName", _setName.c_str()); - for(std::vector::iterator i = _categoryVector.begin(); - i != _categoryVector.end(); i++) (*i)->writeCategory(xml, onlyUsed); - xml->etag(0, "deicsOnzeSet"); -} - -//--------------------------------------------------------- -// readCategory -//--------------------------------------------------------- -void Category::readCategory(QDomNode catNode) { - while(!catNode.isNull()) { - QDomElement catEl = catNode.toElement(); - if (catEl.isNull()) - continue; - if (catEl.tagName() == "categoryName") - _categoryName=catEl.text().ascii(); - if (catEl.tagName() == "hbank") - _hbank=catEl.text().toInt(); - if (catEl.tagName() == "deicsOnzeSubcategory") { - //load Subcategory - QString version = catEl.attribute(QString("version")); - if (version == "1.0") { - Subcategory* lSubcategory = new Subcategory(this); - lSubcategory->readSubcategory(catNode.firstChild()); - } - } - catNode = catNode.nextSibling(); - } -} - -//--------------------------------------------------------- -// writeCategory -//--------------------------------------------------------- -void Category::writeCategory(Xml* xml, bool onlyUsed) { - if((!onlyUsed || _isUsed)) { - xml->tag(SET_LEVEL, "deicsOnzeCategory version=\"1.0\""); - xml->strTag(CAT_LEVEL, "categoryName", _categoryName.c_str()); - xml->intTag(CAT_LEVEL, "hbank", _hbank); - for(std::vector::iterator i=_subcategoryVector.begin(); - i!=_subcategoryVector.end(); i++) - (*i)->writeSubcategory(xml, onlyUsed); - xml->etag(SET_LEVEL, "deicsOnzeCategory"); - } -} - -//--------------------------------------------------------- -// readSubcategory -//--------------------------------------------------------- -void Subcategory::readSubcategory(QDomNode subNode) { - while(!subNode.isNull()) { - QDomElement subEl = subNode.toElement(); - if (subEl.isNull()) - continue; - if (subEl.tagName() == "subcategoryName") - _subcategoryName=subEl.text().ascii(); - if (subEl.tagName() == "lbank") - _lbank=subEl.text().toInt(); - if (subEl.tagName() == "deicsOnzePreset") { - //load preset - QString version = subEl.attribute(QString("version")); - if (version == "1.0") { - Preset* lPreset = new Preset(this); - lPreset->readPreset(subNode.firstChild()); - } - } - subNode = subNode.nextSibling(); - } -} - -//--------------------------------------------------------- -// writeSubcategory -//--------------------------------------------------------- -void Subcategory::writeSubcategory(Xml* xml, bool onlyUsed) { - if((!onlyUsed || _isUsed)) { - xml->tag(CAT_LEVEL, "deicsOnzeSubcategory version=\"1.0\""); - xml->strTag(SUB_LEVEL, "subcategoryName", _subcategoryName.c_str()); - xml->intTag(SUB_LEVEL, "lbank", _lbank); - for(std::vector::iterator i=_presetVector.begin(); - i!=_presetVector.end(); i++) (*i)->writePreset(xml, onlyUsed); - xml->etag(CAT_LEVEL, "deicsOnzeSubcategory"); - } -} - -//--------------------------------------------------------- -// readPreset -//--------------------------------------------------------- -void Preset::readPreset(QDomNode presetNode) { - while(!presetNode.isNull()) { - QDomElement presetEl = presetNode.toElement(); - if (presetEl.isNull()) - continue; - //algorithm - if(presetEl.tagName()==ALGSTR) - algorithm=(presetEl.text()=="FIRST"? FIRST: - (presetEl.text()=="SECOND"? SECOND: - (presetEl.text()=="THIRD"? THIRD: - (presetEl.text()=="FOURTH"? FOURTH: - (presetEl.text()=="FIFTH"? FIFTH: - (presetEl.text()=="SIXTH"? SIXTH: - (presetEl.text()=="SEVENTH"? SEVENTH:EIGHTH))))))); - //feedback - else if(presetEl.tagName()==FEEDBACKSTR) - feedback=presetEl.text().toInt(); - //quick edit - //else if(presetEl.tagName()==FINEBRIGHTNESSSTR) - // brightness=presetEl.text().toInt(); - //else if(presetEl.tagName()==MODULATIONSTR) - // modulation=(unsigned char)presetEl.text().toInt(); - //else if(presetEl.tagName()==GLOBALDETUNESTR) - // globalDetune=presetEl.text().toInt(); - //else if(presetEl.tagName()==ATTACKSTR) - // attack=presetEl.text().toInt(); - //else if(presetEl.tagName()==RELEASESTR) - // release=presetEl.text().toInt(); - //lfo - else if(presetEl.tagName()=="lfo") { - QDomNode lfoNode = presetNode.firstChild(); - while(!lfoNode.isNull()) { - QDomElement lfoEl = lfoNode.toElement(); - if (lfoEl.isNull()) - continue; - if(lfoEl.tagName()==WAVESTR) - lfo.wave=(lfoEl.text()=="SAWUP"? SAWUP: - (lfoEl.text()=="SQUARE"? SQUARE: - (lfoEl.text()=="TRIANGL"? TRIANGL:SHOLD))); - else if(lfoEl.tagName()==SPEEDSTR) - lfo.speed=lfoEl.text().toInt(); - else if(lfoEl.tagName()==DELAYSTR) - lfo.delay=lfoEl.text().toInt(); - else if(lfoEl.tagName()==PMODDEPTHSTR) - lfo.pModDepth=lfoEl.text().toInt(); - else if(lfoEl.tagName()==AMODDEPTHSTR) - lfo.aModDepth=lfoEl.text().toInt(); - else if(lfoEl.tagName()==SYNCSTR) - lfo.sync=(lfoEl.text()=="on"? true:false); - lfoNode = lfoNode.nextSibling(); - } - } - //sensitivity - else if(presetEl.tagName()=="sensitivity") { - QDomNode sensitivityNode = presetNode.firstChild(); - while(!sensitivityNode.isNull()) { - QDomElement sensitivityEl = sensitivityNode.toElement(); - if (sensitivityEl.isNull()) - continue; - QString st=sensitivityEl.tagName(); - if(st==PMODSENSSTR) - sensitivity.pitch=sensitivityEl.text().toInt(); - else if(st==AMSSTR) - sensitivity.amplitude=sensitivityEl.text().toInt(); - else if(st.contains(AMESTR, Qt::CaseSensitive)) { - int op = (st.remove(AMESTR, Qt::CaseSensitive)).toInt()-1; - sensitivity.ampOn[op]=(sensitivityEl.text()=="on"? true:false); - } - else if(st.contains(EBSSTR, Qt::CaseSensitive)) { - int op = (st.remove(EBSSTR, Qt::CaseSensitive)).toInt()-1; - sensitivity.egBias[op]=sensitivityEl.text().toInt(); - } - else if(st.contains(KVSSTR, Qt::CaseSensitive)) { - int op = (st.remove(KVSSTR, Qt::CaseSensitive)).toInt()-1; - sensitivity.keyVelocity[op]=sensitivityEl.text().toInt(); - } - sensitivityNode =sensitivityNode.nextSibling(); - } - } - //frequency - else if(presetEl.tagName()=="frequency") { - QDomNode frequencyNode = presetNode.firstChild(); - while(!frequencyNode.isNull()) { - QDomElement frequencyEl = frequencyNode.toElement(); - if (frequencyEl.isNull()) - continue; - QString ft = frequencyEl.tagName(); - if(ft.contains(RATIOSTR, Qt::CaseSensitive)) { - int op = (ft.remove(RATIOSTR, Qt::CaseSensitive)).toInt()-1; - frequency[op].ratio=frequencyEl.text().toDouble(); - } - else if(ft.contains(FIXSTR, Qt::CaseSensitive)) { - int op = (ft.remove(FIXSTR, Qt::CaseSensitive)).toInt()-1; - frequency[op].isFix=(frequencyEl.text()=="yes"?true:false); - } - else if(ft.contains(FIXRANGESTR, Qt::CaseSensitive)) { - int op= (ft.remove(FIXRANGESTR, Qt::CaseSensitive)).toInt()-1; - frequency[op].freq=frequencyEl.text().toDouble(); - } - frequencyNode =frequencyNode.nextSibling(); - } - } - //oscWave - else if(presetEl.tagName().contains(OSWSTR, Qt::CaseSensitive)) { - int op=(presetEl.tagName().remove(OSWSTR, Qt::CaseSensitive)).toInt()-1; - oscWave[op]=(presetEl.text()=="W1"? W1: - (presetEl.text()=="W2"?W2: - (presetEl.text()=="W3"?W3: - (presetEl.text()=="W4"?W4: - (presetEl.text()=="W5"?W5: - (presetEl.text()=="W6"?W6: - (presetEl.text()=="W7"?W7:W8))))))); - - } - //detune - else if(presetEl.tagName().contains(DETSTR, Qt::CaseSensitive)) { - int op=(presetEl.tagName().remove(DETSTR, Qt::CaseSensitive)).toInt()-1; - detune[op]=presetEl.text().toInt(); - } - //eg - else if(presetEl.tagName()=="eg") { - QDomNode egNode = presetNode.firstChild(); - while(!egNode.isNull()) { - QDomElement egEl = egNode.toElement(); - if (egEl.isNull()) - continue; - QString et=egEl.tagName(); - if(et.contains(ARSTR, Qt::CaseSensitive)) { - int op=(et.remove(ARSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].ar=egEl.text().toInt(); - } - else if(et.contains(D1RSTR, Qt::CaseSensitive)) { - int op=(et.remove(D1RSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].d1r=egEl.text().toInt(); - } - else if(et.contains(D1LSTR, Qt::CaseSensitive)) { - int op = (et.remove(D1LSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].d1l=egEl.text().toInt(); - } - else if(et.contains(D2RSTR, Qt::CaseSensitive)) { - int op=(et.remove(D2RSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].d2r=egEl.text().toInt(); - } - else if(et.contains(RRSTR, Qt::CaseSensitive)) { - int op=(et.remove(RRSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].rr=egEl.text().toInt(); - } - else if(et.contains(SHFTSTR, Qt::CaseSensitive)) { - int op=(et.remove(SHFTSTR, Qt::CaseSensitive)).toInt()-1; - eg[op].egShift=(egEl.text()=="VOF"?VOF: - (egEl.text()=="V48"?V48: - (egEl.text()=="V24"?V24:V12))); - } - egNode =egNode.nextSibling(); - } - } - //pitchEg - else if(presetEl.tagName()=="pitchEg") { - QDomNode pitchEgNode = presetNode.firstChild(); - while(!pitchEgNode.isNull()) { - QDomElement pitchEgEl = pitchEgNode.toElement(); - if (pitchEgEl.isNull()) - continue; - QString pt=pitchEgEl.tagName(); - if(pt==PR1STR) pitchEg.pr1=pitchEgEl.text().toInt(); - else if(pt==PR2STR) pitchEg.pr2=pitchEgEl.text().toInt(); - else if(pt==PR3STR) pitchEg.pr3=pitchEgEl.text().toInt(); - else if(pt==PL1STR) pitchEg.pl1=pitchEgEl.text().toInt(); - else if(pt==PL2STR) pitchEg.pl2=pitchEgEl.text().toInt(); - else if(pt==PL3STR) pitchEg.pl3=pitchEgEl.text().toInt(); - pitchEgNode=pitchEgNode.nextSibling(); - } - } - //outLevel - else if(presetEl.tagName().contains(OUTSTR, Qt::CaseSensitive)) { - int op=(presetEl.tagName().remove(OUTSTR, Qt::CaseSensitive)).toInt()-1; - outLevel[op]=presetEl.text().toInt(); - } - //scaling - else if(presetEl.tagName()=="scaling") { - QDomNode scalingNode = presetNode.firstChild(); - while(!scalingNode.isNull()) { - QDomElement scalingEl = scalingNode.toElement(); - if (scalingEl.isNull()) - continue; - QString st=scalingEl.tagName(); - if(st.contains(RSSTR, Qt::CaseSensitive)) { - int op=(st.remove(RSSTR, Qt::CaseSensitive)).toInt()-1; - scaling.rate[op]=scalingEl.text().toInt(); - } - else if(st.contains(LSSTR, Qt::CaseSensitive)) { - int op=(st.remove(LSSTR, Qt::CaseSensitive)).toInt()-1; - scaling.level[op]=scalingEl.text().toInt(); - } - scalingNode =scalingNode.nextSibling(); - } - } - //function - else if(presetEl.tagName()=="function") { - QDomNode functionNode = presetNode.firstChild(); - while(!functionNode.isNull()) { - QDomElement functionEl = functionNode.toElement(); - if (functionEl.isNull()) - continue; - QString ft=functionEl.tagName(); - if(ft==TRANSPOSESTR) - function.transpose=functionEl.text().toInt(); - else if(ft==POLYMODESTR) - function.mode=(functionEl.text()=="POLY"?POLY:MONO); - else if(ft==PBENDRANGESTR) - function.pBendRange=functionEl.text().toInt(); - else if(ft==PORTAMODESTR) - function.portamento= - functionEl.text()=="FINGER"?FINGER:FULL; - else if(ft==PORTATIMESTR) - function.portamentoTime=functionEl.text().toInt(); - else if(ft==FSWSTR) - function.footSw=(functionEl.text()=="POR"?POR:SUS); - else if(ft==FCVOLUMESTR) - function.fcVolume=functionEl.text().toInt(); - else if(ft==FCPITCHSTR) - function.fcPitch=functionEl.text().toInt(); - else if(ft==FCAMPLITUDESTR) - function.fcAmplitude=functionEl.text().toInt(); - else if(ft==MWPITCHSTR) - function.mwPitch=functionEl.text().toInt(); - else if(ft==MWAMPLITUDESTR) - function.mwAmplitude=functionEl.text().toInt(); - else if(ft==BCPITCHSTR) - function.bcPitch=functionEl.text().toInt(); - else if(ft==BCAMPLITUDESTR) - function.bcAmplitude=functionEl.text().toInt(); - else if(ft==BCPITCHBIASSTR) - function.bcPitchBias=functionEl.text().toInt(); - else if(ft==BCEGBIASSTR) - function.bcEgBias=functionEl.text().toInt(); - else if(ft==ATPITCHSTR) - function.atPitch=functionEl.text().toInt(); - else if(ft==ATAMPLITUDESTR) - function.atAmplitude=functionEl.text().toInt(); - else if(ft==ATPITCHBIASSTR) - function.atPitchBias=functionEl.text().toInt(); - else if(ft==ATEGBIASSTR) - function.atEgBias=functionEl.text().toInt(); - else if(ft==REVERBRATESTR) - function.reverbRate=functionEl.text().toInt(); - functionNode=functionNode.nextSibling(); - } - } - //globalDetune - //else if(presetEl.tagName()=="globalDetune") - // globalDetune=presetEl.text().toInt(); - //Names - else if(presetEl.tagName()=="name") - name=presetEl.text().ascii(); - //prog - else if(presetEl.tagName()=="prog") - prog=presetEl.text().toInt(); - presetNode = presetNode.nextSibling(); - } -} - -//--------------------------------------------------------- -// witePreset -//--------------------------------------------------------- -void Preset::writePreset(Xml* xml, bool onlyUsed) { - char s[MAXCHARTAG]; - if((!onlyUsed || _isUsed)) { - xml->tag(SUB_LEVEL, "deicsOnzePreset version=\"1.0\""); - - //algorithm - xml->strTag(PRE_LEVEL, ALGSTR, (algorithm==FIRST? "FIRST": - (algorithm==SECOND? "SECOND": - (algorithm==THIRD? "THIRD": - (algorithm==FOURTH? "FOURTH": - (algorithm==FIFTH? "FIFTH": - (algorithm==SIXTH? "SIXTH": - (algorithm==SEVENTH? "SEVENTH": - "EIGHTH")))))))); - //feedback - xml->uintTag(PRE_LEVEL, FEEDBACKSTR, feedback); - //quick edit - //xml->tag(FINEBRIGHTNESSSTR, brightness); - //xml->tag(MODULATIONSTR, (int)modulation); - //xml->tag(GLOBALDETUNESTR, globalDetune); - //xml->tag(ATTACKSTR, attack); - //xml->tag(RELEASESTR, release); - //lfo - xml->tag(PRE_LEVEL, "lfo"); - xml->strTag(PRE_LEVEL + 1, WAVESTR, - (lfo.wave==SAWUP? "SAWUP": - (lfo.wave==SQUARE? "SQUARE": - (lfo.wave==TRIANGL? "TRIANGL":"SHOLD")))); - xml->uintTag(PRE_LEVEL + 1, SPEEDSTR, lfo.speed); - xml->uintTag(PRE_LEVEL + 1, DELAYSTR, lfo.delay); - xml->uintTag(PRE_LEVEL + 1, PMODDEPTHSTR, lfo.pModDepth); - xml->uintTag(PRE_LEVEL + 1, AMODDEPTHSTR, lfo.aModDepth); - xml->strTag(PRE_LEVEL + 1, SYNCSTR, (lfo.sync==true? "on":"off")); - xml->etag(PRE_LEVEL, "lfo"); - //sensitivity - xml->tag(PRE_LEVEL, "sensitivity"); - xml->uintTag(PRE_LEVEL + 1, PMODSENSSTR, sensitivity.pitch); - xml->uintTag(PRE_LEVEL + 1, AMSSTR, sensitivity.amplitude); - for(int i=0; istrTag(PRE_LEVEL + 1, s, - (sensitivity.ampOn[i]==true? "on":"off")); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, sensitivity.egBias[i]); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, sensitivity.keyVelocity[i]); - } - xml->etag(PRE_LEVEL, "sensitivity"); - //frequency - xml->tag(PRE_LEVEL, "frequency"); - for(int i=0; idoubleTag(PRE_LEVEL + 1, s, frequency[i].ratio); - } - for(int i=0; istrTag(PRE_LEVEL + 1, s, (frequency[i].isFix==true? "yes":"no")); - } - for(int i=0; idoubleTag(PRE_LEVEL + 1, s, frequency[i].freq); - } - xml->etag(PRE_LEVEL, "frequency"); - //oscWave - for(int i=0; istrTag(PRE_LEVEL, s, (oscWave[i]==W1?"W1": - (oscWave[i]==W2?"W2": - (oscWave[i]==W3?"W3": - (oscWave[i]==W4?"W4": - (oscWave[i]==W5?"W5": - (oscWave[i]==W6?"W6": - (oscWave[i]==W7?"W7":"W8")))))))); - } - //detune - for(int i=0; iintTag(PRE_LEVEL, s, detune[i]); - } - //eg - xml->tag(PRE_LEVEL, "eg"); - for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].ar); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d1r); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d1l); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].d2r); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, eg[i].rr); - } - for(int i=0; istrTag(PRE_LEVEL + 1, s, (eg[i].egShift==VOF?"VOF": - (eg[i].egShift==V48?"V48": - (eg[i].egShift==V24?"V24":"V12")))); - } - xml->etag(PRE_LEVEL, "eg"); - //pitchEg - xml->tag(PRE_LEVEL, "pitchEg"); - xml->uintTag(PRE_LEVEL + 1, PR1STR,pitchEg.pr1); - xml->uintTag(PRE_LEVEL + 1, PR2STR,pitchEg.pr2); - xml->uintTag(PRE_LEVEL + 1, PR3STR,pitchEg.pr3); - xml->uintTag(PRE_LEVEL + 1, PL1STR,pitchEg.pl1); - xml->uintTag(PRE_LEVEL + 1, PL2STR,pitchEg.pl2); - xml->uintTag(PRE_LEVEL + 1, PL3STR,pitchEg.pl3); - xml->etag(PRE_LEVEL, "pitchEg"); - //outLevel - for(int i=0; iuintTag(PRE_LEVEL, s, outLevel[i]); - } - //scaling - xml->tag(PRE_LEVEL, "scaling"); - for(int i=0; iuintTag(PRE_LEVEL + 1, s, scaling.rate[i]); - } - for(int i=0; iuintTag(PRE_LEVEL + 1, s, scaling.level[i]); - } - xml->etag(PRE_LEVEL, "scaling"); - //function - xml->tag(PRE_LEVEL, "function"); - xml->intTag(PRE_LEVEL + 1, TRANSPOSESTR, function.transpose); - xml->strTag(PRE_LEVEL + 1, POLYMODESTR, - (function.mode==POLY? "POLY":"MONO")); - xml->uintTag(PRE_LEVEL + 1, PBENDRANGESTR, function.pBendRange); - xml->strTag(PRE_LEVEL + 1, PORTAMODESTR, - (function.portamento==FINGER? "FINGER":"FULL")); - xml->uintTag(PRE_LEVEL + 1, PORTATIMESTR, function.portamentoTime); - xml->strTag(PRE_LEVEL + 1, FSWSTR, (function.footSw==POR? "POR":"SUS")); - xml->uintTag(PRE_LEVEL + 1, FCVOLUMESTR, function.fcVolume); - xml->uintTag(PRE_LEVEL + 1, FCPITCHSTR, function.fcPitch); - xml->uintTag(PRE_LEVEL + 1, FCAMPLITUDESTR, function.fcAmplitude); - xml->uintTag(PRE_LEVEL + 1, MWPITCHSTR, function.mwPitch); - xml->uintTag(PRE_LEVEL + 1, MWAMPLITUDESTR, function.mwAmplitude); - xml->uintTag(PRE_LEVEL + 1, BCPITCHSTR, function.bcPitch); - xml->uintTag(PRE_LEVEL + 1, BCAMPLITUDESTR, function.bcAmplitude); - xml->intTag(PRE_LEVEL + 1, BCPITCHBIASSTR, function.bcPitchBias); - xml->uintTag(PRE_LEVEL + 1, BCEGBIASSTR, function.bcEgBias); - xml->uintTag(PRE_LEVEL + 1, ATPITCHSTR, function.atPitch); - xml->uintTag(PRE_LEVEL + 1, ATAMPLITUDESTR, function.atAmplitude); - xml->intTag(PRE_LEVEL + 1, ATPITCHBIASSTR, function.atPitchBias); - xml->uintTag(PRE_LEVEL + 1, ATEGBIASSTR, function.atEgBias); - xml->intTag(PRE_LEVEL + 1, REVERBRATESTR, function.reverbRate); - xml->etag(PRE_LEVEL, "function"); - //globalDetune - //xml->tag("globalDetune", globalDetune); - //preset name - xml->strTag(PRE_LEVEL, "name", name.c_str()); - //bank prog - xml->intTag(PRE_LEVEL, "prog", prog); - - xml->etag(SUB_LEVEL, "deicsOnzePreset"); - } -} - -//--------------------------------------------------------- -// printPreset -//--------------------------------------------------------- - -void Preset::printPreset() -{ - printf("\n"); - printf("Algorithm : %d, Feedback : %d\n", algorithm, feedback); - printf("LFO : "); - switch(lfo.wave) - { - case(SAWUP) : printf("SAWUP ,"); break; - case(SQUARE) : printf("SQUARE ,"); break; - case(TRIANGL) : printf("TRIANGL ,"); break; - case(SHOLD) : printf("SHOLD ,"); break; - default : printf("No defined, "); break; - } - printf("Speed : %d, Delay : %d, PModD : %d, AModD : %d, ", - lfo.speed, lfo.delay, lfo.pModDepth, lfo.aModDepth); - if(lfo.sync) printf("Sync\n"); else printf("Not Sync\n"); - printf("LFO Pitch Sensitivity : %d, LFO Amplitude Sensitivity : %d\n", - sensitivity.pitch, sensitivity.amplitude); - for(int i=0; i::iterator i=_presetVector.begin(); - i!=_presetVector.end(); i++) (*i)->printPreset(); -} - -void Category::printCategory() { - std::cout << " " << _categoryName << "\n"; - for(unsigned int i=0; i<_subcategoryVector.size(); i++) - _subcategoryVector[i]->printSubcategory(); -} - -void Set::printSet() { - std::cout << _setName << "\n"; - for(unsigned int i=0; i<_categoryVector.size(); i++) - _categoryVector[i]->printCategory(); -} diff --git a/muse2/synti/deicsonze2/deicsonzepreset.h b/muse2/synti/deicsonze2/deicsonzepreset.h deleted file mode 100644 index 3c005c8d..00000000 --- a/muse2/synti/deicsonze2/deicsonzepreset.h +++ /dev/null @@ -1,567 +0,0 @@ -//=========================================================================== -// -// DeicsOnze an emulator of the YAMAHA DX11 synthesizer -// -// Version 0.5.5 -// -// deicsonzepreset.h -// -// -// Copyright (c) 2004-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 __DEICSONZEPRESET_H -#define __DEICSONZEPRESET_H - -#include -#include - -#include - -#include "muse/xml.h" - -#define NBROP 4 //do not change -#define MAXCHARTAG 64 - -#define PROG_NBR 128 -#define LBANK_NBR 128 -#define HBANK_NBR 128 - -//--------------------------------------------------------- -// define strings of the parameter names for load save and ctrl interface -// number of ctrl -// following the internal DX11 organization (c.f T81Z manual) -//--------------------------------------------------------- -#define CTRLOFFSET 0x100 -#define DECAPAR1 13 -#define ARSTR "AR" -#define ARLONGSTR "AttackRate" -#define CTRL_AR 0+CTRLOFFSET -#define MAXAR 31 -#define D1RSTR "D1R" -#define D1RLONGSTR "Decay1Rate" -#define CTRL_D1R 1+CTRLOFFSET -#define MAXD1R 31 -#define D2RSTR "D2R" -#define D2RLONGSTR "Decay2Rate" -#define CTRL_D2R 2+CTRLOFFSET -#define MAXD2R 31 -#define RRSTR "RR" -#define RRLONGSTR "ReleaseRate" -#define CTRL_RR 3+CTRLOFFSET -#define MAXRR 15 -#define D1LSTR "D1L" -#define D1LLONGSTR "Decay1Level" -#define CTRL_D1L 4+CTRLOFFSET -#define MAXD1L 15 -#define LSSTR "LS" -#define LSLONGSTR "LevelScaling" -#define CTRL_LS 5+CTRLOFFSET -#define MAXLS 99 -#define RSSTR "RS" -#define RSLONGSTR "RateScaling" -#define CTRL_RS 6+CTRLOFFSET -#define MAXRS 3 -#define EBSSTR "EBS" -#define EBSLONGSTR "EGBiasSensitivity" -#define CTRL_EBS 7+CTRLOFFSET -#define MAXEBS 7 -#define AMESTR "AME" -#define AMELONGSTR "AmplitudeModulationEnable" -#define CTRL_AME 8+CTRLOFFSET -#define KVSSTR "KVS" -#define KVSLONGSTR "KeyVelocitySensitivity" -#define CTRL_KVS 9+CTRLOFFSET -#define MAXKVS 7 -#define OUTSTR "OUT" -#define OUTLONGSTR "OperatorOutputLevel" -#define CTRL_OUT 10+CTRLOFFSET -#define MAXOUT 99 -#define RATIOSTR "Ratio" -#define RATIOLONGSTR "Ratio" -#define CTRL_RATIO 11+CTRLOFFSET -#define MAXRATIO 64 -#define DETSTR "DET" -#define DETLONGSTR "Detune" -#define CTRL_DET 12+CTRLOFFSET -#define MAXDET 3 -#define ALGSTR "ALG" -#define ALGLONGSTR "Algorithm" -#define CTRL_ALG 52+CTRLOFFSET -#define MAXALG 7 -#define FEEDBACKSTR "Feedback" -#define CTRL_FEEDBACK 53+CTRLOFFSET -#define MAXFEEDBACK 7 -#define SPEEDSTR "Speed" -#define SPEEDLONGSTR "LFOSpeed" -#define CTRL_SPEED 54+CTRLOFFSET -#define MAXSPEED 99 -#define DELAYSTR "Delay" //TODO LFOD -#define DELAYLONGSTR "LFODelay" -#define CTRL_DELAY 55+CTRLOFFSET -#define MAXDELAY 99 -#define PMODDEPTHSTR "PModDepth" -#define PMODDEPTHLONGSTR "PitchModulationDepth" -#define CTRL_PMODDEPTH 56+CTRLOFFSET -#define MAXPMODDEPTH 99 -#define AMODDEPTHSTR "AModDepth" -#define AMODDEPTHLONGSTR "AmplitudeModulationDepth" -#define CTRL_AMODDEPTH 57+CTRLOFFSET -#define MAXAMODDEPTH 99 -#define SYNCSTR "Sync" -#define SYNCLONGSTR "LFOSync" -#define CTRL_SYNC 58+CTRLOFFSET -#define WAVESTR "Wave" -#define WAVELONGSTR "LFOWave" -#define CTRL_WAVE 59+CTRLOFFSET -#define MAXWAVE 3 -#define PMODSENSSTR "PModSens" -#define PMODSENSLONGSTR "PitchModulationSensitivity" -#define CTRL_PMODSENS 60+CTRLOFFSET -#define MAXPMODSENS 7 -#define AMSSTR "AMS" -#define AMSLONGSTR "AmplitudeModulationSensitivity" -#define CTRL_AMS 61+CTRLOFFSET -#define MAXAMS 3 -#define TRANSPOSESTR "Transpose" -#define CTRL_TRANSPOSE 62+CTRLOFFSET -#define MAXTRANSPOSE 24 -#define POLYMODESTR "PolyMode" -#define CTRL_POLYMODE 63+CTRLOFFSET -#define PBENDRANGESTR "PBendRange" -#define PBENDRANGELONGSTR "PitchBendRange" -#define CTRL_PBENDRANGE 64+CTRLOFFSET -#define MAXPBENDRANGE 12 -#define PORTAMODESTR "PortaMode" -#define PORTAMODELONGSTR "PortamentoMode" -#define CTRL_PORTAMODE 65+CTRLOFFSET -#define PORTATIMESTR "PortaTime" -#define PORTATIMELONGSTR "PortamentoTime" -#define CTRL_PORTATIME 66+CTRLOFFSET -#define MAXPROTATIME 99 -#define FCVOLUMESTR "FCVolume" -#define FCVOLUMELONGSTR "FootControllerVolume" -#define CTRL_FCVOLUME 67+CTRLOFFSET -#define MAXFCVOLUME 99 -#define FSWSTR "FSW" -#define FSWLONGSTR "FootSwitch" -#define CTRL_FSW 68+CTRLOFFSET -#define MAXFSW 99 -#define MWPITCHSTR "MWPitch" -#define MWPITCHLONGSTR "ModulationWheelPitch" -#define CTRL_MWPITCH 71+CTRLOFFSET -#define MAXMWPITCH 99 -#define MWAMPLITUDESTR "MWAmplitude" -#define MWAMPLITUDELONGSTR "ModulationWheelAmplitude" -#define CTRL_MWAMPLITUDE 72+CTRLOFFSET -#define MAXMWAMPLITUDE 99 -#define BCPITCHSTR "BCPitch" -#define BCPITCHLONGSTR "BreathControlPitch" -#define CTRL_BCPITCH 73+CTRLOFFSET -#define MAXBCPITCH 99 -#define BCAMPLITUDESTR "BCAmplitude" -#define BCAMPLITUDELONGSTR "BreathControlAmplitude" -#define CTRL_BCAMPLITUDE 74+CTRLOFFSET -#define MAXBCAMPLITUDE 99 -#define BCPITCHBIASSTR "BCPitchBias" -#define BCPITCHBIASLONGSTR "BreathControlPitchBias" -#define CTRL_BCPITCHBIAS 75+CTRLOFFSET -#define MAXBCPITCHBIAS 50 -#define BCEGBIASSTR "BCEGBias" -#define BCEGBIASLONGSTR "BreathControlEGBias" -#define CTRL_BCEGBIAS 76+CTRLOFFSET -#define MAXBCEGBIAS 99 -#define MIDATTACK 64 -#define ATPITCHSTR "ATPitch" -#define ATPITCHLONGSTR "AfterTouchPitch" -#define CTRL_ATPITCH 77+CTRLOFFSET -#define MAXATPITCH 99 -#define ATAMPLITUDESTR "ATAmplitude" -#define ATAMPLITUDELONGSTR "AfterTouchAmplitude" -#define CTRL_ATAMPLITUDE 78+CTRLOFFSET -#define MAXATAMPLITUDE 99 -#define ATPITCHBIASSTR "ATPitchBias" -#define ATPITCHBIASLONGSTR "AfterTouchPitchBias" -#define CTRL_ATPITCHBIAS 79+CTRLOFFSET -#define MAXATPITCHBIAS 50 -#define ATEGBIASSTR "ATEGBias" -#define ATEGBIASLONGSTR "AfterTouchEGBias" -#define CTRL_ATEGBIAS 80+CTRLOFFSET -#define MAXATEGBIAS 99 -#define PR1STR "PR1" -#define PR1LONGSTR "PitchRateEG1" -#define CTRL_PR1 81+CTRLOFFSET -#define MAXPR 99 -#define PR2STR "PR2" -#define PR2LONGSTR "PitchRateEG2" -#define CTRL_PR2 82+CTRLOFFSET -#define PR3STR "PR3" -#define PR3LONGSTR "PitchRateEG3" -#define CTRL_PR3 83+CTRLOFFSET -#define PL1STR "PL1" -#define PL1LONGSTR "PitchLevelEG1" -#define CTRL_PL1 84+CTRLOFFSET -#define MAXPL 99 -#define PL2STR "PL2" -#define PL2LONGSTR "PitchLevelEG2" -#define CTRL_PL2 85+CTRLOFFSET -#define PL3STR "PL3" -#define PL3LONGSTR "PitchLevelEG3" -#define CTRL_PL3 86+CTRLOFFSET -#define DECAPAR2 5 -#define FIXSTR "FIX" -#define FIXLONGSTR "FixedFrequency" -#define CTRL_FIX 100+CTRLOFFSET -#define FIXRANGESTR "FixRange" -#define FIXRANGELONGSTR "FixedFrequencyRange" -#define CTRL_FIXRANGE 101+CTRLOFFSET -#define MAXFIXRANGE 255 -#define OSWSTR "OSW" -#define OSWLONGSTR "OperatorWaveform" -#define CTRL_OSW 103+CTRLOFFSET -#define MAXOSW 7 -#define SHFTSTR "SHFT" -#define SHFTLONGSTR "EGShift" -#define CTRL_SHFT 104+CTRLOFFSET -#define MAXSHFT 3 -#define REVERBRATESTR "ReverbRate" -#define CTRL_REVERBRATE 120+CTRLOFFSET -#define MAXREVERBRATE 7 -#define FCPITCHSTR "FCPitch" -#define FCPITCHLONGSTR "FootControllerPitch" -#define CTRL_FCPITCH 121+CTRLOFFSET -#define MAXFCPITCH 99 -#define FCAMPLITUDESTR "FCAmplitude" -#define FCAMPLITUDELONGSTR "FootControllerAmplitude" -#define CTRL_FCAMPLITUDE 122+CTRLOFFSET -#define MAXFCAMPLITUDE 99 -#define CHANNELPANSTR "ChannelPan" -#define CTRL_CHANNELPAN 123+CTRLOFFSET -#define MAXCHANNELPAN 127 -#define CHANNELDETUNESTR "ChannelDetune" -#define CTRL_CHANNELDETUNE 124+CTRLOFFSET -#define MAXCHANNELDETUNE 63 -#define CHANNELVOLUMESTR "ChannelVolume" -#define CTRL_CHANNELVOLUME 125+CTRLOFFSET -#define MAXCHANNELVOLUME 255 -#define FINEBRIGHTNESSSTR "FineBrightness" -#define CTRL_FINEBRIGHTNESS 126+CTRLOFFSET -#define MAXFINEBRIGHTNESS 4095 -#define MIDFINEBRIGHTNESS (MAXFINEBRIGHTNESS+1)/2 -#define BRIGHTNESSSTR "Brightness" -#define MAXBRIGHTNESS 127 -#define MIDBRIGHTNESS 64 -#define MAXMODULATION 127 -#define MODULATIONSTR "Modulation" -#define ATTACKSTR "Attack" -#define MAXATTACK 127 -#define MIDATTACK 64 -#define RELEASESTR "Attack" -#define MAXRELEASE 127 -#define MIDRELEASE 64 -#define NBRVOICESSTR "NumberOfVoices" -#define MINNBRVOICES 1 -#define CTRL_NBRVOICES 127+CTRLOFFSET -#define CHANNELENABLESTR "ChannelEnable" -#define MAXCHANNELENABLE 1 -#define MINCHANNELENABLE 0 -#define CTRL_CHANNELENABLE 128+CTRLOFFSET - -class Preset; -class Subcategory; -class Category; -class Set; - -//--------------------------------------------------------- -// Algorithm -//--------------------------------------------------------- - -enum Algorithm { - FIRST, // Op 0 modulated by Op 1 modulated by Op 2 modulated by Op3 - SECOND, // Op 0 modulated by Op 1 modulated by both Op 2 and Op 3 - THIRD, // Op 0 modulated by both Op 3 and Op 1 modulated by Op 2 - FOURTH, // Op 0 modulated by both Op 1 and Op 2 modulated by Op 3 - FIFTH, // (Op 0 modulated by Op 1) add to (Op 2 modulated by Op 3) - SIXTH, // addition of the three Op 0, 1, 2 all modulated by Op 3 - SEVENTH, // addition of the three Op 0, 1, 2 with 2 modulated by Op3 - EIGHTH // addition of the four Op 0, 1, 2, 3 -}; - -//--------------------------------------------------------- -// Wave of the low frequency modulation -//--------------------------------------------------------- -enum Wave { - SAWUP, - SQUARE, - TRIANGL, - SHOLD -}; - -//--------------------------------------------------------- -// Lfo, low frequency modulation -//--------------------------------------------------------- -struct Lfo { - Wave wave; - unsigned char speed; //0 to 99 - unsigned char delay; //0 to 99 - unsigned char pModDepth; //0 to 99 - unsigned char aModDepth; //0 to 99 - bool sync; -}; - -//--------------------------------------------------------- -// Sensitivity -// of the frequency and amplitude of the lfo -// and the key velocity -//--------------------------------------------------------- -struct Sensitivity { - unsigned char pitch; //0 to 7 - unsigned char amplitude; //0 to 3 - bool ampOn[NBROP]; - unsigned char egBias[NBROP]; //O to 7 - unsigned char keyVelocity[NBROP]; //0 to 7 -}; - -//--------------------------------------------------------- -// Frequency -//--------------------------------------------------------- -struct Frequency { - double ratio; - bool isFix; //if isFix no ratio but frequency - double freq; -}; - -//--------------------------------------------------------- -// OscWave -//--------------------------------------------------------- -enum OscWave { - W1, //sine wave - W2, //sine² relative - W3, //half sine - W4, //half sine² relative - W5, - W6, - W7, - W8 -}; - -enum egShiftValue {VOF, V48, V24, V12}; - -//--------------------------------------------------------- -// Eg -// Envelope -//--------------------------------------------------------- -struct Eg { - unsigned char ar; //0 to 31 speed attack - unsigned char d1r; //0 to 31 speed decay - unsigned char d1l; //0 to 15 level sustain - unsigned char d2r; //0 to 31 speed of sustain - unsigned char rr; //1 to 15 - egShiftValue egShift; -}; - -//--------------------------------------------------------- -// PitchEg -//--------------------------------------------------------- -struct PitchEg { - unsigned char pr1;//0 to 99 - unsigned char pr2;//0 to 99 - unsigned char pr3;//0 to 99 - unsigned char pl1;//0 to 99 - unsigned char pl2;//0 to 99 - unsigned char pl3;//0 to 99 -}; - -//--------------------------------------------------------- -// Scaling -//--------------------------------------------------------- -struct Scaling { - unsigned char rate[NBROP];//0 to 3 - unsigned char level[NBROP];//0 to 99 -}; - -//--------------------------------------------------------- -// Mode -//--------------------------------------------------------- -enum Mode { - POLY, - MONO -}; - -//--------------------------------------------------------- -// Portamento -//--------------------------------------------------------- -enum Portamento { - FINGER, - FULL -}; - -//--------------------------------------------------------- -// FootSw -//--------------------------------------------------------- -enum FootSw { - POR, - SUS -}; -//--------------------------------------------------------- -// Function -//--------------------------------------------------------- -struct Function { - int transpose; - Mode mode; - unsigned char pBendRange;//0 to 12 - Portamento portamento; - unsigned char portamentoTime;//0 to 99 - FootSw footSw; - unsigned char fcVolume;//0 to 99 - unsigned char fcPitch;//0 to 99 - unsigned char fcAmplitude;//0 to 99 - unsigned char mwPitch;//0 to 99 - unsigned char mwAmplitude;//0 to 99 - unsigned char bcPitch;//0 to 99 - unsigned char bcAmplitude;//0 to 99 - signed char bcPitchBias;//-50 to 50 - unsigned char bcEgBias;//0 to 99 - unsigned char atPitch;//0 to 99 - unsigned char atAmplitude;//0 to 99 - signed char atPitchBias;//-50 to 50 - unsigned char atEgBias;//0 to 99 - signed char reverbRate;//O=off, 1 to 7 -}; - -//--------------------------------------------------------- -// Preset class -//--------------------------------------------------------- - -class Preset { - public: - Subcategory* _subcategory; //subcategory parent - bool _isUsed; //false if the preset has never been used or modified, - //in this case the preset is not going to be - //save with the project - //Attributes - Algorithm algorithm; - unsigned char feedback; //0 to 7 - Lfo lfo; - Sensitivity sensitivity; - Frequency frequency[NBROP]; - OscWave oscWave[NBROP]; - signed char detune[NBROP]; //-3 to 3 - Eg eg[NBROP]; - PitchEg pitchEg; - unsigned char outLevel[NBROP]; //0 to 99 - Scaling scaling; - Function function; - //int globalDetune; //-31 to 31 //now to the channel - std::string name; - //unsigned char modulation; //0 to 127 - int prog; //0 to 127 - //Methods - void printPreset(); - void initPreset(); - void readPreset(QDomNode qdn); - void writePreset(Xml* xml, bool onlyUsed); - void linkSubcategory(Subcategory* sub); - void merge(Preset* p); //copy the data of p in the preset - void setIsUsed(bool b); //set flag _isUsed and transmit in the parents - void getHBankLBankProg(int* h, int* l, int* p); //return the hbank, lbank and prog of the preset - //Constructor destructor - Preset(); - Preset(Subcategory* sub); - Preset(Subcategory* sub, int prog); - ~Preset(); -}; - -//--------------------------------------------------------------- -// Bank, organized by a tree of category, subcategory, preset -//--------------------------------------------------------------- -class Subcategory { - public: - Category* _category;//parent category - bool _isUsed; //false if the subcategory has never been used or modified, - //in this case the subcategory is not going to be - //save with the project - std::string _subcategoryName; - int _lbank; //0 to 127 - std::vector _presetVector; - Preset* findPreset(int prog); - void readSubcategory(QDomNode subNode); - void writeSubcategory(Xml* xml, bool onlyUsed); - void printSubcategory(); - void linkCategory(Category* cat); - void unlink(); - bool isFreeProg(int prog); - int firstFreeProg(); - void merge(Preset*); - //Constructor destructor - Subcategory(); - Subcategory(Category* cat); - Subcategory(const std::string name); - Subcategory(Category* cat, const std::string name, int lbank); - ~Subcategory(); -}; - -class Category { - public: - Set* _set;//parent set - bool _isUsed; //false if the category has never been used or modified, - //in this case the category is not going to be - //save with the project - std::string _categoryName; - int _hbank; //0 to 127 - std::vector _subcategoryVector; - Subcategory* findSubcategory(int lbank); - Preset* findPreset(int lbank, int prog); - void readCategory(QDomNode catNode); - void writeCategory(Xml* xml, bool onlyUsed); - void printCategory(); - void linkSet(Set* s); - void unlink(); - bool isFreeLBank(int lbank); - int firstFreeLBank(); //return -1 if no free - void merge(Subcategory*); - //Constructor Destructor - Category(); - Category(Set* s); - Category(Set* s,const std::string name, int hbank); - ~Category(); -}; - -class Set { - public: - std::string _setName; - std::vector _categoryVector; - Preset* findPreset(int hbank, int lbank, int prog); - Subcategory* findSubcategory(int hbank, int lbank); - Category* findCategory(int hbank); - void readSet(QDomNode setNode); - void writeSet(Xml* xml, bool onlyUsed); - void printSet(); - bool isFreeHBank(int hbank); - int firstFreeHBank(); - void merge(Category*); - //Constructor Destructor - Set(const std::string name){_setName=name;} - ~Set() { - while(!_categoryVector.empty()) delete(*_categoryVector.begin()); - } -}; - -#endif /* __DEICSONZE_H */ -- cgit v1.2.3