Search in sources :

Example 1 with SLMkIIILightGuide

use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIILightGuide in project DrivenByMoss by git-moss.

the class SLMkIIIControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput keyboardInput = midiAccess.createInput(1, "Keyboard", "8?????", "9?????", "B?????", "D?????", "E?????");
    final IHost hostProxy = this.model.getHost();
    final IMidiInput input = midiAccess.createInput("Pads", "8?????", "9?????");
    final SLMkIIILightGuide lightGuide = new SLMkIIILightGuide(this.model, this.colorManager, output);
    final SLMkIIIControlSurface surface = new SLMkIIIControlSurface(hostProxy, this.colorManager, this.configuration, output, input, lightGuide);
    this.surfaces.add(surface);
    surface.addPianoKeyboard(61, keyboardInput, true);
    keyboardInput.setMidiCallback((status, data1, data2) -> {
        final int code = status & 0xF0;
        if (code == 0x80 || code == 0x90)
            lightGuide.updateKeyboardNote(data1, data2);
    });
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) IHost(de.mossgrabers.framework.daw.IHost) SLMkIIILightGuide(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIILightGuide) SLMkIIIControlSurface(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)

Aggregations

SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)1 SLMkIIILightGuide (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIILightGuide)1 IHost (de.mossgrabers.framework.daw.IHost)1 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)1 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)1 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)1