Search in sources :

Example 1 with IMidiInput

use of de.mossgrabers.framework.daw.midi.IMidiInput in project DrivenByMoss by git-moss.

the class APCControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.isMkII ? "Akai APC40 mkII" : "Akai APC40", "B040??");
    final APCControlSurface surface = new APCControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input, this.isMkII);
    this.surfaces.add(surface);
    surface.setDisplay(new DummyDisplay(this.host));
    for (int i = 0; i < 8; i++) surface.setLED(APCControlSurface.APC_KNOB_DEVICE_KNOB_LED_1 + i, 1);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput)

Example 2 with IMidiInput

use of de.mossgrabers.framework.daw.midi.IMidiInput in project DrivenByMoss by git-moss.

the class APCminiControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput("Akai APCmini");
    final APCminiControlSurface surface = new APCminiControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.setDisplay(new DummyDisplay(this.host));
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) APCminiControlSurface(de.mossgrabers.apcmini.controller.APCminiControlSurface) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput)

Example 3 with IMidiInput

use of de.mossgrabers.framework.daw.midi.IMidiInput in project DrivenByMoss by git-moss.

the class MCUControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    for (int i = 0; i < this.numMCUDevices; i++) {
        final IMidiOutput output = midiAccess.createOutput(i);
        final IMidiInput input = midiAccess.createInput(i, null);
        final MCUControlSurface surface = new MCUControlSurface(this.surfaces, this.model.getHost(), this.colorManager, this.configuration, output, input, 8 * (this.numMCUDevices - i - 1), i == 0);
        this.surfaces.add(surface);
        surface.setDisplay(new MCUDisplay(this.model.getHost(), output, true, false));
        surface.setSecondDisplay(new MCUDisplay(this.model.getHost(), output, false, i == 0));
        surface.setSegmentDisplay(new MCUSegmentDisplay(output));
        surface.getModeManager().setDefaultMode(Modes.MODE_VOLUME);
    }
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) MCUDisplay(de.mossgrabers.mcu.controller.MCUDisplay) MCUSegmentDisplay(de.mossgrabers.mcu.controller.MCUSegmentDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface)

Example 4 with IMidiInput

use of de.mossgrabers.framework.daw.midi.IMidiInput in project DrivenByMoss by git-moss.

the class SLControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.isMkII ? "Novation SL MkII (Drumpads)" : "Novation SL MkI (Drumpads)", "90????", "80????");
    midiAccess.createInput(1, this.isMkII ? "Novation SL MkII (Keyboard)" : "Novation SL MkI (Keyboard)", "80????", "90????", "B0????", "D0????", "E0????");
    final IHost hostProxy = this.model.getHost();
    final SLControlSurface surface = new SLControlSurface(hostProxy, this.colorManager, this.configuration, output, input, this.isMkII);
    surface.setDisplay(new SLDisplay(hostProxy, output));
    this.surfaces.add(surface);
}
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) SLControlSurface(de.mossgrabers.sl.controller.SLControlSurface) SLDisplay(de.mossgrabers.sl.controller.SLDisplay)

Example 5 with IMidiInput

use of de.mossgrabers.framework.daw.midi.IMidiInput in project DrivenByMoss by git-moss.

the class PlayView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int key, final int velocity) {
    if (this.playControls) {
        final int pos = key - this.scales.getStartNote();
        if (pos < 8) {
            final boolean isDown = velocity > 0;
            final IMidiInput midiInput = this.surface.getMidiInput();
            switch(pos) {
                // Sustain
                case 0:
                    this.isSustain = isDown;
                    midiInput.sendRawMidiEvent(0xB0, 64, this.isSustain ? 127 : 0);
                    return;
                // Pitch
                case 1:
                    this.isPitchDown = isDown;
                    midiInput.sendRawMidiEvent(0xE0, 0, this.isPitchDown ? Math.abs(velocity / 2 - 63) : 64);
                    return;
                case 2:
                    this.isPitchUp = isDown;
                    midiInput.sendRawMidiEvent(0xE0, 0, this.isPitchUp ? 64 + velocity / 2 : 64);
                    return;
                // Modulation
                default:
                    if (isDown) {
                        this.isModulation = pos - 3;
                        midiInput.sendRawMidiEvent(0xB0, 1, MODULATION_INTENSITIES[this.isModulation]);
                    }
                    return;
            }
        }
    }
    super.onGridNote(key, velocity);
}
Also used : IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput)

Aggregations

IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)25 IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)18 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)16 DummyDisplay (de.mossgrabers.framework.controller.display.DummyDisplay)5 IHost (de.mossgrabers.framework.daw.IHost)4 ArrayList (java.util.ArrayList)3 Kontrol1ControlSurface (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 BindType (de.mossgrabers.framework.controller.hardware.BindType)2 IHwButton (de.mossgrabers.framework.controller.hardware.IHwButton)2 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)1 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)1 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 GenericFlexiControlSurface (de.mossgrabers.controller.generic.controller.GenericFlexiControlSurface)1 MCUDisplay (de.mossgrabers.controller.mackie.mcu.controller.MCUDisplay)1 MainEncoderCommand (de.mossgrabers.controller.ni.kontrol.mki.command.continuous.MainEncoderCommand)1 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)1 Kontrol1UsbDevice (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1UsbDevice)1 KontrolProtocolControlSurface (de.mossgrabers.controller.ni.kontrol.mkii.controller.KontrolProtocolControlSurface)1