Skip to content

Commit

Permalink
* APC40MkII
Browse files Browse the repository at this point in the history
  * New: Scene buttons are lit in the color of the scene
* Akai Fire
  * Fixed: Ghost notes could appear when quickly editing pitches in the sequencer and create a new clip.
* Push
  * Fixed: Mapped User Parameters did not show their name and value
  • Loading branch information
git-moss committed Aug 9, 2020
1 parent 6c22395 commit 33cc004
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 82 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.mossgrabers</groupId>
<artifactId>DrivenByMoss</artifactId>
<name>DrivenByMoss</name>
<version>10.6.0</version>
<version>10.6.1</version>
<build>
<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>DrivenByMoss</artifactId>
<packaging>jar</packaging>
<name>DrivenByMoss</name>
<version>10.6.0</version>
<version>10.6.1</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import de.mossgrabers.framework.daw.INoteClip;
import de.mossgrabers.framework.daw.IStepInfo;
import de.mossgrabers.framework.daw.constants.TransportConstants;
import de.mossgrabers.framework.daw.data.GridStep;
import de.mossgrabers.framework.daw.data.empty.EmptyStepInfo;

import com.bitwig.extension.controller.api.Clip;
Expand All @@ -34,6 +35,7 @@ public class CursorClipImpl implements INoteClip
private Clip launcherClip;
private int editPage = 0;
private double stepLength;
private final GridStep editStep = new GridStep ();


/**
Expand Down Expand Up @@ -423,7 +425,7 @@ public void updateStepDuration (final int channel, final int step, final int row
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setDuration (duration);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setDuration (duration);
}

Expand All @@ -444,7 +446,7 @@ public void updateStepVelocity (final int channel, final int step, final int row
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setVelocity (velocity);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setVelocity (velocity);
}

Expand All @@ -465,7 +467,7 @@ public void updateStepReleaseVelocity (final int channel, final int step, final
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setReleaseVelocity (releaseVelocity);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setReleaseVelocity (releaseVelocity);
}

Expand All @@ -486,7 +488,7 @@ public void updateStepPressure (final int channel, final int step, final int row
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setPressure (pressure);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setPressure (pressure);
}

Expand All @@ -507,7 +509,7 @@ public void updateStepTimbre (final int channel, final int step, final int row,
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setTimbre (timbre);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setTimbre (timbre);
}

Expand All @@ -528,7 +530,7 @@ public void updateStepPan (final int channel, final int step, final int row, fin
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setPan (pan);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setPan (pan);
}

Expand All @@ -549,7 +551,7 @@ public void updateStepTranspose (final int channel, final int step, final int ro
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setTranspose (transpose);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setTranspose (transpose);
}

Expand All @@ -570,7 +572,7 @@ public void updateStepGain (final int channel, final int step, final int row, fi
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
stepInfo.setGain (gain);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
this.getClip ().getStep (channel, step, row).setGain (gain);
}

Expand Down Expand Up @@ -753,25 +755,30 @@ public void transpose (final int semitones)

/** {@inheritDoc} */
@Override
public void edit (final int channel, final int step, final int row, final boolean enable)
public void startEdit (final int channel, final int step, final int row)
{
final StepInfoImpl stepInfo = this.getUpdateableStep (channel, step, row);
if (enable)
{
stepInfo.setEditing (true);
this.delayedUpdate (channel, step, row);
return;
}
// Is there a previous edit, which is not stopped yet?
this.stopEdit ();

this.sendClipData (channel, step, row);
stepInfo.setEditing (false);
this.editStep.set (this, channel, step, row);
this.delayedUpdate (channel, step, row);
}


/** {@inheritDoc} */
@Override
public void stopEdit ()
{
if (!this.editStep.isSet ())
return;
this.sendClipData (this.editStep.getChannel (), this.editStep.getStep (), this.editStep.getNote ());
this.editStep.reset ();
}


