diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index feb7d0ea8..c30c5e57a 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ de.mossgrabers DrivenByMoss DrivenByMoss - 23.2.3 + 24.0.0 LGPL-2.1-or-later diff --git a/pom.xml b/pom.xml index 0984b50c5..c54fad164 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ DrivenByMoss jar DrivenByMoss - 23.2.3 + 24.0.0 UTF-8 diff --git a/src/main/java/de/mossgrabers/bitwig/framework/daw/BrowserImpl.java b/src/main/java/de/mossgrabers/bitwig/framework/daw/BrowserImpl.java index b111e3b4c..395aceb8f 100755 --- a/src/main/java/de/mossgrabers/bitwig/framework/daw/BrowserImpl.java +++ b/src/main/java/de/mossgrabers/bitwig/framework/daw/BrowserImpl.java @@ -4,6 +4,14 @@ package de.mossgrabers.bitwig.framework.daw; +import com.bitwig.extension.controller.api.BrowserFilterColumn; +import com.bitwig.extension.controller.api.BrowserResultsItemBank; +import com.bitwig.extension.controller.api.CursorBrowserResultItem; +import com.bitwig.extension.controller.api.CursorDevice; +import com.bitwig.extension.controller.api.CursorTrack; +import com.bitwig.extension.controller.api.InsertionPoint; +import com.bitwig.extension.controller.api.PopupBrowser; + import de.mossgrabers.bitwig.framework.daw.data.BrowserColumnImpl; import de.mossgrabers.bitwig.framework.daw.data.BrowserColumnItemImpl; import de.mossgrabers.bitwig.framework.daw.data.ChannelImpl; @@ -18,14 +26,6 @@ import de.mossgrabers.framework.daw.data.IChannel; import de.mossgrabers.framework.daw.data.IItem; -import com.bitwig.extension.controller.api.BrowserFilterColumn; -import com.bitwig.extension.controller.api.BrowserResultsItemBank; -import com.bitwig.extension.controller.api.CursorBrowserResultItem; -import com.bitwig.extension.controller.api.CursorDevice; -import com.bitwig.extension.controller.api.CursorTrack; -import com.bitwig.extension.controller.api.InsertionPoint; -import com.bitwig.extension.controller.api.PopupBrowser; - /** * Provides access to the device, preset, sample, ... browser. @@ -71,7 +71,8 @@ public BrowserImpl (final IHost host, final PopupBrowser browser, final CursorTr this.filterColumns = new BrowserFilterColumn [] { - // TODO Remove this for the time being until the browser API gets adapted to Bitwig 5 + // TODO API extension required - Remove this for the time being until the browser API + // gets adapted to Bitwig 5 // this.browser.smartCollectionColumn (), this.browser.locationColumn (), this.browser.fileTypeColumn (), @@ -149,7 +150,8 @@ public void nextContentType () public String getSelectedContentType () { return "Result"; - // TODO Currently not working in Bitwig 5, requires adaption to the new browser + // TODO API extension required - Currently not working in Bitwig 5, requires adaption to the + // new browser // return this.browser.selectedContentTypeName ().get (); } diff --git a/src/main/java/de/mossgrabers/bitwig/framework/hardware/HwLightImpl.java b/src/main/java/de/mossgrabers/bitwig/framework/hardware/HwLightImpl.java index ec030b16b..4914c9851 100644 --- a/src/main/java/de/mossgrabers/bitwig/framework/hardware/HwLightImpl.java +++ b/src/main/java/de/mossgrabers/bitwig/framework/hardware/HwLightImpl.java @@ -45,13 +45,6 @@ public HwLightImpl (final IHost host, final MultiStateHardwareLight hardwareLigh final ObjectHardwareProperty state = hardwareLight.state (); state.setValueSupplier (valueSupplier); state.onUpdateHardware (hardwareUpdater); - - // TODO Test with next BW Update - // hardwareLight.setColorToStateFunction (color -> { - // - // return new EncodedColorLightState (-1, null); - // - // }); } diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneConfiguration.java b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneConfiguration.java index 69cc7bee0..60f534840 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneConfiguration.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneConfiguration.java @@ -11,6 +11,7 @@ import de.mossgrabers.framework.configuration.ISettingsUI; import de.mossgrabers.framework.controller.valuechanger.IValueChanger; import de.mossgrabers.framework.daw.IHost; +import de.mossgrabers.framework.daw.constants.Capability; import de.mossgrabers.framework.daw.midi.ArpeggiatorMode; @@ -72,6 +73,8 @@ public void init (final ISettingsUI globalSettings, final ISettingsUI documentSe this.activateBehaviourOnStopSetting (globalSettings); this.activateBehaviourOnPauseSetting (globalSettings); + this.activateRecordButtonSetting (globalSettings); + this.activateShiftedRecordButtonSetting (globalSettings); /////////////////////////// // Play and Sequence @@ -79,6 +82,12 @@ public void init (final ISettingsUI globalSettings, final ISettingsUI documentSe this.activateQuantizeAmountSetting (globalSettings); this.activateMidiEditChannelSetting (documentSettings); + /////////////////////////// + // Drum Sequencer + + if (this.host.supports (Capability.HAS_DRUM_DEVICE)) + this.activateTurnOffEmptyDrumPadsSetting (globalSettings); + /////////////////////////// // Workflow diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerDefinition.java b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerDefinition.java index ee68e4ac0..77d9d6bf0 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerDefinition.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerDefinition.java @@ -21,6 +21,7 @@ public class OxiOneControllerDefinition extends DefaultControllerDefinition { private static final UUID EXTENSION_ID = UUID.fromString ("85593F1C-52FD-423F-BCAC-80D90EEB9ACA"); + /** * Constructor. */ diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerSetup.java b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerSetup.java index 4c6bc5cef..817c21d85 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerSetup.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/OxiOneControllerSetup.java @@ -20,8 +20,11 @@ import de.mossgrabers.controller.oxi.one.mode.OxiOneTrackMode; import de.mossgrabers.controller.oxi.one.mode.OxiOneTransportMode; import de.mossgrabers.controller.oxi.one.view.OxiOneDrum8View; +import de.mossgrabers.controller.oxi.one.view.OxiOneDrumView128; import de.mossgrabers.controller.oxi.one.view.OxiOneMixView; import de.mossgrabers.controller.oxi.one.view.OxiOnePlayView; +import de.mossgrabers.controller.oxi.one.view.OxiOnePolySequencerView; +import de.mossgrabers.controller.oxi.one.view.OxiOneSequencerView; import de.mossgrabers.framework.command.continuous.KnobRowModeCommand; import de.mossgrabers.framework.command.core.NopCommand; import de.mossgrabers.framework.command.trigger.Direction; @@ -32,8 +35,8 @@ import de.mossgrabers.framework.command.trigger.application.UndoCommand; import de.mossgrabers.framework.command.trigger.mode.CursorCommand; import de.mossgrabers.framework.command.trigger.mode.ModeSelectCommand; +import de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand; import de.mossgrabers.framework.command.trigger.transport.PlayCommand; -import de.mossgrabers.framework.command.trigger.transport.RecordCommand; import de.mossgrabers.framework.command.trigger.transport.StopCommand; import de.mossgrabers.framework.command.trigger.view.ViewButtonCommand; import de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand; @@ -75,6 +78,7 @@ public class OxiOneControllerSetup extends AbstractControllerSetup !t.isPlaying () ? 1 : 0); - this.addButton (ButtonID.RECORD, "REC", new RecordCommand<> (this.model, surface), 1, OxiOneControlSurface.BUTTON_REC, () -> { + this.addButton (ButtonID.RECORD, "REC", new ConfiguredRecordCommand<> (this.model, surface), 1, OxiOneControlSurface.BUTTON_REC, () -> { int state = 0; if (t.isLauncherOverdub ()) @@ -240,7 +237,7 @@ public void executeShifted (final ButtonEvent event) this.addButton (ButtonID.SESSION, "MIXER", new ViewMultiSelectCommand<> (this.model, surface, Views.MIX), 1, OxiOneControlSurface.BUTTON_ARRANGER, () -> viewManager.isActive (Views.MIX) ? 1 : 0); - this.addButton (ButtonID.KEYBOARD, "KEYBOARD", new ViewMultiSelectCommand<> (this.model, surface, Views.PLAY) + this.addButton (ButtonID.KEYBOARD, "KEYBOARD", new ViewMultiSelectCommand<> (this.model, surface, true, Views.PLAY, Views.DRUM64) { /** {@inheritDoc} */ @@ -255,11 +252,11 @@ public void executeShifted (final ButtonEvent event) if (surface.isShiftPressed ()) return modeManager.isActive (Modes.SCALES) ? 2 : 0; - return viewManager.isActive (Views.PLAY) ? 1 : 0; + return viewManager.isActive (Views.PLAY, Views.DRUM64) ? 1 : 0; }); - this.addButton (ButtonID.SEQUENCER, "SEQUENCE", new ViewMultiSelectCommand<> (this.model, surface, Views.DRUM8) + this.addButton (ButtonID.SEQUENCER, "SEQUENCE", new ViewMultiSelectCommand<> (this.model, surface, true, Views.DRUM8, Views.SEQUENCER, Views.POLY_SEQUENCER) { /** {@inheritDoc} */ @@ -274,7 +271,7 @@ public void executeShifted (final ButtonEvent event) if (surface.isShiftPressed ()) return modeManager.isActive (Modes.REPEAT_NOTE) ? 2 : 0; - return viewManager.isActive (Views.DRUM8) ? 1 : 0; + return viewManager.isActive (Views.DRUM8, Views.SEQUENCER, Views.POLY_SEQUENCER) ? 1 : 0; }); @@ -296,6 +293,17 @@ public void executeShifted (final ButtonEvent event) this.addButton (ButtonID.SETUP, "Y Div", new ModeSelectCommand<> (this.model, surface, Modes.SETUP), 1, OxiOneControlSurface.BUTTON_DIVISION, () -> modeManager.isActive (Modes.SETUP)); this.addButton (ButtonID.PUNCH_IN, "Init", NopCommand.INSTANCE, 1, OxiOneControlSurface.BUTTON_INIT); this.addButton (ButtonID.PUNCH_OUT, "End", NopCommand.INSTANCE, 1, OxiOneControlSurface.BUTTON_END); + this.addButton (ButtonID.QUANTIZE, "Random", (event, velocity) -> { + + if (event == ButtonEvent.UP) + { + if (surface.isShiftPressed ()) + this.model.getCursorDevice ().toggleWindowOpen (); + else + this.model.getCursorClip ().quantize (this.configuration.getQuantizeAmount () / 100.0); + } + + }, 1, OxiOneControlSurface.BUTTON_RANDOM); this.addButton (ButtonID.SCENE1, "1", new ViewButtonCommand<> (ButtonID.SCENE1, surface), 1, OxiOneControlSurface.BUTTON_SEQUENCER1, () -> this.getSceneButtonColor (0)); this.addButton (ButtonID.SCENE2, "2", new ViewButtonCommand<> (ButtonID.SCENE2, surface), 1, OxiOneControlSurface.BUTTON_SEQUENCER2, () -> this.getSceneButtonColor (1)); @@ -387,7 +395,7 @@ private void emulateTouch (final ButtonEvent event, final int knobIndex) if (event == ButtonEvent.LONG) { - if (mode instanceof IOxiModeReset resetMode) + if (mode instanceof final IOxiModeReset resetMode) resetMode.resetValue (knobIndex); else mode.getParameterProvider ().get (knobIndex).resetValue (); @@ -424,118 +432,174 @@ protected void layoutControls () { final OxiOneControlSurface surface = this.getSurface (); - // TODO Implement simulator - - // surface.getButton (ButtonID.PAD1).setBounds (27.0, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD2).setBounds (44.0, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD3).setBounds (61.25, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD4).setBounds (78.25, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD5).setBounds (95.25, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD6).setBounds (112.5, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD7).setBounds (129.75, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD8).setBounds (146.5, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD9).setBounds (163.75, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD10).setBounds (180.75, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD11).setBounds (198.0, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD12).setBounds (214.5, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD13).setBounds (232.0, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD14).setBounds (249.25, 107.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD15).setBounds (266.25, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD16).setBounds (283.0, 107.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD17).setBounds (27.0, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD18).setBounds (44.0, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD19).setBounds (61.25, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD20).setBounds (78.25, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD21).setBounds (95.25, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD22).setBounds (112.5, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD23).setBounds (129.75, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD24).setBounds (146.5, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD25).setBounds (163.75, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD26).setBounds (180.75, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD27).setBounds (198.0, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD28).setBounds (214.5, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD29).setBounds (232.0, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD30).setBounds (249.25, 85.0, 12.75, 18.25); - // surface.getButton (ButtonID.PAD31).setBounds (266.25, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD32).setBounds (283.0, 85.25, 12.75, 18.25); - // surface.getButton (ButtonID.PAD33).setBounds (27.0, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD34).setBounds (44.0, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD35).setBounds (61.25, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD36).setBounds (78.25, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD37).setBounds (95.25, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD38).setBounds (112.5, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD39).setBounds (129.75, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD40).setBounds (146.5, 63.75, 12.0, 18.25); - // surface.getButton (ButtonID.PAD41).setBounds (163.75, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD42).setBounds (180.75, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD43).setBounds (198.0, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD44).setBounds (214.5, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD45).setBounds (232.0, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD46).setBounds (249.25, 63.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD47).setBounds (266.25, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD48).setBounds (283.0, 63.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD49).setBounds (27.0, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD50).setBounds (44.0, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD51).setBounds (61.25, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD52).setBounds (78.25, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD53).setBounds (95.25, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD54).setBounds (112.5, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD55).setBounds (129.75, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD56).setBounds (146.5, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD57).setBounds (163.75, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD58).setBounds (180.75, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD59).setBounds (198.0, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD60).setBounds (214.5, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD61).setBounds (232.0, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD62).setBounds (249.25, 42.5, 12.75, 18.25); - // surface.getButton (ButtonID.PAD63).setBounds (266.25, 42.75, 12.75, 18.25); - // surface.getButton (ButtonID.PAD64).setBounds (283.0, 42.75, 12.75, 18.25); - // - // surface.getButton (ButtonID.BANK_RIGHT).setBounds (4.75, 29.0, 10.0, 10.0); - // surface.getButton (ButtonID.PLAY).setBounds (236.5, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.STOP).setBounds (258.5, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.RECORD).setBounds (280.75, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.METRONOME).setBounds (214.25, 134.0, 17.25, 11.75); - // - // surface.getButton (ButtonID.SELECT).setBounds (238.25, 2.5, 18.25, 10.0); - // - // surface.getButton (ButtonID.SEQUENCER).setBounds (4.5, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.NOTE).setBounds (27.0, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.DRUM).setBounds (49.25, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.SESSION).setBounds (71.75, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.SHIFT).setBounds (94.25, 134.0, 17.25, 11.75); - // surface.getButton (ButtonID.ALT).setBounds (116.5, 134.0, 17.25, 11.75); - // - // surface.getButton (ButtonID.ARROW_LEFT).setBounds (261.0, 18.0, 18.0, 10.0); - // surface.getButton (ButtonID.ARROW_RIGHT).setBounds (281.75, 18.0, 18.0, 10.0); - // surface.getButton (ButtonID.ARROW_UP).setBounds (138.25, 12.25, 18.5, 9.5); - // surface.getButton (ButtonID.ARROW_DOWN).setBounds (138.25, 23.75, 18.5, 9.5); - // - // surface.getButton (ButtonID.SCENE1).setBounds (4.75, 42.75, 10.0, 17.25); - // surface.getButton (ButtonID.SCENE2).setBounds (4.75, 63.75, 10.0, 17.25); - // surface.getButton (ButtonID.SCENE3).setBounds (4.75, 86.0, 10.0, 17.25); - // surface.getButton (ButtonID.SCENE4).setBounds (4.75, 107.75, 10.0, 17.25); - // - // surface.getButton (ButtonID.BROWSE).setBounds (214.25, 17.0, 17.25, 11.75); - // - // surface.getContinuous (ContinuousID.KNOB1).setBounds (27.5, 12.75, 22.0, 19.25); - // surface.getContinuous (ContinuousID.KNOB2).setBounds (55.0, 12.75, 22.0, 19.25); - // surface.getContinuous (ContinuousID.KNOB3).setBounds (82.75, 12.75, 22.0, 19.25); - // surface.getContinuous (ContinuousID.KNOB4).setBounds (110.25, 12.75, 22.0, 19.25); - // surface.getContinuous (ContinuousID.VIEW_SELECTION).setBounds (238.25, 13.5, 17.75, - // 17.25); - // - // surface.getLight (OutputID.LED1).setBounds (4.75, 4.0, 5.5, 4.25); - // surface.getLight (OutputID.LED2).setBounds (4.75, 10.0, 5.5, 4.25); - // surface.getLight (OutputID.LED3).setBounds (4.75, 16.25, 5.5, 4.25); - // surface.getLight (OutputID.LED4).setBounds (4.75, 22.25, 5.5, 4.25); - // surface.getLight (OutputID.LED5).setBounds (18.0, 42.75, 5.0, 17.25); - // surface.getLight (OutputID.LED6).setBounds (18.0, 63.75, 5.0, 17.25); - // surface.getLight (OutputID.LED7).setBounds (18.0, 86.0, 5.0, 17.25); - // surface.getLight (OutputID.LED8).setBounds (18.0, 107.75, 5.0, 17.25); - // - // surface.getGraphicsDisplay ().getHardwareDisplay ().setBounds (165.25, 11.75, 40.75, - // 20.75); + surface.getButton (ButtonID.PAD1).setBounds (89.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD2).setBounds (101.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD3).setBounds (113.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD4).setBounds (125.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD5).setBounds (137.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD6).setBounds (149.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD7).setBounds (161.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD8).setBounds (173.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD9).setBounds (185.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD10).setBounds (197.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD11).setBounds (209.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD12).setBounds (221.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD13).setBounds (233.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD14).setBounds (245.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD15).setBounds (257.75, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD16).setBounds (270.0, 120.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD17).setBounds (89.75, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD18).setBounds (102.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD19).setBounds (114.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD20).setBounds (126.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD21).setBounds (138.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD22).setBounds (150.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD23).setBounds (162.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD24).setBounds (174.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD25).setBounds (186.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD26).setBounds (198.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD27).setBounds (210.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD28).setBounds (222.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD29).setBounds (234.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD30).setBounds (246.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD31).setBounds (258.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD32).setBounds (270.0, 107.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD33).setBounds (89.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD34).setBounds (102.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD35).setBounds (114.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD36).setBounds (126.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD37).setBounds (138.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD38).setBounds (150.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD39).setBounds (162.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD40).setBounds (174.0, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD41).setBounds (185.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD42).setBounds (197.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD43).setBounds (209.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD44).setBounds (221.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD45).setBounds (233.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD46).setBounds (245.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD47).setBounds (257.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD48).setBounds (269.75, 95.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD49).setBounds (89.75, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD50).setBounds (102.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD51).setBounds (114.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD52).setBounds (126.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD53).setBounds (138.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD54).setBounds (150.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD55).setBounds (162.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD56).setBounds (174.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD57).setBounds (186.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD58).setBounds (198.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD59).setBounds (210.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD60).setBounds (222.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD61).setBounds (234.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD62).setBounds (246.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD63).setBounds (258.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD64).setBounds (270.0, 84.0, 10.0, 10.0); + surface.getButton (ButtonID.PAD65).setBounds (89.75, 72.5, 10.0, 10.0); + surface.getButton (ButtonID.PAD66).setBounds (101.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD67).setBounds (113.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD68).setBounds (125.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD69).setBounds (137.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD70).setBounds (149.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD71).setBounds (161.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD72).setBounds (173.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD73).setBounds (185.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD74).setBounds (197.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD75).setBounds (209.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD76).setBounds (221.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD77).setBounds (233.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD78).setBounds (245.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD79).setBounds (257.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD80).setBounds (269.75, 72.25, 10.0, 10.0); + surface.getButton (ButtonID.PAD81).setBounds (89.75, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD82).setBounds (102.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD83).setBounds (114.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD84).setBounds (126.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD85).setBounds (138.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD86).setBounds (150.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD87).setBounds (162.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.PAD88).setBounds (174.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS1).setBounds (186.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS2).setBounds (198.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS3).setBounds (210.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS4).setBounds (222.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS5).setBounds (234.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS6).setBounds (246.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS7).setBounds (258.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS8).setBounds (270.0, 60.75, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS9).setBounds (89.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS10).setBounds (101.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS11).setBounds (113.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS12).setBounds (125.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS13).setBounds (137.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS14).setBounds (149.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS15).setBounds (161.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS16).setBounds (173.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS17).setBounds (185.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS18).setBounds (197.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS19).setBounds (209.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS20).setBounds (221.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS21).setBounds (233.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS22).setBounds (245.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS23).setBounds (257.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS24).setBounds (269.75, 49.0, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS25).setBounds (89.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS26).setBounds (102.0, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS27).setBounds (114.0, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS28).setBounds (125.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS29).setBounds (137.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS30).setBounds (149.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS31).setBounds (161.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS32).setBounds (173.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS33).setBounds (185.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS34).setBounds (197.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS35).setBounds (209.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS36).setBounds (221.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS37).setBounds (233.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS38).setBounds (245.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS39).setBounds (257.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.MORE_PADS40).setBounds (269.75, 37.5, 10.0, 10.0); + surface.getButton (ButtonID.SHIFT).setBounds (6.5, 121.75, 10.0, 10.0); + surface.getButton (ButtonID.PLAY).setBounds (55.25, 121.75, 10.0, 10.0); + surface.getButton (ButtonID.STOP).setBounds (25.0, 121.75, 10.0, 10.0); + surface.getButton (ButtonID.RECORD).setBounds (39.75, 121.75, 10.0, 10.0); + surface.getButton (ButtonID.LOAD).setBounds (22.25, 53.75, 10.0, 10.0); + surface.getButton (ButtonID.SAVE).setBounds (22.25, 65.25, 10.0, 10.0); + surface.getButton (ButtonID.DUPLICATE).setBounds (36.25, 53.75, 10.0, 10.0); + surface.getButton (ButtonID.DELETE).setBounds (36.25, 65.25, 10.0, 10.0); + surface.getButton (ButtonID.SESSION).setBounds (6.5, 72.75, 10.0, 10.0); + surface.getButton (ButtonID.KEYBOARD).setBounds (6.5, 89.0, 10.0, 10.0); + surface.getButton (ButtonID.SEQUENCER).setBounds (6.5, 105.0, 10.0, 10.0); + surface.getButton (ButtonID.UNDO).setBounds (49.75, 53.75, 10.0, 10.0); + surface.getButton (ButtonID.NOTE).setBounds (36.25, 78.25, 10.0, 10.0); + surface.getButton (ButtonID.REPEAT).setBounds (49.75, 78.25, 10.0, 10.0); + surface.getButton (ButtonID.ACCENT).setBounds (49.75, 90.0, 10.0, 10.0); + surface.getButton (ButtonID.SETUP).setBounds (36.25, 90.0, 10.0, 10.0); + surface.getButton (ButtonID.PUNCH_IN).setBounds (22.25, 78.25, 10.0, 10.0); + surface.getButton (ButtonID.PUNCH_OUT).setBounds (22.25, 90.0, 10.0, 10.0); + surface.getButton (ButtonID.QUANTIZE).setBounds (49.75, 65.25, 10.0, 10.0); + surface.getButton (ButtonID.SCENE1).setBounds (70.75, 62.75, 10.0, 10.0); + surface.getButton (ButtonID.SCENE2).setBounds (70.75, 77.0, 10.0, 10.0); + surface.getButton (ButtonID.SCENE3).setBounds (70.75, 90.75, 10.0, 10.0); + surface.getButton (ButtonID.SCENE4).setBounds (70.75, 104.75, 10.0, 10.0); + surface.getButton (ButtonID.MUTE).setBounds (70.5, 121.75, 10.0, 10.0); + surface.getButton (ButtonID.ARROW_UP).setBounds (32.5, 104.75, 10.0, 10.0); + surface.getButton (ButtonID.ARROW_DOWN).setBounds (44.5, 104.75, 10.0, 10.0); + surface.getButton (ButtonID.ARROW_LEFT).setBounds (20.5, 104.75, 10.0, 10.0); + surface.getButton (ButtonID.ARROW_RIGHT).setBounds (57.25, 104.75, 10.0, 10.0); + surface.getButton (ButtonID.KNOB1_TOUCH).setBounds (8.0, 39.5, 10.0, 10.0); + surface.getButton (ButtonID.KNOB2_TOUCH).setBounds (20.0, 39.5, 10.0, 10.0); + surface.getButton (ButtonID.KNOB3_TOUCH).setBounds (32.0, 39.5, 10.0, 10.0); + surface.getButton (ButtonID.KNOB4_TOUCH).setBounds (44.0, 39.5, 10.0, 10.0); + surface.getButton (ButtonID.CONTROL).setBounds (6.5, 57.25, 10.0, 10.0); + + surface.getContinuous (ContinuousID.KNOB1).setBounds (8.0, 28.0, 10.0, 10.0); + surface.getContinuous (ContinuousID.KNOB2).setBounds (20.0, 28.0, 10.0, 10.0); + surface.getContinuous (ContinuousID.KNOB3).setBounds (32.0, 28.0, 10.0, 10.0); + surface.getContinuous (ContinuousID.KNOB4).setBounds (44.0, 28.0, 10.0, 10.0); + + surface.getGraphicsDisplay ().getHardwareDisplay ().setBounds (8.0, 2.0, 44, 22); } diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneColorManager.java b/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneColorManager.java index 4f96fb2e7..80e5e2af7 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneColorManager.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneColorManager.java @@ -138,15 +138,12 @@ public OxiOneColorManager () this.registerColor (OXI_ONE_COLOR_ORANGE, ColorEx.ORANGE); this.registerColor (OXI_ONE_COLOR_DARK_ORANGE, ColorEx.DARK_ORANGE); this.registerColor (OXI_ONE_COLOR_DARKER_ORANGE, ColorEx.DARKER_ORANGE); - this.registerColor (OXI_ONE_COLOR_DARK_YELLOW, ColorEx.DARK_YELLOW); this.registerColor (OXI_ONE_COLOR_YELLOW, ColorEx.YELLOW); + this.registerColor (OXI_ONE_COLOR_DARK_YELLOW, ColorEx.DARK_YELLOW); this.registerColor (OXI_ONE_COLOR_DARKER_YELLOW, ColorEx.DARKER_YELLOW); this.registerColor (OXI_ONE_COLOR_BROWN, ColorEx.BROWN); this.registerColor (OXI_ONE_COLOR_GRAY, ColorEx.DARKER_GRAY); - // No idea - this.registerColor (113, ColorEx.RED); - this.registerColor (SCALE_COLOR_OCTAVE, ColorEx.BLUE); this.registerColor (SCALE_COLOR_NOTE, ColorEx.WHITE); this.registerColor (SCALE_COLOR_OUT_OF_SCALE, ColorEx.DARK_GRAY); @@ -161,19 +158,26 @@ public OxiOneColorManager () @Override public ColorEx getColor (final int colorIndex, final ButtonID buttonID) { - if (ButtonID.isPad (buttonID)) + if (ButtonID.isInRange (buttonID, ButtonID.PAD1, 128)) { if (colorIndex >= DAW_COLOR_START) return DAWColor.getColorEntry (colorIndex - DAW_COLOR_START); - } - try - { - return super.getColor (colorIndex, buttonID); - } - catch (final ColorIndexException ex) - { - return ColorEx.RED; + try + { + return super.getColor (colorIndex, buttonID); + } + catch (final ColorIndexException ex) + { + return ColorEx.RED; + } } + + if (colorIndex == this.getColorIndex (ColorManager.BUTTON_STATE_OFF)) + return ColorEx.BLACK; + if (colorIndex == this.getColorIndex (ColorManager.BUTTON_STATE_ON)) + return ColorEx.DARK_GRAY; + // ColorManager.BUTTON_STATE_HI + return ColorEx.LIGHT_GRAY; } } \ No newline at end of file diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneControlSurface.java b/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneControlSurface.java index 6e466dde2..d4e4be923 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneControlSurface.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/controller/OxiOneControlSurface.java @@ -4,6 +4,11 @@ package de.mossgrabers.controller.oxi.one.controller; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import de.mossgrabers.controller.oxi.one.OxiOneConfiguration; import de.mossgrabers.framework.controller.AbstractControlSurface; import de.mossgrabers.framework.controller.ButtonID; @@ -17,11 +22,6 @@ import de.mossgrabers.framework.graphics.canvas.component.LabelComponent; import de.mossgrabers.framework.graphics.canvas.component.LabelComponent.LabelLayout; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * The OXI One control surface. @@ -257,6 +257,7 @@ public class OxiOneControlSurface extends AbstractControlSurface clipOpt = getClip (); + final Optional clipOpt = this.getClip (); if (clipOpt.isPresent ()) { final INoteClip clip = clipOpt.get (); @@ -84,7 +85,7 @@ public void updateDisplay () case 0: final Scales scales = this.model.getScales (); label = scales.getDrumRangeText (); - value = (int) ((scales.getDrumOffset () / (double) (Scales.DRUM_NOTE_UPPER - Scales.DRUM_NOTE_LOWER)) * upperBound); + value = (int) (scales.getDrumOffset () / (double) (Scales.DRUM_NOTE_UPPER - Scales.DRUM_NOTE_LOWER) * upperBound); break; case 1: @@ -138,9 +139,9 @@ public void onKnobTouch (final int index, final boolean isTouched) @Override public void onKnobValue (final int index, final int value) { - final boolean isInc = value <= 63; + final boolean isInc = this.model.getValueChanger ().isIncrease (value); - final Optional clipOpt = getClip (); + final Optional clipOpt = this.getClip (); if (clipOpt.isEmpty ()) return; @@ -149,8 +150,15 @@ public void onKnobValue (final int index, final int value) { case 0: final IView activeView = this.surface.getViewManager ().getActive (); - if (activeView instanceof AbstractDrumView drumView) + if (activeView instanceof final AbstractDrumView drumView) drumView.changeOctave (ButtonEvent.DOWN, isInc, 8, true, false); + else if (activeView instanceof final TransposeView transView) + { + if (isInc) + transView.onOctaveUp (ButtonEvent.DOWN); + else + transView.onOctaveDown (ButtonEvent.DOWN); + } break; case 1: @@ -173,9 +181,9 @@ public void onKnobValue (final int index, final int value) /** {@inheritDoc} */ @Override - public void resetValue (int index) + public void resetValue (final int index) { - final Optional clipOpt = getClip (); + final Optional clipOpt = this.getClip (); if (clipOpt.isEmpty ()) return; @@ -185,7 +193,7 @@ public void resetValue (int index) { case 0: final IView activeView = this.surface.getViewManager ().getActive (); - if (activeView instanceof AbstractDrumView drumView) + if (activeView instanceof final AbstractDrumView drumView) drumView.resetOctave (); break; @@ -206,7 +214,7 @@ public void resetValue (int index) /** * Set the resolution index. - * + * * @param clip The clip for which to set the resolution * * @param selectedResolutionIndex The index 0-7 @@ -221,7 +229,7 @@ public void setResolutionIndex (final INoteClip clip, final int selectedResoluti /** * Get the resolution index. - * + * * @param clip The clip for which to get the resolution * * @return The index 0-7 @@ -234,7 +242,7 @@ public int getResolutionIndex (final INoteClip clip) private Optional getClip () { - if (this.surface.getViewManager ().getActive () instanceof AbstractSequencerView sequencer) + if (this.surface.getViewManager ().getActive () instanceof final AbstractSequencerView sequencer) return Optional.of (sequencer.getClip ()); return Optional.empty (); } diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/mode/OxiOneTrackMode.java b/src/main/java/de/mossgrabers/controller/oxi/one/mode/OxiOneTrackMode.java index c4d0e0602..dbb47d16b 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/mode/OxiOneTrackMode.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/mode/OxiOneTrackMode.java @@ -18,7 +18,7 @@ import de.mossgrabers.framework.daw.data.bank.ISendBank; import de.mossgrabers.framework.daw.data.bank.ITrackBank; import de.mossgrabers.framework.graphics.canvas.component.IComponent; -import de.mossgrabers.framework.graphics.canvas.component.simple.TitleChannelsMenuComponent; +import de.mossgrabers.framework.graphics.canvas.component.simple.TitleChannelsComponent; import de.mossgrabers.framework.graphics.canvas.component.simple.TitleValueMenuComponent; import de.mossgrabers.framework.mode.track.TrackMode; import de.mossgrabers.framework.parameterprovider.special.FourKnobProvider; @@ -201,7 +201,7 @@ private IComponent drawMixerMode () } } - return new TitleChannelsMenuComponent (label, selected, values, this.selectedIndex == 1 && isMode); + return new TitleChannelsComponent (label, selected, values, this.selectedIndex == 1 && isMode); } diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneDrumView128.java b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneDrumView128.java new file mode 100644 index 000000000..1c0f1357a --- /dev/null +++ b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneDrumView128.java @@ -0,0 +1,44 @@ +// Written by Jürgen Moßgraber - mossgrabers.de +// (c) 2017-2024 +// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt + +package de.mossgrabers.controller.oxi.one.view; + +import de.mossgrabers.controller.oxi.one.OxiOneConfiguration; +import de.mossgrabers.controller.oxi.one.controller.OxiOneControlSurface; +import de.mossgrabers.framework.controller.ButtonID; +import de.mossgrabers.framework.daw.IModel; +import de.mossgrabers.framework.utils.ButtonEvent; +import de.mossgrabers.framework.view.AbstractDrum64View; + + +/** + * The Drum 128 view. + * + * @author Jürgen Moßgraber + */ +public class OxiOneDrumView128 extends AbstractDrum64View +{ + /** + * Constructor. + * + * @param surface The surface + * @param model The model + */ + public OxiOneDrumView128 (final OxiOneControlSurface surface, final IModel model) + { + super (surface, model, 16, 8); + + this.drumStartKey = 0; + this.offsetY = 0; + } + + + /** {@inheritDoc} */ + @Override + public void onButton (final ButtonID buttonID, final ButtonEvent event, final int velocity) + { + if (ButtonID.isSceneButton (buttonID)) + this.onSceneButton (buttonID, event); + } +} diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneMixView.java b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneMixView.java index 72f3fd977..776b1d0ce 100644 --- a/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneMixView.java +++ b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneMixView.java @@ -103,47 +103,60 @@ private static int getTrackStateColor (final boolean state, final boolean colorT @Override public void onGridNote (final int note, final int velocity) { - if (velocity == 0) - return; - - final int index = note % 16; - final int what = note / 16; - - final ITrack track = this.model.getCurrentTrackBank ().getItem (index); - - switch (what) + final int row = note / 16; + if (row < 4) { - case 7: - final OxiOneConfiguration configuration = this.surface.getConfiguration (); - if (configuration.isDeleteModeActive ()) - { - configuration.toggleDeleteModeActive (); - track.remove (); - } - else if (configuration.isDuplicateModeActive ()) + super.onGridNote (note, velocity); + } + else + { + final int index = note % 16; + final ITrack track = this.model.getCurrentTrackBank ().getItem (index); + + if (velocity == 0) + { + switch (row) { - configuration.toggleDuplicateModeActive (); - track.duplicate (); + case 7: + final OxiOneConfiguration configuration = this.surface.getConfiguration (); + if (configuration.isDeleteModeActive ()) + { + configuration.toggleDeleteModeActive (); + track.remove (); + } + else if (configuration.isDuplicateModeActive ()) + { + configuration.toggleDuplicateModeActive (); + track.duplicate (); + } + else + track.selectOrExpandGroup (); + break; + + case 6: + track.toggleMute (); + break; + + case 5: + track.toggleSolo (); + break; + + case 4: + track.toggleRecArm (); + break; + + default: + // Handled above + break; } - else - track.selectOrExpandGroup (); - break; - - case 6: - track.toggleMute (); - break; - - case 5: - track.toggleSolo (); - break; - - case 4: - track.toggleRecArm (); - break; + } + } - default: - super.onGridNote (note, velocity); - break; + // Revert to last view of the selected track + if (velocity == 0 && this.surface.isPressed (ButtonID.SESSION)) + { + this.surface.setTriggerConsumed (ButtonID.SESSION); + this.surface.recallPreferredView (this.model.getCursorTrack ()); } } diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOnePolySequencerView.java b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOnePolySequencerView.java new file mode 100644 index 000000000..3ac72f0e4 --- /dev/null +++ b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOnePolySequencerView.java @@ -0,0 +1,104 @@ +// Written by Jürgen Moßgraber - mossgrabers.de +// (c) 2017-2024 +// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt + +package de.mossgrabers.controller.oxi.one.view; + +import de.mossgrabers.controller.oxi.one.OxiOneConfiguration; +import de.mossgrabers.controller.oxi.one.controller.OxiOneControlSurface; +import de.mossgrabers.framework.controller.ButtonID; +import de.mossgrabers.framework.daw.IModel; +import de.mossgrabers.framework.daw.clip.INoteClip; +import de.mossgrabers.framework.daw.clip.NotePosition; +import de.mossgrabers.framework.daw.clip.StepState; +import de.mossgrabers.framework.daw.constants.Resolution; +import de.mossgrabers.framework.utils.ButtonEvent; +import de.mossgrabers.framework.view.sequencer.AbstractPolySequencerView; + + +/** + * The Poly Sequencer view. + * + * @author Jürgen Moßgraber + */ +public class OxiOnePolySequencerView extends AbstractPolySequencerView +{ + /** + * Constructor. + * + * @param surface The surface + * @param model The model + * @param useTrackColor True to use the color of the current track for coloring the octaves + */ + public OxiOnePolySequencerView (final OxiOneControlSurface surface, final IModel model, final boolean useTrackColor) + { + super (surface, model, useTrackColor, 16, 8, 4); + } + + + /** {@inheritDoc} */ + @Override + public void onGridNote (final int note, final int velocity) + { + // Set loop start and end + final boolean init = this.surface.isPressed (ButtonID.PUNCH_IN); + final boolean end = this.surface.isPressed (ButtonID.PUNCH_OUT); + if (init || end) + { + if (velocity == 0) + { + final INoteClip clip = this.getClip (); + final int lengthOfOnePage = this.getLengthOfOnePage (this.numColumns * this.numSequencerRows); + final int offset = clip.getEditPage () * lengthOfOnePage; + final int index = note - this.surface.getPadGrid ().getStartNote (); + final int x = index % this.numColumns; + final int y = index / this.numColumns; + final int step = this.numColumns * (this.numRows - 1 - y) + x; + + final double lengthOfOnePad = Resolution.getValueAt (this.getResolutionIndex ()); + final double pos = offset + step * lengthOfOnePad; + final double newStart = init ? pos : clip.getLoopStart (); + final double newLength = end ? Math.max (pos - newStart + lengthOfOnePad, lengthOfOnePad) : clip.getLoopLength (); + clip.setLoopStart (newStart); + clip.setLoopLength (newLength); + clip.setPlayRange (newStart, newStart + newLength); + } + return; + } + + super.onGridNote (note, velocity); + } + + + /** {@inheritDoc} */ + @Override + public void onGridNoteLongPress (final int note) + { + if (!this.isActive ()) + return; + + final int index = note - this.surface.getPadGrid ().getStartNote (); + final int x = index % this.numColumns; + final int y = index / this.numColumns; + final int step = this.numColumns * (this.numRows - 1 - y) + x; + final NotePosition notePosition = new NotePosition (this.configuration.getMidiEditChannel (), step, 0); + final INoteClip clip = this.getClip (); + for (int row = 0; row < 128; row++) + { + notePosition.setNote (row); + if (clip.getStep (notePosition).getState () == StepState.START) + this.editNote (clip, notePosition, true); + } + // Prevent note deletion on button-up! + this.surface.consumePads (); + } + + + /** {@inheritDoc} */ + @Override + public void onButton (final ButtonID buttonID, final ButtonEvent event, final int velocity) + { + if (ButtonID.isSceneButton (buttonID)) + this.onSceneButton (buttonID, event); + } +} \ No newline at end of file diff --git a/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneSequencerView.java b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneSequencerView.java new file mode 100644 index 000000000..36f4e44e3 --- /dev/null +++ b/src/main/java/de/mossgrabers/controller/oxi/one/view/OxiOneSequencerView.java @@ -0,0 +1,112 @@ +// Written by Jürgen Moßgraber - mossgrabers.de +// (c) 2017-2024 +// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt + +package de.mossgrabers.controller.oxi.one.view; + +import de.mossgrabers.controller.oxi.one.OxiOneConfiguration; +import de.mossgrabers.controller.oxi.one.controller.OxiOneControlSurface; +import de.mossgrabers.framework.controller.ButtonID; +import de.mossgrabers.framework.daw.IModel; +import de.mossgrabers.framework.daw.clip.INoteClip; +import de.mossgrabers.framework.daw.clip.NotePosition; +import de.mossgrabers.framework.daw.constants.Resolution; +import de.mossgrabers.framework.utils.ButtonEvent; +import de.mossgrabers.framework.view.Views; +import de.mossgrabers.framework.view.sequencer.AbstractNoteSequencerView; + + +/** + * The Sequencer view. + * + * @author Jürgen Moßgraber + */ +public class OxiOneSequencerView extends AbstractNoteSequencerView +{ + /** + * Constructor. + * + * @param surface The surface + * @param model The model + */ + public OxiOneSequencerView (final OxiOneControlSurface surface, final IModel model) + { + super (Views.NAME_SEQUENCER, surface, model, 16, 8, true); + + this.numDisplayRows = 8; + } + + + /** {@inheritDoc} */ + @Override + public void onGridNote (final int note, final int velocity) + { + // Set loop start and end + final boolean init = this.surface.isPressed (ButtonID.PUNCH_IN); + final boolean end = this.surface.isPressed (ButtonID.PUNCH_OUT); + if (init || end) + { + if (velocity == 0) + { + final INoteClip clip = this.getClip (); + final int lengthOfOnePage = this.getLengthOfOnePage (this.numDisplayCols); + final int offset = clip.getEditPage () * lengthOfOnePage; + final int index = note - this.surface.getPadGrid ().getStartNote (); + final int x = index % this.numDisplayCols; + final double lengthOfOnePad = Resolution.getValueAt (this.getResolutionIndex ()); + final double pos = offset + x * lengthOfOnePad; + final double newStart = init ? pos : clip.getLoopStart (); + final double newLength = end ? Math.max (pos - newStart + lengthOfOnePad, lengthOfOnePad) : clip.getLoopLength (); + clip.setLoopStart (newStart); + clip.setLoopLength (newLength); + clip.setPlayRange (newStart, newStart + newLength); + } + return; + } + + super.onGridNote (note, velocity); + } + + + /** {@inheritDoc} */ + @Override + public void onGridNoteLongPress (final int note) + { + if (!this.isActive ()) + return; + + final int index = note - this.surface.getPadGrid ().getStartNote (); + this.surface.getButton (ButtonID.get (ButtonID.PAD1, index)).setConsumed (); + + final int y = index / this.numDisplayCols; + final int x = index % this.numDisplayCols; + final int mappedY = this.keyManager.map (y); + + final NotePosition notePosition = new NotePosition (this.configuration.getMidiEditChannel (), x, mappedY); + this.editNote (this.getClip (), notePosition, false); + } + + + /** {@inheritDoc} */ + @Override + public void onButton (final ButtonID buttonID, final ButtonEvent event, final int velocity) + { + if (ButtonID.isSceneButton (buttonID)) + this.onSceneButton (buttonID, event); + } + + + /** {@inheritDoc} */ + @Override + protected boolean handleSequencerAreaButtonCombinations (final INoteClip clip, final NotePosition notePosition, final int row, final int velocity) + { + if (this.surface.isPressed (ButtonID.REPEAT) || this.surface.isPressed (ButtonID.ACCENT)) + { + if (velocity > 0) + this.handleSequencerAreaRepeatOperator (clip, notePosition, velocity, this.surface.isPressed (ButtonID.REPEAT)); + return true; + } + + return super.handleSequencerAreaButtonCombinations (clip, notePosition, row, velocity); + } +} \ No newline at end of file diff --git a/src/main/java/de/mossgrabers/framework/command/trigger/view/ViewMultiSelectCommand.java b/src/main/java/de/mossgrabers/framework/command/trigger/view/ViewMultiSelectCommand.java index 2918fe574..4e79aa72f 100755 --- a/src/main/java/de/mossgrabers/framework/command/trigger/view/ViewMultiSelectCommand.java +++ b/src/main/java/de/mossgrabers/framework/command/trigger/view/ViewMultiSelectCommand.java @@ -4,6 +4,10 @@ package de.mossgrabers.framework.command.trigger.view; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import de.mossgrabers.framework.command.core.AbstractTriggerCommand; import de.mossgrabers.framework.configuration.Configuration; import de.mossgrabers.framework.controller.IControlSurface; @@ -12,10 +16,6 @@ import de.mossgrabers.framework.utils.ButtonEvent; import de.mossgrabers.framework.view.Views; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** * Selects the next view from a list. If the last element is reached it wraps around to the first. @@ -30,6 +30,7 @@ public class ViewMultiSelectCommand, C extends Conf protected final List viewIds = new ArrayList<> (); private final boolean displayName; private final ButtonEvent triggerEvent; + private boolean storePreferred; /** @@ -50,16 +51,49 @@ public ViewMultiSelectCommand (final IModel model, final S surface, final Views. * * @param model The model * @param surface The surface - * @param displayName Displays a popup with the views name if true + * @param storePreferred If true the selected views are stored as the favorite view of the + * currently selected track + * @param viewIds The list with IDs of the views to select + */ + public ViewMultiSelectCommand (final IModel model, final S surface, final boolean storePreferred, final Views... viewIds) + { + this (model, surface, true, ButtonEvent.DOWN, storePreferred, viewIds); + } + + + /** + * Constructor. + * + * @param model The model + * @param surface The surface + * @param displayName Displays a pop-up with the views name if true * @param triggerEvent The event to trigger this command * @param viewIds The list with IDs of the views to select */ public ViewMultiSelectCommand (final IModel model, final S surface, final boolean displayName, final ButtonEvent triggerEvent, final Views... viewIds) + { + this (model, surface, displayName, triggerEvent, false, viewIds); + } + + + /** + * Constructor. + * + * @param model The model + * @param surface The surface + * @param displayName Displays a pop-up with the views name if true + * @param triggerEvent The event to trigger this command + * @param storePreferred If true the selected views are stored as the favorite view of the + * currently selected track + * @param viewIds The list with IDs of the views to select + */ + public ViewMultiSelectCommand (final IModel model, final S surface, final boolean displayName, final ButtonEvent triggerEvent, final boolean storePreferred, final Views... viewIds) { super (model, surface); this.displayName = displayName; this.triggerEvent = triggerEvent; + this.storePreferred = storePreferred; this.viewIds.addAll (Arrays.asList (viewIds)); } @@ -79,7 +113,10 @@ public void executeNormal (final ButtonEvent event) final Views viewId = this.viewIds.get (index); if (viewManager.isActive (viewId)) return; - viewManager.setActive (viewId); + if (this.storePreferred) + this.activatePreferredView (viewId); + else + viewManager.setActive (viewId); if (this.displayName) this.surface.getDisplay ().notify (viewManager.get (viewId).getName ()); } diff --git a/src/main/java/de/mossgrabers/framework/configuration/Configuration.java b/src/main/java/de/mossgrabers/framework/configuration/Configuration.java index 70f6c7c8e..0e08100e4 100755 --- a/src/main/java/de/mossgrabers/framework/configuration/Configuration.java +++ b/src/main/java/de/mossgrabers/framework/configuration/Configuration.java @@ -175,7 +175,7 @@ public interface Configuration /** * Get the quantize amount. * - * @return The quantize amount + * @return The quantize amount in the range of [1..100] */ int getQuantizeAmount (); diff --git a/src/main/java/de/mossgrabers/framework/graphics/canvas/component/simple/TitleChannelsMenuComponent.java b/src/main/java/de/mossgrabers/framework/graphics/canvas/component/simple/TitleChannelsMenuComponent.java deleted file mode 100644 index b45e172bb..000000000 --- a/src/main/java/de/mossgrabers/framework/graphics/canvas/component/simple/TitleChannelsMenuComponent.java +++ /dev/null @@ -1,99 +0,0 @@ -// Written by Jürgen Moßgraber - mossgrabers.de -// (c) 2017-2024 -// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt - -package de.mossgrabers.framework.graphics.canvas.component.simple; - -import de.mossgrabers.framework.graphics.IGraphicsContext; -import de.mossgrabers.framework.graphics.IGraphicsInfo; - - -/** - * Like TitleChannelsComponent but with a menu strip at the bottom. - * - * @author Jürgen Moßgraber - */ -public class TitleChannelsMenuComponent extends TitleChannelsComponent -{ - /** - * Constructor. - * - * @param label The first row text - * @param selected The selected states of the channel - * @param values The values to display for the channel - * @param isPan Draw values as panorama if true - */ - public TitleChannelsMenuComponent (final String label, final boolean [] selected, final int [] values, final boolean isPan) - { - super (label, selected, values, isPan); - - this.rowHeight = DEFAULT_HEIGHT / 4 - 2; - } - - - /** {@inheritDoc} */ - @Override - public void draw (final IGraphicsInfo info) - { - super.draw (info); - - final IGraphicsContext gc = info.getContext (); - - // final IGraphicsConfiguration configuration = info.getConfiguration (); - // final ColorEx colorText = configuration.getColorText (); - // final ColorEx colorFader = configuration.getColorFader (); - // - // gc.drawTextInHeight (this.label, 0, 0, DEFAULT_ROW_HEIGHT, colorText, - // DEFAULT_ROW_HEIGHT); - // - // final int channelWidth = DEFAULT_WIDTH / this.values.length; - // final int halfChannelWidth = channelWidth / 2; - // final int lowerHeight = DEFAULT_HEIGHT - DEFAULT_ROW_HEIGHT - 1; - // - // for (int i = 0; i < this.values.length; i++) - // { - // final int left = i * channelWidth; - // - // final int faderHeight = this.values[i] * lowerHeight / RESOLUTION; - // - // if (this.isPan) - // { - // final int center = lowerHeight / 2; - // - // if (this.selected[i]) - // { - // if (faderHeight == center) - // gc.fillRectangle (left, DEFAULT_HEIGHT - center + 1.0, halfChannelWidth + 1.0, 1, - // colorFader); - // else if (faderHeight > center) - // gc.fillRectangle (left, DEFAULT_HEIGHT - (double) center, halfChannelWidth + 1.0, - // faderHeight - (double) center, colorFader); - // else - // gc.fillRectangle (left, DEFAULT_HEIGHT - lowerHeight + (double) faderHeight, - // halfChannelWidth + 1.0, center - faderHeight + 2.0, colorFader); - // } - // else - // { - // if (faderHeight == center) - // gc.strokeRectangle (left + 1.0, DEFAULT_HEIGHT - center + 1.0, halfChannelWidth, 1, - // colorFader); - // else if (faderHeight > center) - // gc.strokeRectangle (left + 1.0, DEFAULT_HEIGHT - (double) center, halfChannelWidth, - // faderHeight - (double) center, colorFader); - // else - // gc.strokeRectangle (left + 1.0, DEFAULT_HEIGHT - lowerHeight + (double) faderHeight, - // halfChannelWidth, center - faderHeight + 2.0, colorFader); - // } - // } - // else - // { - // if (this.selected[i]) - // gc.fillRectangle (left, DEFAULT_HEIGHT - (double) faderHeight, halfChannelWidth + 1.0, - // faderHeight, colorFader); - // else - // gc.strokeRectangle (left + 1.0, DEFAULT_HEIGHT - (double) faderHeight, halfChannelWidth, - // faderHeight, colorFader); - // } - // } - } -} diff --git a/src/main/java/de/mossgrabers/framework/scale/Scales.java b/src/main/java/de/mossgrabers/framework/scale/Scales.java index 4c977d9d7..05821e41e 100644 --- a/src/main/java/de/mossgrabers/framework/scale/Scales.java +++ b/src/main/java/de/mossgrabers/framework/scale/Scales.java @@ -1218,7 +1218,7 @@ public void setEndNote (final int endNote) /** * Update the configuration properties from this scale settings if they are different. - * + * * @param configuration The configuration to which to write the changed properties */ public void updateScaleProperties (final Configuration configuration) @@ -1243,7 +1243,7 @@ public void updateScaleProperties (final Configuration configuration) /** * Get the default octave. - * + * * @return The default octave */ public int getDefaultOctave () diff --git a/src/main/java/de/mossgrabers/framework/view/AbstractDrum64View.java b/src/main/java/de/mossgrabers/framework/view/AbstractDrum64View.java index d0a8d6307..c5b0d193e 100755 --- a/src/main/java/de/mossgrabers/framework/view/AbstractDrum64View.java +++ b/src/main/java/de/mossgrabers/framework/view/AbstractDrum64View.java @@ -43,9 +43,11 @@ public abstract class AbstractDrum64View, C extends protected int columns; protected int rows; protected int drumOctave = 0; + protected int drumStartKey = DRUM_START_KEY; private final int xblocks; private final int yblocks; + private final int numPadGrid; /** @@ -70,17 +72,18 @@ protected AbstractDrum64View (final S surface, final IModel model) */ protected AbstractDrum64View (final S surface, final IModel model, final int columns, final int rows) { - super ("Drum 64", surface, model); + super ("Drum " + columns * rows, surface, model); this.columns = columns; this.rows = rows; + this.numPadGrid = this.columns * this.rows; + + this.offsetY = this.drumStartKey; // The number of 4x4 blocks in x and y direction this.xblocks = this.columns / 4; this.yblocks = this.rows / 4; - this.offsetY = DRUM_START_KEY; - final ITrackBank tb = model.getTrackBank (); tb.addSelectionObserver ( (final int index, final boolean isSelected) -> this.clearPressedKeys ()); tb.addNoteObserver (this::updateNote); @@ -114,7 +117,7 @@ public void onGridNote (final int note, final int velocity) if (!this.model.canSelectedTrackHoldNotes ()) return; - final int index = note - 36; + final int index = note - this.drumStartKey; final int x = index % this.columns; final int y = index / this.columns; final int xblockPos = x / 4; @@ -251,7 +254,7 @@ private void setOctave (final int octave) this.clearPressedKeys (); final int oldDrumOctave = this.drumOctave; this.drumOctave = Math.max (-2, Math.min (1, octave)); - this.offsetY = DRUM_START_KEY + this.drumOctave * BLOCK_SIZE; + this.offsetY = this.drumStartKey + this.drumOctave * BLOCK_SIZE; this.updateNoteMapping (); this.surface.getDisplay ().notify (this.getDrumRangeText ()); if (oldDrumOctave != this.drumOctave) @@ -355,7 +358,7 @@ protected void handleSelectButton (final int playedPad) final int x = xblock * 4 + blockX; final int y = yblock * 4 + blockY; - final int note = 36 + y * this.columns + x; + final int note = this.drumStartKey + y * this.columns + x; noteMap[note] = index + this.offsetY; if (noteMap[note] < -1 || noteMap[note] > 127) noteMap[note] = -1; @@ -372,8 +375,8 @@ protected void handleSelectButton (final int playedPad) private String getDrumRangeText () { - final int s = DRUM_START_KEY + this.drumOctave * 64; - return Scales.formatDrumNote (s) + " to " + Scales.formatDrumNote (s + 63); + final int s = this.drumStartKey + this.drumOctave * this.numPadGrid; + return Scales.formatDrumNote (s) + " to " + Scales.formatDrumNote (s + this.numPadGrid - 1); } @@ -405,6 +408,6 @@ private void updateNote (final int trackIndex, final int note, final int velocit protected IDrumPadBank getDrumPadBank () { - return this.model.getDrumDevice (64).getDrumPadBank (); + return this.model.getDrumDevice (this.numPadGrid).getDrumPadBank (); } } diff --git a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractDrumLaneView.java b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractDrumLaneView.java index 16fc4e22a..834dee7fa 100644 --- a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractDrumLaneView.java +++ b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractDrumLaneView.java @@ -96,10 +96,7 @@ public void onGridNote (final int note, final int velocity) final NotePosition notePosition = new NotePosition (this.configuration.getMidiEditChannel (), step, sound); final INoteClip clip = this.getClip (); - if (this.handleSequencerAreaButtonCombinations (clip, notePosition, y, velocity, vel)) - return; - - if (this.handleNoteEditor (clip, notePosition, velocity)) + if (this.handleSequencerAreaButtonCombinations (clip, notePosition, y, velocity, vel) || this.handleNoteEditor (clip, notePosition, velocity)) return; this.handleSequencerArea (velocity, vel, notePosition); diff --git a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractNoteSequencerView.java b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractNoteSequencerView.java index 40704a396..797595ad2 100755 --- a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractNoteSequencerView.java +++ b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractNoteSequencerView.java @@ -116,7 +116,7 @@ public void onGridNote (final int note, final int velocity) if (!this.isActive ()) return; - final int index = note - 36; + final int index = note - this.surface.getPadGrid ().getStartNote (); final int x = index % this.numDisplayCols; final int y = index / this.numDisplayCols; diff --git a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractPolySequencerView.java b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractPolySequencerView.java index a07739364..37c406ec1 100644 --- a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractPolySequencerView.java +++ b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractPolySequencerView.java @@ -169,7 +169,7 @@ public void onGridNote (final int note, final int velocity) if (!isKeyboardEnabled) return; - final int index = note - 36; + final int index = note - this.surface.getPadGrid ().getStartNote (); final int x = index % this.numColumns; final int y = index / this.numColumns; @@ -187,7 +187,7 @@ public void onGridNote (final int note, final int velocity) /** - * Handle button presses in the note area of the poly sequencer. + * Handle button presses in the note area of the poly-sequencer. * * @param note The played note * @param velocity The velocity diff --git a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractSequencerView.java b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractSequencerView.java index 2ac862522..3468018e0 100755 --- a/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractSequencerView.java +++ b/src/main/java/de/mossgrabers/framework/view/sequencer/AbstractSequencerView.java @@ -564,7 +564,7 @@ protected String getStepColor (final IStepInfo stepInfo, final boolean highlight /** * If there is a note editor available this method handles adding and removing notes from it. - * + * * @param clip The clip which contains the notes * @param notePosition The note position * @param velocity The velocity of the pad press