Skip to content

Commit

Permalink
Fix for searching within empty note pool (div/0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Murivan committed Sep 2, 2024
1 parent 9af36b8 commit efc4eb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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.2'
version = '1.0.3'
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.2";
public static final String version = "1.0.3";
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
6 changes: 4 additions & 2 deletions src/main/java/arpeggiatorum/notePool/NotePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ public NoteItem getNext(NoteItem previous) {
// get next note from note pool
switch (this.pattern) {
case up:
index = ++index % this.notePool.size();
if (this.notePool.size() > 0)
index = ++index % this.notePool.size();
break;
case down:
index = Math.floorMod(--index, this.notePool.size());
if (this.notePool.size() > 0)
index = Math.floorMod(--index, this.notePool.size());
break;
case up_down:
if (++index >= this.notePool.size()) {
Expand Down

0 comments on commit efc4eb2

Please sign in to comment.