diff options
author | Phil Burk <[email protected]> | 2022-08-11 19:52:53 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-08-11 19:52:53 -0700 |
commit | a46f8c93193fe8bb1eb7b93e55c85e6f46d5b108 (patch) | |
tree | b306cf9c8fd2fba9ff839a194188e7d0ac46091a /src/main/java/com/jsyn/midi/MessageParser.java | |
parent | c059ebf933ae4c6eeb26da50e168db2322e4790f (diff) |
midi: fixes for ExoSynth (#114)
Combine channel and noteNumber as a tag for the VoiceAllocator
to avoid collisions when the same note is played on multiple channels.
Allocate more voices: numChannels * voicesPerChannel
For GM2 synths, force channel 10 (9) to use preset 128.
That is a sign for the synth that this is a rhythm channel.
Diffstat (limited to 'src/main/java/com/jsyn/midi/MessageParser.java')
-rw-r--r-- | src/main/java/com/jsyn/midi/MessageParser.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/com/jsyn/midi/MessageParser.java b/src/main/java/com/jsyn/midi/MessageParser.java index 4ef119a..552deb7 100644 --- a/src/main/java/com/jsyn/midi/MessageParser.java +++ b/src/main/java/com/jsyn/midi/MessageParser.java @@ -87,7 +87,7 @@ public class MessageParser { public void rawControlChange(int channel, int index, int value) { int paramIndex; int paramValue; - switch(index) { + switch (index) { case MidiConstants.CONTROLLER_DATA_ENTRY: parameterValues[channel] = value << 7; fireParameterChange(channel); @@ -104,7 +104,7 @@ public class MessageParser { parameterIndices[channel] = paramIndex; break; case MidiConstants.CONTROLLER_NRPN_MSB: - parameterIndices[channel] = (value << 7) | BIT_NON_RPM;; + parameterIndices[channel] = (value << 7) | BIT_NON_RPM; break; case MidiConstants.CONTROLLER_RPN_LSB: paramIndex = parameterIndices[channel] & ~0x7F; @@ -133,12 +133,8 @@ public class MessageParser { private void checkMessageLength(int expectedLength, int actualLength) { if (actualLength < expectedLength) { - throw new IllegalArgumentException( - "Expected message of at least " - + expectedLength - + " bytes but got " - + actualLength - + " bytes."); + throw new IllegalArgumentException("Expected message of at least " + expectedLength + + " bytes but got " + actualLength + " bytes."); } } |