Skip to content

Commit

Permalink
Fix for MIDI Channel Input Change
Browse files Browse the repository at this point in the history
Version advanced to 1.0.1
  • Loading branch information
Murivan committed Aug 26, 2024
1 parent a22866d commit 20aab34
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ javafx {

application {
group = 'com.github.axelberndt'
version = '1.0.0'
version = '1.0.1'
mainClass.set("arpeggiatorum.Launcher")
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/arpeggiatorum/Arpeggiator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/arpeggiatorum/microphoneControl/Mic2MIDI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 20aab34

Please sign in to comment.