@@ -29,7 +29,7 @@ public class DrumSequenceMode extends Layer {
2929 private static final LpColor [] ARP_BUTTON_COLORS = new LpColor []{LpColor .BLUE , LpColor .BLUE , LpColor .BLUE , LpColor .BLUE , LpColor .PURPLE , LpColor .PURPLE , LpColor .PURPLE , LpColor .PURPLE };
3030 private static final LpColor [] GRID_BUTTON_COLORS = new LpColor []{LpColor .PINK , LpColor .PINK , LpColor .PINK , LpColor .PINK , LpColor .PINK , LpColor .RED , LpColor .RED , LpColor .RED };
3131
32- private static final RndConfig [] RND_VALUES = new RndConfig []{RndConfig .P25 , RndConfig .P50 , RndConfig .P75 };
32+ static final RndConfig [] RND_VALUES = new RndConfig []{RndConfig .P25 , RndConfig .P50 , RndConfig .P75 };
3333
3434 private int selectedRefVel = 0 ;
3535 private int selectedRndIndex = 2 ;
@@ -71,6 +71,7 @@ public class DrumSequenceMode extends Layer {
7171 private final Layer sendsLayer ;
7272 private final Layer shiftLayer ;
7373 private final Layer randomLayer ;
74+ private final DrumSeqMultilineLayer multilineSeqLayer ;
7475
7576 private Layer currentLayer ;
7677
@@ -132,6 +133,7 @@ public PadContainer(final int index, final DrumPad pad, final BooleanValueObject
132133 selectedPad = this ;
133134 focusOnSelectedPad ();
134135 selectedPadIndex = index ;
136+ multilineSeqLayer .setSelectPadIndex (index );
135137 }
136138 });
137139 pad .exists ().addValueObserver (exists -> this .exists = exists );
@@ -220,6 +222,7 @@ public DrumSequenceMode(final Layers layers, final LaunchpadProMk3ControllerExte
220222 clipAreaNavLayer = new Layer (getLayers (), getName () + "_NAV" );
221223 sendsLayer = new Layer (getLayers (), getName () + "_VEL" );
222224 randomLayer = new Layer (getLayers (), getName () + "_RANDOM" );
225+ multilineSeqLayer = new DrumSeqMultilineLayer (layers , driver , this );
223226 currentLayer = mainLayer ;
224227
225228 noteInput = driver .getNoteInput ();
@@ -305,6 +308,10 @@ private void initSpecialButtons(LaunchpadProMk3ControllerExtension driver) {
305308 hwElements .getButton (LabelCcAssignments .CUSTOM )
306309 .bindToggle (mainLayer , randomModeActive , LpColor .GREEN_SPRING , LpColor .BLACK );
307310 hwElements .getButton (LabelCcAssignments .STOP_CLIP_SWING ).bindPressed (mainLayer , stopButtonHeld , LpColor .RED );
311+ hwElements .getButton (LabelCcAssignments .CHORD ).bindPressed (mainLayer , multilineSeqLayer ::toggleIsActive );
312+ hwElements .getButton (LabelCcAssignments .CHORD )
313+ .bindLight (mainLayer ,
314+ () -> multilineSeqLayer .isActive () ? RgbState .of (LpColor .ORANGE ) : RgbState .of (LpColor .BLACK ));
308315
309316 final LabeledButton deviceButton = hwElements .getButton (LabelCcAssignments .DEVICE_TEMPO );
310317 final ViewCursorControl control = driver .getViewControl ();
@@ -374,7 +381,8 @@ private void initDrumPadButtons(final LaunchpadProMk3ControllerExtension driver)
374381 final PadContainer pad = new PadContainer (index , control .getDrumPadBank ().getItemAt (index ),
375382 playing [index ]);
376383 pads .add (pad );
377- button .bindPressed (mainLayer , p -> handlePadSelection (pad , p ), pad ::getColor );
384+ button .bindPressed (mainLayer , () -> handlePadSelection (pad ));
385+ button .bindLight (mainLayer , pad ::getColor );
378386 button .bindToggle (muteLayer , pad .pad .mute ());
379387 button .bindLight (muteLayer , pad ::mutingColors );
380388 button .bindToggle (soloLayer , pad .pad .solo ());
@@ -383,7 +391,7 @@ private void initDrumPadButtons(final LaunchpadProMk3ControllerExtension driver)
383391 button .bindLight (sendsLayer , pad ::sendStatusColor );
384392 }
385393 }
386- pads .sort (( pc1 , pc2 ) -> pc1 .index - pc2 . index );
394+ pads .sort (Comparator . comparingInt ( pc -> pc .index ) );
387395 }
388396
389397 private void initSequenceSection (final LaunchpadProMk3ControllerExtension driver ) {
@@ -493,6 +501,14 @@ private void adjustMode(final int notes) {
493501 }
494502 }
495503
504+ public double getGatePercent () {
505+ return gatePercent ;
506+ }
507+
508+ public int getRefVelocity () {
509+ return velTable [selectedRefVel ];
510+ }
511+
496512 public void setBackToOriginalLength () {
497513 adjustMode (originalClipLength );
498514 cursorClip .getLoopLength ().set (originalClipLength );
@@ -535,6 +551,7 @@ private void assignGridResolution(final List<LabeledButton> sceneButtons) {
535551 button .bind (this , () -> {
536552 selectedGridIndex = index ;
537553 positionHandler .setGridResolution (GRID_RATES [index ]);
554+ multilineSeqLayer .setGridResolution (GRID_RATES [index ]);
538555 }, () -> getGridState (index ));
539556 }
540557 }
@@ -689,6 +706,14 @@ private void handlePlayingStep(final int playingStep) {
689706 this .playingStep = playingStep - positionHandler .getStepOffset ();
690707 }
691708
709+ public boolean isFixedLengthHeld () {
710+ return fixedLengthHeld .get ();
711+ }
712+
713+ public boolean isRandomModeActive () {
714+ return randomModeActive .get ();
715+ }
716+
692717 private void handleSeqSelection (final int index , final boolean pressed ) {
693718 if (!pressed ) {
694719 return ;
@@ -708,6 +733,10 @@ private void handleSeqSelection(final int index, final boolean pressed) {
708733 }
709734 }
710735
736+ public RndConfig getCurrentRndValue () {
737+ return RND_VALUES [selectedRndIndex ];
738+ }
739+
711740 private void stepActionRandomMode (final int index , final NoteStep note ) {
712741 final double setProb = RND_VALUES [selectedRndIndex ].prob ;
713742 if (note != null && note .state () == State .NoteOn ) {
@@ -723,16 +752,13 @@ private void stepActionRandomMode(final int index, final NoteStep note) {
723752 }
724753 }
725754
726- private void stepActionFixedLength (final int index ) {
755+ void stepActionFixedLength (final int index ) {
727756 final double newLen = positionHandler .lengthWithLastStep (index );
728757 adjustMode (newLen );
729758 cursorClip .getLoopLength ().set (newLen );
730759 }
731760
732- private void handlePadSelection (final PadContainer pad , final boolean pressed ) {
733- if (!pressed ) {
734- return ;
735- }
761+ private void handlePadSelection (final PadContainer pad ) {
736762 if (states .getClearButtonPressed ().get ()) {
737763 cursorClip .scrollToKey (drumScrollOffset + pad .index );
738764 if (randomModeActive .get ()) {
@@ -757,6 +783,7 @@ private void handlePadSelection(final PadContainer pad, final boolean pressed) {
757783 }
758784 } else {
759785 pad .pad .selectInEditor ();
786+ multilineSeqLayer .setSelectPadIndex (pad .index );
760787 }
761788 }
762789
@@ -801,7 +828,7 @@ private RgbState stepState(final int index) {
801828 return RgbState .of (0 );
802829 }
803830
804- private LpColor toColor (final double chance ) {
831+ LpColor toColor (final double chance ) {
805832 if (chance == 0 ) {
806833 return LpColor .GREY_MD ;
807834 }
0 commit comments