summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/CMakeLists.txt4
-rw-r--r--muse/ChangeLog3
-rw-r--r--muse/muse/arranger/canvas.cpp6
-rw-r--r--muse/muse/synth.cpp29
-rw-r--r--muse/synti/deicsonze/TODO3
-rw-r--r--muse/synti/deicsonze/deicsonze.cpp148
-rw-r--r--muse/synti/deicsonze/deicsonze.h10
-rw-r--r--muse/synti/deicsonze/deicsonzegui.cpp24
-rw-r--r--muse/synti/deicsonze/deicsonzepreset.cpp15
-rw-r--r--muse/synti/deicsonze/deicsonzepreset.h4
-rw-r--r--muse/synti/libsynti/mess.h8
11 files changed, 204 insertions, 50 deletions
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt
index e414d48b..4d50367e 100644
--- a/muse/CMakeLists.txt
+++ b/muse/CMakeLists.txt
@@ -26,8 +26,8 @@ if (NOT CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR "lib")
endif (NOT CMAKE_INSTALL_LIBDIR)
-set(CMAKE_BUILD_TYPE debug)
-# set(CMAKE_BUILD_TYPE release)
+# set(CMAKE_BUILD_TYPE debug)
+set(CMAKE_BUILD_TYPE release)
# for debugging the make system uncomment next line:
# set(CMAKE_VERBOSE_MAKEFILE ON)
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 4505256a..125af619 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,6 @@
+26.12 (ng)
+ - changed MessSynthIF::populatePatchPopup to make is work with banks
+ - added getPatchInfo of DeicsOnze
15.12 (ws)
- make slider.maxValue configurable
- pixel tuning for graphical controller editor
diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp
index 961d5cdb..655607fc 100644
--- a/muse/muse/arranger/canvas.cpp
+++ b/muse/muse/arranger/canvas.cpp
@@ -1116,7 +1116,7 @@ void PartCanvas::drop(QDropEvent* event)
Qt::DropAction da = event->proposedAction();
Qt::KeyboardModifiers kb = event->keyboardModifiers();
if (kb == 0 && (Qt::MoveAction & event->possibleActions()))
- da = Qt::MoveAction;
+ da = Qt::MoveAction;
if ((da == Qt::LinkAction) && (cw == this)) {
delete dstPart->events();
@@ -1124,9 +1124,9 @@ void PartCanvas::drop(QDropEvent* event)
event->setDropAction(Qt::LinkAction);
}
else if (da == Qt::MoveAction)
- event->setDropAction(Qt::MoveAction);
+ event->setDropAction(Qt::MoveAction);
else
- event->setDropAction(Qt::CopyAction);
+ event->setDropAction(Qt::CopyAction);
event->accept();
if (cw || needEndUndo)
song->addPart(dstPart);
diff --git a/muse/muse/synth.cpp b/muse/muse/synth.cpp
index ed56e1a0..e9650209 100644
--- a/muse/muse/synth.cpp
+++ b/muse/muse/synth.cpp
@@ -499,16 +499,31 @@ void MessSynthIF::populatePatchPopup(QMenu* menu, int ch)
}
else {
const MidiPatch* mp = _mess->getPatchInfo(ch, 0);
+ QMenu *hm = NULL, *lm = NULL;
while (mp) {
- int id = ((mp->hbank & 0xff) << 16)
- + ((mp->lbank & 0xff) << 8) + mp->prog;
- QAction* a = menu->addAction(QString(mp->name));
- a->setData(id);
- mp = _mess->getPatchInfo(ch, mp);
- }
- }
+ switch(mp->typ) {
+ case MP_TYPE_HBANK :
+ hm = menu->addMenu(QString(mp->name));
+ break;
+ case MP_TYPE_LBANK :
+ if(hm) lm = hm->addMenu(QString(mp->name));
+ else lm = menu->addMenu(QString(mp->name));
+ break;
+ default :
+ int id = ((mp->hbank & 0xff) << 16)
+ + ((mp->lbank & 0xff) << 8) + mp->prog;
+ QAction* a;
+ if(lm) a = lm->addAction(QString(mp->name));
+ else a = menu->addAction(QString(mp->name));
+ a->setData(id);
+ break;
+ }
+ mp = _mess->getPatchInfo(ch, mp);
+ }
+ }
}
+
//---------------------------------------------------------
// getData
//---------------------------------------------------------
diff --git a/muse/synti/deicsonze/TODO b/muse/synti/deicsonze/TODO
index 53c7e3fa..29e681c2 100644
--- a/muse/synti/deicsonze/TODO
+++ b/muse/synti/deicsonze/TODO
@@ -4,11 +4,10 @@
- analogue reverb
- Change presetName subcategoryName category with SysEx
- Internal restructure, private vs public, add comment, etc
-- getPatchInfo...
- Optimize the code
- Remember the last directory
- Pan per voices
- Load BUMP preset
- calibrate portamento and pitch envelope to fit real DX11
- make deicsonze loadable as standalone by mus
-- add filter
+
diff --git a/muse/synti/deicsonze/deicsonze.cpp b/muse/synti/deicsonze/deicsonze.cpp
index f6a72e0c..a615a1bd 100644
--- a/muse/synti/deicsonze/deicsonze.cpp
+++ b/muse/synti/deicsonze/deicsonze.cpp
@@ -104,7 +104,7 @@ DeicsOnze::DeicsOnze() : Mess(2) {
initCtrls();
initGlobal();
- _numPatch = 0; //what is this? TODO
+ _numPatchProg = 0;
_saveOnlyUsed = true;
_saveConfig = true;
_isInitSet = true; //false if an initial bank must be download
@@ -578,12 +578,17 @@ void DeicsOnze::initVoices(int c) {
}
//--------------------------------------------------------
-// findPreset
+// findPreset findSubcategory findCategory
//--------------------------------------------------------
-Preset* DeicsOnze::findPreset(int hbank, int lbank, int prog) {
- return _set->findPreset(hbank, lbank, prog);
+Preset* DeicsOnze::findPreset(int hbank, int lbank, int prog) const {
+ return _set->findPreset(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
@@ -2782,7 +2787,7 @@ bool DeicsOnze::setController(int channel, int id, int val) {
return false;
}
bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) {
- int k=0;
+ int deiPan, k=0;
if(_global.channel[ch].isEnable || ctrl==CTRL_CHANNELENABLE) {
if(ctrl>=CTRL_AR && ctrl<CTRL_ALG) {
k=(ctrl-CTRLOFFSET)/DECAPAR1;
@@ -3286,11 +3291,11 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) {
break;
case CTRL_PANPOT:
_preset[ch]->setIsUsed(true);
- setChannelPan(ch, (val+MAXCHANNELPAN)/2);
+ deiPan = val*2*MAXCHANNELPAN/127-MAXCHANNELPAN;
+ setChannelPan(ch, deiPan);
applyChannelAmp(ch);
if(!fromGui) {
- MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_CHANNELPAN,
- (val+MAXCHANNELPAN)/2);
+ MidiEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, deiPan);
_gui->writeEvent(ev);
}
break;
@@ -3299,7 +3304,7 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) {
setChannelPan(ch, val);
applyChannelAmp(ch);
if(!fromGui) {
- MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_CHANNELPAN, val);
+ MidiEvent ev(0, ch, ME_CONTROLLER, CTRL_CHANNELPAN, val);
_gui->writeEvent(ev);
}
break;
@@ -3398,19 +3403,121 @@ const char* DeicsOnze::getPatchName(int ch, int val, int) const {
}
//---------------------------------------------------------
-// getPatchInfo
+// getBankName
//---------------------------------------------------------
+const char* DeicsOnze::getBankName(int /*val*/) const {
+ /*QString catstr, substr, retstr;
+ Category* c;
+ Subcategory* s;
+ int hbank = (val & 0xff00) >> 8;
+ int lbank = val & 0x7f;
+ if (hbank > 127) // map "dont care" to 0
+ hbank = 0;
+ if (lbank > 127)
+ lbank = 0;
+ c = _set->findCategory(hbank);
+ if(c) {
+ catstr = QString(c->_categoryName.c_str());
+ s = c->findSubcategory(lbank);
+ if(s) {
+ substr = QString(s->_subcategoryName.c_str());
+ retstr = catstr + QString("->") + substr;
+ return retstr.toAscii().data();
+ }
+ else return NULL;
+ }
+ else*/
+ return NULL;
+}
-const MidiPatch* DeicsOnze::getPatchInfo(int /*ch*/, const MidiPatch* /*p*/) const {
- /*if(_numPatch<NBRBANKPRESETS)
- {
- _patch.typ = 0;
- _patch.name = bankA[_numPatch].name;
- _patch.lbank = 1;
- _patch.prog = _numPatch;
+//---------------------------------------------------------
+// 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;
- }*/
- return 0;
+ }
+ 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 {
+ return getPatchInfo(0, &_patch);
+ }
+ }
}
//---------------------------------------------------------
@@ -3701,6 +3808,7 @@ void DeicsOnze::process(float** buffer, int offset, int n) {
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) {
diff --git a/muse/synti/deicsonze/deicsonze.h b/muse/synti/deicsonze/deicsonze.h
index ef3e671a..48b2c7f6 100644
--- a/muse/synti/deicsonze/deicsonze.h
+++ b/muse/synti/deicsonze/deicsonze.h
@@ -456,13 +456,15 @@ class DeicsOnze : public Mess {
LowFilter* _reverbFilter;
mutable MidiPatch _patch;
- int _numPatch; //what is this? TODO
-
+ mutable int _numPatchProg; //used by getPatchInfo
+
//preset tree
Set* _set;
void setSampleRate(int sr);
- Preset* findPreset(int hbank, int lbank, int prog);
+ 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();
@@ -536,6 +538,8 @@ class DeicsOnze : public Mess {
virtual const char* getPatchName(int ch, int number, int) const;
virtual const MidiPatch* getPatchInfo(int, const MidiPatch *) const;
+ virtual const char* getBankName(int) const;
+
virtual int getControllerInfo(int arg1, const char** arg2,
int* arg3, int* arg4, int* arg5);
virtual void getInitData(int* length, const unsigned char** data);
diff --git a/muse/synti/deicsonze/deicsonzegui.cpp b/muse/synti/deicsonze/deicsonzegui.cpp
index 915e7001..25089b75 100644
--- a/muse/synti/deicsonze/deicsonzegui.cpp
+++ b/muse/synti/deicsonze/deicsonzegui.cpp
@@ -2857,37 +2857,37 @@ void DeicsOnzeGui::setFreq1(int val) {
void DeicsOnzeGui::setFix1(bool f) {
sendController(_currentChannel, CTRL_FIX, (f==false?0:1));}
void DeicsOnzeGui::setCoarseRatio2(int val) {
- sendController(_currentChannel, CTRL_RATIO+DECAPAR1, val*100+FineRatio1SpinBox->value());
+ sendController(_currentChannel, CTRL_RATIO+DECAPAR1, val*100+FineRatio2SpinBox->value());
}
void DeicsOnzeGui::setFineRatio2(int val) {
- sendController(_currentChannel,CTRL_RATIO+DECAPAR1,val+CoarseRatio1SpinBox->value()*100);
+ sendController(_currentChannel,CTRL_RATIO+DECAPAR1,val+CoarseRatio2SpinBox->value()*100);
}
void DeicsOnzeGui::setFreq2(int val) {
- sendController(_currentChannel,CTRL_FIXRANGE+DECAPAR1,val*100);}
+ sendController(_currentChannel,CTRL_FIXRANGE+DECAPAR2,val*100);}
void DeicsOnzeGui::setFix2(bool f) {
- sendController(_currentChannel, CTRL_FIX+DECAPAR1, (f==false?0:1));}
+ sendController(_currentChannel, CTRL_FIX+DECAPAR2, (f==false?0:1));}
void DeicsOnzeGui::setCoarseRatio3(int val) {
- sendController(_currentChannel,CTRL_RATIO+2*DECAPAR1,val*100+FineRatio1SpinBox->value());
+ sendController(_currentChannel,CTRL_RATIO+2*DECAPAR1,val*100+FineRatio3SpinBox->value());
}
void DeicsOnzeGui::setFineRatio3(int val) {
sendController(_currentChannel,CTRL_RATIO+2*DECAPAR1,
- val+CoarseRatio1SpinBox->value()*100);
+ val+CoarseRatio3SpinBox->value()*100);
}
void DeicsOnzeGui::setFreq3(int val) {
- sendController(_currentChannel,CTRL_FIXRANGE+2*DECAPAR1,val*100);}
+ sendController(_currentChannel,CTRL_FIXRANGE+2*DECAPAR2,val*100);}
void DeicsOnzeGui::setFix3(bool f) {
- sendController(_currentChannel, CTRL_FIX+2*DECAPAR1, (f==false?0:1));}
+ sendController(_currentChannel, CTRL_FIX+2*DECAPAR2, (f==false?0:1));}
void DeicsOnzeGui::setCoarseRatio4(int val) {
- sendController(_currentChannel,CTRL_RATIO+3*DECAPAR1,val*100+FineRatio1SpinBox->value());
+ sendController(_currentChannel,CTRL_RATIO+3*DECAPAR1,val*100+FineRatio4SpinBox->value());
}
void DeicsOnzeGui::setFineRatio4(int val) {
sendController(_currentChannel,CTRL_RATIO+3*DECAPAR1,
- val+CoarseRatio1SpinBox->value()*100);
+ val+CoarseRatio4SpinBox->value()*100);
}
void DeicsOnzeGui::setFreq4(int val) {
- sendController(_currentChannel,CTRL_FIXRANGE+3*DECAPAR1,val*100);}
+ sendController(_currentChannel,CTRL_FIXRANGE+3*DECAPAR2,val*100);}
void DeicsOnzeGui::setFix4(bool f) {
- sendController(_currentChannel, CTRL_FIX+3*DECAPAR1, (f==false?0:1));}
+ sendController(_currentChannel, CTRL_FIX+3*DECAPAR2, (f==false?0:1));}
//--------------------------------------------------------------
// set Sensitivity
diff --git a/muse/synti/deicsonze/deicsonzepreset.cpp b/muse/synti/deicsonze/deicsonzepreset.cpp
index 2c0ba1e0..ef114014 100644
--- a/muse/synti/deicsonze/deicsonzepreset.cpp
+++ b/muse/synti/deicsonze/deicsonzepreset.cpp
@@ -493,6 +493,21 @@ void Subcategory::unlink() {
}
//---------------------------------------------------------
+// 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
diff --git a/muse/synti/deicsonze/deicsonzepreset.h b/muse/synti/deicsonze/deicsonzepreset.h
index c87ef03f..d0cbdfab 100644
--- a/muse/synti/deicsonze/deicsonzepreset.h
+++ b/muse/synti/deicsonze/deicsonzepreset.h
@@ -36,6 +36,9 @@
#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
@@ -542,6 +545,7 @@ class Set {
std::string _setName;
std::vector<Category*> _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(AL::Xml* xml, bool onlyUsed);
diff --git a/muse/synti/libsynti/mess.h b/muse/synti/libsynti/mess.h
index 033ebb42..7f96db18 100644
--- a/muse/synti/libsynti/mess.h
+++ b/muse/synti/libsynti/mess.h
@@ -20,8 +20,14 @@ class MessP;
// MidiPatch
//---------------------------------------------------------
+#define MP_TYPE_GM 1
+#define MP_TYPE_GS 2
+#define MP_TYPE_XG 4
+#define MP_TYPE_LBANK 8
+#define MP_TYPE_HBANK 16
+
struct MidiPatch {
- signed char typ; // 1 - GM 2 - GS 4 - XG
+ signed char typ; // 1 - GM 2 - GS 4 - XG 8 - LBANK 16 - HBANK
signed char hbank, lbank, prog;
const char* name;
};