Skip to content

Commit

Permalink
git device
Browse files Browse the repository at this point in the history
  • Loading branch information
jimomulloy committed Oct 26, 2024
1 parent 1ed2eb3 commit 0fe778f
Show file tree
Hide file tree
Showing 5 changed files with 3,433 additions and 3,403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,22 @@ public boolean open() {
.getBooleanParameter(InstrumentParameterNames.ACTUATION_VOICE_USER_SYNTHESIZER_SWITCH);
boolean useMidiDevice = parameterManager
.getBooleanParameter(InstrumentParameterNames.ACTUATION_VOICE_MIDI_DEVICE_PLAY_SWITCH);
boolean midiDeviceChannelSwitch = parameterManager
.getBooleanParameter(InstrumentParameterNames.ACTUATION_VOICE_MIDI_DEVICE_CHANNEL_SWITCH);

String midiDeviceName = parameterManager
.getParameter(InstrumentParameterNames.ACTUATION_VOICE_MIDI_DEVICE_NAME);
try {
MidiDevice.Info midiOut = null;
Info[] midiDevs = MidiSystem.getMidiDeviceInfo();
boolean externalMidi = false;
for (Info midiDev : midiDevs) {
LOG.severe(">>MidiSynth Devs: " + midiDev.getName());
if (useMidiDevice && midiDeviceName != null && !midiDeviceName.isEmpty()
&& midiDev.getName().toLowerCase().startsWith(midiDeviceName.toLowerCase())
&& midiOut == null) {
midiOut = midiDev;
externalMidi = true;
midiDevice = MidiSystem.getMidiDevice(midiOut);
LOG.severe(">>MidiSynth Dev: " + midiDev.getName());
}
Expand Down Expand Up @@ -359,9 +363,10 @@ public boolean open() {
for (int i = 0; i < channels.length; i++) {
if (midiDevice instanceof Synthesizer) {
channels[i] = new ChannelData(null, i);
} else if (midiDeviceChannelSwitch) {
channels[i] = new ChannelData(null, channelDeviceMap.getOrDefault(i, 0));
} else {
int channelNumber = channelDeviceMap.getOrDefault(i, 0);
channels[i] = new ChannelData(null, channelNumber);
channels[i] = new ChannelData(null, 0);
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ public class InstrumentParameterNames {
public static final String ACTUATION_VOICE_USER_SYNTHESIZER_SWITCH = "actuation.voice.useSynthesizer";
public static final String ACTUATION_VOICE_MIDI_DEVICE_NAME = "actuation.voice.midiDeviceName";
public static final String ACTUATION_VOICE_MIDI_DEVICE_PLAY_SWITCH = "actuation.voice.midiDevicePlaySwitch";
public static final String ACTUATION_VOICE_MIDI_DEVICE_CHANNEL_SWITCH = "actuation.voice.midiDeviceChannelSwitch";
public static final String ACTUATION_VOICE_RESYNTH_PLAY = "actuation.voice.playResynth";
public static final String ACTUATION_VOICE_MIDI_SOUND_FONTS = "actuation.voice.midiSoundFonts";
public static final String ACTUATION_VOICE_MIDI_PLAY_START_OFFSET = "actuation.voice.playStartOffset";
Expand Down
Loading

0 comments on commit 0fe778f

Please sign in to comment.