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