I have a launchpad, I'm trying to make a backlight for the pad buttons, and also for them to send information with notes and velocity to the synthesizer.
I studied similar scripts, but for my level of knowledge of the language they are too complex.
I managed to implement these two features separately, but together for some reason they do not work. Perhaps the participants of this forum can help me?
I also tried to bind isBeginTouched events and also use addValueObserver instead of markInterested, tried MultiStateHardwareLight instead of OnOffHardwareLight - all this did not lead to the result.
What could be the problem and how can it be circumvented?
I studied similar scripts, but for my level of knowledge of the language they are too complex.
I managed to implement these two features separately, but together for some reason they do not work. Perhaps the participants of this forum can help me?
Code:
method init()NoteInput noteInput = midiIn.createNoteInput("MIDI", "??????", "??????", "??????", "??????");noteInput.setShouldConsumeEvents(false);//I create a button and a backlight for the buttonfinal HardwareButton Button_1 = hardwareSurface.createHardwareButton ("PAD_BUTTON_1");final OnOffHardwareLight ButtonLight1 = hardwareSurface.createOnOffHardwareLight("PAD_BUTTON_LIGHT_1");//installing a backlight for the buttonButton_1.setBackgroundLight(ButtonLight1);//associate pressing and releasing a button with a midi eventButton_1.pressedAction().setActionMatcher(midiIn.createNoteOnActionMatcher(0, 37));Button_1.releasedAction().setActionMatcher(midiIn.createNoteOffActionMatcher(0, 37));//tracking the click eventButton_1.isPressed().markInterested();//pass the press value to the light stateButtonLight1.isOn().setValueSupplier(()-> Button_1.isPressed().get());ButtonLight1.isOn().onUpdateHardware(state -> { host.println("state: " + state); });
What could be the problem and how can it be circumvented?
Statistics: Posted by onyme — Thu Oct 31, 2024 6:11 pm — Replies 1 — Views 55