/*
* 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 decodes information from ModelPeformer for use in SoftVoice.
* It also adds default connections if they where missing in ModelPerformer.
*
* @author Karl Helgason
*/
public final class SoftPerformer {
= new ModelConnectionBlock[42];
static {
int o = 0;
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
new ModelTransform() {
int v = (int) (value * 16384.0);
int msb = v >> 7;
int lsb = v & 127;
}
}),
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
new ModelSource(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
defaultconnections[o++] = new ModelConnectionBlock(
}
public boolean selfNonExclusive = false;
public boolean forcedVelocity = false;
public boolean forcedKeynumber = false;
public int[][] midi_ctrl_connections;
public int[][] midi_connections;
public int[] ctrl_connections;
}
}
}
}
}
}
if (o.equals("midi_cc"))
else if (o.equals("midi_rpn"))
else if (o.equals("midi_nrpn"))
else if (o.equals("midi"))
else if (o.equals("noteon"))
else if (o.equals("osc"))
return;
else if (o.equals("mixer"))
return;
else
}
if (v == null)
return;
if (midi_ctrl_connections[c] == null)
midi_ctrl_connections[c] = new int[]{ix};
else {
int[] olda = midi_ctrl_connections[c];
midi_ctrl_connections[c] = newa;
}
}
int c = -1;
if (v.equals("on"))
c = 3;
if (v.equals("keynumber"))
c = 4;
if (c == -1)
return;
if (midi_connections[c] == null)
midi_connections[c] = new int[]{ix};
else {
int[] olda = midi_connections[c];
midi_connections[c] = newa;
}
}
int c = -1;
if (v.equals("pitch"))
c = 0;
if (v.equals("channel_pressure"))
c = 1;
if (v.equals("poly_pressure"))
c = 2;
if (c == -1)
return;
if (midi_connections[c] == null)
midi_connections[c] = new int[]{ix};
else {
int[] olda = midi_connections[c];
midi_connections[c] = newa;
}
}
if (v == null)
return;
else {
}
}
if (v == null)
return;
else {
}
}
if (performer.isDefaultConnectionsEnabled()) {
// Add modulation depth range (RPN 5) to the modulation wheel (cc#1)
boolean isModulationWheelConectionFound = false;
boolean isModulationWheelConection = false;
// check if connection block has the source "modulation
// wheel cc#1"
"midi_cc")) {
.equals("1")) {
isModulationWheelConection = true;
isModulationWheelConectionFound = true;
break;
}
}
}
}
if (isModulationWheelConection) {
}
}
if (!isModulationWheelConectionFound) {
50,
"5")));
}
// Let Aftertouch to behave just like modulation wheel (cc#1)
boolean channel_pressure_set = false;
boolean poly_pressure = false;
int mod_cc_1_connection_src_ix = 0;
// if(dest != null && sources != null)
// check if connection block has the source "modulation
// wheel cc#1"
}
}
// check if channel or poly pressure are already
// connected
channel_pressure_set = true;
poly_pressure = true;
}
}
}
}
if (mod_cc_1_connection != null) {
if (!channel_pressure_set) {
src_list_new[i] = src_list[i];
}
if (!poly_pressure) {
src_list_new[i] = src_list[i];
}
}
// Enable Vibration Sound Controllers : 76, 77, 78
if (found_vib_connection == null)
else {
.getIdentifier().getInstance() >
}
}
}
}
}
}
int instance = 1;
if (found_vib_connection != null) {
.getInstance();
}
connection = new ModelConnectionBlock(
2000, new ModelDestination(
connection = new ModelConnectionBlock(
new ModelTransform() {
double s = scale;
value *= 600;
if (s == 0) {
return value;
} else if (s > 0) {
if (value < -s)
value = -s;
return value;
} else {
if (value < s)
value = -s;
return -value;
}
}
connection = new ModelConnectionBlock(
2400, new ModelDestination(
}
// Add default connection blocks
// Add connection blocks from modelperformer
// Control Time
midi_ctrl_connections = new int[128][];
midi_ctrl_connections[i] = null;
}
midi_connections = new int[5][];
midi_connections[i] = null;
}
int ix = 0;
boolean mustBeOnTop = false;
mustBeOnTop = true;
forcedKeynumber = true;
forcedVelocity = true;
}
}
if (mustBeOnTop) {
mustBeOnTop = false;
} else
}
}
}
ix++;
}
}
}
}
}
}
}
}
return false;
if (!(transform instanceof ModelStandardTransform))
return false;
return false;
return false;
return false;
return false;
}
}