AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
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?
Code: Select all (#)
method init()
NoteInput noteInput = midiIn.createNoteInput("MIDI", "??????", "??????", "??????", "??????");
noteInput.setShouldConsumeEvents(false);
//I create a button and a backlight for the button
final HardwareButton Button_1 = hardwareSurface.createHardwareButton ("PAD_BUTTON_1");
final OnOffHardwareLight ButtonLight1 = hardwareSurface.createOnOffHardwareLight("PAD_BUTTON_LIGHT_1");
//installing a backlight for the button
Button_1.setBackgroundLight(ButtonLight1);
//associate pressing and releasing a button with a midi event
Button_1.pressedAction().setActionMatcher(midiIn.createNoteOnActionMatcher(0, 37));
Button_1.releasedAction().setActionMatcher(midiIn.createNoteOffActionMatcher(0, 37));
//tracking the click event
Button_1.isPressed().markInterested();
//pass the press value to the light state
ButtonLight1.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?
