Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ public class Notebot extends Module {
.build()
);

public final Setting<Boolean> roundOutOfRange = sgGeneral.add(new BoolSetting.Builder()
.name("round-out-of-range")
.description("Rounds out of range notes")
public final Setting<Boolean> transposeOutOfRange = sgGeneral.add(new BoolSetting.Builder()
.name("transpose-out-of-range")
.description("Transposes out of range notes")
.defaultValue(false)
.build()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ private static void fixSong(Song song) {

int n = note.getNoteLevel();
if (n < 0 || n > 24) {
if (notebot.roundOutOfRange.get()) {
note.setNoteLevel(n < 0 ? 0 : 24);
if (notebot.transposeOutOfRange.get()) {
while (n < 0) {
n += 12;
}
while (n > 24) {
n -= 12;
}
note.setNoteLevel(n);
} else {
notebot.warning("Note at tick %d out of range.", tick);
iterator.remove();
Expand Down
Loading