Search in sources :

Example 1 with NoteStep

use of com.bitwig.extension.controller.api.NoteStep in project DrivenByMoss by git-moss.

the class CursorClipImpl method updateRecurrenceMask.

/**
 * {@inheritDoc}
 */
@Override
public void updateRecurrenceMask(final int channel, final int step, final int row, final int mask) {
    final StepInfoImpl stepInfo = this.getUpdateableStep(channel, step, row);
    stepInfo.setRecurrenceMask(mask);
    if (this.editSteps.isEmpty()) {
        final NoteStep noteStep = this.getClip().getStep(channel, step, row);
        noteStep.setRecurrence(noteStep.recurrenceLength(), mask);
    }
}
Also used : NoteStep(com.bitwig.extension.controller.api.NoteStep)

Example 2 with NoteStep

use of com.bitwig.extension.controller.api.NoteStep in project DrivenByMoss by git-moss.

the class CursorClipImpl method updateRecurrenceLength.

/**
 * {@inheritDoc}
 */
@Override
public void updateRecurrenceLength(final int channel, final int step, final int row, final int recurrenceLength) {
    final int rl = Math.min(8, Math.max(1, recurrenceLength));
    final StepInfoImpl stepInfo = this.getUpdateableStep(channel, step, row);
    stepInfo.setRecurrenceLength(rl);
    if (this.editSteps.isEmpty()) {
        final NoteStep noteStep = this.getClip().getStep(channel, step, row);
        noteStep.setRecurrence(rl, noteStep.recurrenceMask());
    }
}
Also used : NoteStep(com.bitwig.extension.controller.api.NoteStep)

Example 3 with NoteStep

use of com.bitwig.extension.controller.api.NoteStep in project DrivenByMoss by git-moss.

the class CursorClipImpl method sendClipData.

/**
 * Update the locally changed step data in Bitwig.
 *
 * @param channel The MIDI channel
 * @param step The step of the clip
 * @param row The row of the clip
 */
private void sendClipData(final int channel, final int step, final int row) {
    final NoteStep noteInfo = this.getClip().getStep(channel, step, row);
    if (noteInfo == null)
        return;
    final IStepInfo stepInfo = this.getStep(channel, step, row);
    noteInfo.setIsMuted(stepInfo.isMuted());
    noteInfo.setDuration(stepInfo.getDuration());
    noteInfo.setVelocity(stepInfo.getVelocity());
    noteInfo.setVelocitySpread(stepInfo.getVelocitySpread());
    noteInfo.setReleaseVelocity(stepInfo.getReleaseVelocity());
    noteInfo.setPressure(stepInfo.getPressure());
    noteInfo.setTimbre(stepInfo.getTimbre());
    noteInfo.setPan(stepInfo.getPan());
    noteInfo.setTranspose(stepInfo.getTranspose());
    noteInfo.setGain(stepInfo.getGain());
    noteInfo.setIsChanceEnabled(stepInfo.isChanceEnabled());
    noteInfo.setChance(stepInfo.getChance());
    noteInfo.setIsOccurrenceEnabled(stepInfo.isOccurrenceEnabled());
    noteInfo.setOccurrence(NoteOccurrence.valueOf(stepInfo.getOccurrence().name()));
    noteInfo.setIsRecurrenceEnabled(stepInfo.isRecurrenceEnabled());
    final int recurrenceLength = Math.max(1, stepInfo.getRecurrenceLength());
    noteInfo.setRecurrence(recurrenceLength, stepInfo.getRecurrenceMask());
    noteInfo.setIsRepeatEnabled(stepInfo.isRepeatEnabled());
    noteInfo.setRepeatCount(stepInfo.getRepeatCount());
    noteInfo.setRepeatCurve(stepInfo.getRepeatCurve());
    noteInfo.setRepeatVelocityCurve(stepInfo.getRepeatVelocityCurve());
    noteInfo.setRepeatVelocityEnd(stepInfo.getRepeatVelocityEnd());
}
Also used : NoteStep(com.bitwig.extension.controller.api.NoteStep) IStepInfo(de.mossgrabers.framework.daw.IStepInfo)

Aggregations

NoteStep (com.bitwig.extension.controller.api.NoteStep)3 IStepInfo (de.mossgrabers.framework.daw.IStepInfo)1