2017-01-23 10:15:08 +00:00
|
|
|
/*
|
|
|
|
==============================================================================
|
|
|
|
This file is part of Obxd synthesizer.
|
|
|
|
|
2020-07-13 09:19:34 +00:00
|
|
|
Copyright © 2013-2014 Filatov Vadim
|
2017-01-23 10:15:08 +00:00
|
|
|
|
|
|
|
Contact author via email :
|
|
|
|
justdat_@_e1.ru
|
|
|
|
|
|
|
|
This file may be licensed under the terms of of the
|
|
|
|
GNU General Public License Version 2 (the ``GPL'').
|
|
|
|
|
|
|
|
Software distributed under the License is distributed
|
|
|
|
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
|
|
|
|
express or implied. See the GPL for the specific language
|
|
|
|
governing rights and limitations.
|
|
|
|
|
|
|
|
You should have received a copy of the GPL along with this
|
|
|
|
program. If not, go to http://www.gnu.org/licenses/gpl.html
|
|
|
|
or write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
==============================================================================
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "SynthEngine.h"
|
2020-07-13 09:19:34 +00:00
|
|
|
#include "ParamsEnum.h"
|
|
|
|
#include "../JuceLibraryCode/JuceHeader.h"
|
2017-01-23 10:15:08 +00:00
|
|
|
class MidiMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int controllers[255];
|
2020-07-13 09:19:34 +00:00
|
|
|
int controllers_default[255];
|
|
|
|
|
|
|
|
bool loaded = false;
|
2017-01-23 10:15:08 +00:00
|
|
|
MidiMap()
|
|
|
|
{
|
2020-07-13 09:19:34 +00:00
|
|
|
reset();
|
|
|
|
set_default();
|
2017-01-23 10:15:08 +00:00
|
|
|
}
|
2020-07-13 09:19:34 +00:00
|
|
|
void reset(){
|
|
|
|
for(int i = 0 ; i < 255;i++){
|
|
|
|
controllers[i] = 0;
|
|
|
|
controllers_default[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_default(){
|
|
|
|
int midicc = 71;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = VOLUME;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 15;
|
2020-07-13 09:19:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = VOICE_COUNT;
|
|
|
|
|
|
|
|
midicc = 33;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = TUNE;
|
|
|
|
|
|
|
|
midicc = 17;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OCTAVE;
|
|
|
|
|
|
|
|
midicc = 118;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = BENDRANGE;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 34;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = BENDOSC2;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 35;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LEGATOMODE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 36;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = BENDLFORATE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 37;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = VFLTENV;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-15 07:24:24 +00:00
|
|
|
midicc = 20;
|
2020-07-14 06:57:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = VAMPENV;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-15 07:24:24 +00:00
|
|
|
midicc = 21;
|
2020-07-14 06:57:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = ASPLAYEDALLOCATION;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-15 07:24:24 +00:00
|
|
|
midicc = 23;
|
2020-07-14 06:57:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = PORTAMENTO;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 16;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = UNISON;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-15 07:24:24 +00:00
|
|
|
midicc = 24;
|
2020-07-14 06:57:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = UDET;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 43;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2_DET;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 19;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOFREQ;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 44;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOSINWAVE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 45;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOSQUAREWAVE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 46;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOSHWAVE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
|
|
|
midicc = 22;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFO1AMT;
|
|
|
|
|
|
|
|
midicc = 25;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFO2AMT;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 47;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOOSC1;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 48;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOOSC2;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 49;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOFILTER;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 50;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOPW1;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 51;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LFOPW2;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 52;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2HS;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 53;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = XMOD;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 54;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC1P;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 55;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2P;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 56;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSCQuantize;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 57;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC1Saw;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 58;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC1Pul;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 59;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2Saw;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 60;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2Pul;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 61;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PW;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 62;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = BRIGHTNESS;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 63;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = ENVPITCH;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 100;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC1MIX;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 101;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = OSC2MIX;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 102;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = NOISEMIX;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 103;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FLT_KF;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
|
|
|
midicc = 74;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = CUTOFF;
|
|
|
|
|
|
|
|
midicc = 42;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = RESONANCE;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 104;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = MULTIMODE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 18;
|
2020-07-13 09:19:34 +00:00
|
|
|
controllers[midicc] = controllers_default[midicc] = FILTER_WARM;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 105;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = BANDPASS;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 106;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FOURPOLE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 107;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = ENVELOPE_AMT;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
|
|
|
midicc = 73;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LATK;
|
|
|
|
|
|
|
|
midicc = 36;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LDEC;
|
|
|
|
|
|
|
|
midicc = 37;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LSUS;
|
|
|
|
|
|
|
|
midicc = 72;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LREL;
|
|
|
|
|
|
|
|
midicc = 38;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FATK;
|
|
|
|
|
|
|
|
midicc = 39;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FDEC;
|
|
|
|
|
|
|
|
midicc = 40;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FSUS;
|
|
|
|
|
|
|
|
midicc = 41;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FREL;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 108;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = ENVDER;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 109;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FILTERDER;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 110;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PORTADER;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 81;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN1;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 82;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN2;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
|
|
|
midicc = 83;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN3;
|
|
|
|
|
|
|
|
midicc = 84;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN4;
|
|
|
|
|
|
|
|
midicc = 85;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN5;
|
|
|
|
|
|
|
|
midicc = 86;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN6;
|
|
|
|
|
|
|
|
midicc = 87;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN7;
|
|
|
|
|
|
|
|
midicc = 88;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PAN8;
|
|
|
|
|
2020-07-19 09:59:31 +00:00
|
|
|
midicc = 111;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = ECONOMY_MODE;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
//midicc = 112;
|
2020-07-13 09:19:34 +00:00
|
|
|
//controllers[midicc] = controllers_default[midicc] = LFO_SYNC;
|
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 113;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PW_ENV;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 114;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PW_ENV_BOTH;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 115;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = ENV_PITCH_BOTH;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-19 09:59:31 +00:00
|
|
|
midicc = 116;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = FENV_INVERT;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 117;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = PW_OSC2_OFS;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 118;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = LEVEL_DIF;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
2020-07-14 06:57:34 +00:00
|
|
|
midicc = 119;
|
|
|
|
controllers[midicc] = controllers_default[midicc] = SELF_OSC_PUSH;
|
2020-07-13 09:19:34 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int& operator[](int index)
|
|
|
|
{
|
|
|
|
if (index >= 255) {
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
return controllers[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
void setXml( XmlElement &xml){
|
|
|
|
for (int i = 0; i < 255; ++i)
|
|
|
|
{
|
|
|
|
xml.setAttribute("Val_" + String(i), controllers[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void getXml(XmlElement &xml){
|
|
|
|
for (int i = 0; i < 255; ++i)
|
|
|
|
{
|
|
|
|
int tmp = xml.getIntAttribute("Val_" + String(i), controllers_default[i]);
|
|
|
|
if (tmp == 0){
|
|
|
|
tmp = controllers_default[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
controllers[i] = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|