From 235ed4b866e0928ec941331666efab3022c260c5 Mon Sep 17 00:00:00 2001 From: GoryMoon Date: Sun, 14 Jan 2018 21:56:25 +0100 Subject: [PATCH] Fixed note sequencer not scrolling properly and error at 128+ notes --- .../modules/realtimers/ModuleNote.java | 90 ++++++++----------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/src/main/java/vswe/stevescarts/modules/realtimers/ModuleNote.java b/src/main/java/vswe/stevescarts/modules/realtimers/ModuleNote.java index 81dcc703..72906ca8 100644 --- a/src/main/java/vswe/stevescarts/modules/realtimers/ModuleNote.java +++ b/src/main/java/vswe/stevescarts/modules/realtimers/ModuleNote.java @@ -18,18 +18,24 @@ import java.util.ArrayList; public class ModuleNote extends ModuleBase { - private final int maximumTracksPerModuleBitCount = 4; - private final int maximumNotesPerTrackBitCount = 12; - private int veryLongTrackLimit; - private int notesInView; - private int tracksInView; - private int[] instrumentColors; - private String[] pitchNames; - private Localization.MODULES.ATTACHMENTS[] instrumentNames; + private final static int maximumTracksPerModuleBitCount = 4; + private final static int maximumNotesPerTrackBitCount = 12; + private final static int veryLongTrackLimit = 1024; + private final static int notesInView = 13; + private final static int tracksInView = 5; + private final static int[] instrumentColors = new int[] { 4210752, 16711680, 65280, 255, 16776960, 65535 }; + private final static String[] pitchNames = new String[] { "F#", "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#" }; + private final static Localization.MODULES.ATTACHMENTS[] instrumentNames = new Localization.MODULES.ATTACHMENTS[] { Localization.MODULES.ATTACHMENTS.PIANO, Localization.MODULES.ATTACHMENTS.BASS_DRUM, Localization.MODULES.ATTACHMENTS.SNARE_DRUM, + Localization.MODULES.ATTACHMENTS.STICKS, Localization.MODULES.ATTACHMENTS.BASS_GUITAR }; + private final static int notemapX = 70; + private final static int notemapY = 40; + private final static int trackHeight = 20; + private final static int[] scrollXrect = new int[] { notemapX + 120, notemapY - 20, 100, 16 }; + private final static int[] scrollYrect = new int[] { notemapX + 220, notemapY, 16, 100 }; + private final static int maximumNotesPerTrack = (int) Math.pow(2.0, maximumNotesPerTrackBitCount) - 1; + private final static int maximumTracksPerModule = (int) Math.pow(2.0, maximumTracksPerModuleBitCount) - 1; + private ArrayList tracks; - private int notemapX; - private int notemapY; - private int trackHeight; private ArrayList