/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class is used to store modulator/artiuclation data.
* A modulator connects one synthesizer source to
* a destination. For example a note on velocity
* can be mapped to the gain of the synthesized voice.
* It is stored as a "art1" or "art2" chunk inside DLS files.
*
* @author Karl Helgason
*/
public final class DLSModulator {
// DLS1 Destinations
// DLS2 Destinations
// DLS1 Sources
// DLS2 Sources
// DLS1 Transforms
// DLS2 Transforms
int source;
int control;
int destination;
int transform;
int scale;
public int getControl() {
return control;
}
}
if (destination == CONN_DST_GAIN)
return DST_FORMAT_CB;
if (destination == CONN_DST_PITCH)
return DST_FORMAT_CENT;
if (destination == CONN_DST_PAN)
return DST_FORMAT_PERCENT;
if (destination == CONN_DST_LFO_FREQUENCY)
return DST_FORMAT_CENT;
if (destination == CONN_DST_LFO_STARTDELAY)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_ATTACKTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_DECAYTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_RELEASETIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_SUSTAINLEVEL)
return DST_FORMAT_PERCENT;
if (destination == CONN_DST_EG2_ATTACKTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG2_DECAYTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG2_RELEASETIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG2_SUSTAINLEVEL)
return DST_FORMAT_PERCENT;
if (destination == CONN_DST_KEYNUMBER)
return DST_FORMAT_CENT; // NOT SURE WITHOUT DLS 2 SPEC
if (destination == CONN_DST_LEFT)
return DST_FORMAT_CB;
if (destination == CONN_DST_RIGHT)
return DST_FORMAT_CB;
if (destination == CONN_DST_CENTER)
return DST_FORMAT_CB;
if (destination == CONN_DST_LEFTREAR)
return DST_FORMAT_CB;
if (destination == CONN_DST_RIGHTREAR)
return DST_FORMAT_CB;
if (destination == CONN_DST_LFE_CHANNEL)
return DST_FORMAT_CB;
if (destination == CONN_DST_CHORUS)
return DST_FORMAT_PERCENT;
if (destination == CONN_DST_REVERB)
return DST_FORMAT_PERCENT;
if (destination == CONN_DST_VIB_FREQUENCY)
return DST_FORMAT_CENT;
if (destination == CONN_DST_VIB_STARTDELAY)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_DELAYTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_HOLDTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG1_SHUTDOWNTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG2_DELAYTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_EG2_HOLDTIME)
return DST_FORMAT_TIMECENT;
if (destination == CONN_DST_FILTER_CUTOFF)
return DST_FORMAT_CENT;
if (destination == CONN_DST_FILTER_Q)
return DST_FORMAT_CB;
return -1;
}
if (destination == CONN_DST_GAIN)
return "gain";
if (destination == CONN_DST_PITCH)
return "pitch";
if (destination == CONN_DST_PAN)
return "pan";
if (destination == CONN_DST_LFO_FREQUENCY)
return "lfo1.freq";
if (destination == CONN_DST_LFO_STARTDELAY)
return "lfo1.delay";
if (destination == CONN_DST_EG1_ATTACKTIME)
return "eg1.attack";
if (destination == CONN_DST_EG1_DECAYTIME)
return "eg1.decay";
if (destination == CONN_DST_EG1_RELEASETIME)
return "eg1.release";
if (destination == CONN_DST_EG1_SUSTAINLEVEL)
return "eg1.sustain";
if (destination == CONN_DST_EG2_ATTACKTIME)
return "eg2.attack";
if (destination == CONN_DST_EG2_DECAYTIME)
return "eg2.decay";
if (destination == CONN_DST_EG2_RELEASETIME)
return "eg2.release";
if (destination == CONN_DST_EG2_SUSTAINLEVEL)
return "eg2.sustain";
if (destination == CONN_DST_KEYNUMBER)
return "keynumber";
if (destination == CONN_DST_LEFT)
return "left";
if (destination == CONN_DST_RIGHT)
return "right";
if (destination == CONN_DST_CENTER)
return "center";
if (destination == CONN_DST_LEFTREAR)
return "leftrear";
if (destination == CONN_DST_RIGHTREAR)
return "rightrear";
if (destination == CONN_DST_LFE_CHANNEL)
return "lfe_channel";
if (destination == CONN_DST_CHORUS)
return "chorus";
if (destination == CONN_DST_REVERB)
return "reverb";
if (destination == CONN_DST_VIB_FREQUENCY)
return "vib.freq";
if (destination == CONN_DST_VIB_STARTDELAY)
return "vib.delay";
if (destination == CONN_DST_EG1_DELAYTIME)
return "eg1.delay";
if (destination == CONN_DST_EG1_HOLDTIME)
return "eg1.hold";
if (destination == CONN_DST_EG1_SHUTDOWNTIME)
return "eg1.shutdown";
if (destination == CONN_DST_EG2_DELAYTIME)
return "eg2.delay";
if (destination == CONN_DST_EG2_HOLDTIME)
return "eg.2hold";
if (destination == CONN_DST_FILTER_CUTOFF)
return "filter.cutoff"; // NOT SURE WITHOUT DLS 2 SPEC
if (destination == CONN_DST_FILTER_Q)
return "filter.q"; // NOT SURE WITHOUT DLS 2 SPEC
return null;
}
if (source == CONN_SRC_NONE)
return "none";
if (source == CONN_SRC_LFO)
return "lfo";
if (source == CONN_SRC_KEYONVELOCITY)
return "keyonvelocity";
if (source == CONN_SRC_KEYNUMBER)
return "keynumber";
if (source == CONN_SRC_EG1)
return "eg1";
if (source == CONN_SRC_EG2)
return "eg2";
if (source == CONN_SRC_PITCHWHEEL)
return "pitchweel";
if (source == CONN_SRC_CC1)
return "cc1";
if (source == CONN_SRC_CC7)
return "cc7";
if (source == CONN_SRC_CC10)
return "c10";
if (source == CONN_SRC_CC11)
return "cc11";
if (source == CONN_SRC_POLYPRESSURE)
return "polypressure";
if (source == CONN_SRC_CHANNELPRESSURE)
return "channelpressure";
if (source == CONN_SRC_VIBRATO)
return "vibrato";
if (source == CONN_SRC_MONOPRESSURE)
return "monopressure";
if (source == CONN_SRC_CC91)
return "cc91";
if (source == CONN_SRC_CC93)
return "cc93";
return null;
}
public int getDestination() {
return destination;
}
this.destination = destination;
}
public int getScale() {
return scale;
}
}
public int getSource() {
return source;
}
}
public int getVersion() {
return version;
}
}
public int getTransform() {
return transform;
}
}
}