private void delayedUpdate (final int channel, final int step, final int row)
{
final IStepInfo stepInfo = this.getStep (channel, step, row);
if (!stepInfo.isEditing ())
if (!this.editStep.isSet ())
return;
this.sendClipData (channel, step, row);
this.host.scheduleTask ( () -> this.delayedUpdate (channel, step, row), 100);
Expand Down Expand Up @@ -810,8 +817,11 @@ private void sendClipData (final int channel, final int step, final int row)
*/
private void handleStepData (final NoteStep noteStep)
{
final StepInfoImpl sinfo = this.getUpdateableStep (noteStep.channel (), noteStep.x (), noteStep.y ());
if (!sinfo.isEditing ())
final int channel = noteStep.channel ();
final int step = noteStep.x ();
final int note = noteStep.y ();
final StepInfoImpl sinfo = this.getUpdateableStep (channel, step, note);
if (!this.editStep.isSet () || this.editStep.getChannel () != channel || this.editStep.getStep () != step || this.editStep.getNote () != note)
sinfo.updateData (noteStep);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
*/
public class StepInfoImpl implements IStepInfo
{
private int state;
private double duration = Resolution.RES_1_16.getValue ();
private double velocity;
private double releaseVelocity;
private double pressure;
private double timbre;
private double pan;
private double transpose;
private double gain;

private boolean isEditing;
private int state;
private double duration = Resolution.RES_1_16.getValue ();
private double velocity;
private double releaseVelocity;
private double pressure;
private double timbre;
private double pan;
private double transpose;
private double gain;


/**
Expand Down Expand Up @@ -111,25 +109,6 @@ public double getGain ()
}


/** {@inheritDoc} */
@Override
public boolean isEditing ()
{
return this.isEditing;
}


/**
* Set that the note is currently edited.
*
* @param isEditing True if editing is happening
*/
public void setEditing (final boolean isEditing)
{
this.isEditing = isEditing;
}


/**
* Set the state.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import de.mossgrabers.controller.apc.controller.APCColorManager;
import de.mossgrabers.controller.apc.controller.APCControlSurface;
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.daw.DAWColor;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.data.IScene;
import de.mossgrabers.framework.daw.data.bank.ISceneBank;
Expand Down Expand Up @@ -68,9 +69,13 @@ public String getButtonColorID (final ButtonID buttonID)

final ISceneBank sceneBank = this.model.getSceneBank ();
final IScene s = sceneBank.getItem (scene);
if (s.doesExist ())
return s.isSelected () ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
if (!s.doesExist ())
return AbstractSessionView.COLOR_SCENE_OFF;

if (s.isSelected ())
return AbstractSessionView.COLOR_SELECTED_SCENE;

return this.useClipColor ? DAWColor.getColorIndex (s.getColor ()) : AbstractSessionView.COLOR_SCENE;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ public void onKnobTouch (final int index, final boolean isTouched)
return;

this.isKnobTouched[index] = isTouched;
this.clip.edit (this.channel, this.step, this.note, isTouched);
if (isTouched)
this.clip.startEdit (this.channel, this.step, this.note);
else
this.clip.stopEdit ();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ public void onKnobTouch (final int index, final boolean isTouched)
return;
}

this.clip.edit (this.channel, this.step, this.note, isTouched);
if (isTouched)
this.clip.startEdit (this.channel, this.step, this.note);
else
this.clip.stopEdit ();
}


Expand Down
19 changes: 19 additions & 0 deletions src/main/java/de/mossgrabers/controller/push/mode/BaseMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import de.mossgrabers.controller.push.PushConfiguration;
import de.mossgrabers.controller.push.controller.PushControlSurface;
import de.mossgrabers.framework.controller.ContinuousID;
import de.mossgrabers.framework.controller.display.IGraphicDisplay;
import de.mossgrabers.framework.controller.display.ITextDisplay;
import de.mossgrabers.framework.daw.IModel;
Expand Down Expand Up @@ -59,6 +60,24 @@ public BaseMode (final String name, final PushControlSurface surface, final IMod
}


/**
* Constructor.
*
* @param name The name of the mode
* @param surface The control surface
* @param model The model
* @param bank The parameter bank to control with this mode, might be null
* @param firstKnob The ID of the first knob to control this mode, all other knobs must be
* follow up IDs
*/
public BaseMode (final String name, final PushControlSurface surface, final IModel model, final IBank<? extends IItem> bank, final ContinuousID firstKnob)
{
super (name, surface, model, true, bank, firstKnob, 8);

this.isPush2 = this.surface.getConfiguration ().isPush2 ();
}


/** {@inheritDoc} */
@Override
public void updateDisplay ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public void onKnobTouch (final int index, final boolean isTouched)
return;
}

this.clip.edit (this.channel, this.step, this.note, isTouched);
if (isTouched)
this.clip.startEdit (this.channel, this.step, this.note);
else
this.clip.stopEdit ();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import de.mossgrabers.controller.push.controller.PushControlSurface;
import de.mossgrabers.controller.push.mode.BaseMode;
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.controller.ContinuousID;
import de.mossgrabers.framework.controller.color.ColorEx;
import de.mossgrabers.framework.controller.display.IGraphicDisplay;
import de.mossgrabers.framework.controller.display.ITextDisplay;
Expand Down Expand Up @@ -36,7 +37,7 @@ public class UserMode extends BaseMode
*/
public UserMode (final PushControlSurface surface, final IModel model)
{
super ("User Controls", surface, model, model.getUserParameterBank ());
super ("User Controls", surface, model, model.getUserParameterBank (), ContinuousID.KNOB1);

this.isTemporary = false;
}
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/de/mossgrabers/framework/daw/INoteClip.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,20 @@ public interface INoteClip extends IClip


/**
* Start / stop editing the note. Signals to prevent round-trip error by quickly changing values
* to the DAW, which are not set at the same time.
* Start editing a note. Signals to prevent round-trip error by quickly changing values to the
* DAW, which are not set at the same time.
*
* @param channel The MIDI channel
* @param step The step
* @param row The note row
* @param enable Enable editing
* @param note The note to edit
*/
void startEdit (int channel, int step, int note);


/**
* Stop editing the note step, which was started with startEdit.
*/
void edit (int channel, int step, int row, boolean enable);
void stopEdit ();


/**
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/de/mossgrabers/framework/daw/IStepInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,4 @@ public interface IStepInfo
* @return The gain of the note
*/
double getGain ();


/**
* Check if the note is currently edited.
*
* @return True if editing is happening
*/
boolean isEditing ();
}
Loading

0 comments on commit 33cc004

Please sign in to comment.