use of org.apache.cassandra.cql3.Operator in project blue by kunstmusik.
the class BlueX7SysexReader method mapOperatorFromSingle.
public static final void mapOperatorFromSingle(BlueX7 blueX7, byte[] sysex, int operatorNum) {
Operator op = blueX7.operators[operatorNum];
int offset = START_OFFSET;
// get us to the operator we want
offset += (5 - operatorNum) * 21;
// reading envelope generator info - bytes 0 - 7
op.envelopePoints[0].x = sysex[offset++];
op.envelopePoints[1].x = sysex[offset++];
op.envelopePoints[2].x = sysex[offset++];
op.envelopePoints[3].x = sysex[offset++];
op.envelopePoints[0].y = sysex[offset++];
op.envelopePoints[1].y = sysex[offset++];
op.envelopePoints[2].y = sysex[offset++];
op.envelopePoints[3].y = sysex[offset++];
// bytes 8 - 10
op.breakpoint = sysex[offset++];
op.depthLeft = sysex[offset++];
op.depthRight = sysex[offset++];
// byte 11 - 12
op.curveLeft = sysex[offset++];
op.curveRight = sysex[offset++];
// byte 13 - 15
op.keyboardRateScaling = sysex[offset++];
op.modulationAmplitude = sysex[offset++];
op.velocitySensitivity = sysex[offset++];
// byte 16
op.outputLevel = sysex[offset++];
// byte 17 - 20
op.mode = sysex[offset++];
op.freqCoarse = sysex[offset++];
op.freqFine = sysex[offset++];
op.detune = sysex[offset++] - 7;
}
use of org.apache.cassandra.cql3.Operator in project blue by kunstmusik.
the class BlueX7SysexReader method mapOperatorFromBank.
public static final void mapOperatorFromBank(BlueX7 blueX7, byte[] sysex, int patchNum, int operatorNum) {
Operator op = blueX7.operators[operatorNum];
int offset = START_OFFSET;
offset += patchNum * 128;
offset += (5 - operatorNum) * 17;
// reading envelope generator info - bytes 0 - 7
op.envelopePoints[0].x = sysex[offset++];
op.envelopePoints[1].x = sysex[offset++];
op.envelopePoints[2].x = sysex[offset++];
op.envelopePoints[3].x = sysex[offset++];
op.envelopePoints[0].y = sysex[offset++];
op.envelopePoints[1].y = sysex[offset++];
op.envelopePoints[2].y = sysex[offset++];
op.envelopePoints[3].y = sysex[offset++];
// bytes 8 - 10
op.breakpoint = sysex[offset++];
op.depthLeft = sysex[offset++];
op.depthRight = sysex[offset++];
// byte 11
int temp = sysex[offset++];
int val1 = temp & 3;
int val2 = (temp & 12) >>> 2;
op.curveLeft = val2;
op.curveRight = val1;
// byte 12
temp = sysex[offset++];
val1 = temp & 7;
val2 = (temp & 112) >>> 3;
op.keyboardRateScaling = val1;
op.detune = val2 - 7;
// System.out.println("detune: " + op.detune);
// byte 13
temp = sysex[offset++];
val1 = temp & 3;
val2 = (temp & 56) >>> 2;
op.modulationAmplitude = val1;
op.velocitySensitivity = val2;
// byte 14
op.outputLevel = sysex[offset++];
// byte 15
temp = sysex[offset++];
val1 = temp & 1;
val2 = (temp & 62) >>> 1;
op.mode = val1;
op.freqCoarse = val2;
// byte 16
op.freqFine = sysex[offset++];
}
Aggregations