diff options
-rw-r--r-- | muse/ChangeLog | 9 | ||||
-rw-r--r-- | muse/muse/arranger/canvas.cpp | 6 | ||||
-rw-r--r-- | muse/muse/midiedit/CMakeLists.txt | 2 | ||||
-rw-r--r-- | muse/muse/midiedit/miditracker.cpp | 222 | ||||
-rw-r--r-- | muse/muse/midiedit/miditracker.h | 57 | ||||
-rw-r--r-- | muse/muse/midiedit/trackpattern.cpp | 68 | ||||
-rw-r--r-- | muse/muse/midiedit/trackpattern.h | 99 | ||||
-rw-r--r-- | muse/muse/muse.cpp | 26 | ||||
-rw-r--r-- | muse/muse/muse.h | 3 | ||||
-rw-r--r-- | muse/muse/shortcuts.cpp | 2 | ||||
-rw-r--r-- | muse/muse/shortcuts.h | 1 | ||||
-rw-r--r-- | muse/share/wallpapers/paper2.jpg | bin | 0 -> 1875 bytes | |||
-rw-r--r-- | muse/synti/deicsonze/TODO | 3 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonze.cpp | 2030 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonze.h | 209 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzegui.cpp | 1122 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzegui.h | 53 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzegui.ui | 2072 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzepreset.cpp | 60 | ||||
-rw-r--r-- | muse/synti/deicsonze/deicsonzepreset.h | 30 | ||||
-rw-r--r-- | muse/synti/libsynti/gui.h | 2 |
21 files changed, 3668 insertions, 2408 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog index f9913192..63593bfd 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,12 @@ +4.9 (ng) + * DeicsOnze 0.4 + - 16 instances (one per channel) + - stereo + - font size config + - load pixmap background config + - lots of bugs corrected + * add wallpaper paper2.jpg + * add miditracker (not working yet) 3.9 (rj) * added red line to the left of track to identify selected track * various fixes, adding controllers etc diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp index 2b49e70b..340d2566 100644 --- a/muse/muse/arranger/canvas.cpp +++ b/muse/muse/arranger/canvas.cpp @@ -441,7 +441,8 @@ void PartCanvas::contextMenu(const QPoint& pos) a = pop->addAction(*pianoIconSet, tr("pianoroll")); a->setData(10); } - a = pop->addAction(*edit_listIcon, tr("soundtracker")); + a = pop->addAction(*edit_listIcon, tr("miditracker")); + a->setData(11); a = pop->addAction(*edit_listIcon, tr("list")); a->setData(12); } @@ -476,6 +477,9 @@ void PartCanvas::contextMenu(const QPoint& pos) case 10: // pianoroll edit emit startEditor(part, 0); break; + case 11: //miditracker edit + emit startEditor(part, 2); + break; case 12: // list edit emit startEditor(part, 1); break; diff --git a/muse/muse/midiedit/CMakeLists.txt b/muse/muse/midiedit/CMakeLists.txt index c48d0f24..c46a3dd0 100644 --- a/muse/muse/midiedit/CMakeLists.txt +++ b/muse/muse/midiedit/CMakeLists.txt @@ -29,6 +29,7 @@ QT4_WRAP_CPP ( midiedit_mocs midieditor.h pianoroll.h prcanvas.h + miditracker.h ) QT4_WRAP_UI ( midiedit_ui_headers @@ -55,6 +56,7 @@ add_library ( midiedit STATIC midieditor.cpp pianoroll.cpp prcanvas.cpp + miditracker.cpp ${midiedit_mocs} ${midiedit_ui_headers} ) diff --git a/muse/muse/midiedit/miditracker.cpp b/muse/muse/midiedit/miditracker.cpp new file mode 100644 index 00000000..3abb2b36 --- /dev/null +++ b/muse/muse/midiedit/miditracker.cpp @@ -0,0 +1,222 @@ +//================================================================= +// miditracker +// midi editor a la soundtracker +// miditracker.cpp +// (C) Copyright 2006 Nil Geisweiller (a_lin@user.sourceforge.net) +//================================================================= + +#include "miditracker.h" +#include "trackpattern.h" +#include "song.h" +#include "muse.h" +#include "part.h" + +//--------------------------------------------------------- +// MidiTrackerEditor +//--------------------------------------------------------- + +MidiTrackerEditor::MidiTrackerEditor(PartList* pl, bool init) + : MidiEditor(pl) { + + //---------menuView--------------------------------- + menuView = menuBar()->addMenu(tr("&View")); + + //---------ToolBar---------------------------------- + tools = addToolBar(tr("MidiTracker Tools")); + tools->addAction(undoAction); + tools->addAction(redoAction); + tools->addSeparator(); + + tools->addAction(stepRecAction); + stepRecAction->setChecked(INIT_SREC); + + tools->addAction(midiInAction); + midiInAction->setChecked(INIT_MIDIIN); + + tools->addAction(speaker); + speaker->setChecked(INIT_SPEAKER); + + tools->addAction(followSongAction); + followSongAction->setChecked(INIT_FOLLOW); + setFollow(INIT_FOLLOW); + + //panic button + QToolBar* panicToolbar = addToolBar(tr("Panic")); + panicToolbar->addAction(panicAction); + + //Transport Bar + QToolBar* transport = addToolBar(tr("Transport")); + muse->setupTransportToolbar(transport); + + //frame containing the different matrices of time and notes and FX + //QFrame* matricesFrame = new QFrame + + //second bar + addToolBarBreak(); + //row per measure bar + QToolBar* rowfeatures = addToolBar(tr("row features")); + + QLabel* rpmLabel = new QLabel(tr("Row per measure"), rowfeatures); + rpmLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + rpmLabel->setIndent(3); + rowfeatures->addWidget(rpmLabel); + _rpmSpinBox = new QSpinBox(rowfeatures); + _rpmSpinBox->setRange(1, 256); + _rpmSpinBox->setFixedHeight(24); + rowfeatures->addWidget(_rpmSpinBox); + //init row per measure + setRowPerMeasure(16); + updateRowPerMeasure(); + + //number of visible rows + //rowfeatures->addSeparator(); + QLabel* nvrLabel = new QLabel(tr("Number of visible rows"), rowfeatures); + nvrLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + nvrLabel->setIndent(3); + rowfeatures->addWidget(nvrLabel); + _nvrSpinBox = new QSpinBox(rowfeatures); + _nvrSpinBox->setRange(1, 256); + _nvrSpinBox->setFixedHeight(24); + rowfeatures->addWidget(_nvrSpinBox); + //init number of visible row + setNumVisibleRows(20); + updateNumVisibleRows(); + + + //timing matrix + QDockWidget* timingDock = new QDockWidget("Timing"); + addDockWidget(Qt::AllDockWidgetAreas, timingDock); + timingDock->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea); + timingDock->setFeatures(QDockWidget::DockWidgetClosable | + QDockWidget::DockWidgetMovable); + + QTreeWidget* timingTree = new QTreeWidget(timingDock); + timingTree->setColumnCount(3); + timingTree->setHeaderLabels(QStringList("hr:min:sec:fr")+ + QStringList("bar:beat:tick")+ + QStringList("row")); + timingDock->setWidget(timingTree); + //addWidget(trackTest); + + //tracks matrices + QDockWidget* tracksDock[MAXTRACKS]; + QTreeWidget* tracksTree[MAXTRACKS]; + int i=0; + for (ciPart p = _pl->begin(); p != _pl->end(); ++p) { + //Part* part = p->second; + tracksDock[i] = new QDockWidget(/*part->track()->name()*/"trackName"); + tracksDock[i]->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea); + tracksDock[i]->setFeatures(QDockWidget::DockWidgetClosable | + QDockWidget::DockWidgetMovable); + addDockWidget(Qt::AllDockWidgetAreas, tracksDock[i]); + //tracksTree + tracksTree[i] = new QTreeWidget(tracksDock[i]); + tracksTree[i]->setColumnCount(3); + tracksTree[i]->setHeaderLabels(QStringList("Voice 1")+ + QStringList("Voice 2")+ + QStringList("FX 1")); + tracksDock[i]->setWidget(tracksTree[i]); + i++; + } + + /* + addToolBarBreak(); + toolbar = new Toolbar1(initRaster, initQuant); + addToolBar(toolbar); + + addToolBarBreak(); + info = new NoteInfo(this); + addToolBar(info); + + setCentralWidget(tcanvas); + tcanvas->setCornerWidget(new QSizeGrip(tcanvas)); + + connect(song, SIGNAL(posChanged(int,const AL::Pos&,bool)), canvas(), + SLOT(setLocatorPos(int,const AL::Pos&,bool))); + connect(canvas(), SIGNAL(posChanged(int,const AL::Pos&)), + SLOT(setPos(int,const AL::Pos&))); + + connect(canvas(), SIGNAL(toolChanged(int)), tools2, SLOT(set(int))); + connect(tools2, SIGNAL(toolChanged(int)), canvas(), SLOT(setTool(int))); + + connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), + SLOT(noteinfoChanged(NoteInfo::ValType, int))); + + connect(canvas(), SIGNAL(selectionChanged(int, Event&, Part*)), this, + SLOT(setSelection(int, Event&, Part*))); + + info->setEnabled(false); + + setWindowTitle(canvas()->getCaption()); + int s1, e; + canvas()->range(&s1, &e); + e += AL::sigmap.ticksMeasure(e); // show one more measure + canvas()->setTimeRange(s1, e);*/ + +} + +//--------------------------------------------------------- +// setRowPerMeasure +//--------------------------------------------------------- +void MidiTrackerEditor::setRowPerMeasure(int rpm) { + _rowPerMeasure = rpm; +} + +//--------------------------------------------------------- +// getRowPerMeasure +//--------------------------------------------------------- +int MidiTrackerEditor::getRowPerMeasure() { + return _rowPerMeasure; +} + +//--------------------------------------------------------- +// updateRowPerMeasure +//--------------------------------------------------------- +void MidiTrackerEditor::updateRowPerMeasure() { + _rpmSpinBox->blockSignals(true); + _rpmSpinBox->setValue(_rowPerMeasure); + _rpmSpinBox->blockSignals(false); +} + +//--------------------------------------------------------- +// setNumVisibleRows +//--------------------------------------------------------- +void MidiTrackerEditor::setNumVisibleRows(int nvr) { + _numVisibleRows = nvr; +} + +//--------------------------------------------------------- +// getNumVisibleRows +//--------------------------------------------------------- +int MidiTrackerEditor::getNumVisibleRows() { + return _numVisibleRows; +} + +//--------------------------------------------------------- +// updateNumVisibleRows +//--------------------------------------------------------- +void MidiTrackerEditor::updateNumVisibleRows() { + _nvrSpinBox->blockSignals(true); + _nvrSpinBox->setValue(_numVisibleRows); + _nvrSpinBox->blockSignals(false); +} + +//--------------------------------------------------------- +// setFollow +//--------------------------------------------------------- +void MidiTrackerEditor::setFollow(bool f) { + _follow = f; +} + +//--------------------------------------------------------- +// cmd +// pulldown menu commands +//--------------------------------------------------------- + +void MidiTrackerEditor::cmd(QAction* a) { + //int cmd = a->data().toInt(); + //canvas()->cmd(cmd, _quantStrength, _quantLimit, _quantLen); +} + diff --git a/muse/muse/midiedit/miditracker.h b/muse/muse/midiedit/miditracker.h new file mode 100644 index 00000000..164d6841 --- /dev/null +++ b/muse/muse/midiedit/miditracker.h @@ -0,0 +1,57 @@ +//================================================================= +// miditracker +// midi editor a la soundtracker +// miditracker.h +// (C) Copyright 2006 Nil Geisweiller (a_lin@user.sourceforge.net) +//================================================================= + +#ifndef __MTEDITOR_H__ +#define __MTEDITOR_H__ + +#include "midieditor.h" +#include "trackpattern.h" + +#define MAXTRACKS 256 + +namespace AL { + class Xml; + }; +using AL::Xml; + +//--------------------------------------------------------- +// SoundTrackerEditor +//--------------------------------------------------------- + +class MidiTrackerEditor : public MidiEditor { + Q_OBJECT + private: + int _rowPerMeasure; + int _numVisibleRows; + QSpinBox* _nvrSpinBox; + QSpinBox* _rpmSpinBox; + + QMenu* menuView; + bool _follow; + void setFollow(bool); + private slots: + virtual void cmd(QAction*); + public: + MidiTrackerEditor(PartList*, bool); + ~MidiTrackerEditor() {} + + void setRowPerMeasure(int rpm); + int getRowPerMeasure(); + void updateRowPerMeasure(); //update the gui + + void setNumVisibleRows(int nvr); + int getNumVisibleRows(); + void updateNumVisibleRows(); //update the gui + + static const bool INIT_FOLLOW = false; + static const bool INIT_SPEAKER = true; + static const bool INIT_SREC = false; + static const bool INIT_MIDIIN = false; + +}; + +#endif diff --git a/muse/muse/midiedit/trackpattern.cpp b/muse/muse/midiedit/trackpattern.cpp new file mode 100644 index 00000000..6099d212 --- /dev/null +++ b/muse/muse/midiedit/trackpattern.cpp @@ -0,0 +1,68 @@ +#include "trackpattern.h" + +//---------------------------------------------------------- +// EventPat +// has to be derived, can be note or control +//---------------------------------------------------------- +EventPat::EventPat(bool r) {_isReadable = r;} +EventPat::EventPat() {EventPat(true);} +EventPat::~EventPat() {} + +void EventPat::setReadable(bool r) {_isReadable = r;} +bool EventPat::getReadable() {return _isReadable;} + +//---------------------------------------------------------- +// VoicePat +//---------------------------------------------------------- +VoicePat::VoicePat(int n, int v):EventPat(true) { + _noteNum = n; + _velocity = v; +} +VoicePat::VoicePat():EventPat(false) {} +VoicePat::~VoicePat() {} + +void VoicePat::setNoteNum(int n) { _noteNum = n; } +int VoicePat::getNoteNum() { return _noteNum; } +void VoicePat::setVelocity(int n) { _velocity = n; } +int VoicePat::getVelocity() { return _velocity; } +QString VoicePat::str() { + //TODO + QString sNote; + sNote.setNum(_noteNum); + QString s = " "; + QString sVel; + sVel.setNum(_velocity); + return sNote + s + sVel; +} + +//---------------------------------------------------------- +// CtrlPat +//---------------------------------------------------------- +CtrlPat::CtrlPat(int c, int v):EventPat(true) { + _ctrlNum = c; + _value = v; +} +CtrlPat::CtrlPat():EventPat(false) {} +CtrlPat::~CtrlPat() {} + +void CtrlPat::setCtrlNum(int n) { _ctrlNum = n; } +int CtrlPat::getCtrlNum() { return _ctrlNum; } +void CtrlPat::setValue(int n) { _value = n; } +int CtrlPat::getValue() { return _value; } +QString CtrlPat::str() { + //TODO + QString sCtrl; + sCtrl.setNum(_ctrlNum); + QString s = " "; + QString sVal; + sVal.setNum(_value); + return sCtrl + s + sVal; +} + + +//------------------------------------------------------ +// TrackPattern +//------------------------------------------------------ +TrackPattern::TrackPattern(){} +TrackPattern::~TrackPattern(){} + diff --git a/muse/muse/midiedit/trackpattern.h b/muse/muse/midiedit/trackpattern.h new file mode 100644 index 00000000..f6fcaa3c --- /dev/null +++ b/muse/muse/midiedit/trackpattern.h @@ -0,0 +1,99 @@ +//================================================================= +// trackpattern.h +// TrackPattern class for miditracker, QDock, QTree, Part, matrix +// miditracker.h +// (C) Copyright 2006 Nil Geisweiller (a_lin@user.sourceforge.net) +//================================================================= + +#ifndef __TRACKERPATTERN_H__ +#define __TRACKERPATTERN_H__ + +#include <vector> +#include "miditrack.h" + +//---------------------------------------------------------- +// EventPat +// has to be derived, can be note or control +//---------------------------------------------------------- +class EventPat { + private: + bool _isReadable; //true iff the time of the event is the exact row time + public: + EventPat(bool); + EventPat(); //_isReadable is true at the initialization + ~EventPat(); + + void setReadable(bool); + bool getReadable(); +}; + +//---------------------------------------------------------- +// VoicePat +//---------------------------------------------------------- +class VoicePat : public EventPat { + private: + int _noteNum; //absolute note number including octave + int _velocity; //if velocity is 0 note is off + public: + VoicePat(int noteNum, int velocity); // _isReadable is initialized true + VoicePat(); // _isReadable is initialized false + ~VoicePat(); + + void setNoteNum(int n); + int getNoteNum(); + void setVelocity(int n); + int getVelocity(); + QString str(); //return the string to display on the entry of the pattern +}; + +//---------------------------------------------------------- +// CtrlPat +//---------------------------------------------------------- +class CtrlPat : public EventPat { + private: + int _ctrlNum; + int _value; //if velocity is 0 note is off + public: + CtrlPat(int ctrlNum, int value); // _isReadable is initialized true + CtrlPat(); // _isReadable is initialized false + ~CtrlPat(); + + void setCtrlNum(int n); + int getCtrlNum(); + void setValue(int n); + int getValue(); + QString str(); //return the string to display on the entry of the pattern +}; + +//---------------------------------------------------------- +// TrackRowPat +//---------------------------------------------------------- +class TrackRowPat { + private: + std::vector<EventPat> _events; //one event for each voice/ctrl of a track + public: + TrackRowPat(); + ~TrackRowPat(); + + //TODO methods +}; + + +//------------------------------------------------------ +// TrackPattern +//------------------------------------------------------ +class TrackPattern { + private: + QDockWidget* _dock; + QTreeWidget* _tree; + PartList* _partList; //partList concerned by a track + MidiTrack* _track; + TrackRowPat* _trackRow; + public: + TrackPattern(); + ~TrackPattern(); + + //TODO methods +}; + +#endif diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index 35861a0c..f359af38 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -65,6 +65,7 @@ #include "part.h" #include "projectdialog.h" #include "templatedialog.h" +#include "midiedit/miditracker.h" #include "projectpropsdialog.h" static pthread_t watchdogThread; @@ -572,6 +573,9 @@ MusE::MusE() pianoAction = new QAction(*pianoIconSet, tr("Pianoroll"), this); connect(pianoAction, SIGNAL(triggered()), SLOT(startPianoroll())); + trackerAction = new QAction(*pianoIconSet, tr("MidiTracker"), this); + connect(trackerAction, SIGNAL(triggered()), SLOT(startMidiTrackerEditor())); + connect(fileOpenAction, SIGNAL(triggered()), SLOT(loadProject())); connect(fileSaveAction, SIGNAL(triggered()), SLOT(save())); @@ -696,6 +700,7 @@ MusE::MusE() menuEdit->addSeparator(); menuEdit->addAction(pianoAction); + menuEdit->addAction(trackerAction); menu_ids[CMD_OPEN_DRUMS] = menuEdit->addAction(QIcon(*edit_drummsIcon), tr("Drums")); menu_ids[CMD_OPEN_LIST] = menuEdit->addAction(QIcon(*edit_listIcon), tr("List")); menu_ids[CMD_OPEN_GRAPHIC_MASTER] = menuEdit->addAction(QIcon(*mastertrack_graphicIcon),tr("Mastertrack")); @@ -1452,6 +1457,7 @@ void MusE::startEditor(PartList* pl, int type) switch (type) { case 0: startPianoroll(pl); break; case 1: startListEditor(pl); break; + case 2: startMidiTrackerEditor(pl); break; case 3: startDrumEditor(pl); break; case 4: startWaveEditor(pl); break; } @@ -1550,6 +1556,25 @@ void MusE::startListEditor(PartList* /*pl*/) } //--------------------------------------------------------- +// startMidiTrackerEditor +//--------------------------------------------------------- + +void MusE::startMidiTrackerEditor() + { + PartList* pl = getMidiPartsToEdit(); + if (pl == 0) + return; + startMidiTrackerEditor(pl); + } + +void MusE::startMidiTrackerEditor(PartList* pl) + { + //MidiTrackerEditor* miditracker = new MidiTrackerEditor(pl, false); + //miditracker->show(); + //connect(muse, SIGNAL(configChanged()), miditracker, SLOT(configChanged())); + } + +//--------------------------------------------------------- // startMasterEditor //--------------------------------------------------------- @@ -2495,6 +2520,7 @@ void MusE::updateConfiguration() mk_id->setShortcutContext(Qt::ApplicationShortcut); pianoAction->setShortcut(shortcuts[SHRT_OPEN_PIANO].key); //pianoroll + trackerAction->setShortcut(shortcuts[SHRT_OPEN_TRACKER].key); //midiTracker menu_ids[CMD_GLOBAL_CUT]->setShortcut(shortcuts[SHRT_GLOBAL_CUT].key); menu_ids[CMD_GLOBAL_INSERT]->setShortcut(shortcuts[SHRT_GLOBAL_INSERT].key); diff --git a/muse/muse/muse.h b/muse/muse/muse.h index 43f5551e..b30b000d 100644 --- a/muse/muse/muse.h +++ b/muse/muse/muse.h @@ -91,6 +91,7 @@ class MusE : public QMainWindow // , public Ui::MuseBase QAction* fileSaveAction; QAction* fileOpenAction; QAction* pianoAction; + QAction* trackerAction; QAction* fileNewAction; QString appName; @@ -205,6 +206,8 @@ class MusE : public QMainWindow // , public Ui::MuseBase void startEditor(PartList*, int); void startPianoroll(); void startPianoroll(PartList* pl); + void startMidiTrackerEditor(); + void startMidiTrackerEditor(PartList* pl); void startWaveEditor(); void startWaveEditor(PartList*); void writeGlobalConfiguration() const; diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp index 6a182b6c..2f8359e3 100644 --- a/muse/muse/shortcuts.cpp +++ b/muse/muse/shortcuts.cpp @@ -248,6 +248,8 @@ void initShortCuts() // defShrt(SHRT_DESEL_PARTS, Qt::CTRL + Qt::Key_B, "Deselect all parts", ARRANG_SHRT, "deselect_parts"); defShrt(SHRT_SELECT_PRTSTRACK, Qt::CTRL+ Qt::ALT + Qt::Key_P, 24, ARRANG_SHRT, "select_parts_on_track"); defShrt(SHRT_OPEN_PIANO, Qt::CTRL + Qt::Key_E, 25, ARRANG_SHRT, "open_pianoroll"); + //Warning it is the same ShortcutConfig::ls than Open pianoroll + defShrt(SHRT_OPEN_TRACKER, Qt::CTRL + Qt::Key_T, 25, ARRANG_SHRT, "open_miditracker"); defShrt(SHRT_OPEN_DRUMS, Qt::CTRL + Qt::Key_D, 26, ARRANG_SHRT, "open_drumedit"); defShrt(SHRT_OPEN_LIST, Qt::CTRL + Qt::Key_L, 27, ARRANG_SHRT, "open_listedit"); defShrt(SHRT_OPEN_GRAPHIC_MASTER, Qt::CTRL + Qt::Key_M, 28, ARRANG_SHRT, "open_graph_master"); diff --git a/muse/muse/shortcuts.h b/muse/muse/shortcuts.h index 9d29409c..40aff914 100644 --- a/muse/muse/shortcuts.h +++ b/muse/muse/shortcuts.h @@ -135,6 +135,7 @@ enum { SHRT_DESEL_PARTS, //Ctrl+B SHRT_SELECT_PRTSTRACK, //Default: undefined SHRT_OPEN_PIANO, //Ctrl+E + SHRT_OPEN_TRACKER, //Ctrl+T SHRT_OPEN_SCORE, //Ctrl+R SHRT_OPEN_DRUMS, //Ctrl+D SHRT_OPEN_LIST, //Ctrl+L diff --git a/muse/share/wallpapers/paper2.jpg b/muse/share/wallpapers/paper2.jpg Binary files differnew file mode 100644 index 00000000..a692fc41 --- /dev/null +++ b/muse/share/wallpapers/paper2.jpg diff --git a/muse/synti/deicsonze/TODO b/muse/synti/deicsonze/TODO index e7ab96c5..3f7dfe15 100644 --- a/muse/synti/deicsonze/TODO +++ b/muse/synti/deicsonze/TODO @@ -13,5 +13,6 @@ - getPatchInfo - Optimize the code, make 3 level of quality sound - Remember the last directory -- instance for each channel - Create SutulaBank.dei +- pan per channel and per voices +- load BUMP preset diff --git a/muse/synti/deicsonze/deicsonze.cpp b/muse/synti/deicsonze/deicsonze.cpp index 76b08b5a..c645e147 100644 --- a/muse/synti/deicsonze/deicsonze.cpp +++ b/muse/synti/deicsonze/deicsonze.cpp @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // // @@ -36,7 +36,7 @@ #include "libsynti/mess.h" #include "muse/midictrl.h" #include "deicsonze.h" -// #include "config.h" +#include "config.h" #define ABS(x) (x>=0?x:-x) @@ -48,7 +48,7 @@ int DeicsOnze::useCount = 0; // DeicsOnze //--------------------------------------------------------- -DeicsOnze::DeicsOnze() : Mess(1) +DeicsOnze::DeicsOnze() : Mess(2) { if (useCount++ == 0) { // create sinus wave table, W1 @@ -87,16 +87,28 @@ DeicsOnze::DeicsOnze() : Mess(1) srand(time(0)); // initialize random number generator + initCtrls(); + initGlobal(); + + _numPatch = 0; //what is this? TODO + _saveOnlyUsed = true; + _saveConfig = true; + _isInitSet = true; //false if an initial bank must be download + _initSetPath = INSTPREFIX "/share/muse-" VERSION "/presets/deicsonze/ARCH_ALIN"; + //"/usr/local/share/muse-1.0pre1/presets/deicsonze/SutulaBank.dei"; + //TODO + //INSTPREFIX + "/share/" + PACKAGEVERSION + "/presets/deicsonze/ARCH_ALIN"; + _isBackgroundPix = true; //false if an initial bank must be download + _backgroundPixPath = INSTPREFIX "/share/muse-" VERSION "/wallpapers/paper2.jpg"; + //"/usr/local/share/muse-1.0pre1/wallpapers/abstractdeicsonze1.jpg"; + + //initialization GUI _gui = new DeicsOnzeGui(this); _gui->setWindowTitle(QString("DeicsOnze")); _gui->show(); - initCtrls(); - initGlobal(); - initVoices(); - //Load configuration - QString defaultConf = (QString(getenv("HOME")) + QString("/." DEICSONZESTR)); + QString defaultConf = (QString(getenv("HOME")) + QString("/." DEICSONZESTR ".dco")); FILE* f; f = fopen(defaultConf.toAscii().data(), "r"); if(f) { @@ -109,10 +121,11 @@ DeicsOnze::DeicsOnze() : Mess(1) if(_isInitSet) loadSet(_initSetPath); _initialPreset = new - Preset(new Subcategory(new Category(NULL, "NONE", 0), "NONE", 0)); - _preset=_initialPreset; - - setPreset(); + Preset(new Subcategory(new Category(NULL, "NONE", 0), "NONE", 0), 0); + for(int c = 0; c < NBRCHANNELS; c++) { + _preset[c]=_initialPreset; + setPreset(c); + } } //--------------------------------------------------------- @@ -121,8 +134,8 @@ DeicsOnze::DeicsOnze() : Mess(1) DeicsOnze::~DeicsOnze() { - //if (--useCount == 0) - //delete[] sine_table; + //if (--useCount == 0) + //delete[] sine_table; } //--------------------------------------------------------- @@ -386,14 +399,18 @@ void DeicsOnze::initCtrls() { _ctrl[i].num=CTRL_FCAMPLITUDE; _ctrl[i].min=0; _ctrl[i++].max=MAXFCAMPLITUDE; - _ctrl[i].name=GLOBALDETUNESTR; - _ctrl[i].num=CTRL_GLOBALDETUNE; - _ctrl[i].min=0; - _ctrl[i++].max=MAXGLOBALDETUNE; - _ctrl[i].name=MASTERVOLUMESTR; - _ctrl[i].num=CTRL_MASTERVOLUME; + _ctrl[i].name=CHANNELPANSTR; + _ctrl[i].num=CTRL_CHANNELPAN; + _ctrl[i].min=-MAXCHANNELPAN; + _ctrl[i++].max=MAXCHANNELPAN; + _ctrl[i].name=CHANNELDETUNESTR; + _ctrl[i].num=CTRL_CHANNELDETUNE; + _ctrl[i].min=-MAXCHANNELDETUNE; + _ctrl[i++].max=MAXCHANNELDETUNE; + _ctrl[i].name=CHANNELVOLUMESTR; + _ctrl[i].num=CTRL_CHANNELVOLUME; _ctrl[i].min=0; - _ctrl[i++].max=MAXMASTERVOLUME; + _ctrl[i++].max=MAXCHANNELVOLUME; _ctrl[i].name=FINEBRIGHTNESSSTR; _ctrl[i].num=CTRL_FINEBRIGHTNESS; _ctrl[i].min=0; @@ -409,41 +426,56 @@ void DeicsOnze::initCtrls() { // initGlobal //--------------------------------------------------------- void DeicsOnze::initGlobal() { - setMasterVol(32); + setMasterVol(INITMASTERVOL); _global.quality = high; - _global.sustain = false; - _global.pitchBendCoef = 1.0; - _global.lfoIndex = 0; - _numPatch = 0; - _saveOnlyUsed = true; - _saveConfig = true; - _global.nbrVoices = 8; - _global.channelNum = -1; - _isInitSet = true; - _initSetPath = - "/usr/local/share/muse-1.0pre1/presets/deicsonze/SutulaBank.dei"; - //INSTPREFIX + "/share/" + PACKAGEVERSION + "/presets/deicsonze/ARCH_ALIN"; + _global.fontSize = 9; + initChannels(); +} + +void DeicsOnze::initChannels() { + for(int c=0; c<NBRCHANNELS; c++) initChannel(c); + _global.channel[0].isEnable = true; //the first one is enable +} + +void DeicsOnze::initChannel(int c) { + _global.channel[c].isEnable = false; + _global.channel[c].sustain = false; + _global.channel[c].volume = 200; + _global.channel[c].pan = 0; + _global.channel[c].modulation = 0; + _global.channel[c].detune = 0; + _global.channel[c].brightness = MIDFINEBRIGHTNESS; + _global.channel[c].attack = MIDATTACK; + _global.channel[c].release = MIDRELEASE; + _global.channel[c].pitchBendCoef = 1.0; + _global.channel[c].lfoIndex = 0; + _global.channel[c].nbrVoices = 8; + _global.channel[c].lastVoice = NULL; + applyChannelAmp(c); + initVoices(c); } //--------------------------------------------------------- // resetVoices //--------------------------------------------------------- void DeicsOnze::resetVoices() { - initVoices(); //take care of this if initVoices() changes + for(int c = 0; c<NBRCHANNELS; c++) initVoices(c); + //take care of this if initVoices() changes } //--------------------------------------------------------- // initVoice //--------------------------------------------------------- -void DeicsOnze::initVoice(unsigned char v) { - _voices[v].isOn=false; - _voices[v].isSustained=false; +void DeicsOnze::initVoice(int c /*channel*/, int v) { + _global.channel[c].voices[v].hasAttractor=false; + _global.channel[c].voices[v].isOn=false; + _global.channel[c].voices[v].isSustained=false; } //--------------------------------------------------------- // initVoices //--------------------------------------------------------- -void DeicsOnze::initVoices() { - for(int v=0; v<MAXNBRVOICES; v++) initVoice((unsigned char)v); +void DeicsOnze::initVoices(int c) { + for(int v=0; v<MAXNBRVOICES; v++) initVoice(c, v); } //-------------------------------------------------------- @@ -481,113 +513,240 @@ inline double delay2Time(int d) //---------------------------------------------------------------- // setNbrVoices //---------------------------------------------------------------- -void DeicsOnze::setNbrVoices(unsigned char nv) { +void DeicsOnze::setNbrVoices(int c, int nv) { nv=(nv>MAXNBRVOICES?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.nbrVoices; v++) initVoice(v); - _global.nbrVoices=nv; + 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.amp=(double)mv/(double)MAXMASTERVOLUME; + _global.masterVolume=(double)mv/(double)MAXMASTERVOLUME; +} +//---------------------------------------------------------------- +// setChannelEnable +//---------------------------------------------------------------- +void DeicsOnze::setChannelEnable(int c, bool e) { + _global.channel[c].isEnable = e; } //---------------------------------------------------------------- +// setChannelVol +//---------------------------------------------------------------- +void DeicsOnze::setChannelVol(int c, int v) { + _global.channel[c].volume = v; +} + +void DeicsOnze::applyChannelAmp(int c) { + _global.channel[c].ampLeft = + ((double)_global.channel[c].volume/(double)MAXCHANNELVOLUME) + * ((double)(MAXCHANNELPAN - _global.channel[c].pan) + /(double)(2*MAXCHANNELPAN)); + _global.channel[c].ampRight = + ((double)_global.channel[c].volume/(double)MAXCHANNELVOLUME) + * ((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; +} +//---------------------------------------------------------------- +// getNbrVoices +//---------------------------------------------------------------- +int DeicsOnze::getNbrVoices(int c) const { + return(_global.channel[c].nbrVoices); +} +//---------------------------------------------------------------- // getMasterVol //---------------------------------------------------------------- -int DeicsOnze::getMasterVol(void) { - return((int)(_global.amp*(double)MAXMASTERVOLUME)); +int DeicsOnze::getMasterVol(void) const { + return((int)(_global.masterVolume*(double)MAXMASTERVOLUME)); +} +//---------------------------------------------------------------- +// 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); } //---------------------------------------------------------------- // setLfo //---------------------------------------------------------------- -void DeicsOnze::setLfo() +void DeicsOnze::setLfo(int c/*channel*/) { double x; - x=(double)_preset->lfo.speed; + x=(double)_preset[c]->lfo.speed; // lfoSpeed to Hz, obtained by fitting the actual curve by a polynomial - _global.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 + _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.lfoMaxIndex=(_global.lfoFreq==0?0:(int)((1.0/_global.lfoFreq) - *(double)sampleRate())); - _global.lfoPitch=(((double)_preset->lfo.pModDepth/(double)MAXPMODDEPTH) - *(COEFPLFO(_preset->sensitivity.pitch))); + _global.channel[c].lfoMaxIndex = + (_global.channel[c].lfoFreq==0?0:(int)((1.0/_global.channel[c].lfoFreq) + *(double)sampleRate())); + _global.channel[c].lfoPitch = + (((double)_preset[c]->lfo.pModDepth/(double)MAXPMODDEPTH) + *(COEFPLFO(_preset[c]->sensitivity.pitch))); //Amplitude LFO - _global.lfoMaxAmp=(((double)_preset->lfo.aModDepth/(double)MAXAMODDEPTH) - *(COEFALFO(_preset->sensitivity.amplitude))); + _global.channel[c].lfoMaxAmp = + (((double)_preset[c]->lfo.aModDepth/(double)MAXAMODDEPTH) + *(COEFALFO(_preset[c]->sensitivity.amplitude))); //index is concidered on the frequency of the delay - _global.lfoDelayMaxIndex=delay2Time(_preset->lfo.delay)*_global.lfoFreq; - _global.lfoDelayInct=(double)(RESOLUTION/4)/_global.lfoDelayMaxIndex; + _global.channel[c].lfoDelayMaxIndex = + delay2Time(_preset[c]->lfo.delay)*_global.channel[c].lfoFreq; + _global.channel[c].lfoDelayInct = + (double)(RESOLUTION/4)/_global.channel[c].lfoDelayMaxIndex; } //----------------------------------------------------------------- // setOutLevel //----------------------------------------------------------------- -void DeicsOnze::setOutLevel(int k) { - for(int v=0; v<_global.nbrVoices; v++) { - if(_voices[v].op[k].envState!=OFF) { - _voices[v].op[k].amp = outLevel2Amp(_preset->outLevel[k]) - * _voices[v].op[k].ampVeloNote * brightness2Amp(k); +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() { +void DeicsOnze::setOutLevel(int c) { for(int k=0; k<NBROP; k++) { - setOutLevel(k); + setOutLevel(c, k); } } //----------------------------------------------------------------- // setEnvAttack //----------------------------------------------------------------- -void DeicsOnze::setEnvAttack(int v, int k) { - if(_voices[v].op[k].envState==ATTACK) - _voices[v].op[k].envInct= - (_preset->eg[k].ar==0?0: - (double)(RESOLUTION/4)/(envAR2s(_preset->eg[k].ar) +void DeicsOnze::setEnvAttack(int c, int v, int k) { + if(_global.channel[c].voices[v].op[k].envState==ATTACK) + _global.channel[c].voices[v].op[k].envInct= + (_preset[c]->eg[k].ar==0?0: + (double)(RESOLUTION/4)/(envAR2s(_preset[c]->eg[k].ar) *(double)sampleRate())) - *coefAttack(_preset->attack); + *coefAttack(_global.channel[c].attack); } -void DeicsOnze::setEnvAttack(int k) { - for(int v=0; v<_global.nbrVoices; v++) setEnvAttack(v, k); +void DeicsOnze::setEnvAttack(int c, int k) { + for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvAttack(c, v, k); } -void DeicsOnze::setEnvAttack() { - for(int k=0; k<NBROP; k++) setEnvAttack(k); +void DeicsOnze::setEnvAttack(int c) { + for(int k=0; k<NBROP; k++) setEnvAttack(c, k); } //----------------------------------------------------------------- // setEnvRelease //----------------------------------------------------------------- -void DeicsOnze::setEnvRelease(int v, int k) { - if(_voices[v].op[k].envState==RELEASE) - _voices[v].op[k].coefVLevel = envRR2coef(_preset->eg[k].rr, - sampleRate(), - _preset->release); +void DeicsOnze::setEnvRelease(int c, int v, int k) { + if(_global.channel[c].voices[v].op[k].envState==RELEASE) + _global.channel[c].voices[v].op[k].coefVLevel = + envRR2coef(_preset[c]->eg[k].rr, sampleRate(), + _global.channel[c].release); } -void DeicsOnze::setEnvRelease(int k) { - for(int v=0; v<_global.nbrVoices; v++) setEnvRelease(v, k); +void DeicsOnze::setEnvRelease(int c, int k) { + for(int v=0; v<_global.channel[c].nbrVoices; v++) setEnvRelease(c, v, k); } -void DeicsOnze::setEnvRelease() { - for(int k=0; k<NBROP; k++) setEnvRelease(k); +void DeicsOnze::setEnvRelease(int c) { + for(int k=0; k<NBROP; k++) setEnvRelease(c, k); } //----------------------------------------------------------------- // brightness2Amp //----------------------------------------------------------------- -double DeicsOnze::brightness2Amp(int k) { +double DeicsOnze::brightness2Amp(int c, int k) { if( - (k==1 && (_preset->algorithm!=SIXTH || _preset->algorithm!=SEVENTH - || _preset->algorithm!=EIGHTH)) + (k==1 && (_preset[c]->algorithm!=SIXTH || _preset[c]->algorithm!=SEVENTH + || _preset[c]->algorithm!=EIGHTH)) || - (k==2 && (_preset->algorithm==FIRST || _preset->algorithm==SECOND - || _preset->algorithm==THIRD || _preset->algorithm==FOURTH)) + (k==2 && (_preset[c]->algorithm==FIRST || _preset[c]->algorithm==SECOND + || _preset[c]->algorithm==THIRD || _preset[c]->algorithm==FOURTH)) || - (k==3 && (_preset->algorithm!=EIGHTH)) + (k==3 && (_preset[c]->algorithm!=EIGHTH)) ) { - double x = 2.0*(double)_preset->brightness/(double)MAXFINEBRIGHTNESS; + double x = 2.0*(double)_global.channel[c].brightness + / (double)MAXFINEBRIGHTNESS; double square_x = x*x; return(square_x*x); } @@ -596,21 +755,21 @@ double DeicsOnze::brightness2Amp(int k) { //----------------------------------------------------------------- // setFeedback //----------------------------------------------------------------- -void DeicsOnze::setFeedback() { - _global.feedbackAmp=COEFFEEDBACK*exp(log(2)*(double)(_preset->feedback - -MAXFEEDBACK)); +void DeicsOnze::setFeedback(int c) { + _global.channel[c].feedbackAmp = + COEFFEEDBACK*exp(log(2)*(double)(_preset[c]->feedback-MAXFEEDBACK)); } //----------------------------------------------------------------- // setPreset //----------------------------------------------------------------- -void DeicsOnze::setPreset() { - setFeedback(); - setLfo(); - setEnvAttack(); - setEnvRelease(); - setOutLevel(); +void DeicsOnze::setPreset(int c) { + setFeedback(c); + setLfo(c); + setEnvAttack(c); + setEnvRelease(c); + setOutLevel(c); } @@ -714,7 +873,7 @@ void DeicsOnze::loadSet(QString fileName) { if (e.tagName() == "deicsOnzeSet") { QString version = e.attribute(QString("version")); if (version == "1.0") { - _preset=_initialPreset; + for(int c = 0; c<NBRCHANNELS; c++) _preset[c]=_initialPreset; while(!_set->_categoryVector.empty()) delete(*_set->_categoryVector.begin()); _set->readSet(node.firstChild()); @@ -958,28 +1117,42 @@ void DeicsOnze::loadSutulaPresets() // return the number of the voice which is the least aloud // and is not is the ATTACK state //--------------------------------------------------------- -int DeicsOnze::minVolu2Voice() { +int DeicsOnze::minVolu2Voice(int c) { int minVoice=0; double min=MAXVOLUME; - for(int i=0; i<_global.nbrVoices; i++) + for(int i=0; i<_global.channel[c].nbrVoices; i++) { - min=((min>_voices[i].volume - && _voices[i].op[0].envState!=ATTACK - && _voices[i].op[1].envState!=ATTACK - && _voices[i].op[2].envState!=ATTACK - && _voices[i].op[3].envState!=ATTACK)?_voices[i].volume:min); - minVoice=(min==_voices[i].volume?i:minVoice); + 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; } +//--------------------------------------------------------- +// allNoteOff +// return true iff all notes are off +//--------------------------------------------------------- +bool DeicsOnze::allNoteOff(int c) { + bool allOff = true; + for(int i=0; i<_global.channel[c].nbrVoices; i++) { + allOff = !_global.channel[c].voices[i].isOn; + if(!allOff) return allOff; + } + return allOff; +} //--------------------------------------------------------- // noteOff2Voice // return the number of one off voice, MAXNBRVOICES otherwise //--------------------------------------------------------- -int DeicsOnze::noteOff2Voice() { +int DeicsOnze::noteOff2Voice(int c) { int offVoice=MAXNBRVOICES; - for(int i=0; i<_global.nbrVoices; i++) offVoice=(_voices[i].isOn?offVoice:i); + for(int i=0; i<_global.channel[c].nbrVoices; i++) + offVoice=(_global.channel[c].voices[i].isOn?offVoice:i); return offVoice; } @@ -988,38 +1161,40 @@ int DeicsOnze::noteOff2Voice() { // return the number of the voice which has the input // pitch and is On and not release, MAXNBRVOICES otherwise //--------------------------------------------------------- -int DeicsOnze::pitchOn2Voice(int pitch) { +int DeicsOnze::pitchOn2Voice(int c, int pitch) { int pitchVoice=MAXNBRVOICES; - for(int i=0; i<_global.nbrVoices; i++) { - if(_voices[i].pitch==pitch && _voices[i].isOn && !_voices[i].isSustained) { - if((_preset->algorithm == FIRST || _preset->algorithm == SECOND - || _preset->algorithm == THIRD || _preset->algorithm == FOURTH) - && _voices[i].op[0].envState!=RELEASE - && _voices[i].op[0].envState!=OFF) + for(int i=0; i<_global.channel[c].nbrVoices; i++) { + if(_global.channel[c].voices[i].pitch== + pitch && _global.channel[c].voices[i].isOn + && !_global.channel[c].voices[i].isSustained) { + if((_preset[c]->algorithm == FIRST || _preset[c]->algorithm == SECOND + || _preset[c]->algorithm == THIRD || _preset[c]->algorithm == FOURTH) + && _global.channel[c].voices[i].op[0].envState!=RELEASE + && _global.channel[c].voices[i].op[0].envState!=OFF) pitchVoice = i; - if(_preset->algorithm == FIFTH - && ((_voices[i].op[0].envState!=RELEASE - && _voices[i].op[0].envState!=OFF) - || (_voices[i].op[2].envState!=RELEASE - && _voices[i].op[2].envState!=OFF))) + if(_preset[c]->algorithm == FIFTH + && ((_global.channel[c].voices[i].op[0].envState!=RELEASE + && _global.channel[c].voices[i].op[0].envState!=OFF) + || (_global.channel[c].voices[i].op[2].envState!=RELEASE + && _global.channel[c].voices[i].op[2].envState!=OFF))) pitchVoice = i; - if((_preset->algorithm == SIXTH || _preset->algorithm == SEVENTH) - && ((_voices[i].op[0].envState!=RELEASE - && _voices[i].op[0].envState!=OFF) - || (_voices[i].op[1].envState!=RELEASE - && _voices[i].op[1].envState!=OFF) - || (_voices[i].op[2].envState!=RELEASE - && _voices[i].op[2].envState!=OFF))) + if((_preset[c]->algorithm == SIXTH || _preset[c]->algorithm == SEVENTH) + && ((_global.channel[c].voices[i].op[0].envState!=RELEASE + && _global.channel[c].voices[i].op[0].envState!=OFF) + || (_global.channel[c].voices[i].op[1].envState!=RELEASE + && _global.channel[c].voices[i].op[1].envState!=OFF) + || (_global.channel[c].voices[i].op[2].envState!=RELEASE + && _global.channel[c].voices[i].op[2].envState!=OFF))) pitchVoice = i; - if(_preset->algorithm == EIGHTH - && ((_voices[i].op[0].envState!=RELEASE - && _voices[i].op[0].envState!=OFF) - || (_voices[i].op[1].envState!=RELEASE - && _voices[i].op[1].envState!=OFF) - || (_voices[i].op[2].envState!=RELEASE - && _voices[i].op[2].envState!=OFF) - || (_voices[i].op[3].envState!=RELEASE - && _voices[i].op[3].envState!=OFF))) + if(_preset[c]->algorithm == EIGHTH + && ((_global.channel[c].voices[i].op[0].envState!=RELEASE + && _global.channel[c].voices[i].op[0].envState!=OFF) + || (_global.channel[c].voices[i].op[1].envState!=RELEASE + && _global.channel[c].voices[i].op[1].envState!=OFF) + || (_global.channel[c].voices[i].op[2].envState!=RELEASE + && _global.channel[c].voices[i].op[2].envState!=OFF) + || (_global.channel[c].voices[i].op[3].envState!=RELEASE + && _global.channel[c].voices[i].op[3].envState!=OFF))) pitchVoice = i; } } @@ -1040,97 +1215,97 @@ inline double pitch2freq(double p) { // get the right current frequency with respect to the lfo // update the coefficent which multiplies the amplitude. //--------------------------------------------------------- -inline void lfoUpdate(Preset* p, Global* p_g, float* wt) { +inline void lfoUpdate(Preset* p, Channel* p_c, float* wt) { double delayCoef; - if(p_g->lfoIndex==0) + if(p_c->lfoIndex==0) { - if(p_g->lfoDelayIndex<(double)(RESOLUTION/4)) + if(p_c->lfoDelayIndex<(double)(RESOLUTION/4)) { - delayCoef=(double)wt[(int)p_g->lfoDelayIndex]; - p_g->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_g->lfoPitch*delayCoef); - p_g->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_g->lfoPitch*delayCoef) - /p_g->lfoMaxIndex)); - p_g->lfoDelayIndex+=p_g->lfoDelayInct; - p_g->lfoMaxDAmp=delayCoef*p_g->lfoMaxAmp; + 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 - if(!p_g->delayPassed) + if(!p_c->delayPassed) { - p_g->lfoMaxCoefInct=exp((log(2.0)/12.0)*p_g->lfoPitch); - p_g->lfoCoefInctInct= - exp((log(2.0)/12.0)*((2*p_g->lfoPitch)/p_g->lfoMaxIndex)); - p_g->delayPassed=true; - p_g->lfoMaxDAmp=p_g->lfoMaxDAmp; + 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->lfoMaxDAmp; } } switch(p->lfo.wave) { case SAWUP : - if(p_g->lfoIndex==0) + if(p_c->lfoIndex==0) { - p_g->lfoCoefInct=1.0/(p_g->lfoMaxCoefInct); - p_g->lfoCoefAmp=p_g->lfoMaxDAmp/(double)p_g->lfoMaxIndex; - p_g->lfoAmp=1.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_g->lfoCoefInct*=p_g->lfoCoefInctInct; - p_g->lfoAmp-=p_g->lfoCoefAmp; + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; } break; case SQUARE : - if(p_g->lfoIndex==0) + if(p_c->lfoIndex==0) { - p_g->lfoCoefInct=p_g->lfoMaxCoefInct; - p_g->lfoAmp=1.0; + p_c->lfoCoefInct=p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0; } - if(p_g->lfoIndex==(p_g->lfoMaxIndex/2)) + if(p_c->lfoIndex==(p_c->lfoMaxIndex/2)) { - p_g->lfoCoefInct=1.0/p_g->lfoMaxCoefInct; - p_g->lfoAmp=1.0-p_g->lfoMaxDAmp; + p_c->lfoCoefInct=1.0/p_c->lfoMaxCoefInct; + p_c->lfoAmp=1.0-p_c->lfoMaxDAmp; } break; case TRIANGL : - if(p_g->lfoIndex==0) + if(p_c->lfoIndex==0) { - p_g->lfoCoefInct=1.0; - p_g->lfoCoefAmp=p_g->lfoMaxDAmp - /(double)(p_g->lfoMaxIndex/2); - p_g->lfoAmp=1.0-p_g->lfoMaxDAmp/2.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_g->lfoIndex<(p_g->lfoMaxIndex/4)) + else if(p_c->lfoIndex<(p_c->lfoMaxIndex/4)) { - p_g->lfoCoefInct*=p_g->lfoCoefInctInct; - p_g->lfoAmp-=p_g->lfoCoefAmp; + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; } - else if(p_g->lfoIndex<((3*p_g->lfoMaxIndex)/4)) + else if(p_c->lfoIndex<((3*p_c->lfoMaxIndex)/4)) { - p_g->lfoCoefInct/=p_g->lfoCoefInctInct; - p_g->lfoAmp+=p_g->lfoCoefAmp; + p_c->lfoCoefInct/=p_c->lfoCoefInctInct; + p_c->lfoAmp+=p_c->lfoCoefAmp; } - else if(p_g->lfoIndex<p_g->lfoMaxIndex) + else if(p_c->lfoIndex<p_c->lfoMaxIndex) { - p_g->lfoCoefInct*=p_g->lfoCoefInctInct; - p_g->lfoAmp-=p_g->lfoCoefAmp; + p_c->lfoCoefInct*=p_c->lfoCoefInctInct; + p_c->lfoAmp-=p_c->lfoCoefAmp; } break; case SHOLD : - if(p_g->lfoIndex==0||p_g->lfoIndex==(p_g->lfoMaxIndex/2)) + 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_g->lfoCoefInct=(r>=0.0?1.0+r*(p_g->lfoMaxCoefInct-1.0) - :1.0/(1.0-r*(p_g->lfoMaxCoefInct-1.0))); - p_g->lfoAmp=1.0-(r/2.0+0.5)*p_g->lfoMaxDAmp; + 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_g->lfoIndex=(p_g->lfoIndex<p_g->lfoMaxIndex?p_g->lfoIndex+1:0); + p_c->lfoIndex=(p_c->lfoIndex<p_c->lfoMaxIndex?p_c->lfoIndex+1:0); } //--------------------------------------------------------- @@ -1306,49 +1481,49 @@ inline double env2AmpR(int sr, float* wt, Eg eg, OpVoice* p_opVoice) { // programSelect //--------------------------------------------------------- -void DeicsOnze::programSelect(int hbank, int lbank, int prog) { +void DeicsOnze::programSelect(int c, int hbank, int lbank, int prog) { Preset* foundPreset; foundPreset=findPreset(hbank, lbank, prog); - if (foundPreset) _preset=foundPreset; + if (foundPreset) _preset[c]=foundPreset; else { - _preset=_initialPreset; - _preset->prog=prog; - _preset->_subcategory->_lbank=lbank; - _preset->_subcategory->_category->_hbank=hbank; + _preset[c]=_initialPreset; + _preset[c]->prog=prog; + _preset[c]->_subcategory->_lbank=lbank; //TODO : real link + _preset[c]->_subcategory->_category->_hbank=hbank; } - setPreset(); + setPreset(c); } //--------------------------------------------------------- // setModulation //--------------------------------------------------------- -void DeicsOnze::setModulation(int val) { - _preset->modulation = (unsigned char) val; +void DeicsOnze::setModulation(int c, int val) { + _preset[c]->modulation = (unsigned char) val; } //--------------------------------------------------------- // setPitchBendCoef //--------------------------------------------------------- -void DeicsOnze::setPitchBendCoef(int val) { - _global.pitchBendCoef = exp(log(2) - *((double)_preset->function.pBendRange - /(double)MAXPBENDRANGE) - *((double)val/(double)MAXPITCHBENDVALUE)); +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 val) { - _global.sustain=(val>64); - if(!_global.sustain) - for(int i=0; i<_global.nbrVoices; i++) - if(_voices[i].isSustained) { - for(int j=0; j<NBROP; j++) { - _voices[i].op[j].envState=RELEASE; - setEnvRelease(i, j); - } - _voices[i].isSustained=false; - } +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; j<NBROP; j++) { + _global.channel[c].voices[i].op[j].envState=RELEASE; + setEnvRelease(c, i, j); + } + _global.channel[c].voices[i].isSustained=false; + } } //--------------------------------------------------------- @@ -1373,14 +1548,19 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { if(qdEl.isNull()) continue; //nbrVoices - if(qdEl.tagName()==NBRVOICESSTR) { + //question? does the configurqtion has to save the number of + //voices for each channel or not? + //temporarly or definitly under comments + /* + if(qdEl.tagName()==NBRVOICESSTR) { setNbrVoices(qdEl.text().toInt()); MidiEvent evNbrVoices(0, 0, ME_CONTROLLER, CTRL_NBRVOICES, _global.nbrVoices); _gui->writeEvent(evNbrVoices); - } + }*/ //channelNum - if(qdEl.tagName()==CHANNELNUMSTR) { + /* + 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; @@ -1388,7 +1568,7 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { MidiEvent evChannelNum(0, ME_SYSEX, (const unsigned char*)dataChannelNum, 2); _gui->writeEvent(evChannelNum); - } + }*/ //quality if(qdEl.tagName()==QUALITYSTR) { _global.quality = (qdEl.text()==HIGHSTR?high: @@ -1399,6 +1579,15 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { MidiEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); _gui->writeEvent(evQuality); } + //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; + MidiEvent evFontSize(0, ME_SYSEX, (const unsigned char*)dataFontSize, 2); + _gui->writeEvent(evFontSize); + } //saveConfig if(qdEl.tagName()==SAVECONFIGSTR) { _saveConfig = (qdEl.text()==YESSTRDEI?true:false); @@ -1425,6 +1614,9 @@ void DeicsOnze::readConfiguration(QDomNode 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); @@ -1447,6 +1639,31 @@ void DeicsOnze::readConfiguration(QDomNode qdn) { 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; + MidiEvent + 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); + MidiEvent + evBackgroundPixPath(0, ME_SYSEX, + (const unsigned char*)dataBackgroundPixPath, + 1+MAXSTRLENGTHBACKGROUNDPIXPATH); + _gui->writeEvent(evBackgroundPixPath); + } qdn = qdn.nextSibling(); } //send colors @@ -1517,11 +1734,12 @@ void DeicsOnze::loadConfiguration(QString fileName) { void DeicsOnze::writeConfiguration(AL::Xml* xml) { QString str; xml->tag("deicsOnzeConfiguation version=\"1.0\""); - xml->intTag(NBRVOICESSTR, (int)_global.nbrVoices); - xml->strTag(CHANNELNUMSTR, (_global.channelNum==-1?ALLSTR: - str.setNum(_global.channelNum+1))); + //xml->intTag(NBRVOICESSTR, (int)_global.nbrVoices); + //xml->strTag(CHANNELNUMSTR, (_global.channelNum==-1?ALLSTR: + // str.setNum(_global.channelNum+1))); xml->strTag(QUALITYSTR, (_global.quality==high?HIGHSTR: (_global.quality==middle?MIDDLESTR:LOWSTR))); + xml->intTag(FONTSIZESTR, _global.fontSize); xml->strTag(SAVECONFIGSTR, (_saveConfig?YESSTRDEI:NOSTRDEI)); xml->strTag(SAVEONLYUSEDSTR, (_saveOnlyUsed?YESSTRDEI:NOSTRDEI)); xml->colorTag(TEXTCOLORSTR, @@ -1533,8 +1751,11 @@ void DeicsOnze::writeConfiguration(AL::Xml* xml) { xml->colorTag(EDITBACKGROUNDCOLORSTR, reinterpret_cast<const QColor &>(*_gui->ebColor)); xml->strTag(ISINITSETSTR, (_isInitSet?YESSTRDEI:NOSTRDEI)); - printf("initSetPath : %s\n", _initSetPath.toAscii().data()); + //printf("initSetPath : %s\n", _initSetPath.toAscii().data()); xml->strTag(INITSETPATHSTR, _initSetPath.toAscii().data()); + xml->strTag(ISBACKGROUNDPIXSTR, (_isBackgroundPix?YESSTRDEI:NOSTRDEI)); + xml->strTag(BACKGROUNDPIXPATHSTR, _backgroundPixPath.toAscii().data()); + xml->etag(DEICSONZECONFIGURATIONSTR); } @@ -1542,75 +1763,89 @@ void DeicsOnze::writeConfiguration(AL::Xml* xml) { // getInitData //--------------------------------------------------------- void DeicsOnze::getInitData(int* length, const unsigned char** data) const { - FILE* tmp; - char* comptmp; - QString cmd="bzip2 > "; - - //compress the set - comptmp=tempnam("/tmp", "DeicsOnze"); - cmd+=comptmp; - tmp=popen(cmd.toAscii().data(), "w"); - QFile file; - file.open(tmp, QIODevice::WriteOnly); - AL::Xml* xml=new AL::Xml(&file); - xml->header(); - _set->writeSet(xml, _saveOnlyUsed); - file.close(); //flush - pclose(tmp); - - //save the set - FILE* comptmpf=fopen(comptmp, "r"); - fseek(comptmpf, 0, SEEK_END); - *length=ftell(comptmpf) - + SAVEINITLENGTH + SAVEGLOBALLENGTH + SAVECONFIGLENGTH - + MAXSTRLENGTHINITSETPATH + 1; - fseek(comptmpf, 0, SEEK_SET); - 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[NUMMASTERVOL]= - (unsigned char)(_global.amp*(double)MAXMASTERVOLUME); - buffer[NUMCURRENTPROG]=(unsigned char) _preset->prog; - buffer[NUMCURRENTLBANK]=(unsigned char) _preset->_subcategory->_lbank; - buffer[NUMCURRENTHBANK]= - (unsigned char) _preset->_subcategory->_category->_hbank; - buffer[NUMNBRVOICES]=(unsigned char) _global.nbrVoices; - buffer[NUMCHANNELNUM]=(unsigned char) _global.channelNum; - buffer[NUMSAVEONLYUSED]=(unsigned char) _saveOnlyUsed; - buffer[NUMSAVECONFIG]=(unsigned char) _saveConfig; - //save config data - if(_saveConfig) { - buffer[NUMQUALITY]=(unsigned char)_global.quality; - buffer[NUMREDTEXT]=(unsigned char)_gui->tColor->red(); - buffer[NUMGREENTEXT]=(unsigned char)_gui->tColor->green(); - buffer[NUMBLUETEXT]=(unsigned char)_gui->tColor->blue(); - buffer[NUMREDBACKGROUND]=(unsigned char)_gui->bColor->red(); - buffer[NUMGREENBACKGROUND]=(unsigned char)_gui->bColor->green(); - buffer[NUMBLUEBACKGROUND]=(unsigned char)_gui->bColor->blue(); - buffer[NUMREDEDITTEXT]=(unsigned char)_gui->etColor->red(); - buffer[NUMGREENEDITTEXT]=(unsigned char)_gui->etColor->green(); - buffer[NUMBLUEEDITTEXT]=(unsigned char)_gui->etColor->blue(); - buffer[NUMREDEDITBACKGROUND]=(unsigned char)_gui->ebColor->red(); - buffer[NUMGREENEDITBACKGROUND]=(unsigned char)_gui->ebColor->green(); - buffer[NUMBLUEEDITBACKGROUND]=(unsigned char)_gui->ebColor->blue(); - buffer[NUMISINITSET]=(unsigned char)_isInitSet; - strncpy((char*)&buffer[NUMINITSETPATH], - _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); - } - //save set data - for(int i=SAVEINITLENGTH+SAVEGLOBALLENGTH+SAVECONFIGLENGTH - +MAXSTRLENGTHINITSETPATH+1; i<*length; i++) - buffer[i]=(unsigned char)getc(comptmpf); - fclose(comptmpf); - QString rmcmd="rm "; - rmcmd+=comptmp; - system(rmcmd.toAscii().data()); - free(comptmp); - //printf("Taille en save : %d\n", *length); - //for(int i=0; i<*length; i++) printf("%x ", buffer[i]); - *data=buffer; + FILE* tmp; + char* comptmp; + QString cmd="bzip2 > "; + + //compress the set + comptmp=tempnam("/tmp", "DeicsOnze"); + cmd+=comptmp; + tmp=popen(cmd.toAscii().data(), "w"); + QFile file; + file.open(tmp, QIODevice::WriteOnly); + AL::Xml* xml=new AL::Xml(&file); + xml->header(); + _set->writeSet(xml, _saveOnlyUsed); + file.close(); //flush + pclose(tmp); + + //save the set + FILE* comptmpf=fopen(comptmp, "r"); + fseek(comptmpf, 0, SEEK_END); + *length=ftell(comptmpf) + NUMCONFIGLENGTH; + fseek(comptmpf, 0, SEEK_SET); + 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[NUMMASTERVOL] = (unsigned char) getMasterVol(); + for(int c = 0; c < NBRCHANNELS; c++) { + buffer[NUMCHANNELENABLE + c] = (unsigned char) getChannelEnable(c); + buffer[NUMCHANNELVOL + c] = (unsigned char) getChannelVol(c); + buffer[NUMCHANNELPAN + c] = (unsigned char) getChannelPan(c); + int b = getChannelBrightness(c); + buffer[NUMCHANNELBRIGHTNESS + 2*c] = (unsigned char) (b%256); + buffer[NUMCHANNELBRIGHTNESS + 2*c + 1] = (unsigned char) (b/256); + buffer[NUMCHANNELMODULATION + c] = (unsigned char) getChannelModulation(c); + buffer[NUMCHANNELDETUNE + c] = + (unsigned char) getChannelDetune(c) + MAXCHANNELDETUNE; + buffer[NUMCHANNELATTACK + c] = (unsigned char) getChannelAttack(c); + buffer[NUMCHANNELRELEASE + c] = (unsigned char) getChannelRelease(c); + buffer[NUMCURRENTPROG + c] = (unsigned char) _preset[c]->prog; + buffer[NUMCURRENTLBANK + c] = + (unsigned char) _preset[c]->_subcategory->_lbank; + buffer[NUMCURRENTHBANK + c] = + (unsigned char) _preset[c]->_subcategory->_category->_hbank; + buffer[NUMNBRVOICES + c] = (unsigned char) getNbrVoices(c); + } + buffer[NUMSAVEONLYUSED]=(unsigned char) _saveOnlyUsed; + buffer[NUMSAVECONFIG]=(unsigned char) _saveConfig; + //save config data + if(_saveConfig) { + buffer[NUMQUALITY]=(unsigned char)_global.quality; + buffer[NUMFONTSIZE]=(unsigned char)_global.fontSize; + buffer[NUMREDTEXT]=(unsigned char)_gui->tColor->red(); + buffer[NUMGREENTEXT]=(unsigned char)_gui->tColor->green(); + buffer[NUMBLUETEXT]=(unsigned char)_gui->tColor->blue(); + buffer[NUMREDBACKGROUND]=(unsigned char)_gui->bColor->red(); + buffer[NUMGREENBACKGROUND]=(unsigned char)_gui->bColor->green(); + buffer[NUMBLUEBACKGROUND]=(unsigned char)_gui->bColor->blue(); + buffer[NUMREDEDITTEXT]=(unsigned char)_gui->etColor->red(); + buffer[NUMGREENEDITTEXT]=(unsigned char)_gui->etColor->green(); + buffer[NUMBLUEEDITTEXT]=(unsigned char)_gui->etColor->blue(); + buffer[NUMREDEDITBACKGROUND]=(unsigned char)_gui->ebColor->red(); + buffer[NUMGREENEDITBACKGROUND]=(unsigned char)_gui->ebColor->green(); + buffer[NUMBLUEEDITBACKGROUND]=(unsigned char)_gui->ebColor->blue(); + buffer[NUMISINITSET]=(unsigned char)_isInitSet; + strncpy((char*)&buffer[NUMINITSETPATH], + _initSetPath.toLatin1().data(), MAXSTRLENGTHINITSETPATH); + buffer[NUMISBACKGROUNDPIX]=(unsigned char)_isBackgroundPix; + strncpy((char*)&buffer[NUMBACKGROUNDPIXPATH], + _backgroundPixPath.toLatin1().data(), + MAXSTRLENGTHBACKGROUNDPIXPATH); + } + //save set data + for(int i=NUMCONFIGLENGTH; + i<*length; i++) buffer[i]=(unsigned char)getc(comptmpf); + fclose(comptmpf); + QString rmcmd="rm "; + rmcmd+=comptmp; + system(rmcmd.toAscii().data()); + free(comptmp); + //printf("Taille en save : %d\n", *length); + //for(int i=0; i<*length; i++) printf("%x ", buffer[i]); + *data=buffer; } //--------------------------------------------------------- // parseInitData @@ -1618,21 +1853,72 @@ void DeicsOnze::getInitData(int* length, const unsigned char** data) const { void DeicsOnze::parseInitData(int length, const unsigned char* data) { if(data[1]==SYSEX_INIT_DATA_VERSION) { //load global parameters + //master volume setMasterVol(data[NUMMASTERVOL]); - MidiEvent ev(0, 0, ME_CONTROLLER, CTRL_MASTERVOLUME, data[NUMMASTERVOL]); - _gui->writeEvent(ev); - //nbrVoices - setNbrVoices(data[NUMNBRVOICES]); - MidiEvent evNbrVoices(0,0,ME_CONTROLLER,CTRL_NBRVOICES,data[NUMNBRVOICES]); - _gui->writeEvent(evNbrVoices); - //channelNum - _global.channelNum = (char)data[NUMCHANNELNUM]; - unsigned char *dataChannelNum = new unsigned char[2]; - dataChannelNum[0]=SYSEX_CHANNELNUM; - dataChannelNum[1]=(unsigned char)_global.channelNum; + unsigned char *dataMasterVol = new unsigned char[2]; + dataMasterVol[0]=SYSEX_MASTERVOL; + dataMasterVol[1]=(unsigned char) getMasterVol(); MidiEvent - evChannelNum(0, ME_SYSEX, (const unsigned char*)dataChannelNum, 2); - _gui->writeEvent(evChannelNum); + 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[NUMCHANNELENABLE + c]); + MidiEvent + evChEnable(0, c, ME_CONTROLLER, + CTRL_CHANNELENABLE, data[NUMCHANNELENABLE + c]); + _gui->writeEvent(evChEnable); + //nbrVoices + setNbrVoices(c, data[NUMNBRVOICES + c]); + MidiEvent + evNbrVoices(0,c,ME_CONTROLLER,CTRL_NBRVOICES, data[NUMNBRVOICES + c]); + _gui->writeEvent(evNbrVoices); + //channel volume + setChannelVol(c, data[NUMCHANNELVOL + c]); + MidiEvent + evChVol(0, c, ME_CONTROLLER, + CTRL_CHANNELVOLUME, data[NUMCHANNELVOL + c]); + _gui->writeEvent(evChVol); + //channel pan + setChannelPan(c, data[NUMCHANNELPAN + c]); + MidiEvent + evChPan(0, c, ME_CONTROLLER, CTRL_CHANNELPAN, data[NUMCHANNELPAN + c]); + _gui->writeEvent(evChPan); + if(getChannelEnable(c)) applyChannelAmp(c); + //channel detune + setChannelDetune(c, data[NUMCHANNELDETUNE + c]-MAXCHANNELDETUNE); + MidiEvent + evChDetune(0, c, ME_CONTROLLER, CTRL_CHANNELDETUNE, + data[NUMCHANNELDETUNE + c]-MAXCHANNELDETUNE); + _gui->writeEvent(evChDetune); + //channel brightness + setChannelBrightness(c, + data[NUMCHANNELBRIGHTNESS + 2*c] + + data[NUMCHANNELBRIGHTNESS + 2*c + 1] * 256); + MidiEvent + evChBrightness(0, c, ME_CONTROLLER, + CTRL_FINEBRIGHTNESS, getChannelBrightness(c)); + _gui->writeEvent(evChBrightness); + //channel modulation + setChannelModulation(c, data[NUMCHANNELMODULATION + c]); + MidiEvent + evChMod(0, c, ME_CONTROLLER, + CTRL_MODULATION, data[NUMCHANNELMODULATION + c]); + _gui->writeEvent(evChMod); + //channel attack + setChannelAttack(c, data[NUMCHANNELATTACK + c]); + MidiEvent + evChAttack(0, c, ME_CONTROLLER, + CTRL_ATTACK_TIME, data[NUMCHANNELATTACK + c]); + _gui->writeEvent(evChAttack); + //channel release + setChannelRelease(c, data[NUMCHANNELRELEASE + c]); + MidiEvent + evChRelease(0, c, ME_CONTROLLER, + CTRL_RELEASE_TIME, data[NUMCHANNELRELEASE + c]); + _gui->writeEvent(evChRelease); + } //load configuration _saveConfig = (bool)data[NUMSAVECONFIG]; unsigned char *dataSaveConfig = new unsigned char[2]; @@ -1664,19 +1950,40 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { dataQuality[1]=data[NUMQUALITY]; MidiEvent evQuality(0, ME_SYSEX, (const unsigned char*)dataQuality, 2); _gui->writeEvent(evQuality); + //font size + unsigned char dataFontSize[2]; + dataFontSize[0]=SYSEX_FONTSIZE; + dataFontSize[1]=data[NUMFONTSIZE]; + MidiEvent 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[NUMISINITSET]; MidiEvent evIsInitSet(0, ME_SYSEX, (const unsigned char*)dataIsInitSet, 2); - _gui->writeEvent(ev); + _gui->writeEvent(evIsInitSet); unsigned char dataInitSetPath[1+MAXSTRLENGTHINITSETPATH]; dataInitSetPath[0]=SYSEX_INITSETPATH; dataInitSetPath[1]=data[NUMINITSETPATH]; MidiEvent 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[NUMISBACKGROUNDPIX]; + MidiEvent 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+NUMBACKGROUNDPIXPATH]; + MidiEvent evBackgroundPixPath(0,ME_SYSEX, + (const unsigned char*)dataBackgroundPixPath, + 1+MAXSTRLENGTHBACKGROUNDPIXPATH); + _gui->writeEvent(evBackgroundPixPath); } else _gui->saveConfigCheckBox->setChecked(false); @@ -1685,21 +1992,20 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { char* tmpname; char* uncompname; QString cmd="bunzip2 "; - + //get the bz2 part tmpname=tempnam("/tmp", "DEIBZ2"); tmp=fopen(tmpname, "w"); - for(int i=SAVEINITLENGTH+SAVEGLOBALLENGTH+SAVECONFIGLENGTH; - i<length; i++) putc(data[i], tmp); + for(int i = NUMCONFIGLENGTH;i<length; i++) putc(data[i], tmp); fclose(tmp); - + //uncompress the set uncompname=tempnam("/tmp", "DEISET"); cmd+=tmpname; cmd+=" -c > "; cmd+=uncompname; system(cmd.toAscii().data()); - + //load the set // read the XML file and create DOM tree //QString filename = (const char*) (data+2); @@ -1718,7 +2024,7 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { if (e.tagName() == "deicsOnzeSet") { QString version = e.attribute(QString("version")); if (version == "1.0") { - _preset=_initialPreset; + for(int c = 0; c < NBRCHANNELS; c++) _preset[c]=_initialPreset; //read the set if((bool)data[NUMSAVEONLYUSED]) { //printf("Mini\n"); @@ -1739,7 +2045,8 @@ void DeicsOnze::parseInitData(int length, const unsigned char* 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 + //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+strlen(uncompname); char dataSend[dL]; dataSend[0]=SYSEX_LOADSET; @@ -1747,21 +2054,23 @@ void DeicsOnze::parseInitData(int length, const unsigned char* data) { for(int i=2; i<dL; i++) dataSend[i]=uncompname[i-2]; MidiEvent evSysex(0,ME_SYSEX,(const unsigned char*)dataSend, dL); _gui->writeEvent(evSysex); - - - //set the last hbank, lbank, prog - int hbank=(int)data[NUMCURRENTHBANK]; - int lbank=(int)data[NUMCURRENTLBANK]; - int prog=(int)data[NUMCURRENTPROG]; - int val=prog+(lbank<<8)+(hbank<<16); - MidiEvent evProgSel(0, 0, ME_CONTROLLER, CTRL_PROGRAM, val); - _gui->writeEvent(evProgSel); - + + //select programs per channel + for(int c = 0; c < NBRCHANNELS; c++) { + int hbank=(int)data[NUMCURRENTHBANK+c]; + int lbank=(int)data[NUMCURRENTLBANK+c]; + int prog=(int)data[NUMCURRENTPROG+c]; + programSelect(c, hbank, lbank, prog); + int val=prog+(lbank<<8)+(hbank<<16); + MidiEvent evProgSel(0, c, ME_CONTROLLER, CTRL_PROGRAM, val); + _gui->writeEvent(evProgSel); + } + //delete the temporary file bz2 QString rmfile; rmfile="rm "; rmfile+=tmpname; - system(rmfile.toAscii().data()); + //system(rmfile.toAscii().data()); } } //--------------------------------------------------------- @@ -1777,13 +2086,20 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { case SYSEX_INIT_DATA: parseInitData(length, data); break; - case SYSEX_CHANNELNUM: - _global.channelNum = (char)data[1]; + case SYSEX_MASTERVOL: + setMasterVol((int)data[1]); if(!fromGui) { MidiEvent evSysex(0, ME_SYSEX, data, length); _gui->writeEvent(evSysex); } break; + //case SYSEX_CHANNELNUM: + //_global.channelNum = (char)data[1]; + //if(!fromGui) { + // MidiEvent evSysex(0, ME_SYSEX, data, length); + // _gui->writeEvent(evSysex); + //} + //break; case SYSEX_QUALITY: _global.quality = (Quality)data[1]; if(!fromGui) { @@ -1791,6 +2107,13 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { _gui->writeEvent(evSysex); } break; + case SYSEX_FONTSIZE: + _global.fontSize = (int)data[1]; + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; case SYSEX_SAVECONFIG: _saveConfig = (bool)data[1]; if(!fromGui) { @@ -1819,6 +2142,20 @@ bool DeicsOnze::sysex(int length, const unsigned char* data, bool fromGui) { _gui->writeEvent(evSysex); } break; + case SYSEX_ISBACKGROUNDPIX: + _isBackgroundPix = (bool)data[1]; + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; + case SYSEX_BACKGROUNDPIXPATH: + _backgroundPixPath = (char*)&data[1]; + if(!fromGui) { + MidiEvent evSysex(0, ME_SYSEX, data, length); + _gui->writeEvent(evSysex); + } + break; case SYSEX_PANIC: resetVoices(); default: @@ -1835,7 +2172,7 @@ bool DeicsOnze::setController(int channel, int id, int val) { } bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { int k=0; - if(ch==_global.channelNum || _global.channelNum==-1 || fromGui) { + if(_global.channel[ch].isEnable || ctrl==CTRL_CHANNELENABLE) { if(ctrl>=CTRL_AR && ctrl<CTRL_ALG) { k=(ctrl-CTRLOFFSET)/DECAPAR1; ctrl=ctrl-DECAPAR1*k; @@ -1846,461 +2183,468 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { } switch(ctrl) { case CTRL_AR: - _preset->setIsUsed(true); - _preset->eg[k].ar=val; - printf("AR : %d\n", val); + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].ar=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_AR+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_AR+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_D1R: - _preset->setIsUsed(true); - _preset->eg[k].d1r=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d1r=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_D1R+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_D1R+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_D2R: - _preset->setIsUsed(true); - _preset->eg[k].d2r=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d2r=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_D2R+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_D2R+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_RR: - _preset->setIsUsed(true); - _preset->eg[k].rr=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].rr=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_RR+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_RR+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_D1L: - _preset->setIsUsed(true); - _preset->eg[k].d1l=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].d1l=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_D1L+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_D1L+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_LS: - _preset->setIsUsed(true); - _preset->scaling.level[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->scaling.level[k]=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_LS+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_LS+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_RS: - _preset->setIsUsed(true); - _preset->scaling.rate[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->scaling.rate[k]=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_RS+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_RS+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_EBS: - _preset->setIsUsed(true); - _preset->sensitivity.egBias[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.egBias[k]=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_EBS+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_EBS+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_AME: - _preset->setIsUsed(true); - _preset->sensitivity.ampOn[k]=val==1; + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.ampOn[k]=val==1; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_AME+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_AME+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_KVS: - _preset->setIsUsed(true); - _preset->sensitivity.keyVelocity[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.keyVelocity[k]=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_KVS+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_KVS+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_OUT: - _preset->setIsUsed(true); - _preset->outLevel[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->outLevel[k]=val; setOutLevel(k); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_OUT+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_OUT+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_RATIO: - _preset->setIsUsed(true); - _preset->frequency[k].ratio=((double)val)/100.0; + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].ratio=((double)val)/100.0; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER, + MidiEvent ev(0,ch,ME_CONTROLLER, CTRL_RATIO+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_DET: - _preset->setIsUsed(true); - _preset->detune[k]=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->detune[k]=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_DET+k*DECAPAR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_DET+k*DECAPAR1,val); _gui->writeEvent(ev); } break; case CTRL_ALG: - _preset->setIsUsed(true); - _preset->algorithm=(Algorithm)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->algorithm=(Algorithm)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_ALG,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_ALG,val); _gui->writeEvent(ev); } break; case CTRL_FEEDBACK: - _preset->setIsUsed(true); - _preset->feedback=val; - setFeedback(); + _preset[ch]->setIsUsed(true); + _preset[ch]->feedback=val; + setFeedback(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FEEDBACK,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FEEDBACK,val); _gui->writeEvent(ev); } break; case CTRL_SPEED: - _preset->setIsUsed(true); - _preset->lfo.speed=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.speed=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_SPEED,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_SPEED,val); _gui->writeEvent(ev); } break; case CTRL_DELAY: - _preset->setIsUsed(true); - _preset->lfo.delay=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.delay=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_DELAY,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_DELAY,val); _gui->writeEvent(ev); } break; case CTRL_PMODDEPTH: - _preset->setIsUsed(true); - _preset->lfo.pModDepth=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.pModDepth=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PMODDEPTH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODDEPTH,val); _gui->writeEvent(ev); } break; case CTRL_AMODDEPTH: - _preset->setIsUsed(true); - _preset->lfo.aModDepth=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.aModDepth=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_AMODDEPTH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_AMODDEPTH,val); _gui->writeEvent(ev); } break; case CTRL_SYNC: - _preset->setIsUsed(true); - _preset->lfo.sync=val==1; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.sync=val==1; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_SYNC,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_SYNC,val); _gui->writeEvent(ev); } break; case CTRL_WAVE: - _preset->setIsUsed(true); - _preset->lfo.wave=(Wave)val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->lfo.wave=(Wave)val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_WAVE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_WAVE,val); _gui->writeEvent(ev); } break; case CTRL_PMODSENS: - _preset->setIsUsed(true); - _preset->sensitivity.pitch=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.pitch=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PMODSENS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PMODSENS,val); _gui->writeEvent(ev); } break; case CTRL_AMS: - _preset->setIsUsed(true); - _preset->sensitivity.amplitude=val; - setLfo(); + _preset[ch]->setIsUsed(true); + _preset[ch]->sensitivity.amplitude=val; + setLfo(ch); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_AMS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_AMS,val); _gui->writeEvent(ev); } break; case CTRL_TRANSPOSE: - _preset->setIsUsed(true); - _preset->function.transpose=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.transpose=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_TRANSPOSE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_TRANSPOSE,val); _gui->writeEvent(ev); } break; case CTRL_POLYMODE: - _preset->setIsUsed(true); - _preset->function.mode=(Mode)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mode=(Mode)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_POLYMODE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_POLYMODE,val); _gui->writeEvent(ev); } break; case CTRL_PBENDRANGE: - _preset->setIsUsed(true); - _preset->function.pBendRange=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.pBendRange=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PBENDRANGE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PBENDRANGE,val); _gui->writeEvent(ev); } break; case CTRL_PORTAMODE: - _preset->setIsUsed(true); - _preset->function.portamento=(Portamento)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.portamento=(Portamento)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PORTAMODE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTAMODE,val); _gui->writeEvent(ev); } break; case CTRL_PORTATIME: - _preset->setIsUsed(true); - _preset->function.portamentoTime=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.portamentoTime=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PORTATIME,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PORTATIME,val); _gui->writeEvent(ev); } break; case CTRL_FCVOLUME: - _preset->setIsUsed(true); - _preset->function.fcVolume=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcVolume=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FCVOLUME,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FCVOLUME,val); _gui->writeEvent(ev); } break; case CTRL_FSW: - _preset->setIsUsed(true); - _preset->function.footSw=(FootSw)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.footSw=(FootSw)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FSW,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FSW,val); _gui->writeEvent(ev); } break; case CTRL_MWPITCH: - _preset->setIsUsed(true); - _preset->function.mwPitch=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mwPitch=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_MWPITCH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_MWPITCH,val); _gui->writeEvent(ev); } break; case CTRL_MWAMPLITUDE: - _preset->setIsUsed(true); - _preset->function.mwAmplitude=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.mwAmplitude=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_MWAMPLITUDE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_MWAMPLITUDE,val); _gui->writeEvent(ev); } break; case CTRL_BCPITCH: - _preset->setIsUsed(true); - _preset->function.bcPitch=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcPitch=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_BCPITCH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCH,val); _gui->writeEvent(ev); } break; case CTRL_BCAMPLITUDE: - _preset->setIsUsed(true); - _preset->function.bcAmplitude=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcAmplitude=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_BCAMPLITUDE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_BCAMPLITUDE,val); _gui->writeEvent(ev); } break; case CTRL_BCPITCHBIAS: - _preset->setIsUsed(true); - _preset->function.bcPitchBias=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcPitchBias=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_BCPITCHBIAS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_BCPITCHBIAS,val); _gui->writeEvent(ev); } break; case CTRL_BCEGBIAS: - _preset->setIsUsed(true); - _preset->function.bcEgBias=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.bcEgBias=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_BCEGBIAS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_BCEGBIAS,val); _gui->writeEvent(ev); } break; case CTRL_ATPITCH: - _preset->setIsUsed(true); - _preset->function.atPitch=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atPitch=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_ATPITCH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCH,val); _gui->writeEvent(ev); } break; case CTRL_ATAMPLITUDE: - _preset->setIsUsed(true); - _preset->function.atAmplitude=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atAmplitude=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_ATAMPLITUDE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_ATAMPLITUDE,val); _gui->writeEvent(ev); } break; case CTRL_ATPITCHBIAS: - _preset->setIsUsed(true); - _preset->function.atPitchBias=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atPitchBias=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_ATPITCHBIAS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_ATPITCHBIAS,val); _gui->writeEvent(ev); } break; case CTRL_ATEGBIAS: - _preset->setIsUsed(true); - _preset->function.atEgBias=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.atEgBias=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_ATEGBIAS,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_ATEGBIAS,val); _gui->writeEvent(ev); } break; case CTRL_PR1: - _preset->setIsUsed(true); - _preset->pitchEg.pr1=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr1=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PR1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PR1,val); _gui->writeEvent(ev); } break; case CTRL_PR2: - _preset->setIsUsed(true); - _preset->pitchEg.pr2=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr2=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PR2,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PR2,val); _gui->writeEvent(ev); } break; case CTRL_PR3: - _preset->setIsUsed(true); - _preset->pitchEg.pr3=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pr3=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PR3,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PR3,val); _gui->writeEvent(ev); } break; case CTRL_PL1: - _preset->setIsUsed(true); - _preset->pitchEg.pl1=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl1=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PL1,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PL1,val); _gui->writeEvent(ev); } break; case CTRL_PL2: - _preset->setIsUsed(true); - _preset->pitchEg.pl2=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl2=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PL2,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PL2,val); _gui->writeEvent(ev); } break; case CTRL_PL3: - _preset->setIsUsed(true); - _preset->pitchEg.pl3=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->pitchEg.pl3=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_PL3,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_PL3,val); _gui->writeEvent(ev); } break; case CTRL_FIX: - _preset->setIsUsed(true); - _preset->frequency[k].isFix=val==1; + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].isFix=val==1; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FIX+k*DECAPAR2,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FIX+k*DECAPAR2,val); _gui->writeEvent(ev); } break; case CTRL_FIXRANGE: - _preset->setIsUsed(true); - _preset->frequency[k].freq=((double)val)/100.0; + _preset[ch]->setIsUsed(true); + _preset[ch]->frequency[k].freq=((double)val)/100.0; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER, + MidiEvent ev(0,ch,ME_CONTROLLER, CTRL_FIXRANGE+k*DECAPAR2,val); _gui->writeEvent(ev); } break; case CTRL_OSW: - _preset->setIsUsed(true); - _preset->oscWave[k]=(OscWave)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->oscWave[k]=(OscWave)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_OSW+k*DECAPAR2,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_OSW+k*DECAPAR2,val); _gui->writeEvent(ev); } break; case CTRL_SHFT: - _preset->setIsUsed(true); - _preset->eg[k].egShift=(egShiftValue)val; + _preset[ch]->setIsUsed(true); + _preset[ch]->eg[k].egShift=(egShiftValue)val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_SHFT+k*DECAPAR2,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_SHFT+k*DECAPAR2,val); _gui->writeEvent(ev); } break; case CTRL_REVERBRATE: - _preset->setIsUsed(true); - _preset->function.reverbRate=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.reverbRate=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_REVERBRATE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_REVERBRATE,val); _gui->writeEvent(ev); } break; case CTRL_FCPITCH: - _preset->setIsUsed(true); - _preset->function.fcPitch=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcPitch=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FCPITCH,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FCPITCH,val); _gui->writeEvent(ev); } break; case CTRL_FCAMPLITUDE: - _preset->setIsUsed(true); - _preset->function.fcAmplitude=val; + _preset[ch]->setIsUsed(true); + _preset[ch]->function.fcAmplitude=val; if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_FCAMPLITUDE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_FCAMPLITUDE,val); _gui->writeEvent(ev); } break; - case CTRL_GLOBALDETUNE: - _preset->setIsUsed(true); - _preset->globalDetune=val; + case CTRL_CHANNELENABLE: + setChannelEnable(ch, (bool)val); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_GLOBALDETUNE,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELENABLE,val); _gui->writeEvent(ev); } break; - case CTRL_MASTERVOLUME: - setMasterVol(val); + case CTRL_CHANNELDETUNE: + _preset[ch]->setIsUsed(true); + setChannelDetune(ch, val); if(!fromGui) { - MidiEvent ev(0,0,ME_CONTROLLER,CTRL_MASTERVOLUME,val); + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELDETUNE,val); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELVOLUME: + setChannelVol(ch, val); + applyChannelAmp(ch); + if(!fromGui) { + MidiEvent ev(0,ch,ME_CONTROLLER,CTRL_CHANNELVOLUME,val); _gui->writeEvent(ev); } break; case CTRL_NBRVOICES: - setNbrVoices((unsigned char)val); + setNbrVoices(ch, val); if(!fromGui) { - MidiEvent ev(0, 0/*ch*/, ME_CONTROLLER, CTRL_NBRVOICES, val); + MidiEvent ev(0, ch, ME_CONTROLLER, CTRL_NBRVOICES, val); _gui->writeEvent(ev); } break; @@ -2312,61 +2656,89 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { hbank = 0; if (lbank > 127) lbank = 0; - programSelect(hbank, lbank, prog); - _preset->setIsUsed(true);//not sure to put that + programSelect(ch, hbank, lbank, prog); + _preset[ch]->setIsUsed(true);//TODO : not sure to put that if(!fromGui) { - MidiEvent ev(0, 0, ME_CONTROLLER, CTRL_PROGRAM, val); + MidiEvent ev(0, ch, ME_CONTROLLER, CTRL_PROGRAM, val); _gui->writeEvent(ev); } } break; case CTRL_MODULATION: printf("TODO : CONTROLE MODULATION %d\n", val); - setModulation(val); + setModulation(ch, val); break; case CTRL_PITCH: printf("CONTROLE PITCH %d\n", val); - setPitchBendCoef(val); + setPitchBendCoef(ch, val); break; + case CTRL_PANPOT: + _preset[ch]->setIsUsed(true); + setChannelPan(ch, (val+MAXCHANNELPAN)/2); + applyChannelAmp(ch); + if(!fromGui) { + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_CHANNELPAN, + (val+MAXCHANNELPAN)/2); + _gui->writeEvent(ev); + } + break; + case CTRL_CHANNELPAN: + _preset[ch]->setIsUsed(true); + setChannelPan(ch, val); + applyChannelAmp(ch); + if(!fromGui) { + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_CHANNELPAN, val); + _gui->writeEvent(ev); + } + break; case CTRL_FINEBRIGHTNESS: - _preset->setIsUsed(true); - _preset->brightness = val; - setOutLevel(); + _preset[ch]->setIsUsed(true); + setChannelBrightness(ch, val); + setOutLevel(ch); if(!fromGui) { - MidiEvent ev(0,0, ME_CONTROLLER, CTRL_FINEBRIGHTNESS, val); + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_FINEBRIGHTNESS, val); _gui->writeEvent(ev); } break; case CTRL_BRIGHTNESS: - _preset->setIsUsed(true); - _preset->brightness = val*(MIDFINEBRIGHTNESS/MIDBRIGHTNESS); - setOutLevel(); + _preset[ch]->setIsUsed(true); + setChannelBrightness(ch, val*(MIDFINEBRIGHTNESS/MIDBRIGHTNESS)); + setOutLevel(ch); if(!fromGui) { MidiEvent - ev(0,0,ME_CONTROLLER,CTRL_FINEBRIGHTNESS,_preset->brightness); + ev(0,ch,ME_CONTROLLER,CTRL_FINEBRIGHTNESS,getChannelBrightness(ch)); _gui->writeEvent(ev); } break; case CTRL_ATTACK_TIME: - _preset->setIsUsed(true); - _preset->attack = val; - setEnvAttack(); + _preset[ch]->setIsUsed(true); + setChannelAttack(ch, val); + setEnvAttack(ch); if(!fromGui) { - MidiEvent ev(0,0, ME_CONTROLLER, CTRL_ATTACK_TIME, val); + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_ATTACK_TIME, val); _gui->writeEvent(ev); } break; case CTRL_RELEASE_TIME: - _preset->setIsUsed(true); - _preset->release = val; - setEnvRelease(); + _preset[ch]->setIsUsed(true); + setChannelRelease(ch, val); + setEnvRelease(ch); if(!fromGui) { - MidiEvent ev(0,0, ME_CONTROLLER, CTRL_RELEASE_TIME, val); + MidiEvent ev(0,ch, ME_CONTROLLER, CTRL_RELEASE_TIME, val); _gui->writeEvent(ev); } break; case CTRL_SUSTAIN: - setSustain(val); + setSustain(ch, val); break; + case CTRL_VOLUME: + setChannelVol(ch, val*(MAXCHANNELVOLUME/127)); + applyChannelAmp(ch); + if(!fromGui) { + MidiEvent + ev(0, ch, ME_CONTROLLER, CTRL_CHANNELVOLUME, getChannelVol(ch)); + _gui->writeEvent(ev); + } + break; default: break; } @@ -2378,9 +2750,8 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) { // getPatchName //--------------------------------------------------------- -const char* DeicsOnze::getPatchName(int ch, int val, int) const -{ - if(ch==_global.channelNum || _global.channelNum==-1) { +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; @@ -2396,6 +2767,7 @@ const char* DeicsOnze::getPatchName(int ch, int val, int) const if (p_preset) tempName=const_cast<char *>(p_preset->name.c_str()); return tempName; } + return " "; } //--------------------------------------------------------- @@ -2446,63 +2818,90 @@ int DeicsOnze::getControllerInfo(int index, const char** name, // playNote // process note on //--------------------------------------------------------- - bool DeicsOnze::playNote(int ch, int pitch, int velo) { int newVoice; int nO2V; int p2V; - if(ch==_global.channelNum || _global.channelNum==-1) { + if(_global.channel[ch].isEnable) { if(velo==0) {//Note off - p2V=pitchOn2Voice(pitch); - printf("pitchOn2Voice %d\n", p2V); - if(p2V<_global.nbrVoices) { - if(_global.sustain) _voices[p2V].isSustained=true; + 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 for(int i=0; i<NBROP; i++) { - _voices[p2V].op[i].envState=RELEASE; - _voices[p2V].op[i].coefVLevel= - envRR2coef(_preset->eg[i].rr, sampleRate(), _preset->release); + _global.channel[ch].voices[p2V].op[i].envState=RELEASE; + _global.channel[ch].voices[p2V].op[i].coefVLevel= + envRR2coef(_preset[ch]->eg[i].rr, sampleRate(), + getChannelRelease(ch)); } return false;} //else printf("error over NBRVOICES\n"); } else //Note on { - nO2V=noteOff2Voice(); - newVoice=((nO2V==MAXNBRVOICES)?minVolu2Voice():nO2V); - - _voices[newVoice].isOn=true; - _voices[newVoice].sampleFeedback=0.0; - _voices[newVoice].pitch=pitch; - - /*if(_preset->lfo.sync)*/ _global.lfoIndex=0;//a revoir - _global.lfoDelayIndex=0.0; - _global.delayPassed=false; + nO2V=noteOff2Voice(ch); + newVoice=((nO2V==MAXNBRVOICES)?minVolu2Voice(ch):nO2V); + printf("Note On : ch = %d, v = %d, p = %d\n", ch, newVoice, pitch); + //some initializations + // hasAttractor is false by default but can become true if + // a portamento is appliable + _global.channel[ch].voices[newVoice].hasAttractor = false; + _global.channel[ch].voices[newVoice].isOn = true; + _global.channel[ch].voices[newVoice].sampleFeedback = 0.0; + _global.channel[ch].voices[newVoice].pitch = pitch; + + + //portamento + //if there is no previous note there is no portamento + if(_preset[ch]->function.portamentoTime!=0 + && _global.channel[ch].lastVoice && + (_preset[ch]->function.portamento==FULL) || + (_preset[ch]->function.portamento==FINGER && !allNoteOff(ch))) { + _global.channel[ch].voices[newVoice].hasAttractor = true; + _global.channel[ch].voices[newVoice].attractor = + _global.channel[ch].lastVoice->pitch; //TODO : all to do... + } + + /*if(_preset->lfo.sync)*/ _global.channel[ch].lfoIndex=0;//a revoir + _global.channel[ch].lfoDelayIndex=0.0; + _global.channel[ch].delayPassed=false; for(int i=0; i<NBROP; i++) { - _voices[newVoice].op[i].ampVeloNote = - velo2AmpR(velo, _preset->sensitivity.keyVelocity[i]) - *note2Amp((double) (pitch+_preset->function.transpose), - _preset->scaling.level[i]); - _voices[newVoice].op[i].amp = outLevel2Amp(_preset->outLevel[i]) - *_voices[newVoice].op[i].ampVeloNote * brightness2Amp(i); - _voices[newVoice].op[i].index=0.0; - _voices[newVoice].op[i].freq= - (pitch2freq((double)_preset->globalDetune/(double)MAXGLOBALDETUNE) + _global.channel[ch].voices[newVoice].op[i].ampVeloNote = + velo2AmpR(velo, _preset[ch]->sensitivity.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 get 0.0, it means that the offset is 0 + // for monophonic it will be different + _global.channel[ch].voices[newVoice].op[i].index=0.0; + //the frequence for each operator is calculated + //and is used later to calculate inct + _global.channel[ch].voices[newVoice].op[i].freq= + (pitch2freq((double)getChannelDetune(ch) + /(double)MAXCHANNELDETUNE) /LOWERNOTEFREQ)* - (_preset->frequency[i].isFix? - _preset->frequency[i].freq: - (_preset->frequency[i].ratio - *pitch2freq((double)(pitch+_preset->function.transpose) - +(double)_preset->detune[i]*COEFDETUNE))); - _voices[newVoice].op[i].inct=(double)RESOLUTION - /((double)sampleRate()/_voices[newVoice].op[i].freq); - _voices[newVoice].op[i].envState=ATTACK; - _voices[newVoice].op[i].envIndex=0.0; - setEnvAttack(newVoice, i); + (_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))); + //compute inct + _global.channel[ch].voices[newVoice].op[i].inct=(double)RESOLUTION + /((double)sampleRate() + /_global.channel[ch].voices[newVoice].op[i].freq); + _global.channel[ch].voices[newVoice].op[i].envState=ATTACK; + _global.channel[ch].voices[newVoice].op[i].envIndex=0.0; + setEnvAttack(ch, newVoice, i); //printf("Coef Attack = %e envInct = %e\n", //coefAttack(_preset->attack), _voices[newVoice].op[i].envInct); } + _global.channel[ch].lastVoice = &_global.channel[ch].voices[newVoice]; return false; } } @@ -2511,7 +2910,7 @@ bool DeicsOnze::playNote(int ch, int pitch, int velo) { //--------------------------------------------------------- // plusMod -// add two doubles modulo SINRESOLUTION +// add two doubles modulo RESOLUTION //--------------------------------------------------------- inline double plusMod(double x, double y) { @@ -2527,252 +2926,275 @@ inline double plusMod(double x, double y) // write // synthesize n samples into buffer+offset //--------------------------------------------------------- - void DeicsOnze::process(float** buffer, int offset, int n) { - //Process messages from the gui - while (_gui->fifoSize()) { - MidiEvent 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); - } + //Process messages from the gui + while (_gui->fifoSize()) { + MidiEvent ev = _gui->readEvent(); + if (ev.type() == ME_SYSEX) { + sysex(ev.len(), ev.data(), true); + sendEvent(ev); } - float* p = buffer[0] + offset; - float sample[MAXNBRVOICES]; - float resSample; - float sampleOp[NBROP]; - float ampOp[NBROP]; - for(int i = 0; i < n; i++) - { - resSample = 0; - //stepProcess return the result to resSample - - //Global - lfoUpdate(_preset, &_global, waveTable[W2]); + 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; + //maybe to put outside to optimize + float sample[MAXNBRVOICES]; + float tempLeftOutput; + float tempRightOutput; + float tempChannelOutput; + float sampleOp[NBROP]; + float ampOp[NBROP]; + for(int i = 0; i < n; i++) { + tempLeftOutput = 0.0; + tempRightOutput = 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]); //per voice - for(int j=0; j<_global.nbrVoices; j++) - { - if (_voices[j].isOn) - { - for(int k=0; k<NBROP; k++) - { - _voices[j].op[k].index= - plusMod(_voices[j].op[k].index, - _global.lfoCoefInct*_voices[j].op[k].inct - *_global.pitchBendCoef); - - ampOp[k]=_voices[j].op[k].amp*COEFLEVEL - *(_preset->sensitivity.ampOn[k]?_global.lfoAmp:1.0) - *env2AmpR(sampleRate(), waveTable[W2], - _preset->eg[k], &_voices[j].op[k]); - } - switch(_preset->algorithm) - { - case FIRST : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)plusMod(_voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)plusMod(_voices[j].op[1].index, - (float)RESOLUTION*sampleOp[2])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION*sampleOp[1])]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case SECOND : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)_voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)plusMod(_voices[j].op[1].index, - (float)RESOLUTION - *(sampleOp[2]+sampleOp[3])/2.0)]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION - *sampleOp[1])]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case THIRD : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)_voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)plusMod(_voices[j].op[1].index, - (float)RESOLUTION*sampleOp[2])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION - *(sampleOp[3]+sampleOp[1])/2.0)]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case FOURTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)plusMod(_voices[j].op[2].index, - (float)RESOLUTION - *sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)_voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION - *(sampleOp[1]+sampleOp[2])/2.0)]; - - sample[j]=sampleOp[0];///COEFLEVEL; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case FIFTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)plusMod(_voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)_voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION*sampleOp[1])]; - - sample[j]=(sampleOp[0]+sampleOp[2])/2.0;///COEFLEVEL; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF - ||_voices[j].op[2].envState!=OFF); - break; - case SIXTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)plusMod(_voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)plusMod(_voices[j].op[1].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)plusMod(_voices[j].op[0].index, - (float)RESOLUTION*sampleOp[3])]; - - sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case SEVENTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)plusMod(_voices[j].op[2].index, - (float)RESOLUTION*sampleOp[3])]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)_voices[j].op[1].index]; - sampleOp[0]=ampOp[0]*waveTable[_preset->oscWave[0]] - [(int)_voices[j].op[0].index]; - - sample[j]=(sampleOp[0]+sampleOp[1]+sampleOp[2])/3.0; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF); - break; - case EIGHTH : - sampleOp[3]=ampOp[3] - *waveTable[_preset->oscWave[3]] - [(int)plusMod(_voices[j].op[3].index, - (float)RESOLUTION - *_voices[j].sampleFeedback)]; - sampleOp[2]=ampOp[2] - *waveTable[_preset->oscWave[2]] - [(int)_voices[j].op[2].index]; - sampleOp[1]=ampOp[1] - *waveTable[_preset->oscWave[1]] - [(int)_voices[j].op[1].index]; - sampleOp[0]=ampOp[0] - *waveTable[_preset->oscWave[0]] - [(int)_voices[j].op[0].index]; - - sample[j]= - (sampleOp[0]+sampleOp[1]+sampleOp[2]+sampleOp[3]) - /4.0; - - _voices[j].isOn=(_voices[j].op[0].envState!=OFF - || _voices[j].op[1].envState!=OFF - || _voices[j].op[2].envState!=OFF - || _voices[j].op[3].envState!=OFF); - break; - default : printf("Error : No algorithm"); - break; - } - - _voices[j].volume= - ampOp[0]+ampOp[1]+ampOp[2]+ampOp[3]; - - _voices[j].sampleFeedback=sampleOp[3]*_global.feedbackAmp; - - resSample += sample[j]; + for(int j=0; j<_global.channel[c].nbrVoices; j++) { + if (_global.channel[c].voices[j].isOn) { + //per op + for(int k=0; k<NBROP; k++) { + //compute the next index on the wavetable, + //without taking account of the feedback and FM modulation + _global.channel[c].voices[j].op[k].index= + plusMod(_global.channel[c].voices[j].op[k].index, + _global.channel[c].lfoCoefInct* + _global.channel[c].voices[j].op[k].inct + *_global.channel[c].pitchBendCoef); + + ampOp[k]=_global.channel[c].voices[j].op[k].amp*COEFLEVEL + *(_preset[c]->sensitivity.ampOn[k]? + _global.channel[c].lfoAmp:1.0) + *env2AmpR(sampleRate(), 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]; + } } - p[i] += resSample*_global.amp; + //printf("left out = %f, temp out = %f, left amp = %f\n", + //tempLeftOutput, tempChannelOutput, _global.channel[c].ampLeft); + tempLeftOutput += tempChannelOutput*_global.channel[c].ampLeft; + tempRightOutput += tempChannelOutput*_global.channel[c].ampRight; + } } + leftOutput[i] += tempLeftOutput*_global.masterVolume; + rightOutput[i] += tempRightOutput*_global.masterVolume; + } } @@ -2793,7 +3215,7 @@ extern "C" { static MESS descriptor = { "DeicsOnze", "DeicsOnze FM DX11 emulator", - "0.3", // version string + "0.4", // version string MESS_MAJOR_VERSION, MESS_MINOR_VERSION, instantiate }; diff --git a/muse/synti/deicsonze/deicsonze.h b/muse/synti/deicsonze/deicsonze.h index 7d456d35..666bdd37 100644 --- a/muse/synti/deicsonze/deicsonze.h +++ b/muse/synti/deicsonze/deicsonze.h @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // // @@ -36,7 +36,7 @@ #include "deicsonzegui.h" #include "libsynti/mess.h" -#define DEICSONZESTR "deicsonze-0.3" +#define DEICSONZESTR "deicsonze" #define MAXPITCHBENDVALUE 8191 @@ -56,12 +56,14 @@ #define MAXVELO 127 #define MAXVOLUME 100.0 -#define MAXSTRLENGTHINITSETPATH 128 +#define MAXSTRLENGTHINITSETPATH 256 +#define MAXSTRLENGTHBACKGROUNDPIXPATH 256 //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) (x<y?y:x) #define COEFLEVEL 1.0//19.0 #define COEFMAXATTACK 7.5 #define COEFERRDECSUS 0.01 //for the transition between DECAY and SUSTAIN @@ -78,21 +80,24 @@ #define NBRWAVES 8 //number wave forms, do not change #define NBRBANKPRESETS 32 #define MAXNBRVOICES 64 -#define NBRCHANNEL 16 +#define NBRCHANNELS 16 #define SYSEX_INIT_DATA 1 #define SYSEX_INIT_DATA_VERSION 1 #define SAVEINITLENGTH 2 #define DEICSONZECONFIGURATIONSTR "deicsOnzeConfiguation" +#define SYSEX_MASTERVOL 4 +#define MASTERVOLSTR "MasterVolume" +#define MAXMASTERVOLUME 255 +#define INITMASTERVOL 96 #define SYSEX_QUALITY 5 #define QUALITYSTR "Quality" #define HIGHSTR "High" #define MIDDLESTR "Middle" #define LOWSTR "Low" -#define SYSEX_CHANNELNUM 6 -#define CHANNELNUMSTR "ChannelNumber" -#define ALLSTR "All" +#define SYSEX_FONTSIZE 6 +#define FONTSIZESTR "fontSize" #define SYSEX_SAVECONFIG 7 #define SAVECONFIGSTR "SaveConfig" #define SYSEX_SAVEONLYUSED 8 @@ -104,6 +109,10 @@ #define ISINITSETSTR "IsInitSet" #define SYSEX_INITSETPATH 13 #define INITSETPATHSTR "InitSetPath" +#define SYSEX_ISBACKGROUNDPIX 14 +#define ISBACKGROUNDPIXSTR "IsBackgroundPix" +#define SYSEX_BACKGROUNDPIXPATH 15 +#define BACKGROUNDPIXPATHSTR "backgroundPixPath" #define SYSEX_COLORGUI 20 #define TEXTCOLORSTR "TextColor" #define BACKGROUNDCOLORSTR "BackgroundColor" @@ -113,33 +122,42 @@ #define SYSEX_UPDATESETGUI 25 #define SYSEX_PANIC 30 -#define NUMMASTERVOL SAVEINITLENGTH -#define NUMCURRENTPROG SAVEINITLENGTH+1 -#define NUMCURRENTLBANK SAVEINITLENGTH+2 -#define NUMCURRENTHBANK SAVEINITLENGTH+3 -#define NUMSAVEONLYUSED SAVEINITLENGTH+4 -#define NUMSAVECONFIG SAVEINITLENGTH+5 -#define NUMNBRVOICES SAVEINITLENGTH+6 -#define NUMCHANNELNUM SAVEINITLENGTH+7 -#define SAVEGLOBALLENGTH 10 - -#define NUMREDTEXT SAVEINITLENGTH+SAVEGLOBALLENGTH -#define NUMGREENTEXT SAVEINITLENGTH+SAVEGLOBALLENGTH+1 -#define NUMBLUETEXT SAVEINITLENGTH+SAVEGLOBALLENGTH+2 -#define NUMREDBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+3 -#define NUMGREENBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+4 -#define NUMBLUEBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+5 -#define NUMREDEDITTEXT SAVEINITLENGTH+SAVEGLOBALLENGTH+6 -#define NUMGREENEDITTEXT SAVEINITLENGTH+SAVEGLOBALLENGTH+7 -#define NUMBLUEEDITTEXT SAVEINITLENGTH+SAVEGLOBALLENGTH+8 -#define NUMREDEDITBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+9 -#define NUMGREENEDITBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+10 -#define NUMBLUEEDITBACKGROUND SAVEINITLENGTH+SAVEGLOBALLENGTH+11 -#define NUMQUALITY SAVEINITLENGTH+SAVEGLOBALLENGTH+12 -#define SAVECONFIGLENGTH 20 - -#define NUMISINITSET SAVEINITLENGTH+SAVEGLOBALLENGTH+SAVECONFIGLENGTH -#define NUMINITSETPATH SAVEINITLENGTH+SAVEGLOBALLENGTH+SAVECONFIGLENGTH+1 +enum { + NUMMASTERVOL = SAVEINITLENGTH, + NUMCHANNELENABLE, + NUMCHANNELVOL = NUMCHANNELENABLE + NBRCHANNELS + 1, + NUMCHANNELPAN = NUMCHANNELVOL + NBRCHANNELS + 1, + NUMCHANNELBRIGHTNESS = NUMCHANNELPAN + NBRCHANNELS + 1, + NUMCHANNELMODULATION = NUMCHANNELBRIGHTNESS + 2*NBRCHANNELS +1, + NUMCHANNELDETUNE = NUMCHANNELMODULATION + NBRCHANNELS + 1, + NUMCHANNELATTACK = NUMCHANNELDETUNE + NBRCHANNELS + 1, + NUMCHANNELRELEASE = NUMCHANNELATTACK + NBRCHANNELS + 1, + NUMCURRENTPROG = NUMCHANNELRELEASE + NBRCHANNELS + 1, + NUMCURRENTLBANK = NUMCURRENTPROG + NBRCHANNELS + 1, + NUMCURRENTHBANK = NUMCURRENTLBANK + NBRCHANNELS + 1, + NUMNBRVOICES = NUMCURRENTHBANK + NBRCHANNELS + 1, + NUMSAVEONLYUSED = NUMNBRVOICES + NBRCHANNELS + 1, + NUMSAVECONFIG, + NUMREDTEXT, + NUMGREENTEXT, + NUMBLUETEXT, + NUMREDBACKGROUND, + NUMGREENBACKGROUND, + NUMBLUEBACKGROUND, + NUMREDEDITTEXT, + NUMGREENEDITTEXT, + NUMBLUEEDITTEXT, + NUMREDEDITBACKGROUND, + NUMGREENEDITBACKGROUND, + NUMBLUEEDITBACKGROUND, + NUMQUALITY, + NUMFONTSIZE, + NUMISINITSET, + NUMINITSETPATH, + NUMISBACKGROUNDPIX = NUMINITSETPATH + MAXSTRLENGTHINITSETPATH +1, + NUMBACKGROUNDPIXPATH, + NUMCONFIGLENGTH = NUMBACKGROUNDPIXPATH + MAXSTRLENGTHBACKGROUNDPIXPATH + 1 +}; class DeicsOnzeGui; @@ -214,26 +232,30 @@ struct OpVoice { //--------------------------------------------------------- struct Voice { + bool hasAttractor;//true iff the voice has an attractor (portamento occuring) + double attractor; //contain the current inct for portamento bool isOn; bool isSustained; - int pitch; + int pitch; //number of the note double volume; OpVoice op[NBROP]; float sampleFeedback; }; //--------------------------------------------------------- -// Global +// Channel //--------------------------------------------------------- - -enum Quality { - high, - middle, - low -}; - -struct Global { - float amp; +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; @@ -252,11 +274,27 @@ struct Global { bool delayPassed; bool sustain; double pitchBendCoef;//speed coef to read the sample - Quality quality; //0=high, 1=medium, 2=low unsigned char nbrVoices; - char channelNum;//-1 to 15, -1 means all + Voice voices[MAXNBRVOICES]; + Voice* lastVoice;// keep in memory the last voice played to + // the right attractor for portamento }; +//--------------------------------------------------------- +// Global +//--------------------------------------------------------- +enum Quality { + high, + middle, + low +}; + +struct Global { + float masterVolume; + Quality quality; + int fontSize; + Channel channel[NBRCHANNELS]; +}; //--------------------------------------------------------- // DeicsOnze : DX11 emulator @@ -277,16 +315,17 @@ class DeicsOnze : public Mess { QString _initSetPath; bool _isInitSet; + QString _backgroundPixPath; + bool _isBackgroundPix; bool _saveOnlyUsed; bool _saveConfig; DeicsOnzeCtlr _ctrl[NBRCTRLS]; Global _global; - Voice _voices[MAXNBRVOICES]; - Preset* _preset; + Preset* _preset[NBRCHANNELS]; Preset* _initialPreset; mutable MidiPatch _patch; - int _numPatch; + int _numPatch; //what is this? TODO //preset tree Set* _set; @@ -294,35 +333,55 @@ class DeicsOnze : public Mess { Preset* findPreset(int hbank, int lbank, int prog); void initCtrls(); void initGlobal(); + void initChannels(); + void initChannel(int c); void resetVoices(); //when panic is pressed - void initVoice(unsigned char v); - void initVoices(); - void initPreset(); - void setPreset(); - void setFeedback(); - void setLfo(); - void setOutLevel(int k); //set the output level of the operator k - void setOutLevel(); //do the same for all operators - void setEnvAttack(int v, int k); //set envInct of voice v and operator k - void setEnvAttack(int k); //do the same for all voices of operator k - void setEnvAttack(); //do the same for all voices all operators - void setEnvRelease(int v, int k); //set coefVLevel of voice v and operator k - void setEnvRelease(int k); //do the same for all voices of operator k - void setEnvRelease(); //do the same for all voices all operators - double brightness2Amp(int k); //get the brightness of the operator k + 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 + double brightness2Amp(int c, int k); //get the brightness of the operator k //void loadSutulaPresets(); void loadSet(QString s); - int noteOff2Voice(); - int minVolu2Voice(); - int pitchOn2Voice(int pitch); - void programSelect(int hbank, int lbank, int prog); + int noteOff2Voice(int c); //return the first free voice + bool allNoteOff(int c); //return true iff all notes of channel c are off + int minVolu2Voice(int c); + int pitchOn2Voice(int c, int pitch); + void programSelect(int c, int hbank, int lbank, int prog); - void setNbrVoices(unsigned char nv); - void setMasterVol(int mv); - int getMasterVol(void); - void setPitchBendCoef(int val); - void setModulation(int val); - void setSustain(int val); + 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); + bool getChannelEnable(int c) const; + int getNbrVoices(int c) const; + int getMasterVol(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; + 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(AL::Xml* xml); diff --git a/muse/synti/deicsonze/deicsonzegui.cpp b/muse/synti/deicsonze/deicsonzegui.cpp index 35e06194..72851cb6 100644 --- a/muse/synti/deicsonze/deicsonzegui.cpp +++ b/muse/synti/deicsonze/deicsonzegui.cpp @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // deicsonzegui.cpp // @@ -29,6 +29,7 @@ #include "muse/midi.h" #include "muse/midictrl.h" +#include "config.h" #include "deicsonzegui.h" @@ -40,6 +41,8 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) _deicsOnze = deicsOnze; lastDir= ""; + _currentChannel = 0; + tColor = new TCOLOR; bColor = new BCOLOR; etColor = new ETCOLOR; @@ -53,11 +56,21 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) envelopeGraph[2] = new QFrameEnvelope(envelope3Frame, this, 2); envelopeGraph[3] = new QFrameEnvelope(envelope4Frame, this, 3); + //change/enable channel + connect(ChannelCheckBox, SIGNAL(toggled(bool)), this, + SLOT(setEnabledChannel(bool))); + connect(ChannelNumSpinBox, SIGNAL(valueChanged(int)), this, + SLOT(setChangeChannel(int))); + //MasterVolume + connect(masterVolKnob, SIGNAL(valueChanged(float, int)), + this, SLOT(setMasterVolKnob(float))); //Panic connect(panicButton, SIGNAL(pressed()), this, SLOT(setPanic())); //Quick edit connect(channelVolumeKnob, SIGNAL(valueChanged(float, int)), this, SLOT(setChannelVolKnob(float))); + connect(channelPanKnob, SIGNAL(valueChanged(float, int)), + this, SLOT(setChannelPan(float))); connect(brightnessKnob, SIGNAL(valueChanged(float, int)), this, SLOT(setBrightnessKnob(float))); connect(modulationKnob, SIGNAL(valueChanged(float, int)), @@ -74,6 +87,9 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) //quality connect(qualityComboBox, SIGNAL(activated(const QString&)), this, SLOT(setQuality(const QString&))); + //change font size + connect(fontSizeSpinBox, SIGNAL(valueChanged(int)), + this, SLOT(setFontSize(int))); //load save configuration connect(saveConfPushButton, SIGNAL(pressed()), this, SLOT(saveConfiguration())); @@ -84,10 +100,17 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) //load init set connect(initSetCheckBox, SIGNAL(toggled(bool)), this, SLOT(setIsInitSet(bool))); - connect(pathLineEdit, SIGNAL(textChanged(const QString&)), + connect(initSetPathLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setInitSetPath(const QString&))); - connect(browsePushButton, SIGNAL(pressed()), + connect(initSetBrowsePushButton, SIGNAL(pressed()), this, SLOT(setBrowseInitSetPath())); + //load background pix + connect(imageCheckBox, SIGNAL(toggled(bool)), + this, SLOT(setIsBackgroundPix(bool))); + connect(imagePathLineEdit, SIGNAL(textChanged(const QString&)), + this, SLOT(setBackgroundPixPath(const QString&))); + connect(imageBrowsePushButton, SIGNAL(pressed()), + this, SLOT(setBrowseBackgroundPixPath())); //Midi in channel //connect(MidiInChComboBox, SIGNAL(activated(int)), @@ -132,8 +155,8 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) this, SLOT(setLBank(int))); connect(progSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setProg(int))); //Global - connect(channelPanSlider, SIGNAL(valueChanged(int)), - this, SLOT(setPanVol(int))); + //connect(channelPanSlider, SIGNAL(valueChanged(int)), + //this, SLOT(setChannelPan(int))); connect(feedbackSlider, SIGNAL(valueChanged(int)), this, SLOT(setFeedback(int))); connect(LFOWaveComboBox, SIGNAL(activated(int)), @@ -152,8 +175,8 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) this, SLOT(setLfoAmpSens(int))); connect(transposeSlider, SIGNAL(valueChanged(int)), this, SLOT(setTranspose(int))); - connect(globalDetuneSlider, SIGNAL(valueChanged(int)), - this, SLOT(setGlobalDetune(int))); + connect(detuneKnob, SIGNAL(valueChanged(float, int)), + this, SLOT(setChannelDetune(float))); connect(algorithmComboBox, SIGNAL(activated(int)), this, SLOT(setAlgorithm(int))); connect(pitchBendRangeSlider, SIGNAL(valueChanged(int)), @@ -318,18 +341,57 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze) p.setColor(QPalette::Window, (reinterpret_cast<const QColor &>(*tColor))); colorFrame->setPalette(p); + //update maaster volume + updateMasterVolume(INITMASTERVOL); + //update Quick edit + updateQuickEdit(); + //updatePreset(); _enabledPreset = true; setEnabledPreset(false); updateInitSetPath - (QString - ("/usr/local/share/muse-1.0pre1/presets/deicsonze/SutulaBank.dei") - ); + (INSTPREFIX "/share/muse-" VERSION "/presets/deicsonze/ARCH_ALIN"); + //"/usr/local/share/muse-1.0pre1/presets/deicsonze/SutulaBank.dei") + //); + updateBackgroundPixPath + (INSTPREFIX "/share/muse-" VERSION "/wallpapers/paper2.jpg"); + updateBackgroundPixCheckBox(true); + applyBackgroundPix(); +} +//----------------------------------------------------------- +// setEnabledChannel +//----------------------------------------------------------- +void DeicsOnzeGui::setEnabledChannel(bool e) { + sendController(_currentChannel, CTRL_CHANNELENABLE, (int)e); + updateEnabledChannel(e); +} +//----------------------------------------------------------- +// setUpdateEnabledChannelCheckBox +//----------------------------------------------------------- +void DeicsOnzeGui::updateChannelCheckBox(bool b) { + ChannelCheckBox->blockSignals(true); + ChannelCheckBox->setChecked(b); + ChannelCheckBox->blockSignals(false); } //----------------------------------------------------------- +// setChangeChannel +//----------------------------------------------------------- +void DeicsOnzeGui::setChangeChannel(int c) { + _currentChannel = c-1; + updateChannelEnable(_deicsOnze->getChannelEnable(_currentChannel)); + updateNbrVoices(_deicsOnze->getNbrVoices(_currentChannel)); + //update quick edit + updateQuickEdit(); + //update preset + int p, l, h; + _deicsOnze->_preset[_currentChannel]->getHBankLBankProg(&h, &l, &p); + updateSelectPreset(h, l, p); + updatePreset(); +} +//----------------------------------------------------------- // setPanic //----------------------------------------------------------- void DeicsOnzeGui::setPanic() { @@ -342,18 +404,18 @@ void DeicsOnzeGui::setPanic() { // setNbrVoices //----------------------------------------------------------- void DeicsOnzeGui::setNbrVoices(int nv) { - sendController(0, CTRL_NBRVOICES, nv); + sendController(_currentChannel, CTRL_NBRVOICES, nv); } //---------------------------------------------------------- // setMidiInCh //---------------------------------------------------------- -void DeicsOnzeGui::setMidiInCh(int m) { - unsigned char* message = new unsigned char[2]; - message[0]=SYSEX_CHANNELNUM; - message[1]=(unsigned char)(m-1); - sendSysex(message, 2); -} +//void DeicsOnzeGui::setMidiInCh(int m) { +// unsigned char* message = new unsigned char[2]; +// message[0]=SYSEX_CHANNELNUM; +// message[1]=(unsigned char)(m-1); +// sendSysex(message, 2); +//} //----------------------------------------------------------- // saveConfiguration @@ -382,7 +444,7 @@ void DeicsOnzeGui::saveConfiguration() { // saveDefaultConfiguration //----------------------------------------------------------- void DeicsOnzeGui::saveDefaultConfiguration() { - QString filename = QString(getenv("HOME")) + QString("/." DEICSONZESTR); + QString filename = QString(getenv("HOME")) + QString("/." DEICSONZESTR ".dco"); if(!filename.isEmpty()) { QFile f(filename); f.open(QIODevice::WriteOnly); @@ -462,7 +524,16 @@ void DeicsOnzeGui::setQuality(const QString& q) { message[1]=(unsigned char)(q=="High"?high:(q=="Middle"?middle:low)); sendSysex(message, 2); } - +//----------------------------------------------------------- +// setFontSize +//----------------------------------------------------------- +void DeicsOnzeGui::setFontSize(int fs) { + applyFontSize(fs); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_FONTSIZE; + message[1]=(unsigned char)fs; + sendSysex(message, 2); +} //----------------------------------------------------------- // setSaveOnlyUsed //----------------------------------------------------------- @@ -604,8 +675,8 @@ void DeicsOnzeGui::setTextColor(const QColor & c) { QPalette p = this->palette(); p.setColor(QPalette::WindowText, c); this->setPalette(p); - quickEditGroupBox->setPalette(p); - channelPanGroupBox->setPalette(p); + channelCtrlGroupBox->setPalette(p); + //channelPanGroupBox->setPalette(p); FeedbackGroupBox->setPalette(p); LFOGroupBox->setPalette(p); ModulationMatrixGroupBox->setPalette(p); @@ -649,28 +720,117 @@ void DeicsOnzeGui::setTextColor(const QColor & c) { fileGroupBox->setPalette(p); } void DeicsOnzeGui::setBackgroundColor(const QColor & c) { - QPalette p = this->palette(); - p.setColor(QPalette::Window, c); - this->setPalette(p); + if(imageCheckBox->checkState()==Qt::Unchecked) { + QPalette p = this->palette(); + p.setColor(QPalette::Window, c); + this->setPalette(p); + } } void DeicsOnzeGui::setEditTextColor(const QColor & c) { QPalette p = this->palette(); p.setColor(QPalette::Text, c); this->setPalette(p); + channelCtrlGroupBox->setPalette(p); + //channelPanGroupBox->setPalette(p); + FeedbackGroupBox->setPalette(p); + LFOGroupBox->setPalette(p); + ModulationMatrixGroupBox->setPalette(p); + FeedbackGroupBox->setPalette(p); + pitchEnvGroupBox->setPalette(p); + Frequency1groupBox->setPalette(p); + OUT1groupBox->setPalette(p); + Env1GroupBox->setPalette(p); + Scaling1GroupBox->setPalette(p); + DetWaveEGS1GroupBox->setPalette(p); + sensitivity1groupBox->setPalette(p); + Frequency2groupBox->setPalette(p); + OUT2groupBox->setPalette(p); + Env2GroupBox->setPalette(p); + Scaling2GroupBox->setPalette(p); + DetWaveEGS2GroupBox->setPalette(p); + sensitivity2groupBox->setPalette(p); + Frequency3groupBox->setPalette(p); + OUT3groupBox->setPalette(p); + Env3GroupBox->setPalette(p); + Scaling3GroupBox->setPalette(p); + DetWaveEGS3GroupBox->setPalette(p); + sensitivity3groupBox->setPalette(p); + Frequency4groupBox->setPalette(p); + OUT4groupBox->setPalette(p); + Env4GroupBox->setPalette(p); + Scaling4GroupBox->setPalette(p); + DetWaveEGS4GroupBox->setPalette(p); + sensitivity4groupBox->setPalette(p); + transposeGroupBox->setPalette(p); + detuneGroupBox->setPalette(p); + footSWGroupBox->setPalette(p); + pitchBendRangeGroupBox->setPalette(p); + reverbGroupBox->setPalette(p); + modeGroupBox->setPalette(p); + portamentoGroupBox->setPalette(p); + colorGroupBox->setPalette(p); + pathGroupBox->setPalette(p); + qualityGroupBox->setPalette(p); + saveModeButtonGroup->setPalette(p); + fileGroupBox->setPalette(p); masterVolKnob->setScaleValueColor(c); channelVolumeKnob->setScaleValueColor(c); + channelPanKnob->setScaleValueColor(c); brightnessKnob->setScaleValueColor(c); modulationKnob->setScaleValueColor(c); detuneKnob->setScaleValueColor(c); attackKnob->setScaleValueColor(c); releaseKnob->setScaleValueColor(c); - p.setColor(QPalette::WindowText, c); - presetNameLabel->setPalette(p); + //p.setColor(QPalette::WindowText, c); + //presetNameLabel->setPalette(p); } void DeicsOnzeGui::setEditBackgroundColor(const QColor & c) { QPalette p = this->palette(); p.setColor(QPalette::Base, c); this->setPalette(p); + channelCtrlGroupBox->setPalette(p); + //channelPanGroupBox->setPalette(p); + FeedbackGroupBox->setPalette(p); + LFOGroupBox->setPalette(p); + ModulationMatrixGroupBox->setPalette(p); + FeedbackGroupBox->setPalette(p); + pitchEnvGroupBox->setPalette(p); + Frequency1groupBox->setPalette(p); + OUT1groupBox->setPalette(p); + Env1GroupBox->setPalette(p); + Scaling1GroupBox->setPalette(p); + DetWaveEGS1GroupBox->setPalette(p); + sensitivity1groupBox->setPalette(p); + Frequency2groupBox->setPalette(p); + OUT2groupBox->setPalette(p); + Env2GroupBox->setPalette(p); + Scaling2GroupBox->setPalette(p); + DetWaveEGS2GroupBox->setPalette(p); + sensitivity2groupBox->setPalette(p); + Frequency3groupBox->setPalette(p); + OUT3groupBox->setPalette(p); + Env3GroupBox->setPalette(p); + Scaling3GroupBox->setPalette(p); + DetWaveEGS3GroupBox->setPalette(p); + sensitivity3groupBox->setPalette(p); + Frequency4groupBox->setPalette(p); + OUT4groupBox->setPalette(p); + Env4GroupBox->setPalette(p); + Scaling4GroupBox->setPalette(p); + DetWaveEGS4GroupBox->setPalette(p); + sensitivity4groupBox->setPalette(p); + transposeGroupBox->setPalette(p); + detuneGroupBox->setPalette(p); + footSWGroupBox->setPalette(p); + pitchBendRangeGroupBox->setPalette(p); + reverbGroupBox->setPalette(p); + modeGroupBox->setPalette(p); + portamentoGroupBox->setPalette(p); + colorGroupBox->setPalette(p); + pathGroupBox->setPalette(p); + qualityGroupBox->setPalette(p); + saveModeButtonGroup->setPalette(p); + fileGroupBox->setPalette(p); p = pitchEnvFrame->palette(); p.setColor(QPalette::Window, c); pitchEnvFrame->setPalette(p); @@ -688,6 +848,7 @@ void DeicsOnzeGui::setEditBackgroundColor(const QColor & c) { envelope4Frame->setPalette(p); masterVolKnob->setScaleColor(c); channelVolumeKnob->setScaleColor(c); + channelPanKnob->setScaleColor(c); brightnessKnob->setScaleColor(c); modulationKnob->setScaleColor(c); detuneKnob->setScaleColor(c); @@ -709,7 +870,8 @@ void QFramePitchEnvelope::paintEvent(QPaintEvent* /*e*/) { resize(_deicsOnzeGui->pitchEnvFrame->width(), _deicsOnzeGui->pitchEnvFrame->height()); //update the positions of the envelope - PitchEg* pe=&_deicsOnzeGui->_deicsOnze->_preset->pitchEg; + PitchEg* pe = &_deicsOnzeGui->_deicsOnze + ->_preset[_deicsOnzeGui->_currentChannel]->pitchEg; env2Points(pe->pl1, pe->pl2, pe->pl3, pe->pr1, pe->pr2, pe->pr3); } //Draw the verticale line on the release time @@ -813,7 +975,8 @@ void QFrameEnvelope::paintEvent(QPaintEvent* /*e*/) { //and update the envelope int op = _deicsOnzeGui->deicsOnzeTabWidget->currentIndex()-2; //-2 because of the presetsTab and globalTab - Eg* eg=&(_deicsOnzeGui->_deicsOnze->_preset->eg[op]); + Eg* eg=&(_deicsOnzeGui->_deicsOnze-> + _preset[_deicsOnzeGui->_currentChannel]->eg[op]); switch(op) { case 0 : if(_deicsOnzeGui->envelope1Frame->width()!=width() || @@ -1042,129 +1205,139 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { if (ev.type() == ME_CONTROLLER) { //printf("ME_CONTROLLER\n"); int id=ev.dataA(); + int ch=ev.channel(); int val=ev.dataB(); - switch(id) { - case CTRL_AR: updateAR(0, val); break; - case CTRL_D1R: updateD1R(0, val); break; - case CTRL_D2R: updateD2R(0, val); break; - case CTRL_RR: updateRR(0, val); break; - case CTRL_D1L: updateD1L(0, val); break; - case CTRL_LS: updateLS(0, val); break; - case CTRL_RS: updateRS(0, val); break; - case CTRL_EBS: updateEBS(0, val); break; - case CTRL_AME: updateAME(0, val==1); break; - case CTRL_KVS: updateKVS(0, val); break; - case CTRL_OUT: updateOUT(0, val); break; - case CTRL_RATIO: updateRATIO(0, val); break; - case CTRL_DET: updateDET(0, val); break; - case CTRL_AR+DECAPAR1: updateAR(1, val); break; - case CTRL_D1R+DECAPAR1: updateD1R(1, val); break; - case CTRL_D2R+DECAPAR1: updateD2R(1, val); break; - case CTRL_RR+DECAPAR1: updateRR(1, val); break; - case CTRL_D1L+DECAPAR1: updateD1L(1, val); break; - case CTRL_LS+DECAPAR1: updateLS(1, val); break; - case CTRL_RS+DECAPAR1: updateRS(1, val); break; - case CTRL_EBS+DECAPAR1: updateEBS(1, val); break; - case CTRL_AME+DECAPAR1: updateAME(1, val==1); break; - case CTRL_KVS+DECAPAR1: updateKVS(1, val); break; - case CTRL_OUT+DECAPAR1: updateOUT(1, val); break; - case CTRL_RATIO+DECAPAR1: updateRATIO(1, val); break; - case CTRL_DET+DECAPAR1: updateDET(1, val); break; - case CTRL_AR+2*DECAPAR1: updateAR(2, val); break; - case CTRL_D1R+2*DECAPAR1: updateD1R(2, val); break; - case CTRL_D2R+2*DECAPAR1: updateD2R(2, val); break; - case CTRL_RR+2*DECAPAR1: updateRR(2, val); break; - case CTRL_D1L+2*DECAPAR1: updateD1L(2, val); break; - case CTRL_LS+2*DECAPAR1: updateLS(2, val); break; - case CTRL_RS+2*DECAPAR1: updateRS(2, val); break; - case CTRL_EBS+2*DECAPAR1: updateEBS(2, val); break; - case CTRL_AME+2*DECAPAR1: updateAME(2, val==1); break; - case CTRL_KVS+2*DECAPAR1: updateKVS(2, val); break; - case CTRL_OUT+2*DECAPAR1: updateOUT(2, val); break; - case CTRL_RATIO+2*DECAPAR1: updateRATIO(2, val); break; - case CTRL_DET+2*DECAPAR1: updateDET(2, val); break; - case CTRL_AR+3*DECAPAR1: updateAR(3, val); break; - case CTRL_D1R+3*DECAPAR1: updateD1R(3, val); break; - case CTRL_D2R+3*DECAPAR1: updateD2R(3, val); break; - case CTRL_RR+3*DECAPAR1: updateRR(3, val); break; - case CTRL_D1L+3*DECAPAR1: updateD1L(3, val); break; - case CTRL_LS+3*DECAPAR1: updateLS(3, val); break; - case CTRL_RS+3*DECAPAR1: updateRS(3, val); break; - case CTRL_EBS+3*DECAPAR1: updateEBS(3, val); break; - case CTRL_AME+3*DECAPAR1: updateAME(3, val==1); break; - case CTRL_KVS+3*DECAPAR1: updateKVS(3, val); break; - case CTRL_OUT+3*DECAPAR1: updateOUT(3, val); break; - case CTRL_RATIO+3*DECAPAR1: updateRATIO(3, val); break; - case CTRL_DET+3*DECAPAR1: updateDET(3, val); break; - case CTRL_ALG: updateALG(val); break; - case CTRL_FEEDBACK: updateFEEDBACK(val); break; - case CTRL_SPEED: updateSPEED(val); break; - case CTRL_DELAY: updateDELAY(val); break; - case CTRL_PMODDEPTH: updatePMODDEPTH(val); break; - case CTRL_AMODDEPTH: updateAMODDEPTH(val); break; - case CTRL_SYNC: updateSYNC(val==1); break; - case CTRL_WAVE: updateWAVE(val); break; - case CTRL_PMODSENS: updatePMODSENS(val); break; - case CTRL_AMS: updateAMS(val); break; - case CTRL_TRANSPOSE: updateTRANSPOSE(val); break; - case CTRL_POLYMODE: updatePOLYMODE(val); break; - case CTRL_PBENDRANGE: updatePBENDRANGE(val); break; - case CTRL_PORTAMODE: updatePORTAMODE(val); break; - case CTRL_PORTATIME: updatePORTATIME(val); break; - case CTRL_FCVOLUME: updateFcVolume(val); break; - case CTRL_FSW: - break; - case CTRL_MWPITCH: updateMwPitch(val); break; - case CTRL_MWAMPLITUDE: updateMwAmplitude(val); break; - case CTRL_BCPITCH: updateBcPitch(val); break; - case CTRL_BCAMPLITUDE: updateBcAmplitude(val); break; - case CTRL_BCPITCHBIAS: updateBcPitchBias(val); break; - case CTRL_BCEGBIAS: updateBcEgBias(val); break; - case CTRL_PR1: updatePR1(val); break; - case CTRL_PR2: updatePR2(val); break; - case CTRL_PR3: updatePR3(val); break; - case CTRL_PL1: updatePL1(val); break; - case CTRL_PL2: updatePL2(val); break; - case CTRL_PL3: updatePL3(val); break; - case CTRL_FIX: updateFIX(0, val==1); break; - case CTRL_FIXRANGE: updateFIXRANGE(0, val); break; - case CTRL_OSW: updateOSW(0, val); break; - case CTRL_SHFT: updateSHFT(0, val); break; - case CTRL_FIX+DECAPAR2: updateFIX(1, val==1); break; - case CTRL_FIXRANGE+DECAPAR2: updateFIXRANGE(1, val); break; - case CTRL_OSW+DECAPAR2: updateOSW(1, val); break; - case CTRL_SHFT+DECAPAR2: updateSHFT(1, val); break; - case CTRL_FIX+2*DECAPAR2: updateFIX(2, val==1); break; - case CTRL_FIXRANGE+2*DECAPAR2: updateFIXRANGE(2, val); break; - case CTRL_OSW+2*DECAPAR2: updateOSW(2, val); break; - case CTRL_SHFT+2*DECAPAR2: updateSHFT(2, val); break; - case CTRL_FIX+3*DECAPAR2: updateFIX(3, val==1); break; - case CTRL_FIXRANGE+3*DECAPAR2: updateFIXRANGE(3, val); break; - case CTRL_OSW+3*DECAPAR2: updateOSW(3, val); break; - case CTRL_SHFT+3*DECAPAR2: updateSHFT(3, val); break; - case CTRL_REVERBRATE: updateReverbRate(val); break; - case CTRL_FCPITCH: updateFcPitch(val); break; - case CTRL_FCAMPLITUDE: updateFcAmplitude(val); break; - case CTRL_GLOBALDETUNE: updateGLOBALDETUNE(val); break; - case CTRL_MASTERVOLUME: updateMASTERVOLUME(val); break; - case CTRL_NBRVOICES: updateNbrVoices(val); break; - case CTRL_FINEBRIGHTNESS: updateBrightness(val); break; - case CTRL_ATTACK_TIME: updateAttack(val); break; - case CTRL_RELEASE_TIME: updateRelease(val); break; - case CTRL_PROGRAM : - int hbank = (val & 0xff0000) >> 16; - int lbank = (val & 0xff00) >> 8; - if (hbank > 127) // map "dont care" to 0 - hbank = 0; - if (lbank > 127) - lbank = 0; - int prog = val & 0x7f; - //change the _deicsonze preset - _deicsOnze->programSelect(hbank, lbank, prog); - //only display _deicsonze preset - setPreset(hbank, lbank, prog); - updatePreset(); - break; + if(ch == _currentChannel || id == CTRL_CHANNELENABLE) { + switch(id) { + case CTRL_AR: updateAR(0, val); break; + case CTRL_D1R: updateD1R(0, val); break; + case CTRL_D2R: updateD2R(0, val); break; + case CTRL_RR: updateRR(0, val); break; + case CTRL_D1L: updateD1L(0, val); break; + case CTRL_LS: updateLS(0, val); break; + case CTRL_RS: updateRS(0, val); break; + case CTRL_EBS: updateEBS(0, val); break; + case CTRL_AME: updateAME(0, val==1); break; + case CTRL_KVS: updateKVS(0, val); break; + case CTRL_OUT: updateOUT(0, val); break; + case CTRL_RATIO: updateRATIO(0, val); break; + case CTRL_DET: updateDET(0, val); break; + case CTRL_AR+DECAPAR1: updateAR(1, val); break; + case CTRL_D1R+DECAPAR1: updateD1R(1, val); break; + case CTRL_D2R+DECAPAR1: updateD2R(1, val); break; + case CTRL_RR+DECAPAR1: updateRR(1, val); break; + case CTRL_D1L+DECAPAR1: updateD1L(1, val); break; + case CTRL_LS+DECAPAR1: updateLS(1, val); break; + case CTRL_RS+DECAPAR1: updateRS(1, val); break; + case CTRL_EBS+DECAPAR1: updateEBS(1, val); break; + case CTRL_AME+DECAPAR1: updateAME(1, val==1); break; + case CTRL_KVS+DECAPAR1: updateKVS(1, val); break; + case CTRL_OUT+DECAPAR1: updateOUT(1, val); break; + case CTRL_RATIO+DECAPAR1: updateRATIO(1, val); break; + case CTRL_DET+DECAPAR1: updateDET(1, val); break; + case CTRL_AR+2*DECAPAR1: updateAR(2, val); break; + case CTRL_D1R+2*DECAPAR1: updateD1R(2, val); break; + case CTRL_D2R+2*DECAPAR1: updateD2R(2, val); break; + case CTRL_RR+2*DECAPAR1: updateRR(2, val); break; + case CTRL_D1L+2*DECAPAR1: updateD1L(2, val); break; + case CTRL_LS+2*DECAPAR1: updateLS(2, val); break; + case CTRL_RS+2*DECAPAR1: updateRS(2, val); break; + case CTRL_EBS+2*DECAPAR1: updateEBS(2, val); break; + case CTRL_AME+2*DECAPAR1: updateAME(2, val==1); break; + case CTRL_KVS+2*DECAPAR1: updateKVS(2, val); break; + case CTRL_OUT+2*DECAPAR1: updateOUT(2, val); break; + case CTRL_RATIO+2*DECAPAR1: updateRATIO(2, val); break; + case CTRL_DET+2*DECAPAR1: updateDET(2, val); break; + case CTRL_AR+3*DECAPAR1: updateAR(3, val); break; + case CTRL_D1R+3*DECAPAR1: updateD1R(3, val); break; + case CTRL_D2R+3*DECAPAR1: updateD2R(3, val); break; + case CTRL_RR+3*DECAPAR1: updateRR(3, val); break; + case CTRL_D1L+3*DECAPAR1: updateD1L(3, val); break; + case CTRL_LS+3*DECAPAR1: updateLS(3, val); break; + case CTRL_RS+3*DECAPAR1: updateRS(3, val); break; + case CTRL_EBS+3*DECAPAR1: updateEBS(3, val); break; + case CTRL_AME+3*DECAPAR1: updateAME(3, val==1); break; + case CTRL_KVS+3*DECAPAR1: updateKVS(3, val); break; + case CTRL_OUT+3*DECAPAR1: updateOUT(3, val); break; + case CTRL_RATIO+3*DECAPAR1: updateRATIO(3, val); break; + case CTRL_DET+3*DECAPAR1: updateDET(3, val); break; + case CTRL_ALG: updateALG(val); break; + case CTRL_FEEDBACK: updateFEEDBACK(val); break; + case CTRL_SPEED: updateSPEED(val); break; + case CTRL_DELAY: updateDELAY(val); break; + case CTRL_PMODDEPTH: updatePMODDEPTH(val); break; + case CTRL_AMODDEPTH: updateAMODDEPTH(val); break; + case CTRL_SYNC: updateSYNC(val==1); break; + case CTRL_WAVE: updateWAVE(val); break; + case CTRL_PMODSENS: updatePMODSENS(val); break; + case CTRL_AMS: updateAMS(val); break; + case CTRL_TRANSPOSE: updateTRANSPOSE(val); break; + case CTRL_POLYMODE: updatePOLYMODE(val); break; + case CTRL_PBENDRANGE: updatePBENDRANGE(val); break; + case CTRL_PORTAMODE: updatePORTAMODE(val); break; + case CTRL_PORTATIME: updatePORTATIME(val); break; + case CTRL_FCVOLUME: updateFcVolume(val); break; + case CTRL_FSW: + break; + case CTRL_MWPITCH: updateMwPitch(val); break; + case CTRL_MWAMPLITUDE: updateMwAmplitude(val); break; + case CTRL_BCPITCH: updateBcPitch(val); break; + case CTRL_BCAMPLITUDE: updateBcAmplitude(val); break; + case CTRL_BCPITCHBIAS: updateBcPitchBias(val); break; + case CTRL_BCEGBIAS: updateBcEgBias(val); break; + case CTRL_PR1: updatePR1(val); break; + case CTRL_PR2: updatePR2(val); break; + case CTRL_PR3: updatePR3(val); break; + case CTRL_PL1: updatePL1(val); break; + case CTRL_PL2: updatePL2(val); break; + case CTRL_PL3: updatePL3(val); break; + case CTRL_FIX: updateFIX(0, val==1); break; + case CTRL_FIXRANGE: updateFIXRANGE(0, val); break; + case CTRL_OSW: updateOSW(0, val); break; + case CTRL_SHFT: updateSHFT(0, val); break; + case CTRL_FIX+DECAPAR2: updateFIX(1, val==1); break; + case CTRL_FIXRANGE+DECAPAR2: updateFIXRANGE(1, val); break; + case CTRL_OSW+DECAPAR2: updateOSW(1, val); break; + case CTRL_SHFT+DECAPAR2: updateSHFT(1, val); break; + case CTRL_FIX+2*DECAPAR2: updateFIX(2, val==1); break; + case CTRL_FIXRANGE+2*DECAPAR2: updateFIXRANGE(2, val); break; + case CTRL_OSW+2*DECAPAR2: updateOSW(2, val); break; + case CTRL_SHFT+2*DECAPAR2: updateSHFT(2, val); break; + case CTRL_FIX+3*DECAPAR2: updateFIX(3, val==1); break; + case CTRL_FIXRANGE+3*DECAPAR2: updateFIXRANGE(3, val); break; + case CTRL_OSW+3*DECAPAR2: updateOSW(3, val); break; + case CTRL_SHFT+3*DECAPAR2: updateSHFT(3, val); break; + case CTRL_REVERBRATE: updateReverbRate(val); break; + case CTRL_FCPITCH: updateFcPitch(val); break; + case CTRL_FCAMPLITUDE: updateFcAmplitude(val); break; + case CTRL_CHANNELENABLE: + if(ch == _currentChannel) updateChannelEnable(val); + break; + case CTRL_CHANNELDETUNE: updateChannelDetune(val); break; + case CTRL_CHANNELPAN: updateChannelPan(val); break; + case CTRL_CHANNELVOLUME: updateChannelVolume(val); break; + case CTRL_NBRVOICES: updateNbrVoices(val); break; + case CTRL_FINEBRIGHTNESS: updateBrightness(val); break; + case CTRL_ATTACK_TIME: updateAttack(val); break; + case CTRL_RELEASE_TIME: updateRelease(val); break; + case CTRL_PROGRAM : + int hbank = (val & 0xff0000) >> 16; + int lbank = (val & 0xff00) >> 8; + if (hbank > 127) // map "dont care" to 0 + hbank = 0; + if (lbank > 127) + lbank = 0; + int prog = val & 0x7f; + //printf("GUI program : ch = %d, hbank = %d, lbank = %d, prog = %d\n", + // ch, hbank, lbank, prog); + //change the _deicsonze preset + //to update the right preset + _deicsOnze->programSelect(ch, hbank, lbank, prog); + //only display _deicsonze preset + updateSelectPreset(hbank, lbank, prog); + updatePreset(); + break; + } } } // Sysexes @@ -1176,8 +1349,12 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { case SYSEX_QUALITY : updateQuality((int)data[1]); break; - case SYSEX_CHANNELNUM : - updateMidiInCh((int)(((char)data[1])+1)); + case SYSEX_FONTSIZE : + updateFontSize((int)data[1]); + applyFontSize((int)data[1]); + break; + case SYSEX_MASTERVOL : + updateMasterVolume((int)data[1]); break; case SYSEX_SAVECONFIG : updateSaveConfig((bool)data[1]); @@ -1202,6 +1379,14 @@ void DeicsOnzeGui::processEvent(const MidiEvent& ev) { case SYSEX_INITSETPATH : updateInitSetPath(QString((char*)&data[1])); break; + case SYSEX_ISBACKGROUNDPIX : + updateBackgroundPixCheckBox((bool)data[1]); + if((bool)data[1]) applyBackgroundPix(); + break; + case SYSEX_BACKGROUNDPIXPATH : + updateBackgroundPixPath(QString((char*)&data[1])); + applyBackgroundPix(); + break; case SYSEX_UPDATESETGUI : setSet(); subcategoryListView->clear(); @@ -1284,20 +1469,22 @@ QString DeicsOnzeGui::num3Digits(int n) { // deleteSet //----------------------------------------------------------- void DeicsOnzeGui::deleteSetDialog() { - _deicsOnze->_preset=_deicsOnze->_initialPreset; - while(!_deicsOnze->_set->_categoryVector.empty()) - delete(*_deicsOnze->_set->_categoryVector.begin()); - setSet(); - //_currentQLVCategory = NULL; - presetListView->clear(); - subcategoryListView->clear(); - updateCategoryName("NONE", false); - hbankSpinBox->setEnabled(false); - updateSubcategoryName("NONE", false); - lbankSpinBox->setEnabled(false); - updatePresetName("INITVOICE", false); - progSpinBox->setEnabled(false); - updatePreset(); + //TODO : maybe to put this in sysex to deicsonze.cpp + for(int c = 0; c < NBRCHANNELS; c++) + _deicsOnze->_preset[c]=_deicsOnze->_initialPreset; + while(!_deicsOnze->_set->_categoryVector.empty()) + delete(*_deicsOnze->_set->_categoryVector.begin()); + setSet(); + //_currentQLVCategory = NULL; + presetListView->clear(); + subcategoryListView->clear(); + updateCategoryName("NONE", false); + hbankSpinBox->setEnabled(false); + updateSubcategoryName("NONE", false); + lbankSpinBox->setEnabled(false); + updatePresetName("INITVOICE", false); + progSpinBox->setEnabled(false); + updatePreset(); } //----------------------------------------------------------- // loadSetDialog @@ -1340,7 +1527,8 @@ void DeicsOnzeGui::loadSetDialog() { if (e.tagName() == "deicsOnzeSet") { QString version = e.attribute(QString("version")); if (version == "1.0") { - _deicsOnze->_preset=_deicsOnze->_initialPreset; + for(int c = 0; c < NBRCHANNELS; c++) + _deicsOnze->_preset[c]=_deicsOnze->_initialPreset; while(!_deicsOnze->_set->_categoryVector.empty()) delete(*_deicsOnze->_set->_categoryVector.begin()); _deicsOnze->_set->readSet(node.firstChild()); @@ -1482,6 +1670,7 @@ void DeicsOnzeGui::newCategoryDialog() { QTreeWidgetItem* ci= categoryListView->findItems(num3Digits(nhbank+1), Qt::MatchExactly).at(0); categoryListView->setItemSelected(ci, true); + categoryListView->setCurrentItem(ci); setCategory(ci); categoryListView->scrollToItem(ci); } @@ -1501,7 +1690,8 @@ void DeicsOnzeGui::deleteCategoryDialog() { tr("&Yes"), tr("&No"), QString::null, 0, 1 )) { - _deicsOnze->_preset=_deicsOnze->_initialPreset; + for(int c = 0; c < NBRCHANNELS; c++) + _deicsOnze->_preset[c]=_deicsOnze->_initialPreset; delete(cat->_category); delete(cat); subcategoryListView->clear(); @@ -1647,6 +1837,7 @@ void DeicsOnzeGui::newSubcategoryDialog() { subcategoryListView->findItems(num3Digits(nlbank+1), Qt::MatchExactly).at(0); subcategoryListView->setItemSelected(si, true); + subcategoryListView->setCurrentItem(si); setSubcategory(si); subcategoryListView->scrollToItem(si); } @@ -1668,7 +1859,8 @@ void DeicsOnzeGui::deleteSubcategoryDialog() { ->_subcategoryName.c_str()), tr("&Yes"), tr("&No"), QString::null, 0, 1 )) { - _deicsOnze->_preset=_deicsOnze->_initialPreset; + for(int c = 0; c < NBRCHANNELS; c++) + _deicsOnze->_preset[c]=_deicsOnze->_initialPreset; delete(sub->_subcategory); delete(sub); presetListView->clear(); @@ -1816,6 +2008,7 @@ void DeicsOnzeGui::newPresetDialog() { presetListView->findItems(num3Digits(nprog+1), Qt::MatchExactly).at(0); presetListView->setItemSelected(pi, true); + presetListView->setCurrentItem(pi); setPreset(pi); presetListView->scrollToItem(pi); } @@ -1836,7 +2029,8 @@ void DeicsOnzeGui::deletePresetDialog() { .arg(pre->_preset->name.c_str()), tr("&Yes"), tr("&No"), QString::null, 0, 1 )) { - _deicsOnze->_preset=_deicsOnze->_initialPreset; + for(int c = 0; c < NBRCHANNELS; c++) + _deicsOnze->_preset[c]=_deicsOnze->_initialPreset; delete(pre->_preset); delete(pre); presetLineEdit->setEnabled(false); @@ -1968,7 +2162,8 @@ void DeicsOnzeGui::savePresetDialog() { void DeicsOnzeGui::setPresetName(const QString& n) { QTreeWidgetItem* pre = presetListView->currentItem(); if(pre) { - _deicsOnze->_preset->name=n.toAscii().data();//must be changed with SysEx + //TODO : must be changed with SysEx + _deicsOnze->_preset[_currentChannel]->name = n.toAscii().data(); pre->setText(1,n.toAscii().data()); } } @@ -2044,8 +2239,8 @@ void DeicsOnzeGui::setProg(int pr) {//must be changed with SysEx // load init set //----------------------------------------------------------- void DeicsOnzeGui::setIsInitSet(bool b) { - pathLineEdit->setEnabled(b); - browsePushButton-> setEnabled(b); + initSetPathLineEdit->setEnabled(b); + initSetBrowsePushButton->setEnabled(b); unsigned char* message = new unsigned char[2]; message[0]=SYSEX_ISINITSET; message[1]=(unsigned char)b; @@ -2064,80 +2259,119 @@ void DeicsOnzeGui::setBrowseInitSetPath() { tr("Browse set dialog"), lastDir, QString("*.dei")); - QFileInfo fi(fileName); - lastDir = fi.path(); - updateInitSetPath(fileName); - setInitSetPath(fileName); + if(!fileName.isEmpty()) { + QFileInfo fi(fileName); + lastDir = fi.path(); + updateInitSetPath(fileName); + setInitSetPath(fileName); + } +} +//----------------------------------------------------------- +// load background pix +//----------------------------------------------------------- +void DeicsOnzeGui::setIsBackgroundPix(bool b) { + if(b && !imagePathLineEdit->text().isEmpty()) applyBackgroundPix(); + else setBackgroundColor(reinterpret_cast<const QColor &>(*bColor)); + imagePathLineEdit->setEnabled(b); + imageBrowsePushButton->setEnabled(b); + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_ISBACKGROUNDPIX; + message[1]=(unsigned char)b; + sendSysex(message, 2); +} +void DeicsOnzeGui::setBackgroundPixPath(const QString& s) { + applyBackgroundPix(); + unsigned char* message = new unsigned char[1+MAXSTRLENGTHBACKGROUNDPIXPATH]; + message[0]=SYSEX_BACKGROUNDPIXPATH; + strncpy((char*)&message[1], s.toAscii().data(), + MAXSTRLENGTHBACKGROUNDPIXPATH); + sendSysex(message, 1+MAXSTRLENGTHBACKGROUNDPIXPATH); +} +void DeicsOnzeGui::setBrowseBackgroundPixPath() { + QString fileName = + QFileDialog::getOpenFileName( + this, + tr("Browse image dialog"), + lastDir, + QString("*.jpg *.png")); + if(!fileName.isEmpty()) { + QFileInfo fi(fileName); + lastDir = fi.path(); + updateBackgroundPixPath(fileName); + setBackgroundPixPath(fileName); + } } //----------------------------------------------------------- // Quick Edit //----------------------------------------------------------- void DeicsOnzeGui::setChannelVolKnob(float val) { - channelVolumeKnob->setValue((int)(val*MAXMASTERVOLUME)); //TODO to change + sendController(_currentChannel, CTRL_CHANNELVOLUME, + (int)(val*(float)MAXCHANNELVOLUME)); } void DeicsOnzeGui::setBrightnessKnob(float val) { - sendController(0, CTRL_FINEBRIGHTNESS, (int)(val*(float)MAXFINEBRIGHTNESS)); + sendController(_currentChannel, CTRL_FINEBRIGHTNESS, + (int)(val*(float)MAXFINEBRIGHTNESS)); } void DeicsOnzeGui::setModulationKnob(float val) { - sendController(0, CTRL_MODULATION, (int)(val*(float)MAXMODULATION)); + sendController(_currentChannel, CTRL_MODULATION, + (int)(val*(float)MAXMODULATION)); } void DeicsOnzeGui::setDetuneKnob(float val) { - globalDetuneSlider->setValue((int)((2.0*val-1.0)*(float)MAXGLOBALDETUNE)); + channelDetuneSlider->setValue((int)((2.0*val-1.0)*(float)MAXCHANNELDETUNE)); } void DeicsOnzeGui::setAttackKnob(float val) { - sendController(0, CTRL_ATTACK_TIME, (int)(val*(float)MAXATTACK)); + sendController(_currentChannel, CTRL_ATTACK_TIME, (int)(val*(float)MAXATTACK)); } void DeicsOnzeGui::setReleaseKnob(float val) { - sendController(0, CTRL_RELEASE_TIME, (int)(val*(float)MAXRELEASE)); + sendController(_currentChannel, CTRL_RELEASE_TIME, (int)(val*(float)MAXRELEASE)); } //----------------------------------------------------------- // Global control //----------------------------------------------------------- -void DeicsOnzeGui::setPanVol(int mv) { //TODO - //volumeKnob->blockSignals(true); - //volumeKnob->setValue((float)mv/(float)MAXMASTERVOLUME); - //volumeKnob->blockSignals(false); - //sendController(0, CTRL_MASTERVOLUME, mv); +void DeicsOnzeGui::setChannelPan(float mv) { + sendController(_currentChannel, CTRL_CHANNELPAN, + (int)((mv-0.5)*2*(float)MAXCHANNELPAN)); } -void DeicsOnzeGui::setMasterVol(int mv) { //to change - //volumeKnob->blockSignals(true); - //volumeKnob->setValue((float)mv/(float)MAXMASTERVOLUME); - //volumeKnob->blockSignals(false); - sendController(0, CTRL_MASTERVOLUME, mv); +void DeicsOnzeGui::setMasterVolKnob(float mv) { + setMasterVol((int)(mv*(float)MAXMASTERVOLUME)); +} +void DeicsOnzeGui::setMasterVol(int mv) { + unsigned char* message = new unsigned char[2]; + message[0]=SYSEX_MASTERVOL; + message[1]=(unsigned char)mv; + sendSysex(message, 2); } -void DeicsOnzeGui::setFeedback(int f) {sendController(0, CTRL_FEEDBACK, f);} +void DeicsOnzeGui::setFeedback(int f) {sendController(_currentChannel, CTRL_FEEDBACK, f);} -void DeicsOnzeGui::setLfoWave(int lw) {sendController(0, CTRL_WAVE, lw);} +void DeicsOnzeGui::setLfoWave(int lw) {sendController(_currentChannel, CTRL_WAVE, lw);} -void DeicsOnzeGui::setLfoSpeed(int ls) {sendController(0, CTRL_SPEED, ls);} +void DeicsOnzeGui::setLfoSpeed(int ls) {sendController(_currentChannel, CTRL_SPEED, ls);} -void DeicsOnzeGui::setLfoDelay(int ld) {sendController(0, CTRL_DELAY, ld);} +void DeicsOnzeGui::setLfoDelay(int ld) {sendController(_currentChannel, CTRL_DELAY, ld);} void DeicsOnzeGui::setLfoPModDepth(int lpmd) { - sendController(0, CTRL_PMODDEPTH, lpmd); + sendController(_currentChannel, CTRL_PMODDEPTH, lpmd); } void DeicsOnzeGui::setLfoPitchSens(int lps) { - sendController(0, CTRL_PMODSENS, lps); + sendController(_currentChannel, CTRL_PMODSENS, lps); } void DeicsOnzeGui::setLfoAModDepth(int lamd) { - sendController(0, CTRL_AMODDEPTH, lamd); + sendController(_currentChannel, CTRL_AMODDEPTH, lamd); } -void DeicsOnzeGui::setLfoAmpSens(int las) {sendController(0, CTRL_AMS, las);} +void DeicsOnzeGui::setLfoAmpSens(int las) {sendController(_currentChannel, CTRL_AMS, las);} -void DeicsOnzeGui::setTranspose(int t) {sendController(0, CTRL_TRANSPOSE, t);} +void DeicsOnzeGui::setTranspose(int t) {sendController(_currentChannel, CTRL_TRANSPOSE, t);} -void DeicsOnzeGui::setGlobalDetune(int gd) { - detuneKnob->blockSignals(true); - detuneKnob->setValue((((float)gd)/((float)MAXGLOBALDETUNE))/2.0+0.5); - detuneKnob->blockSignals(false); - sendController(0, CTRL_GLOBALDETUNE, gd); +void DeicsOnzeGui::setChannelDetune(float d) { + sendController(_currentChannel, CTRL_CHANNELDETUNE, + (int)((d-0.5)*2.0*(float)MAXCHANNELDETUNE)); } void DeicsOnzeGui::setAlgorithm(int a) { - sendController(0, CTRL_ALG, (int) (a==0?FIRST: + sendController(_currentChannel, CTRL_ALG, (int) (a==0?FIRST: (a==1?SECOND: (a==2?THIRD: (a==3?FOURTH: @@ -2147,324 +2381,324 @@ void DeicsOnzeGui::setAlgorithm(int a) { } void DeicsOnzeGui::setPitchBendRange(int pbr) { - sendController(0, CTRL_PBENDRANGE, pbr); + sendController(_currentChannel, CTRL_PBENDRANGE, pbr); } //--------------------------------------------------------------- // Pitch Envelope //--------------------------------------------------------------- void DeicsOnzeGui::setPL1(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(val, pe->pl2, pe->pl3, pe->pr1, pe->pr2, pe->pr3); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PL1, val); + sendController(_currentChannel, CTRL_PL1, val); } void DeicsOnzeGui::setPL2(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(pe->pl1, val, pe->pl3, pe->pr1, pe->pr2, pe->pr3); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PL2, val); + sendController(_currentChannel, CTRL_PL2, val); } void DeicsOnzeGui::setPL3(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(pe->pl1, pe->pl2, val, pe->pr1, pe->pr2, pe->pr3); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PL3, val); + sendController(_currentChannel, CTRL_PL3, val); } void DeicsOnzeGui::setPR1(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(pe->pl1, pe->pl2, pe->pl3, val, pe->pr2, pe->pr3); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PR1, val); + sendController(_currentChannel, CTRL_PR1, val); } void DeicsOnzeGui::setPR2(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(pe->pl1, pe->pl2, pe->pl3, pe->pr1, val, pe->pr3); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PR2, val); + sendController(_currentChannel, CTRL_PR2, val); } void DeicsOnzeGui::setPR3(int val) { - PitchEg* pe=&_deicsOnze->_preset->pitchEg; + PitchEg* pe=&_deicsOnze->_preset[_currentChannel]->pitchEg; pitchEnvelopeGraph->env2Points(pe->pl1, pe->pl2, pe->pl3, pe->pr1, pe->pr2, val); pitchEnvelopeGraph->updateEnv(); - sendController(0, CTRL_PR3, val); + sendController(_currentChannel, CTRL_PR3, val); } //--------------------------------------------------------------- // Function //--------------------------------------------------------------- -void DeicsOnzeGui::setFcVolume(int val){sendController(0, CTRL_FCVOLUME, val);} -void DeicsOnzeGui::setFcPitch(int val){sendController(0, CTRL_FCPITCH, val);} +void DeicsOnzeGui::setFcVolume(int val){sendController(_currentChannel, CTRL_FCVOLUME, val);} +void DeicsOnzeGui::setFcPitch(int val){sendController(_currentChannel, CTRL_FCPITCH, val);} void DeicsOnzeGui::setFcAmplitude(int val) { - sendController(0, CTRL_FCAMPLITUDE, val); + sendController(_currentChannel, CTRL_FCAMPLITUDE, val); } -void DeicsOnzeGui::setMwPitch(int val){sendController(0, CTRL_MWPITCH, val);} +void DeicsOnzeGui::setMwPitch(int val){sendController(_currentChannel, CTRL_MWPITCH, val);} void DeicsOnzeGui::setMwAmplitude(int val) { - sendController(0, CTRL_MWAMPLITUDE, val); + sendController(_currentChannel, CTRL_MWAMPLITUDE, val); } -void DeicsOnzeGui::setBcPitch(int val){sendController(0, CTRL_BCPITCH, val);} +void DeicsOnzeGui::setBcPitch(int val){sendController(_currentChannel, CTRL_BCPITCH, val);} void DeicsOnzeGui::setBcAmplitude(int val) { - sendController(0, CTRL_BCAMPLITUDE, val); + sendController(_currentChannel, CTRL_BCAMPLITUDE, val); } void DeicsOnzeGui::setBcPitchBias(int val) { - sendController(0, CTRL_BCPITCHBIAS, val);} + sendController(_currentChannel, CTRL_BCPITCHBIAS, val);} void DeicsOnzeGui::setBcEgBias(int val) { - sendController(0, CTRL_BCEGBIAS, val); + sendController(_currentChannel, CTRL_BCEGBIAS, val); } -void DeicsOnzeGui::setAtPitch(int val){sendController(0, CTRL_ATPITCH, val);} +void DeicsOnzeGui::setAtPitch(int val){sendController(_currentChannel, CTRL_ATPITCH, val);} void DeicsOnzeGui::setAtAmplitude(int val) { - sendController(0, CTRL_ATAMPLITUDE, val); + sendController(_currentChannel, CTRL_ATAMPLITUDE, val); } void DeicsOnzeGui::setAtPitchBias(int val) { - sendController(0, CTRL_ATPITCHBIAS, val);} + sendController(_currentChannel, CTRL_ATPITCHBIAS, val);} void DeicsOnzeGui::setAtEgBias(int val) { - sendController(0, CTRL_ATEGBIAS, val); + sendController(_currentChannel, CTRL_ATEGBIAS, val); } void DeicsOnzeGui::setReverbRate(int val) { //printf("Envoie\n"); - sendController(0, CTRL_REVERBRATE, val); + sendController(_currentChannel, CTRL_REVERBRATE, val); } //--------------------------------------------------------------- // envelope controle //--------------------------------------------------------------- void DeicsOnzeGui::setAR1(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[0]); - printf("ar : %d, d1r : %d, d1l : %d, d2r : %d, rr : %d\n", - val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[0]); + //printf("ar : %d, d1r : %d, d1l : %d, d2r : %d, rr : %d\n", + // val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[0]->env2Points(val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[0]->updateEnv(); - sendController(0, CTRL_AR, val); + sendController(_currentChannel, CTRL_AR, val); } void DeicsOnzeGui::setD1R1(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[0]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[0]); envelopeGraph[0]->env2Points(_eg->ar, val, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[0]->updateEnv(); - sendController(0, CTRL_D1R, val); + sendController(_currentChannel, CTRL_D1R, val); } void DeicsOnzeGui::setD1L1(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[0]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[0]); envelopeGraph[0]->env2Points(_eg->ar, _eg->d1r, val, _eg->d2r, _eg->rr); envelopeGraph[0]->updateEnv(); - sendController(0, CTRL_D1L, val); + sendController(_currentChannel, CTRL_D1L, val); } void DeicsOnzeGui::setD2R1(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[0]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[0]); envelopeGraph[0]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, val, _eg->rr); envelopeGraph[0]->updateEnv(); - sendController(0, CTRL_D2R, val); + sendController(_currentChannel, CTRL_D2R, val); } void DeicsOnzeGui::setRR1(int val){ - Eg* _eg=&(_deicsOnze->_preset->eg[0]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[0]); envelopeGraph[0]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, _eg->d2r, val); envelopeGraph[0]->updateEnv(); - sendController(0, CTRL_RR, val); + sendController(_currentChannel, CTRL_RR, val); } void DeicsOnzeGui::setAR2(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[1]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[1]); envelopeGraph[1]->env2Points(val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[1]->updateEnv(); - sendController(0, CTRL_AR+DECAPAR1, val); + sendController(_currentChannel, CTRL_AR+DECAPAR1, val); } void DeicsOnzeGui::setD1R2(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[1]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[1]); envelopeGraph[1]->env2Points(_eg->ar, val, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[1]->updateEnv(); - sendController(0, CTRL_D1R+DECAPAR1, val); + sendController(_currentChannel, CTRL_D1R+DECAPAR1, val); } void DeicsOnzeGui::setD1L2(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[1]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[1]); envelopeGraph[1]->env2Points(_eg->ar, _eg->d1r, val, _eg->d2r, _eg->rr); envelopeGraph[1]->updateEnv(); - sendController(0, CTRL_D1L+DECAPAR1, val); + sendController(_currentChannel, CTRL_D1L+DECAPAR1, val); } void DeicsOnzeGui::setD2R2(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[1]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[1]); envelopeGraph[1]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, val, _eg->rr); envelopeGraph[1]->updateEnv(); - sendController(0, CTRL_D2R+DECAPAR1, val); + sendController(_currentChannel, CTRL_D2R+DECAPAR1, val); } void DeicsOnzeGui::setRR2(int val){ - Eg* _eg=&(_deicsOnze->_preset->eg[1]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[1]); envelopeGraph[1]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, _eg->d2r, val); envelopeGraph[1]->updateEnv(); - sendController(0, CTRL_RR+DECAPAR1, val); + sendController(_currentChannel, CTRL_RR+DECAPAR1, val); } void DeicsOnzeGui::setAR3(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[2]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[2]); envelopeGraph[2]->env2Points(val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[2]->updateEnv(); - sendController(0, CTRL_AR+2*DECAPAR1, val); + sendController(_currentChannel, CTRL_AR+2*DECAPAR1, val); } void DeicsOnzeGui::setD1R3(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[2]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[2]); envelopeGraph[2]->env2Points(_eg->ar, val, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[2]->updateEnv(); - sendController(0, CTRL_D1R+2*DECAPAR1, val); + sendController(_currentChannel, CTRL_D1R+2*DECAPAR1, val); } void DeicsOnzeGui::setD1L3(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[2]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[2]); envelopeGraph[2]->env2Points(_eg->ar, _eg->d1r, val, _eg->d2r, _eg->rr); envelopeGraph[2]->updateEnv(); - sendController(0, CTRL_D1L+2*DECAPAR1, val); + sendController(_currentChannel, CTRL_D1L+2*DECAPAR1, val); } void DeicsOnzeGui::setD2R3(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[2]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[2]); envelopeGraph[2]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, val, _eg->rr); envelopeGraph[2]->updateEnv(); - sendController(0, CTRL_D2R+2*DECAPAR1, val); + sendController(_currentChannel, CTRL_D2R+2*DECAPAR1, val); } void DeicsOnzeGui::setRR3(int val){ - Eg* _eg=&(_deicsOnze->_preset->eg[2]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[2]); envelopeGraph[2]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, _eg->d2r, val); envelopeGraph[2]->updateEnv(); - sendController(0, CTRL_RR+2*DECAPAR1, val); + sendController(_currentChannel, CTRL_RR+2*DECAPAR1, val); } void DeicsOnzeGui::setAR4(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[3]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[3]); envelopeGraph[3]->env2Points(val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[3]->updateEnv(); - sendController(0, CTRL_AR+3*DECAPAR1, val); + sendController(_currentChannel, CTRL_AR+3*DECAPAR1, val); } void DeicsOnzeGui::setD1R4(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[3]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[3]); envelopeGraph[3]->env2Points(_eg->ar, val, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[3]->updateEnv(); - sendController(0, CTRL_D1R+3*DECAPAR1, val); + sendController(_currentChannel, CTRL_D1R+3*DECAPAR1, val); } void DeicsOnzeGui::setD1L4(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[3]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[3]); envelopeGraph[3]->env2Points(_eg->ar, _eg->d1r, val, _eg->d2r, _eg->rr); envelopeGraph[3]->updateEnv(); - sendController(0, CTRL_D1L+3*DECAPAR1, val); + sendController(_currentChannel, CTRL_D1L+3*DECAPAR1, val); } void DeicsOnzeGui::setD2R4(int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[3]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[3]); envelopeGraph[3]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, val, _eg->rr); envelopeGraph[3]->updateEnv(); - sendController(0, CTRL_D2R+3*DECAPAR1, val); + sendController(_currentChannel, CTRL_D2R+3*DECAPAR1, val); } void DeicsOnzeGui::setRR4(int val){ - Eg* _eg=&(_deicsOnze->_preset->eg[3]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[3]); envelopeGraph[3]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, _eg->d2r, val); envelopeGraph[3]->updateEnv(); - sendController(0, CTRL_RR+3*DECAPAR1, val); + sendController(_currentChannel, CTRL_RR+3*DECAPAR1, val); } //-------------------------------------------------------------- // set Scaling //-------------------------------------------------------------- -void DeicsOnzeGui::setLS1(int val){sendController(0, CTRL_LS, val);} -void DeicsOnzeGui::setRS1(int val){sendController(0, CTRL_RS, val);} -void DeicsOnzeGui::setLS2(int val){sendController(0, CTRL_LS+DECAPAR1, val);} -void DeicsOnzeGui::setRS2(int val){sendController(0, CTRL_RS+DECAPAR1, val);} -void DeicsOnzeGui::setLS3(int val){sendController(0, CTRL_LS+2*DECAPAR1, val);} -void DeicsOnzeGui::setRS3(int val){sendController(0, CTRL_RS+2*DECAPAR1, val);} -void DeicsOnzeGui::setLS4(int val){sendController(0, CTRL_LS+3*DECAPAR1, val);} -void DeicsOnzeGui::setRS4(int val){sendController(0, CTRL_RS+3*DECAPAR1, val);} +void DeicsOnzeGui::setLS1(int val){sendController(_currentChannel, CTRL_LS, val);} +void DeicsOnzeGui::setRS1(int val){sendController(_currentChannel, CTRL_RS, val);} +void DeicsOnzeGui::setLS2(int val){sendController(_currentChannel, CTRL_LS+DECAPAR1, val);} +void DeicsOnzeGui::setRS2(int val){sendController(_currentChannel, CTRL_RS+DECAPAR1, val);} +void DeicsOnzeGui::setLS3(int val){sendController(_currentChannel, CTRL_LS+2*DECAPAR1, val);} +void DeicsOnzeGui::setRS3(int val){sendController(_currentChannel, CTRL_RS+2*DECAPAR1, val);} +void DeicsOnzeGui::setLS4(int val){sendController(_currentChannel, CTRL_LS+3*DECAPAR1, val);} +void DeicsOnzeGui::setRS4(int val){sendController(_currentChannel, CTRL_RS+3*DECAPAR1, val);} //-------------------------------------------------------------- // set Volume //-------------------------------------------------------------- -void DeicsOnzeGui::setVol1(int val){sendController(0, CTRL_OUT, val);} -void DeicsOnzeGui::setVol2(int val){sendController(0, CTRL_OUT+DECAPAR1, val);} -void DeicsOnzeGui::setVol3(int val){sendController(0,CTRL_OUT+2*DECAPAR1,val);} -void DeicsOnzeGui::setVol4(int val){sendController(0,CTRL_OUT+3*DECAPAR1,val);} +void DeicsOnzeGui::setVol1(int val){sendController(_currentChannel, CTRL_OUT, val);} +void DeicsOnzeGui::setVol2(int val){sendController(_currentChannel, CTRL_OUT+DECAPAR1, val);} +void DeicsOnzeGui::setVol3(int val){sendController(_currentChannel,CTRL_OUT+2*DECAPAR1,val);} +void DeicsOnzeGui::setVol4(int val){sendController(_currentChannel,CTRL_OUT+3*DECAPAR1,val);} //-------------------------------------------------------------- // set Ratio and Frequency //-------------------------------------------------------------- void DeicsOnzeGui::setCoarseRatio1(int val) { - sendController(0, CTRL_RATIO, val*100+FineRatio1SpinBox->value()); + sendController(_currentChannel, CTRL_RATIO, val*100+FineRatio1SpinBox->value()); } void DeicsOnzeGui::setFineRatio1(int val) { - sendController(0, CTRL_RATIO, val+CoarseRatio1SpinBox->value()*100); + sendController(_currentChannel, CTRL_RATIO, val+CoarseRatio1SpinBox->value()*100); } void DeicsOnzeGui::setFreq1(int val) { - sendController(0,CTRL_FIXRANGE,val*100);} + sendController(_currentChannel,CTRL_FIXRANGE,val*100);} void DeicsOnzeGui::setFix1(bool f) { - sendController(0, CTRL_FIX, (f==false?0:1));} + sendController(_currentChannel, CTRL_FIX, (f==false?0:1));} void DeicsOnzeGui::setCoarseRatio2(int val) { - sendController(0, CTRL_RATIO+DECAPAR1, val*100+FineRatio1SpinBox->value()); + sendController(_currentChannel, CTRL_RATIO+DECAPAR1, val*100+FineRatio1SpinBox->value()); } void DeicsOnzeGui::setFineRatio2(int val) { - sendController(0,CTRL_RATIO+DECAPAR1,val+CoarseRatio1SpinBox->value()*100); + sendController(_currentChannel,CTRL_RATIO+DECAPAR1,val+CoarseRatio1SpinBox->value()*100); } void DeicsOnzeGui::setFreq2(int val) { - sendController(0,CTRL_FIXRANGE+DECAPAR1,val*100);} + sendController(_currentChannel,CTRL_FIXRANGE+DECAPAR1,val*100);} void DeicsOnzeGui::setFix2(bool f) { - sendController(0, CTRL_FIX+DECAPAR1, (f==false?0:1));} + sendController(_currentChannel, CTRL_FIX+DECAPAR1, (f==false?0:1));} void DeicsOnzeGui::setCoarseRatio3(int val) { - sendController(0,CTRL_RATIO+2*DECAPAR1,val*100+FineRatio1SpinBox->value()); + sendController(_currentChannel,CTRL_RATIO+2*DECAPAR1,val*100+FineRatio1SpinBox->value()); } void DeicsOnzeGui::setFineRatio3(int val) { - sendController(0,CTRL_RATIO+2*DECAPAR1, + sendController(_currentChannel,CTRL_RATIO+2*DECAPAR1, val+CoarseRatio1SpinBox->value()*100); } void DeicsOnzeGui::setFreq3(int val) { - sendController(0,CTRL_FIXRANGE+2*DECAPAR1,val*100);} + sendController(_currentChannel,CTRL_FIXRANGE+2*DECAPAR1,val*100);} void DeicsOnzeGui::setFix3(bool f) { - sendController(0, CTRL_FIX+2*DECAPAR1, (f==false?0:1));} + sendController(_currentChannel, CTRL_FIX+2*DECAPAR1, (f==false?0:1));} void DeicsOnzeGui::setCoarseRatio4(int val) { - sendController(0,CTRL_RATIO+3*DECAPAR1,val*100+FineRatio1SpinBox->value()); + sendController(_currentChannel,CTRL_RATIO+3*DECAPAR1,val*100+FineRatio1SpinBox->value()); } void DeicsOnzeGui::setFineRatio4(int val) { - sendController(0,CTRL_RATIO+3*DECAPAR1, + sendController(_currentChannel,CTRL_RATIO+3*DECAPAR1, val+CoarseRatio1SpinBox->value()*100); } void DeicsOnzeGui::setFreq4(int val) { - sendController(0,CTRL_FIXRANGE+3*DECAPAR1,val*100);} + sendController(_currentChannel,CTRL_FIXRANGE+3*DECAPAR1,val*100);} void DeicsOnzeGui::setFix4(bool f) { - sendController(0, CTRL_FIX+3*DECAPAR1, (f==false?0:1));} + sendController(_currentChannel, CTRL_FIX+3*DECAPAR1, (f==false?0:1));} //-------------------------------------------------------------- // set Sensitivity //-------------------------------------------------------------- -void DeicsOnzeGui::setAME1(bool val) {sendController(0, CTRL_AME, val);} -void DeicsOnzeGui::setEBS1(int val) {sendController(0, CTRL_EBS, val);} -void DeicsOnzeGui::setKVS1(int val) {sendController(0, CTRL_KVS, val);} -void DeicsOnzeGui::setAME2(bool val) {sendController(0,CTRL_AME+DECAPAR1,val);} -void DeicsOnzeGui::setEBS2(int val) {sendController(0,CTRL_EBS+DECAPAR1,val);} -void DeicsOnzeGui::setKVS2(int val) {sendController(0,CTRL_KVS+DECAPAR1,val);} +void DeicsOnzeGui::setAME1(bool val) {sendController(_currentChannel, CTRL_AME, val);} +void DeicsOnzeGui::setEBS1(int val) {sendController(_currentChannel, CTRL_EBS, val);} +void DeicsOnzeGui::setKVS1(int val) {sendController(_currentChannel, CTRL_KVS, val);} +void DeicsOnzeGui::setAME2(bool val) {sendController(_currentChannel,CTRL_AME+DECAPAR1,val);} +void DeicsOnzeGui::setEBS2(int val) {sendController(_currentChannel,CTRL_EBS+DECAPAR1,val);} +void DeicsOnzeGui::setKVS2(int val) {sendController(_currentChannel,CTRL_KVS+DECAPAR1,val);} void DeicsOnzeGui::setAME3(bool val) { - sendController(0,CTRL_AME+2*DECAPAR1,val);} + sendController(_currentChannel,CTRL_AME+2*DECAPAR1,val);} void DeicsOnzeGui::setEBS3(int val) { - sendController(0, CTRL_EBS+2*DECAPAR1, val);} + sendController(_currentChannel, CTRL_EBS+2*DECAPAR1, val);} void DeicsOnzeGui::setKVS3(int val) { - sendController(0, CTRL_KVS+2*DECAPAR1, val);} + sendController(_currentChannel, CTRL_KVS+2*DECAPAR1, val);} void DeicsOnzeGui::setAME4(bool val) { - sendController(0, CTRL_AME+3*DECAPAR1, val);} + sendController(_currentChannel, CTRL_AME+3*DECAPAR1, val);} void DeicsOnzeGui::setEBS4(int val) { - sendController(0, CTRL_EBS+3*DECAPAR1, val);} + sendController(_currentChannel, CTRL_EBS+3*DECAPAR1, val);} void DeicsOnzeGui::setKVS4(int val) { - sendController(0, CTRL_KVS+3*DECAPAR1, val);} + sendController(_currentChannel, CTRL_KVS+3*DECAPAR1, val);} //-------------------------------------------------------------- // set detune //-------------------------------------------------------------- -void DeicsOnzeGui::setDET1(int val){sendController(0, CTRL_DET, val);} -void DeicsOnzeGui::setDET2(int val){sendController(0, CTRL_DET+DECAPAR1, val);} -void DeicsOnzeGui::setDET3(int val){sendController(0,CTRL_DET+2*DECAPAR1,val);} -void DeicsOnzeGui::setDET4(int val){sendController(0,CTRL_DET+3*DECAPAR1,val);} +void DeicsOnzeGui::setDET1(int val){sendController(_currentChannel, CTRL_DET, val);} +void DeicsOnzeGui::setDET2(int val){sendController(_currentChannel, CTRL_DET+DECAPAR1, val);} +void DeicsOnzeGui::setDET3(int val){sendController(_currentChannel,CTRL_DET+2*DECAPAR1,val);} +void DeicsOnzeGui::setDET4(int val){sendController(_currentChannel,CTRL_DET+3*DECAPAR1,val);} //-------------------------------------------------------------- // set WaveForm //-------------------------------------------------------------- void DeicsOnzeGui::setWaveForm1(int w) { - sendController(0, CTRL_OSW, w); + sendController(_currentChannel, CTRL_OSW, w); } void DeicsOnzeGui::setWaveForm2(int w) { - sendController(0, CTRL_OSW+DECAPAR2, w); + sendController(_currentChannel, CTRL_OSW+DECAPAR2, w); } void DeicsOnzeGui::setWaveForm3(int w) { - sendController(0, CTRL_OSW+2*DECAPAR2, w); + sendController(_currentChannel, CTRL_OSW+2*DECAPAR2, w); } void DeicsOnzeGui::setWaveForm4(int w) { - sendController(0, CTRL_OSW+3*DECAPAR2, w); + sendController(_currentChannel, CTRL_OSW+3*DECAPAR2, w); } //-------------------------------------------------------------- // setSet @@ -2554,7 +2788,7 @@ void DeicsOnzeGui::setPreset(QTreeWidgetItem* pre) { int hbank = cpre->_preset->_subcategory->_category->_hbank; setEnabledPreset(true); updatePreset(cpre->_preset); - sendController(0, CTRL_PROGRAM, (hbank<<16)+(lbank<<8)+prog); + sendController(_currentChannel, CTRL_PROGRAM, (hbank<<16)+(lbank<<8)+prog); } } //-------------------------------------------------------------- @@ -2575,21 +2809,46 @@ void DeicsOnzeGui::setEnabledPreset(bool b) { _enabledPreset=b; } } +void DeicsOnzeGui::updateChannelEnable(bool e) { + updateChannelCheckBox(e); + updateEnabledChannel(e); +} +void DeicsOnzeGui::updateEnabledChannel(bool e) { + numberVoicesLabel->setEnabled(e); + nbrVoicesSpinBox->setEnabled(e); + channelCtrlGroupBox->setEnabled(e); + deicsOnzeTabWidget->setEnabled(e); +} void DeicsOnzeGui::updateNbrVoices(int val) { nbrVoicesSpinBox->blockSignals(true); nbrVoicesSpinBox->setValue(val); nbrVoicesSpinBox->blockSignals(false); } -void DeicsOnzeGui::updateMidiInCh(int val) { +void DeicsOnzeGui::updateMasterVolume(int val) { + masterVolKnob->blockSignals(true); + masterVolKnob->setValue(((float)val)/((float)MAXMASTERVOLUME)); + masterVolKnob->blockSignals(false); +} +//void DeicsOnzeGui::updateMidiInCh(int val) { //MidiInChComboBox->blockSignals(true); //MidiInChComboBox->setCurrentIndex(val); //MidiInChComboBox->blockSignals(false); -} +//} void DeicsOnzeGui::updateQuality(int val) { qualityComboBox->blockSignals(true); qualityComboBox->setCurrentIndex(val); qualityComboBox->blockSignals(false); } +void DeicsOnzeGui::updateFontSize(int val) { + fontSizeSpinBox->blockSignals(true); + fontSizeSpinBox->setValue(val); + fontSizeSpinBox->blockSignals(false); +} +void DeicsOnzeGui::applyFontSize(int fs) { + QFont f = font(); + f.setPointSize(fs); + setFont(f); +} void DeicsOnzeGui::updateSaveConfig(bool usc) { saveConfigCheckBox->blockSignals(true); saveConfigCheckBox->setChecked(usc); @@ -2749,7 +3008,7 @@ void DeicsOnzeGui::updateReverbRate(int val) { } //Envelope void DeicsOnzeGui::updateAR(int op, int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[op]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); envelopeGraph[op]->env2Points(val, _eg->d1r, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[op]->updateEnv(); switch(op) { @@ -2778,7 +3037,7 @@ void DeicsOnzeGui::updateAR(int op, int val) { } void DeicsOnzeGui::updateD1R(int op, int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[op]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); envelopeGraph[op]->env2Points(_eg->ar, val, _eg->d1l, _eg->d2r, _eg->rr); envelopeGraph[op]->updateEnv(); switch(op) { @@ -2806,7 +3065,7 @@ void DeicsOnzeGui::updateD1R(int op, int val) { } } void DeicsOnzeGui::updateD2R(int op, int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[op]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); envelopeGraph[op]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, val, _eg->rr); envelopeGraph[op]->updateEnv(); switch(op) { @@ -2834,7 +3093,7 @@ void DeicsOnzeGui::updateD2R(int op, int val) { } } void DeicsOnzeGui::updateRR(int op, int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[op]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); envelopeGraph[op]->env2Points(_eg->ar, _eg->d1r, _eg->d1l, _eg->d2r, val); envelopeGraph[op]->updateEnv(); switch(op) { @@ -2862,7 +3121,7 @@ void DeicsOnzeGui::updateRR(int op, int val) { } } void DeicsOnzeGui::updateD1L(int op, int val) { - Eg* _eg=&(_deicsOnze->_preset->eg[op]); + Eg* _eg=&(_deicsOnze->_preset[_currentChannel]->eg[op]); envelopeGraph[op]->env2Points(_eg->ar, _eg->d1r, val, _eg->d2r, _eg->rr); envelopeGraph[op]->updateEnv(); switch(op) { @@ -3403,26 +3662,14 @@ void DeicsOnzeGui::updateSHFT(int op, int val) { default: printf("DeicsOnzeGui::updateSHFT : Error switch\n"); } } -void DeicsOnzeGui::updateGLOBALDETUNE(int val) { - globalDetuneSlider->blockSignals(true); - globalDetuneSlider->setValue(val); - globalDetuneSlider->blockSignals(false); - globalDetuneSpinBox->blockSignals(true); - globalDetuneSpinBox->setValue(val); - globalDetuneSpinBox->blockSignals(false); +void DeicsOnzeGui::updateChannelDetune(int val) { detuneKnob->blockSignals(true); - detuneKnob->setValue((((float)val)/((float)MAXGLOBALDETUNE))/2.0+0.5); + detuneKnob->setValue((((float)val)/((float)MAXCHANNELDETUNE))/2.0+0.5); detuneKnob->blockSignals(false); } -void DeicsOnzeGui::updateMASTERVOLUME(int val) { - //masterVolSlider->blockSignals(true); - //masterVolSlider->setValue(val); - //masterVolSlider->blockSignals(false); - //masterVolSpinBox->blockSignals(true); - //masterVolSpinBox->setValue(val); - //masterVolSpinBox->blockSignals(false); +void DeicsOnzeGui::updateChannelVolume(int val) { channelVolumeKnob->blockSignals(true); - channelVolumeKnob->setValue(((float)val)/(float)MAXMASTERVOLUME); + channelVolumeKnob->setValue(((float)val)/(float)MAXCHANNELVOLUME); channelVolumeKnob->blockSignals(false); } void DeicsOnzeGui::updateCategoryName(QString cn, bool enable) { @@ -3441,7 +3688,7 @@ void DeicsOnzeGui::updatePresetName(QString pn) { //presetNameLineEdit->blockSignals(true); //presetNameLineEdit->setText(pn); //presetNameLineEdit->blockSignals(false); - presetNameLabel->setText(pn); + //presetNameLabel->setText(pn); presetLineEdit->blockSignals(true); presetLineEdit->setText(pn); presetLineEdit->blockSignals(false); @@ -3473,13 +3720,39 @@ void DeicsOnzeGui::updateInitSetCheckBox(bool b) { initSetCheckBox->blockSignals(true); initSetCheckBox->setChecked(b); initSetCheckBox->blockSignals(false); - pathLineEdit->setEnabled(b); - browsePushButton-> setEnabled(b); + initSetPathLineEdit->setEnabled(b); + initSetBrowsePushButton-> setEnabled(b); } void DeicsOnzeGui::updateInitSetPath(QString s) { - pathLineEdit->blockSignals(true); - pathLineEdit->setText(s); - pathLineEdit->blockSignals(false); + initSetPathLineEdit->blockSignals(true); + initSetPathLineEdit->setText(s); + initSetPathLineEdit->blockSignals(false); +} +void DeicsOnzeGui::updateBackgroundPixCheckBox(bool b) { + imageCheckBox->blockSignals(true); + imageCheckBox->setChecked(b); + imageCheckBox->blockSignals(false); + imagePathLineEdit->setEnabled(b); + imageBrowsePushButton-> setEnabled(b); +} +void DeicsOnzeGui::updateBackgroundPixPath(QString s) { + imagePathLineEdit->blockSignals(true); + imagePathLineEdit->setText(s); + imagePathLineEdit->blockSignals(false); +} +void DeicsOnzeGui::applyBackgroundPix() { + QPalette p = this->palette(); + QPixmap pixmap = QPixmap(imagePathLineEdit->text()); + p.setBrush((this)->backgroundRole(), QBrush(pixmap)); + (this)->setPalette(p); +} +void DeicsOnzeGui::updateChannelPan(int val) { + channelPanKnob->blockSignals(true); + channelPanKnob->setValue((((float)val/(float)MAXCHANNELPAN)+1.0)/2.0); + channelPanKnob->blockSignals(false); + //channelPanSpinBox->blockSignals(true); + //channelPanSpinBox->setValue(val); + //channelPanSpinBox->blockSignals(false); } void DeicsOnzeGui::updateBrightness(int val) { brightnessKnob->blockSignals(true); @@ -3501,19 +3774,23 @@ void DeicsOnzeGui::updateRelease(int val) { releaseKnob->setValue((float)val/((float)MAXRELEASE)); releaseKnob->blockSignals(false); } +void DeicsOnzeGui::updateQuickEdit() { + updateChannelVolume(_deicsOnze->getChannelVol(_currentChannel)); + updateChannelPan(_deicsOnze->getChannelPan(_currentChannel)); + updateBrightness(_deicsOnze->getChannelBrightness(_currentChannel)); + updateModulation(_deicsOnze->getChannelModulation(_currentChannel)); + updateChannelDetune(_deicsOnze->getChannelDetune(_currentChannel)); + updateAttack(_deicsOnze->getChannelAttack(_currentChannel)); + updateRelease(_deicsOnze->getChannelRelease(_currentChannel)); +} //-------------------------------------------------------------- // updatePreset //-------------------------------------------------------------- void DeicsOnzeGui::updatePreset(Preset* p) { - //global - updateMASTERVOLUME(_deicsOnze->getMasterVol()); //to change - updateBrightness(p->brightness); - updateModulation(p->modulation); + //TODO : why updateMasterVolume + //updateMasterVolume(_deicsOnze->getMasterVol()); //to change updatePresetName(p->name.c_str()); updateFEEDBACK(p->feedback); - updateGLOBALDETUNE(p->globalDetune); - updateAttack(p->attack); - updateRelease(p->release); updateWAVE((int)p->lfo.wave); updateSPEED(p->lfo.speed); updateDELAY(p->lfo.delay); @@ -3579,54 +3856,54 @@ void DeicsOnzeGui::updatePreset(Preset* p) { //Waveform updateOSW(k, (int)p->oscWave[0]); } - +} +void DeicsOnzeGui::updateCurrentChannel() { + updateBrightness(_deicsOnze->_global.channel[_currentChannel].brightness); + updateModulation(_deicsOnze->_global.channel[_currentChannel].modulation); + updateChannelDetune(_deicsOnze->_global.channel[_currentChannel].detune); + updateAttack(_deicsOnze->_global.channel[_currentChannel].attack); + updateRelease(_deicsOnze->_global.channel[_currentChannel].release); } void DeicsOnzeGui::updatePreset() { - updatePreset(_deicsOnze->_preset); + updatePreset(_deicsOnze->_preset[_currentChannel]); } -void DeicsOnzeGui::setPreset(int hbank, int lbank, int prog) { +void DeicsOnzeGui::updateSelectPreset(int hbank, int lbank, int prog) { QTreeWidgetItem* cat = categoryListView->currentItem(); QTreeWidgetItem* sub = subcategoryListView->currentItem(); QTreeWidgetItem* pre = presetListView->currentItem(); //select category, subcategory, preset //category - QTreeWidgetItem* qcat=categoryListView->findItems(num3Digits(hbank+1), - Qt::MatchExactly).at(0); + QList<QTreeWidgetItem *> qlcat = + categoryListView->findItems(num3Digits(hbank+1), Qt::MatchExactly); + QTreeWidgetItem* qcat = qlcat.empty()? NULL:qlcat.at(0); //if the category is different than the last one then select the new one - if(!cat || qcat!= cat) { - if(qcat) { - categoryListView->setItemSelected(qcat, true); - categoryListView->scrollToItem(qcat); - setEnabledPreset(true); - } - else { - updateCategoryName(QString("NONE"), false); - updateHBank(hbank, false); - categoryListView->clearSelection(); - subcategoryListView->clear(); - setEnabledPreset(false); - } + //if(!cat || !qcat || qcat!= cat) { + if(qcat) { + categoryListView->setItemSelected(qcat, true); + categoryListView->setCurrentItem(qcat); + categoryListView->scrollToItem(qcat); + setEnabledPreset(true); } + else { + updateCategoryName(QString("NONE"), false); + updateHBank(hbank, false); + categoryListView->clearSelection(); + subcategoryListView->clear(); + setEnabledPreset(false); + } + //} //subcategory - if(cat) { - QTreeWidgetItem* qsub; - qsub=subcategoryListView->findItems(num3Digits(lbank+1), - Qt::MatchExactly).at(0); - if(!sub || qsub!=sub) { - if(qsub) { - subcategoryListView->setItemSelected(qsub, true); - subcategoryListView->scrollToItem(qsub); - setEnabledPreset(true); - } - else { - updateSubcategoryName(QString("NONE"), false); - updateLBank(lbank, false); - subcategoryListView->clearSelection(); - presetListView->clear(); - setEnabledPreset(false); - } - } + //if(cat) { + QList<QTreeWidgetItem *> qlsub = + subcategoryListView->findItems(num3Digits(lbank+1), Qt::MatchExactly); + QTreeWidgetItem* qsub = qlsub.empty()? NULL:qlsub.at(0); + // if(!sub || qsub!=sub) { + if(qsub) { + subcategoryListView->setItemSelected(qsub, true); + subcategoryListView->setCurrentItem(qsub); + subcategoryListView->scrollToItem(qsub); + setEnabledPreset(true); } else { updateSubcategoryName(QString("NONE"), false); @@ -3635,26 +3912,30 @@ void DeicsOnzeGui::setPreset(int hbank, int lbank, int prog) { presetListView->clear(); setEnabledPreset(false); } + // } + //} + //else { + // updateSubcategoryName(QString("NONE"), false); + // updateLBank(lbank, false); + // subcategoryListView->clearSelection(); + // presetListView->clear(); + // setEnabledPreset(false); + //} //preset - if(sub) { - QTreeWidgetItem* qpre=presetListView->findItems(num3Digits(prog+1), - Qt::MatchExactly).at(0); - if(qpre) { - presetListView->blockSignals(true); - presetListView->setItemSelected(qpre, true); - presetListView->blockSignals(false); - presetListView->scrollToItem(qpre); - updatePresetName(qpre->text(1), true); - updateProg(prog, true); - pre=(QTreePreset*) qpre; - setEnabledPreset(true); - } - else { - updatePresetName(QString("INITVOICE"), false); - updateProg(prog, false); - presetListView->clearSelection(); - setEnabledPreset(false); - } + //if(sub) { + QList<QTreeWidgetItem *> qlpre = + presetListView->findItems(num3Digits(prog+1), Qt::MatchExactly); + QTreeWidgetItem* qpre = qlpre.empty()? NULL:qlpre.at(0); + if(qpre) { + presetListView->blockSignals(true); + presetListView->setItemSelected(qpre, true); + presetListView->setCurrentItem(qpre); + presetListView->blockSignals(false); + presetListView->scrollToItem(qpre); + updatePresetName(qpre->text(1), true); + updateProg(prog, true); + pre=(QTreePreset*) qpre; + setEnabledPreset(true); } else { updatePresetName(QString("INITVOICE"), false); @@ -3662,4 +3943,11 @@ void DeicsOnzeGui::setPreset(int hbank, int lbank, int prog) { presetListView->clearSelection(); setEnabledPreset(false); } + //} + //else { + // updatePresetName(QString("INITVOICE"), false); + // updateProg(prog, false); + // presetListView->clearSelection(); + // setEnabledPreset(false); + //} } diff --git a/muse/synti/deicsonze/deicsonzegui.h b/muse/synti/deicsonze/deicsonzegui.h index a8d28e93..5f0906cc 100644 --- a/muse/synti/deicsonze/deicsonzegui.h +++ b/muse/synti/deicsonze/deicsonzegui.h @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // deicsonzegui.h // @@ -84,14 +84,14 @@ class QTreeCategory:public QTreeWidgetItem { class QTreeSubcategory:public QTreeWidgetItem { public: - Subcategory* _subcategory; - QTreeSubcategory(QTreeWidget* p, QString slbank, - QString l, Subcategory* s) - :QTreeWidgetItem(p) { - setText(0, slbank); - setText(1, l); - _subcategory=s; - }; + Subcategory* _subcategory; + QTreeSubcategory(QTreeWidget* p, QString slbank, + QString l, Subcategory* s) + :QTreeWidgetItem(p) { + setText(0, slbank); + setText(1, l); + _subcategory=s; + }; }; class QTreePreset:public QTreeWidgetItem { @@ -118,6 +118,8 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui QString lastDir; private slots: void readMessage(int); + void setEnabledChannel(bool); + void setChangeChannel(int); void setPanic(); void setNbrVoices(int); void setSaveOnlyUsed(bool); @@ -125,6 +127,7 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setSaveConfig(bool); void setMidiInCh(int); //to change void setQuality(const QString&); + void setFontSize(int); void saveConfiguration(); void saveDefaultConfiguration(); void loadConfiguration(); @@ -133,8 +136,13 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setIsInitSet(bool); void setInitSetPath(const QString&); void setBrowseInitSetPath(); + //load init set + void setIsBackgroundPix(bool); + void setBackgroundPixPath(const QString&); + void setBrowseBackgroundPixPath(); //quick edit void setChannelVolKnob(float val); + void setChannelPan(float val); void setBrightnessKnob(float val); void setModulationKnob(float val); void setDetuneKnob(float val); @@ -177,7 +185,7 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setLBank(int); void setProg(int); //Global - void setPanVol(int); + void setMasterVolKnob(float); void setMasterVol(int); void setFeedback(int); void setLfoWave(int); @@ -188,7 +196,7 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setLfoAModDepth(int); void setLfoAmpSens(int); void setTranspose(int); - void setGlobalDetune(int); + void setChannelDetune(float); void setAlgorithm(int); void setPitchBendRange(int); //Pitch Envelope @@ -297,22 +305,34 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void setPreset(QTreeWidgetItem*); public: virtual void processEvent(const MidiEvent&); - void setPreset(int hbank, int lbank, int prog); + 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 updateMidiInCh(int val); //to change void updateQuality(int val); + void updateFontSize(int fs); + void applyFontSize(int fs); void updateSaveOnlyUsed(bool); void updateSaveConfig(bool); //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); @@ -370,8 +390,8 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui void updateFIXRANGE(int op, int val); void updateOSW(int op, int val); void updateSHFT(int op, int val); - void updateGLOBALDETUNE(int val); - void updateMASTERVOLUME(int val); //to change + void updateChannelDetune(int val); + void updateChannelVolume(int val); void updateCategoryName(QString cn, bool enable); void updateSubcategoryName(QString sn, bool enable); void updatePresetName(QString pn, bool enable); @@ -381,9 +401,12 @@ class DeicsOnzeGui : public QDialog, public Ui::DeicsOnzeGuiBase, public MessGui 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 diff --git a/muse/synti/deicsonze/deicsonzegui.ui b/muse/synti/deicsonze/deicsonzegui.ui index dd0ccc91..c9054595 100644 --- a/muse/synti/deicsonze/deicsonzegui.ui +++ b/muse/synti/deicsonze/deicsonzegui.ui @@ -8,21 +8,10 @@ <rect> <x>0</x> <y>0</y> - <width>586</width> - <height>663</height> + <width>688</width> + <height>575</height> </rect> </property> - <property name="font" > - <font> - <family>Sans Serif</family> - <pointsize>9</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> <property name="windowTitle" > <string>DeicsOnze</string> </property> @@ -39,33 +28,16 @@ <property name="spacing" > <number>6</number> </property> - <item row="0" column="0" > - <widget class="QLabel" name="masterVolumeLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Vol</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="Awl::VolKnob" name="masterVolKnob" > + <item rowspan="2" row="0" column="4" > + <widget class="QGroupBox" name="channelCtrlGroupBox" > <property name="minimumSize" > <size> - <width>40</width> - <height>40</height> + <width>96</width> + <height>16</height> </size> </property> - </widget> - </item> - <item row="0" column="2" > - <widget class="QGroupBox" name="generalBox" > <property name="title" > - <string/> + <string>Channel Ctrl</string> </property> <layout class="QGridLayout" > <property name="margin" > @@ -74,68 +46,191 @@ <property name="spacing" > <number>6</number> </property> - <item row="0" column="4" > - <widget class="QSpinBox" name="nbrVoicesSpinBox" > - <property name="enabled" > - <bool>true</bool> + <item row="2" column="0" > + <widget class="Awl::VolKnob" name="channelPanKnob" > + <property name="minValue" > + <double>0</double> </property> - <property name="toolTip" > - <string>Number of Voices</string> + <property name="maxValue" > + <double>1</double> </property> - <property name="maximum" > - <number>64</number> + <property name="lineStep" > + <double>0.1</double> </property> - <property name="minimum" > - <number>1</number> + <property name="pageStep" > + <double>0.2</double> </property> - <property name="value" > - <number>8</number> + <property name="log" > + <bool>false</bool> </property> </widget> </item> - <item row="0" column="3" > - <widget class="QLabel" name="numberVoicesLabel" > + <item row="13" column="0" > + <widget class="QLabel" name="releaseLabel" > <property name="frameShape" > <enum>QFrame::StyledPanel</enum> </property> <property name="text" > - <string>Number of voices</string> + <string>Release</string> </property> <property name="alignment" > <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="0" column="2" > - <widget class="QCheckBox" name="ChannelCheckBox" > + <item row="12" column="0" > + <widget class="Awl::Knob" name="releaseKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="11" column="0" > + <widget class="QLabel" name="attackTimeLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> <property name="text" > - <string>Enable</string> + <string>Attack</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QSpinBox" name="ChannelNumSpinBox" > - <property name="maximum" > - <number>16</number> + <item row="10" column="0" > + <widget class="Awl::Knob" name="attackKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> </property> - <property name="minimum" > - <number>1</number> + </widget> + </item> + <item row="9" column="0" > + <widget class="QLabel" name="detuneLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="text" > + <string>Detune</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="0" column="0" > - <widget class="QLabel" name="channelNumLabel" > + <item row="8" column="0" > + <widget class="Awl::Knob" name="detuneKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="7" column="0" > + <widget class="QLabel" name="brightnessLabel" > <property name="frameShape" > <enum>QFrame::StyledPanel</enum> </property> <property name="text" > - <string>Channel</string> + <string>Brightness</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="Awl::Knob" name="brightnessKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="modulationLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="text" > + <string>Modulation</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="Awl::Knob" name="modulationKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="channelPanLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="text" > + <string>Pan</string> </property> <property name="alignment" > <set>Qt::AlignCenter</set> </property> </widget> </item> + <item row="1" column="0" > + <widget class="QLabel" name="channelVolumeLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="text" > + <string>Volume</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="Awl::Knob" name="channelVolumeKnob" > + <property name="minimumSize" > + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="maxValue" > + <double>1</double> + </property> + <property name="lineStep" > + <double>0.1</double> + </property> + <property name="pageStep" > + <double>0.2</double> + </property> + <property name="scaleSize" > + <number>270</number> + </property> + <property name="markSize" > + <number>6</number> + </property> + </widget> + </item> </layout> </widget> </item> @@ -428,16 +523,10 @@ </property> </widget> </item> - <item row="1" column="0" colspan="4" > - <widget class="QGroupBox" name="quickEditGroupBox" > - <property name="minimumSize" > - <size> - <width>16</width> - <height>104</height> - </size> - </property> + <item row="0" column="2" > + <widget class="QGroupBox" name="generalBox" > <property name="title" > - <string>Quick Edit (per channel)</string> + <string/> </property> <layout class="QGridLayout" > <property name="margin" > @@ -446,149 +535,65 @@ <property name="spacing" > <number>6</number> </property> - <item row="0" column="3" > - <widget class="Awl::Knob" name="detuneKnob" /> - </item> - <item row="1" column="3" > - <widget class="QLabel" name="detuneLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Detune</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> <item row="0" column="4" > - <widget class="Awl::Knob" name="attackKnob" /> - </item> - <item row="1" column="4" > - <widget class="QLabel" name="attackTimeLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Attack</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="1" column="5" > - <widget class="QLabel" name="releaseLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Release</string> + <widget class="QSpinBox" name="nbrVoicesSpinBox" > + <property name="enabled" > + <bool>true</bool> </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> + <property name="toolTip" > + <string>Number of Voices</string> </property> - </widget> - </item> - <item row="0" column="5" > - <widget class="Awl::Knob" name="releaseKnob" /> - </item> - <item row="0" column="2" > - <widget class="Awl::Knob" name="modulationKnob" /> - </item> - <item row="1" column="2" > - <widget class="QLabel" name="modulationLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> + <property name="maximum" > + <number>64</number> </property> - <property name="text" > - <string>Modulation</string> + <property name="minimum" > + <number>1</number> </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> + <property name="value" > + <number>8</number> </property> </widget> </item> - <item row="1" column="6" > - <widget class="QLabel" name="currentPresetLabel" > + <item row="0" column="3" > + <widget class="QLabel" name="numberVoicesLabel" > <property name="frameShape" > <enum>QFrame::StyledPanel</enum> </property> <property name="text" > - <string>Current preset</string> + <string>Number of voices</string> </property> <property name="alignment" > <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="1" column="0" > - <widget class="QLabel" name="channelVolumeLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> + <item row="0" column="2" > + <widget class="QCheckBox" name="ChannelCheckBox" > <property name="text" > - <string>Volume</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="Awl::Knob" name="channelVolumeKnob" > - <property name="maxValue" > - <double>1</double> - </property> - <property name="lineStep" > - <double>0.1</double> - </property> - <property name="pageStep" > - <double>0.2</double> - </property> - <property name="scaleSize" > - <number>270</number> + <string>Enable</string> </property> - <property name="markSize" > - <number>6</number> + <property name="checked" > + <bool>true</bool> </property> </widget> </item> <item row="0" column="1" > - <widget class="Awl::Knob" name="brightnessKnob" /> - </item> - <item row="1" column="1" > - <widget class="QLabel" name="brightnessLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Brightness</string> + <widget class="QSpinBox" name="ChannelNumSpinBox" > + <property name="maximum" > + <number>16</number> </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> + <property name="minimum" > + <number>1</number> </property> </widget> </item> - <item row="0" column="6" > - <widget class="QLabel" name="presetNameLabel" > - <property name="font" > - <font> - <family>Sans Serif</family> - <pointsize>9</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> + <item row="0" column="0" > + <widget class="QLabel" name="channelNumLabel" > <property name="frameShape" > <enum>QFrame::StyledPanel</enum> </property> <property name="text" > - <string>INITVOICE</string> + <string>Channel</string> </property> <property name="alignment" > <set>Qt::AlignCenter</set> @@ -598,7 +603,45 @@ </layout> </widget> </item> - <item row="2" column="0" colspan="4" > + <item row="0" column="0" > + <widget class="QLabel" name="masterVolumeLabel" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="text" > + <string>Vol</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="Awl::VolKnob" name="masterVolKnob" > + <property name="minimumSize" > + <size> + <width>40</width> + <height>40</height> + </size> + </property> + <property name="minValue" > + <double>0</double> + </property> + <property name="maxValue" > + <double>1</double> + </property> + <property name="lineStep" > + <double>0.1</double> + </property> + <property name="pageStep" > + <double>0.2</double> + </property> + <property name="log" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0" colspan="4" > <widget class="QTabWidget" name="deicsOnzeTabWidget" > <property name="sizePolicy" > <sizepolicy> @@ -634,13 +677,13 @@ <property name="spacing" > <number>6</number> </property> - <item row="0" column="0" > - <widget class="QSpinBox" name="hbankSpinBox" > + <item row="0" column="4" > + <widget class="QSpinBox" name="progSpinBox" > <property name="enabled" > <bool>false</bool> </property> <property name="toolTip" > - <string>Bank numerous</string> + <string>Program numerous</string> </property> <property name="maximum" > <number>128</number> @@ -650,21 +693,41 @@ </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="categoryLineEdit" > + <item row="0" column="5" > + <widget class="QLineEdit" name="presetLineEdit" > <property name="enabled" > <bool>false</bool> </property> <property name="text" > - <string>NONE</string> + <string>INITVOICE</string> </property> <property name="maxLength" > <number>12</number> </property> </widget> </item> - <item row="0" column="2" > - <widget class="QSpinBox" name="lbankSpinBox" > + <item row="1" column="2" colspan="2" > + <widget class="QTreeWidget" name="subcategoryListView" > + <property name="contextMenuPolicy" > + <enum>Qt::CustomContextMenu</enum> + </property> + <property name="rootIsDecorated" > + <bool>false</bool> + </property> + <column> + <property name="text" > + <string>LBank</string> + </property> + </column> + <column> + <property name="text" > + <string>Subcategory</string> + </property> + </column> + </widget> + </item> + <item row="0" column="0" > + <widget class="QSpinBox" name="hbankSpinBox" > <property name="enabled" > <bool>false</bool> </property> @@ -679,6 +742,19 @@ </property> </widget> </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="categoryLineEdit" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>NONE</string> + </property> + <property name="maxLength" > + <number>12</number> + </property> + </widget> + </item> <item row="0" column="3" > <widget class="QLineEdit" name="subcategoryLineEdit" > <property name="enabled" > @@ -692,13 +768,13 @@ </property> </widget> </item> - <item row="0" column="4" > - <widget class="QSpinBox" name="progSpinBox" > + <item row="0" column="2" > + <widget class="QSpinBox" name="lbankSpinBox" > <property name="enabled" > <bool>false</bool> </property> <property name="toolTip" > - <string>Program numerous</string> + <string>Bank numerous</string> </property> <property name="maximum" > <number>128</number> @@ -772,26 +848,6 @@ </column> </widget> </item> - <item row="1" column="2" colspan="2" > - <widget class="QTreeWidget" name="subcategoryListView" > - <property name="contextMenuPolicy" > - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="rootIsDecorated" > - <bool>false</bool> - </property> - <column> - <property name="text" > - <string>LBank</string> - </property> - </column> - <column> - <property name="text" > - <string>Subcategory</string> - </property> - </column> - </widget> - </item> <item row="2" column="0" colspan="6" > <widget class="QLabel" name="presentTextLAbel" > <property name="font" > @@ -812,20 +868,7 @@ <enum>QFrame::Plain</enum> </property> <property name="text" > - <string>DeicsOnze v0.3 Copyright (c) 2004-2006 Nil Geisweiller. Published under GPL licence.</string> - </property> - </widget> - </item> - <item row="0" column="5" > - <widget class="QLineEdit" name="presetLineEdit" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="text" > - <string>INITVOICE</string> - </property> - <property name="maxLength" > - <number>12</number> + <string>DeicsOnze v0.4 Copyright (c) 2004-2006 Nil Geisweiller. Published under GPL licence.</string> </property> </widget> </item> @@ -1486,10 +1529,13 @@ </layout> </widget> </item> - <item row="0" column="0" > - <widget class="QGroupBox" name="channelPanGroupBox" > + <item row="0" column="1" > + <widget class="QGroupBox" name="FeedbackGroupBox" > + <property name="toolTip" > + <string/> + </property> <property name="title" > - <string>Channel Panoramic</string> + <string>Op4 Feedback</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -1499,24 +1545,21 @@ <number>6</number> </property> <item> - <widget class="QSlider" name="channelPanSlider" > + <widget class="QSlider" name="feedbackSlider" > <property name="cursor" > <cursor>13</cursor> </property> <property name="toolTip" > - <string>Master Volume</string> - </property> - <property name="minimum" > - <number>-127</number> + <string>Feedback level of the operator 4</string> </property> <property name="maximum" > - <number>127</number> + <number>7</number> </property> - <property name="value" > - <number>0</number> + <property name="singleStep" > + <number>1</number> </property> - <property name="sliderPosition" > - <number>0</number> + <property name="pageStep" > + <number>1</number> </property> <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -1524,31 +1567,22 @@ </widget> </item> <item> - <widget class="QSpinBox" name="masterVolSpinBox" > + <widget class="QSpinBox" name="feedbackSpinBox" > <property name="toolTip" > - <string>Master volume</string> + <string>Feedback level of the operator 4</string> </property> <property name="maximum" > - <number>127</number> - </property> - <property name="minimum" > - <number>-127</number> - </property> - <property name="value" > - <number>0</number> + <number>7</number> </property> </widget> </item> </layout> </widget> </item> - <item row="0" column="1" > - <widget class="QGroupBox" name="FeedbackGroupBox" > - <property name="toolTip" > - <string/> - </property> + <item row="0" column="0" > + <widget class="QGroupBox" name="transposeGroupBox" > <property name="title" > - <string>Op4 Feedback</string> + <string>Transpose</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -1558,18 +1592,18 @@ <number>6</number> </property> <item> - <widget class="QSlider" name="feedbackSlider" > + <widget class="QSlider" name="transposeSlider" > <property name="cursor" > <cursor>13</cursor> </property> <property name="toolTip" > - <string>Feedback level of the operator 4</string> + <string>Transpose</string> </property> - <property name="maximum" > - <number>7</number> + <property name="minimum" > + <number>-24</number> </property> - <property name="singleStep" > - <number>1</number> + <property name="maximum" > + <number>24</number> </property> <property name="pageStep" > <number>1</number> @@ -1580,12 +1614,15 @@ </widget> </item> <item> - <widget class="QSpinBox" name="feedbackSpinBox" > + <widget class="QSpinBox" name="transposeSpinBox" > <property name="toolTip" > - <string>Feedback level of the operator 4</string> + <string>Transpose</string> </property> <property name="maximum" > - <number>7</number> + <number>99</number> + </property> + <property name="minimum" > + <number>-24</number> </property> </widget> </item> @@ -4536,10 +4573,10 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <property name="spacing" > <number>6</number> </property> - <item row="0" column="0" colspan="4" > + <item row="0" column="0" colspan="3" > <widget class="QTabWidget" name="controlTabWidget" > <property name="currentIndex" > - <number>0</number> + <number>3</number> </property> <widget class="QWidget" name="FCTab" > <attribute name="title" > @@ -5219,45 +5256,10 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </widget> </widget> </item> - <item row="3" column="0" > - <widget class="QGroupBox" name="modeGroupBox" > - <property name="title" > - <string>Phony Mode</string> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QComboBox" name="polyMonoComboBox" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="cursor" > - <cursor>13</cursor> - </property> - <item> - <property name="text" > - <string>POLY</string> - </property> - </item> - <item> - <property name="text" > - <string>MONO</string> - </property> - </item> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="3" > - <widget class="QGroupBox" name="reverbGroupBox" > + <item row="1" column="0" colspan="3" > + <widget class="QGroupBox" name="detuneGroupBox" > <property name="title" > - <string>Reverb</string> + <string>Detune</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -5267,7 +5269,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <number>6</number> </property> <item> - <widget class="QSlider" name="reverbSlider" > + <widget class="QSlider" name="channelDetuneSlider" > <property name="cursor" > <cursor>13</cursor> </property> @@ -5275,10 +5277,10 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <string>Detune</string> </property> <property name="minimum" > - <number>0</number> + <number>-31</number> </property> <property name="maximum" > - <number>7</number> + <number>31</number> </property> <property name="pageStep" > <number>1</number> @@ -5289,25 +5291,25 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </widget> </item> <item> - <widget class="QSpinBox" name="reverbSpinBox" > + <widget class="QSpinBox" name="channelDetuneSpinBox" > <property name="toolTip" > <string>Detune</string> </property> <property name="maximum" > - <number>7</number> + <number>31</number> </property> <property name="minimum" > - <number>0</number> + <number>-31</number> </property> </widget> </item> </layout> </widget> </item> - <item row="1" column="2" colspan="2" > - <widget class="QGroupBox" name="detuneGroupBox" > + <item row="2" column="0" > + <widget class="QGroupBox" name="footSWGroupBox" > <property name="title" > - <string>Detune</string> + <string>Foot Switch</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -5317,44 +5319,76 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <number>6</number> </property> <item> - <widget class="QSlider" name="globalDetuneSlider" > + <widget class="QComboBox" name="footSWComboBox" > + <property name="enabled" > + <bool>false</bool> + </property> + <item> + <property name="text" > + <string>Sustain</string> + </property> + </item> + <item> + <property name="text" > + <string>Portamento</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="1" > + <widget class="QGroupBox" name="pitchBendRangeGroupBox" > + <property name="title" > + <string>Pitch Bend Range</string> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>10</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QSlider" name="pitchBendRangeSlider" > <property name="cursor" > <cursor>13</cursor> </property> <property name="toolTip" > - <string>Detune</string> + <string>Pitch Bend Range</string> </property> <property name="minimum" > - <number>-31</number> + <number>0</number> </property> <property name="maximum" > - <number>31</number> + <number>12</number> </property> <property name="pageStep" > <number>1</number> </property> + <property name="value" > + <number>0</number> + </property> <property name="orientation" > <enum>Qt::Horizontal</enum> </property> </widget> </item> <item> - <widget class="QSpinBox" name="globalDetuneSpinBox" > + <widget class="QSpinBox" name="pitchBendRangeSpinBox" > <property name="toolTip" > - <string>Detune</string> + <string>Pitch Bend Range</string> </property> <property name="maximum" > - <number>31</number> - </property> - <property name="minimum" > - <number>-31</number> + <number>12</number> </property> </widget> </item> </layout> </widget> </item> - <item row="3" column="1" colspan="3" > + <item row="3" column="1" colspan="2" > <widget class="QGroupBox" name="portamentoGroupBox" > <property name="title" > <string>Potamento</string> @@ -5446,10 +5480,10 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </layout> </widget> </item> - <item row="2" column="1" colspan="2" > - <widget class="QGroupBox" name="pitchBendRangeGroupBox" > + <item row="2" column="2" > + <widget class="QGroupBox" name="reverbGroupBox" > <property name="title" > - <string>Pitch Bend Range</string> + <string>Reverb</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -5459,47 +5493,47 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <number>6</number> </property> <item> - <widget class="QSlider" name="pitchBendRangeSlider" > + <widget class="QSlider" name="reverbSlider" > <property name="cursor" > <cursor>13</cursor> </property> <property name="toolTip" > - <string>Pitch Bend Range</string> + <string>Detune</string> </property> <property name="minimum" > <number>0</number> </property> <property name="maximum" > - <number>12</number> + <number>7</number> </property> <property name="pageStep" > <number>1</number> </property> - <property name="value" > - <number>0</number> - </property> <property name="orientation" > <enum>Qt::Horizontal</enum> </property> </widget> </item> <item> - <widget class="QSpinBox" name="pitchBendRangeSpinBox" > + <widget class="QSpinBox" name="reverbSpinBox" > <property name="toolTip" > - <string>Pitch Bend Range</string> + <string>Detune</string> </property> <property name="maximum" > - <number>12</number> + <number>7</number> + </property> + <property name="minimum" > + <number>0</number> </property> </widget> </item> </layout> </widget> </item> - <item row="2" column="0" > - <widget class="QGroupBox" name="footSWGroupBox" > + <item row="3" column="0" > + <widget class="QGroupBox" name="modeGroupBox" > <property name="title" > - <string>Foot Switch</string> + <string>Phony Mode</string> </property> <layout class="QHBoxLayout" > <property name="margin" > @@ -5509,18 +5543,21 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <number>6</number> </property> <item> - <widget class="QComboBox" name="footSWComboBox" > + <widget class="QComboBox" name="polyMonoComboBox" > <property name="enabled" > <bool>false</bool> </property> + <property name="cursor" > + <cursor>13</cursor> + </property> <item> <property name="text" > - <string>Sustain</string> + <string>POLY</string> </property> </item> <item> <property name="text" > - <string>Portamento</string> + <string>MONO</string> </property> </item> </widget> @@ -5528,56 +5565,6 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </layout> </widget> </item> - <item row="1" column="0" colspan="2" > - <widget class="QGroupBox" name="transposeGroupBox" > - <property name="title" > - <string>Transpose</string> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QSlider" name="transposeSlider" > - <property name="cursor" > - <cursor>13</cursor> - </property> - <property name="toolTip" > - <string>Transpose</string> - </property> - <property name="minimum" > - <number>-24</number> - </property> - <property name="maximum" > - <number>24</number> - </property> - <property name="pageStep" > - <number>1</number> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="transposeSpinBox" > - <property name="toolTip" > - <string>Transpose</string> - </property> - <property name="maximum" > - <number>99</number> - </property> - <property name="minimum" > - <number>-24</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> </layout> </widget> <widget class="QWidget" name="ConfigureTab" > @@ -5591,44 +5578,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <property name="spacing" > <number>6</number> </property> - <item row="2" column="0" > - <widget class="QGroupBox" name="qualityGroupBox" > - <property name="title" > - <string>Quality</string> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QComboBox" name="qualityComboBox" > - <property name="enabled" > - <bool>false</bool> - </property> - <item> - <property name="text" > - <string>High</string> - </property> - </item> - <item> - <property name="text" > - <string>Middle</string> - </property> - </item> - <item> - <property name="text" > - <string>Low</string> - </property> - </item> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" colspan="2" > + <item row="1" column="0" colspan="3" > <widget class="QGroupBox" name="pathGroupBox" > <property name="title" > <string>Set Path</string> @@ -5640,117 +5590,51 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <property name="spacing" > <number>6</number> </property> - <item row="0" column="0" colspan="2" > - <widget class="QCheckBox" name="initSetCheckBox" > + <item row="1" column="0" > + <widget class="QCheckBox" name="imageCheckBox" > <property name="text" > - <string>Load the following set at the initialization :</string> + <string>Image in the background :</string> </property> <property name="checked" > - <bool>true</bool> + <bool>false</bool> </property> </widget> </item> <item row="1" column="1" > - <widget class="QPushButton" name="browsePushButton" > - <property name="text" > - <string>Browse...</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLineEdit" name="pathLineEdit" > + <widget class="QLineEdit" name="imagePathLineEdit" > <property name="maxLength" > <number>128</number> </property> </widget> </item> - </layout> - </widget> - </item> - <item row="3" column="0" > - <widget class="QGroupBox" name="fileGroupBox" > - <property name="title" > - <string>Configuration File</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="1" > - <widget class="QPushButton" name="saveConfPushButton" > - <property name="enabled" > - <bool>true</bool> - </property> - <property name="text" > - <string>Save...</string> - </property> - </widget> - </item> - <item row="0" column="2" > - <widget class="QPushButton" name="loadConfPushButton" > + <item row="1" column="2" > + <widget class="QPushButton" name="imageBrowsePushButton" > <property name="enabled" > - <bool>true</bool> - </property> - <property name="text" > - <string>Load...</string> + <bool>false</bool> </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QPushButton" name="saveDefaultPushButton" > <property name="text" > - <string>Save as default</string> + <string>Browse...</string> </property> </widget> </item> - </layout> - </widget> - </item> - <item rowspan="2" row="2" column="1" > - <widget class="QGroupBox" name="saveModeButtonGroup" > - <property name="title" > - <string>Save Mode (into the song)</string> - </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QRadioButton" name="minSaveRadioButton" > - <property name="cursor" > - <cursor>13</cursor> - </property> - <property name="text" > - <string>Save only the used presets</string> - </property> - <property name="checked" > - <bool>true</bool> + <item row="0" column="1" > + <widget class="QLineEdit" name="initSetPathLineEdit" > + <property name="maxLength" > + <number>128</number> </property> </widget> </item> - <item> - <widget class="QRadioButton" name="hugeSaveRadioButton" > - <property name="cursor" > - <cursor>13</cursor> - </property> + <item row="0" column="2" > + <widget class="QPushButton" name="initSetBrowsePushButton" > <property name="text" > - <string>Save the entire set</string> + <string>Browse...</string> </property> </widget> </item> - <item> - <widget class="QCheckBox" name="saveConfigCheckBox" > - <property name="cursor" > - <cursor>13</cursor> - </property> + <item row="0" column="0" > + <widget class="QCheckBox" name="initSetCheckBox" > <property name="text" > - <string>Save the configuration</string> + <string>Load the set at the initialization :</string> </property> <property name="checked" > <bool>true</bool> @@ -5760,7 +5644,7 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </layout> </widget> </item> - <item row="0" column="0" colspan="2" > + <item row="0" column="0" colspan="3" > <widget class="QGroupBox" name="colorGroupBox" > <property name="title" > <string>Colors</string> @@ -5949,6 +5833,164 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin </layout> </widget> </item> + <item row="3" column="0" colspan="2" > + <widget class="QGroupBox" name="fileGroupBox" > + <property name="title" > + <string>Configuration File</string> + </property> + <layout class="QGridLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item row="0" column="1" > + <widget class="QPushButton" name="saveConfPushButton" > + <property name="enabled" > + <bool>true</bool> + </property> + <property name="text" > + <string>Save...</string> + </property> + </widget> + </item> + <item row="0" column="2" > + <widget class="QPushButton" name="loadConfPushButton" > + <property name="enabled" > + <bool>true</bool> + </property> + <property name="text" > + <string>Load...</string> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="QPushButton" name="saveDefaultPushButton" > + <property name="text" > + <string>Save as default</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item rowspan="2" row="2" column="2" > + <widget class="QGroupBox" name="saveModeButtonGroup" > + <property name="title" > + <string>Save Mode (into the song)</string> + </property> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>10</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QRadioButton" name="minSaveRadioButton" > + <property name="cursor" > + <cursor>13</cursor> + </property> + <property name="text" > + <string>Save only the used presets</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="hugeSaveRadioButton" > + <property name="cursor" > + <cursor>13</cursor> + </property> + <property name="text" > + <string>Save the entire set</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="saveConfigCheckBox" > + <property name="cursor" > + <cursor>13</cursor> + </property> + <property name="text" > + <string>Save the configuration</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="0" > + <widget class="QGroupBox" name="qualityGroupBox" > + <property name="title" > + <string>Quality</string> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>10</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QComboBox" name="qualityComboBox" > + <property name="enabled" > + <bool>false</bool> + </property> + <item> + <property name="text" > + <string>High</string> + </property> + </item> + <item> + <property name="text" > + <string>Middle</string> + </property> + </item> + <item> + <property name="text" > + <string>Low</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="1" > + <widget class="QGroupBox" name="fontSizeGroupBox" > + <property name="title" > + <string>Font Size</string> + </property> + <layout class="QGridLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QSpinBox" name="fontSizeSpinBox" > + <property name="maximum" > + <number>32</number> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="value" > + <number>9</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> </widget> @@ -5959,16 +6001,16 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <pixmapfunction></pixmapfunction> <customwidgets> <customwidget> - <class>Awl::VolKnob</class> - <extends>Awl::Knob</extends> - <header>awl/volknob.h</header> + <class>Awl::Knob</class> + <extends>QWidget</extends> + <header>awl/knob.h</header> <container>0</container> <pixmap></pixmap> </customwidget> <customwidget> - <class>Awl::Knob</class> - <extends>QWidget</extends> - <header>awl/knob.h</header> + <class>Awl::VolKnob</class> + <extends>Awl::Knob</extends> + <header>awl/volknob.h</header> <container>0</container> <pixmap></pixmap> </customwidget> @@ -5976,7 +6018,6 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <tabstops> <tabstop>deicsOnzeTabWidget</tabstop> <tabstop>presetLineEdit</tabstop> - <tabstop>channelPanSlider</tabstop> <tabstop>feedbackSlider</tabstop> <tabstop>LFOSyncCheckBox</tabstop> <tabstop>PModSensSlider</tabstop> @@ -6028,7 +6069,6 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <tabstop>categoryLineEdit</tabstop> <tabstop>lbankSpinBox</tabstop> <tabstop>progSpinBox</tabstop> - <tabstop>masterVolSpinBox</tabstop> <tabstop>feedbackSpinBox</tabstop> <tabstop>PModSensSpinBox</tabstop> <tabstop>AModSensSpinBox</tabstop> @@ -6099,50 +6139,18 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <resources/> <connections> <connection> - <sender>channelPanSlider</sender> - <signal>valueChanged(int)</signal> - <receiver>masterVolSpinBox</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel" > - <x>110</x> - <y>172</y> - </hint> - <hint type="destinationlabel" > - <x>110</x> - <y>172</y> - </hint> - </hints> - </connection> - <connection> - <sender>masterVolSpinBox</sender> - <signal>valueChanged(int)</signal> - <receiver>channelPanSlider</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel" > - <x>110</x> - <y>172</y> - </hint> - <hint type="destinationlabel" > - <x>110</x> - <y>172</y> - </hint> - </hints> - </connection> - <connection> <sender>feedbackSlider</sender> <signal>valueChanged(int)</signal> <receiver>feedbackSpinBox</receiver> <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>443</x> + <y>265</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>268</y> </hint> </hints> </connection> @@ -6153,12 +6161,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>268</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>443</x> + <y>265</y> </hint> </hints> </connection> @@ -6169,12 +6177,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>242</x> + <y>354</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>357</y> </hint> </hints> </connection> @@ -6185,12 +6193,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>357</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>242</x> + <y>354</y> </hint> </hints> </connection> @@ -6201,12 +6209,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>242</x> + <y>393</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>396</y> </hint> </hints> </connection> @@ -6217,12 +6225,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>396</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>242</x> + <y>393</y> </hint> </hints> </connection> @@ -6233,12 +6241,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>435</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>432</y> </hint> </hints> </connection> @@ -6249,12 +6257,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>474</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>471</y> </hint> </hints> </connection> @@ -6265,12 +6273,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>510</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>513</y> </hint> </hints> </connection> @@ -6281,12 +6289,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>513</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>510</y> </hint> </hints> </connection> @@ -6297,12 +6305,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>549</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>552</y> </hint> </hints> </connection> @@ -6313,12 +6321,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>552</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>549</y> </hint> </hints> </connection> @@ -6329,12 +6337,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>194</x> + <y>432</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>302</x> + <y>435</y> </hint> </hints> </connection> @@ -6345,12 +6353,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>478</x> + <y>258</y> </hint> </hints> </connection> @@ -6361,12 +6369,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>327</x> + <y>258</y> </hint> </hints> </connection> @@ -6377,12 +6385,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>176</x> + <y>258</y> </hint> </hints> </connection> @@ -6393,12 +6401,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>57</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> <hint type="destinationlabel" > - <x>95</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> </hints> </connection> @@ -6409,12 +6417,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>95</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>57</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> </hints> </connection> @@ -6425,12 +6433,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> </hints> </connection> @@ -6441,12 +6449,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> </hints> </connection> @@ -6457,12 +6465,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> </hints> </connection> @@ -6473,12 +6481,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> </hints> </connection> @@ -6489,12 +6497,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> </hints> </connection> @@ -6505,12 +6513,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> </hints> </connection> @@ -6521,12 +6529,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> </hints> </connection> @@ -6537,12 +6545,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> </hints> </connection> @@ -6553,12 +6561,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> </hints> </connection> @@ -6569,12 +6577,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> </hints> </connection> @@ -6585,12 +6593,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>478</x> + <y>258</y> </hint> </hints> </connection> @@ -6601,12 +6609,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>327</x> + <y>258</y> </hint> </hints> </connection> @@ -6617,12 +6625,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>176</x> + <y>258</y> </hint> </hints> </connection> @@ -6633,12 +6641,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>95</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>57</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> </hints> </connection> @@ -6649,12 +6657,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> </hints> </connection> @@ -6665,12 +6673,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> </hints> </connection> @@ -6681,12 +6689,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> </hints> </connection> @@ -6697,12 +6705,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> </hints> </connection> @@ -6713,12 +6721,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> </hints> </connection> @@ -6729,12 +6737,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> </hints> </connection> @@ -6745,12 +6753,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> </hints> </connection> @@ -6761,12 +6769,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> </hints> </connection> @@ -6777,12 +6785,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> </hints> </connection> @@ -6793,12 +6801,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> </hints> </connection> @@ -6809,12 +6817,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>478</x> + <y>258</y> </hint> </hints> </connection> @@ -6825,12 +6833,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>327</x> + <y>258</y> </hint> </hints> </connection> @@ -6841,12 +6849,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>176</x> + <y>258</y> </hint> </hints> </connection> @@ -6857,12 +6865,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>57</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> <hint type="destinationlabel" > - <x>82</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> </hints> </connection> @@ -6873,12 +6881,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>60</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> </hints> </connection> @@ -6889,12 +6897,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> </hints> </connection> @@ -6905,12 +6913,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> </hints> </connection> @@ -6921,12 +6929,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> </hints> </connection> @@ -6937,12 +6945,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> </hints> </connection> @@ -6953,12 +6961,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> </hints> </connection> @@ -6969,12 +6977,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> </hints> </connection> @@ -6985,12 +6993,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> </hints> </connection> @@ -7001,12 +7009,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> </hints> </connection> @@ -7017,12 +7025,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> </hints> </connection> @@ -7033,12 +7041,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> </hints> </connection> @@ -7049,12 +7057,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>478</x> + <y>258</y> </hint> </hints> </connection> @@ -7065,12 +7073,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>327</x> + <y>258</y> </hint> </hints> </connection> @@ -7081,12 +7089,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>254</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>176</x> + <y>258</y> </hint> </hints> </connection> @@ -7098,11 +7106,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>55</x> - <y>172</y> + <y>519</y> </hint> <hint type="destinationlabel" > - <x>84</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> </hints> </connection> @@ -7113,12 +7121,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>85</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>56</x> - <y>172</y> + <x>55</x> + <y>519</y> </hint> </hints> </connection> @@ -7129,12 +7137,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> </hints> </connection> @@ -7145,12 +7153,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>463</x> + <y>506</y> </hint> </hints> </connection> @@ -7161,12 +7169,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> </hints> </connection> @@ -7177,12 +7185,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>338</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>523</x> + <y>506</y> </hint> </hints> </connection> @@ -7193,12 +7201,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> </hints> </connection> @@ -7209,12 +7217,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>247</x> + <y>614</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>187</x> + <y>611</y> </hint> </hints> </connection> @@ -7225,12 +7233,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> </hints> </connection> @@ -7241,12 +7249,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>611</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>608</y> </hint> </hints> </connection> @@ -7257,12 +7265,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> </hints> </connection> @@ -7273,12 +7281,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>493</x> + <y>650</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>433</x> + <y>647</y> </hint> </hints> </connection> @@ -7290,11 +7298,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7306,11 +7314,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7322,11 +7330,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7338,11 +7346,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7354,11 +7362,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7370,11 +7378,11 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <hints> <hint type="sourcelabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> <hint type="destinationlabel" > <x>110</x> - <y>172</y> + <y>219</y> </hint> </hints> </connection> @@ -7385,12 +7393,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>66</x> - <y>155</y> + <x>130</x> + <y>277</y> </hint> <hint type="destinationlabel" > - <x>102</x> - <y>155</y> + <x>536</x> + <y>280</y> </hint> </hints> </connection> @@ -7401,12 +7409,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>102</x> - <y>155</y> + <x>536</x> + <y>280</y> </hint> <hint type="destinationlabel" > - <x>66</x> - <y>155</y> + <x>130</x> + <y>277</y> </hint> </hints> </connection> @@ -7417,12 +7425,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>66</x> - <y>159</y> + <x>130</x> + <y>333</y> </hint> <hint type="destinationlabel" > - <x>102</x> - <y>159</y> + <x>536</x> + <y>336</y> </hint> </hints> </connection> @@ -7433,12 +7441,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>102</x> - <y>159</y> + <x>536</x> + <y>336</y> </hint> <hint type="destinationlabel" > - <x>66</x> - <y>159</y> + <x>130</x> + <y>333</y> </hint> </hints> </connection> @@ -7449,12 +7457,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>102</x> - <y>163</y> + <x>536</x> + <y>392</y> </hint> <hint type="destinationlabel" > - <x>66</x> - <y>163</y> + <x>130</x> + <y>389</y> </hint> </hints> </connection> @@ -7465,76 +7473,44 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>66</x> - <y>163</y> + <x>130</x> + <y>389</y> </hint> <hint type="destinationlabel" > - <x>102</x> - <y>163</y> + <x>536</x> + <y>392</y> </hint> </hints> </connection> <connection> - <sender>transposeSlider</sender> + <sender>channelDetuneSpinBox</sender> <signal>valueChanged(int)</signal> - <receiver>transposeSpinBox</receiver> + <receiver>channelDetuneSlider</receiver> <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>490</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>345</x> + <y>487</y> </hint> </hints> </connection> <connection> - <sender>transposeSpinBox</sender> + <sender>channelDetuneSlider</sender> <signal>valueChanged(int)</signal> - <receiver>transposeSlider</receiver> + <receiver>channelDetuneSpinBox</receiver> <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> - </hint> - <hint type="destinationlabel" > - <x>110</x> - <y>172</y> - </hint> - </hints> - </connection> - <connection> - <sender>globalDetuneSpinBox</sender> - <signal>valueChanged(int)</signal> - <receiver>globalDetuneSlider</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>345</x> + <y>487</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> - </hint> - </hints> - </connection> - <connection> - <sender>globalDetuneSlider</sender> - <signal>valueChanged(int)</signal> - <receiver>globalDetuneSpinBox</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel" > - <x>110</x> - <y>172</y> - </hint> - <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>490</y> </hint> </hints> </connection> @@ -7545,12 +7521,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>226</x> + <y>567</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>286</x> + <y>570</y> </hint> </hints> </connection> @@ -7561,12 +7537,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>286</x> + <y>570</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>226</x> + <y>567</y> </hint> </hints> </connection> @@ -7577,12 +7553,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>427</x> + <y>567</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>570</y> </hint> </hints> </connection> @@ -7593,12 +7569,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>570</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>427</x> + <y>567</y> </hint> </hints> </connection> @@ -7609,12 +7585,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>371</x> + <y>647</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>650</y> </hint> </hints> </connection> @@ -7625,12 +7601,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>553</x> + <y>650</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>371</x> + <y>647</y> </hint> </hints> </connection> @@ -7641,12 +7617,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7657,12 +7633,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7673,12 +7649,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7689,12 +7665,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7705,12 +7681,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7721,12 +7697,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7737,12 +7713,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7753,12 +7729,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7769,12 +7745,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7785,12 +7761,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7801,12 +7777,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7817,12 +7793,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7833,12 +7809,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7849,12 +7825,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7865,12 +7841,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7881,12 +7857,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7897,12 +7873,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7913,12 +7889,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7929,12 +7905,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7945,12 +7921,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7961,12 +7937,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7977,12 +7953,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> <hint type="destinationlabel" > - <x>110</x> - <y>172</y> + <x>121</x> + <y>253</y> </hint> </hints> </connection> @@ -7993,28 +7969,12 @@ Wave form 8 = <i>if <b>t</b>&#060 pi then sin(2*<b>t</b>)*sin <slot>setValue(int)</slot> <hints> <hint type="sourcelabel" > - <x>53</x> - <y>172</y> - </hint> - <hint type="destinationlabel" > - <x>70</x> - <y>172</y> - </hint> - </hints> - </connection> - <connection> - <sender>presetLineEdit</sender> - <signal>textChanged(QString)</signal> - <receiver>presetNameLabel</receiver> - <slot>setText(QString)</slot> - <hints> - <hint type="sourcelabel" > - <x>483</x> - <y>165</y> + <x>55</x> + <y>519</y> </hint> <hint type="destinationlabel" > - <x>473</x> - <y>56</y> + <x>85</x> + <y>338</y> </hint> </hints> </connection> diff --git a/muse/synti/deicsonze/deicsonzepreset.cpp b/muse/synti/deicsonze/deicsonzepreset.cpp index d65140c7..ff0a8933 100644 --- a/muse/synti/deicsonze/deicsonzepreset.cpp +++ b/muse/synti/deicsonze/deicsonzepreset.cpp @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // deicsonzepreset.cpp // @@ -73,6 +73,19 @@ void Preset::setIsUsed(bool 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 @@ -186,11 +199,6 @@ void Preset::initPreset() { algorithm=FIRST; //feedeback feedback=0; - //quick edit - brightness=MIDFINEBRIGHTNESS; - attack=MIDATTACK; - release=MIDRELEASE; - modulation=0; //lfo lfo.wave=TRIANGL; lfo.speed=35; @@ -302,7 +310,7 @@ void Preset::initPreset() { function.atPitchBias=0; function.atEgBias=0; function.reverbRate=0; - globalDetune=0; + //globalDetune=0; //Name name="INITVOICE"; } @@ -378,7 +386,7 @@ void Preset::merge(Preset* p) { function.atPitchBias=p->function.atPitchBias; function.atEgBias=p->function.atEgBias; function.reverbRate=p->function.reverbRate; - globalDetune=p->globalDetune; + //globalDetune=p->globalDetune; //Name name=p->name; } @@ -650,16 +658,16 @@ void Preset::readPreset(QDomNode presetNode) { 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(); + //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(); @@ -882,8 +890,8 @@ void Preset::readPreset(QDomNode presetNode) { } } //globalDetune - else if(presetEl.tagName()=="globalDetune") - globalDetune=presetEl.text().toInt(); + //else if(presetEl.tagName()=="globalDetune") + // globalDetune=presetEl.text().toInt(); //Names else if(presetEl.tagName()=="name") name=presetEl.text().toAscii().data(); @@ -914,11 +922,11 @@ void Preset::writePreset(AL::Xml* xml, bool onlyUsed) { //feedback xml->intTag(FEEDBACKSTR, feedback); //quick edit - xml->intTag(FINEBRIGHTNESSSTR, brightness); - xml->intTag(MODULATIONSTR, (int)modulation); - xml->intTag(GLOBALDETUNESTR, globalDetune); - xml->intTag(ATTACKSTR, attack); - xml->intTag(RELEASESTR, release); + //xml->intTag(FINEBRIGHTNESSSTR, brightness); + //xml->intTag(MODULATIONSTR, (int)modulation); + //xml->intTag(GLOBALDETUNESTR, globalDetune); + //xml->intTag(ATTACKSTR, attack); + //xml->intTag(RELEASESTR, release); //lfo xml->tag("lfo"); xml->strTag(WAVESTR, (lfo.wave==SAWUP? "SAWUP": @@ -1057,7 +1065,7 @@ void Preset::writePreset(AL::Xml* xml, bool onlyUsed) { xml->intTag(REVERBRATESTR, function.reverbRate); xml->etag("function"); //globalDetune - xml->intTag("globalDetune", globalDetune); + //xml->intTag("globalDetune", globalDetune); //preset name xml->strTag("name", name.c_str()); //bank prog diff --git a/muse/synti/deicsonze/deicsonzepreset.h b/muse/synti/deicsonze/deicsonzepreset.h index e9132380..22422b00 100644 --- a/muse/synti/deicsonze/deicsonzepreset.h +++ b/muse/synti/deicsonze/deicsonzepreset.h @@ -2,7 +2,7 @@ // // DeicsOnze an emulator of the YAMAHA DX11 synthesizer // -// Version 0.3 +// Version 0.4 // // deicsonzepreset.h // @@ -246,14 +246,17 @@ #define FCAMPLITUDELONGSTR "FootControllerAmplitude" #define CTRL_FCAMPLITUDE 122+CTRLOFFSET #define MAXFCAMPLITUDE 99 -#define GLOBALDETUNESTR "GlobalDetune" -#define CTRL_GLOBALDETUNE 123+CTRLOFFSET -#define MAXGLOBALDETUNE 31 -#define MASTERVOLUMESTR "MasterVolume" -#define CTRL_MASTERVOLUME 124+CTRLOFFSET -#define MAXMASTERVOLUME 255 -#define CTRL_FINEBRIGHTNESS 125+CTRLOFFSET +#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" @@ -268,7 +271,12 @@ #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; @@ -445,9 +453,6 @@ class Preset { //Attributes Algorithm algorithm; unsigned char feedback; //0 to 7 - unsigned short brightness; //0 to 4095 - unsigned char attack; //0 to 127 - unsigned char release; //0 to 127 Lfo lfo; Sensitivity sensitivity; Frequency frequency[NBROP]; @@ -458,7 +463,7 @@ class Preset { unsigned char outLevel[NBROP]; //0 to 99 Scaling scaling; Function function; - int globalDetune; //-31 to 31 + //int globalDetune; //-31 to 31 //now to the channel std::string name; unsigned char modulation; //0 to 127 int prog; //0 to 127 @@ -470,6 +475,7 @@ class Preset { 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); diff --git a/muse/synti/libsynti/gui.h b/muse/synti/libsynti/gui.h index 1aa375c7..24d7fe52 100644 --- a/muse/synti/libsynti/gui.h +++ b/muse/synti/libsynti/gui.h @@ -39,7 +39,7 @@ class MessGui { int readFd; void readMessage(); void sendEvent(const MidiEvent& ev); - void sendController(int,int,int); + void sendController(int ch, int idx, int val); void sendSysex(unsigned char*, int); virtual void processEvent(const MidiEvent&) {}; |