Search in sources :

Example 6 with IMidiAccess

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

the class OSCControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiInput input = midiAccess.createInput("OSC");
    final OSCControlSurface surface = new OSCControlSurface(this.host, this.configuration, this.colorManager, input);
    surface.addTextDisplay(new DummyDisplay(this.host));
    this.surfaces.add(surface);
    this.keyManager = new KeyManager(this.model, this.model.getScales(), surface.getPadGrid());
    // Send OSC messages
    final String sendHost = this.configuration.getSendHost();
    final int sendPort = this.configuration.getSendPort();
    this.host.println(String.format("Connecting to OSC server %s:%d", sendHost, Integer.valueOf(sendPort)));
    final IOpenSoundControlClient oscClient = this.host.connectToOSCServer(sendHost, sendPort);
    this.writer = new OSCWriter(this.host, this.model, oscClient, this.configuration);
    // Receive OSC messages
    final OSCParser parser = new OSCParser(this.host, surface, this.model, this.configuration, this.writer, input, this.keyManager);
    final List<IModule> modules = new ArrayList<>();
    modules.add(new TransportModule(this.host, this.model, surface, this.writer));
    modules.add(new GlobalModule(this.host, this.model, this.writer));
    modules.add(new LayoutModule(this.host, this.model, this.writer));
    modules.add(new MarkerModule(this.host, this.model, this.writer));
    modules.add(new ProjectModule(this.host, this.model, this.writer));
    modules.add(new TrackModule(this.host, this.model, this.writer, this.configuration));
    modules.add(new SceneModule(this.host, this.model, this.writer));
    modules.add(new DeviceModule(this.host, this.model, this.writer, this.configuration));
    modules.add(new BrowserModule(this.host, this.model, this.writer));
    modules.add(new MidiModule(this.host, this.model, surface, this.writer, this.keyManager));
    modules.add(new UserModule(this.host, this.model, this.writer));
    modules.add(new ActionModule(this.host, this.model, this.writer, this.configuration));
    modules.add(new ClipModule(this.host, this.model, this.writer));
    modules.forEach(module -> {
        this.writer.registerModule(module);
        parser.registerModule(module);
    });
    this.oscServer = this.host.createOSCServer(parser);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IModule(de.mossgrabers.controller.osc.module.IModule) TransportModule(de.mossgrabers.controller.osc.module.TransportModule) ActionModule(de.mossgrabers.controller.osc.module.ActionModule) ArrayList(java.util.ArrayList) MarkerModule(de.mossgrabers.controller.osc.module.MarkerModule) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) UserModule(de.mossgrabers.controller.osc.module.UserModule) TrackModule(de.mossgrabers.controller.osc.module.TrackModule) KeyManager(de.mossgrabers.framework.utils.KeyManager) GlobalModule(de.mossgrabers.controller.osc.module.GlobalModule) ClipModule(de.mossgrabers.controller.osc.module.ClipModule) LayoutModule(de.mossgrabers.controller.osc.module.LayoutModule) SceneModule(de.mossgrabers.controller.osc.module.SceneModule) OSCParser(de.mossgrabers.controller.osc.protocol.OSCParser) BrowserModule(de.mossgrabers.controller.osc.module.BrowserModule) MidiModule(de.mossgrabers.controller.osc.module.MidiModule) IOpenSoundControlClient(de.mossgrabers.framework.osc.IOpenSoundControlClient) ProjectModule(de.mossgrabers.controller.osc.module.ProjectModule) DeviceModule(de.mossgrabers.controller.osc.module.DeviceModule) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) OSCWriter(de.mossgrabers.controller.osc.protocol.OSCWriter)

Example 7 with IMidiAccess

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

the class MidiMonitorSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiInput input = midiAccess.createInput("Midi Monitor");
    this.surfaces.add(new MidiMonitorControlSurface(this.host, this.configuration, input));
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) MidiMonitorControlSurface(de.mossgrabers.controller.utilities.midimonitor.controller.MidiMonitorControlSurface)

Example 8 with IMidiAccess

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

the class LaunchkeyMk3ControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    // A bit tricky to exclude only channel 16...
    final List<String> filters = new ArrayList<>();
    for (int i = 0; i < 15; i++) {
        filters.add(StringUtils.toHexStr(0x80 + i) + "????");
        filters.add(StringUtils.toHexStr(0x90 + i) + "????");
    }
    final IMidiInput input = midiAccess.createInput("Pads", filters.toArray(new String[filters.size()]));
    final IMidiInput inputKeys = midiAccess.createInput(1, "Keyboard", "8?????", /* Note off */
    "9?????", /* Note on */
    "A?????", /* Polyphonic After-touch */
    "B?01??", /* Modulation */
    "C?????", /* Program change */
    "B?40??", /* Sustain pedal */
    "D?????", /* Channel After-touch */
    "E?????");
    final LaunchkeyMk3ControlSurface surface = new LaunchkeyMk3ControlSurface(this.host, this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.addTextDisplay(new LaunchkeyMk3Display(this.host, output));
    surface.addPianoKeyboard(25, inputKeys, true);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) LaunchkeyMk3Display(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ArrayList(java.util.ArrayList)

Example 9 with IMidiAccess

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

the class BeatstepControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput("Control", "82????", "92????", "A2????", "B2????");
    // Sequencer 1 is on channel 1
    input.createNoteInput("Seq. 1", "90????", "80????");
    // Setup the 2 note sequencers and 1 drum sequencer
    if (this.isPro) {
        // Sequencer 2 is on channel 2
        input.createNoteInput("Seq. 2", "91????", "81????");
        // Drum Sequencer is on channel 10
        input.createNoteInput("Drums", "99????", "89????");
    }
    final BeatstepControlSurface surface = new BeatstepControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input, this.isPro);
    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) DummyDisplay(de.mossgrabers.framework.controller.display.DummyDisplay) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface)

Example 10 with IMidiAccess

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

the class PushControllerSetup method createSurface.

/**
 * {@inheritDoc}
 */
@Override
protected void createSurface() {
    final IMidiAccess midiAccess = this.factory.createMidiAccess();
    final IMidiOutput output = midiAccess.createOutput();
    final IMidiInput input = midiAccess.createInput(this.isPush2 ? "Ableton Push 2" : "Ableton Push 1", "80????", /* Note off */
    "90????", /* Note on */
    "B040??");
    final PushControlSurface surface = new PushControlSurface(this.model.getHost(), this.colorManager, this.configuration, output, input);
    this.surfaces.add(surface);
    surface.setDisplay(this.createDisplay(output));
    surface.getModeManager().setDefaultMode(Modes.MODE_TRACK);
}
Also used : IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface)

Aggregations

IMidiAccess (de.mossgrabers.framework.daw.midi.IMidiAccess)18 IMidiInput (de.mossgrabers.framework.daw.midi.IMidiInput)18 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)15 DummyDisplay (de.mossgrabers.framework.controller.display.DummyDisplay)5 IHost (de.mossgrabers.framework.daw.IHost)3 ArrayList (java.util.ArrayList)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 Kontrol1ControlSurface (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface)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 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)1 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)1 LaunchkeyMk3Display (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3Display)1 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)1