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);
}
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));
}
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);
}
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));
}
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);
}
Aggregations