diff --git a/build.gradle b/build.gradle index f14e175..4e40275 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ javafx { application { group = 'com.github.axelberndt' - version = '1.0.0' + version = '1.0.1' mainClass.set("arpeggiatorum.Launcher") } diff --git a/src/main/java/arpeggiatorum/Arpeggiator.java b/src/main/java/arpeggiatorum/Arpeggiator.java index f182717..c840984 100644 --- a/src/main/java/arpeggiatorum/Arpeggiator.java +++ b/src/main/java/arpeggiatorum/Arpeggiator.java @@ -19,7 +19,7 @@ * @author Axel Berndt */ public class Arpeggiator implements Receiver, Transmitter { - public static final String version = "1.0.0"; + public static final String version = "1.0.1"; public static final int ARPEGGIO_CHANNEL_PRESET = 1; public static final int HELD_NOTES_CHANNEL_PRESET = 2; public static final int BASS_CHANNEL_PRESET = 0; diff --git a/src/main/java/arpeggiatorum/gui/ArpeggiatorumGUIController.java b/src/main/java/arpeggiatorum/gui/ArpeggiatorumGUIController.java index 060ccab..9405bd7 100644 --- a/src/main/java/arpeggiatorum/gui/ArpeggiatorumGUIController.java +++ b/src/main/java/arpeggiatorum/gui/ArpeggiatorumGUIController.java @@ -362,8 +362,10 @@ public void comboMIDIOutChanged(ActionEvent actionEvent) { @FXML public void comboMIDIChannelChanged(ActionEvent actionEvent) { - if (comboMIDIChannel.getValue() != null) + if (comboMIDIChannel.getValue() != null) { Arpeggiatorum.getInstance().getArpeggiator().setInputChannel(comboMIDIChannel.getValue()); + Mic2MIDI.MIDIChannelIn=comboMIDIChannel.getValue(); + } } @FXML diff --git a/src/main/java/arpeggiatorum/microphoneControl/Mic2MIDI.java b/src/main/java/arpeggiatorum/microphoneControl/Mic2MIDI.java index 5c07535..6c01dac 100644 --- a/src/main/java/arpeggiatorum/microphoneControl/Mic2MIDI.java +++ b/src/main/java/arpeggiatorum/microphoneControl/Mic2MIDI.java @@ -22,6 +22,7 @@ public abstract class Mic2MIDI extends Circuit implements Transmitter, IMic2MIDI public static final double FREQUENCY_RAMP_TIME = 0.01; public static final double PEAK_FOLLOWER_RAMP_TIME = 0.25; public final ChannelIn channelIn = new ChannelIn();// microphone input + public static int MIDIChannelIn=0; public final double sampleRate; protected final SchmidtTrigger schmidtTrigger = new SchmidtTrigger(); public String NAME = "Abstract"; @@ -104,7 +105,7 @@ public void setSignalToNoiseThreshold(double value) { public void sendNoteOn(int pitch, int velocity) { ShortMessage noteOn; try { - noteOn = new ShortMessage(EventMaker.NOTE_ON, pitch, velocity); + noteOn = new ShortMessage(EventMaker.NOTE_ON, MIDIChannelIn, pitch, velocity); } catch (InvalidMidiDataException e) { Logger logger = Logger.getLogger(ArpeggiatorumGUI.getInstance().getClass().getName()); logger.log(Level.SEVERE, "MIDI Exception.", e); @@ -137,7 +138,7 @@ public void sendNoteOn(int pitch) { public void sendNoteOff(int pitch) { ShortMessage noteOff; try { - noteOff = new ShortMessage(EventMaker.NOTE_OFF, pitch, 0); + noteOff = new ShortMessage(EventMaker.NOTE_OFF,MIDIChannelIn, pitch, 0); } catch (InvalidMidiDataException e) { Logger logger = Logger.getLogger(ArpeggiatorumGUI.getInstance().getClass().getName()); logger.log(Level.SEVERE, "MIDI Exception.", e);