Skip to content

Commit 2dad555

Browse files
committed
Merge branch 'api-17' into CI
2 parents dd14681 + e9b9e5d commit 2dad555

File tree

273 files changed

+24690
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+24690
-1394
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ hs_err_pid*
1515

1616
bitwig-extensions.iml
1717

18-
target/
19-
build/
18+
/target/
19+
/build/
2020
/.idea
2121
/.classpath
2222
/.project
2323
/${bitwig.extension.directory}/
2424
/${bitwig.extension.directory}/Bitwig.bwextension
2525
/.gradle/
26+
/out
27+
/bin/
28+
/.settings/
29+
.DS_Store
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
eclipse.preferences.version=1
22
encoding//src/main/java=UTF-8
3+
encoding//src/test/java=UTF-8

build.gradle

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
plugins {
22
id 'java'
3+
id 'eclipse'
4+
id 'idea'
35
}
46

5-
repositories {
6-
mavenLocal()
7-
maven {
8-
url = uri('https://maven.bitwig.com')
9-
}
7+
var isBuildingBitwig = rootProject.getName().equals("bitwig")
108

11-
maven {
12-
url = uri('https://repo.maven.apache.org/maven2/')
9+
if (isBuildingBitwig)
10+
{
11+
dependencies {
12+
implementation project(':base-extensions-api')
1313
}
1414
}
15+
else
16+
{
17+
repositories {
18+
maven {
19+
url = uri('https://maven.bitwig.com')
20+
}
21+
}
1522

1623
dependencies {
1724
if (project.file('../is-building-bitwig.txt').exists())
18-
implementation project(':base-extensions-api')
25+
implementation 'com.bitwig:base-extensions-api:LOCAL'
1926
else
2027
implementation 'com.bitwig:base-extensions-api:13'
2128
}
2229

2330
group = 'com.bitwig.extensions'
24-
version = '1-SNAPSHOT'
2531
description = 'Bitwig Studio Extensions (Github)'
26-
java.sourceCompatibility = JavaVersion.VERSION_13
32+
33+
java {
34+
sourceCompatibility = JavaVersion.VERSION_16
35+
36+
jar {
37+
archiveFileName = 'BitwigControllers.bwextension'
38+
}
39+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@
8181
<dependency>
8282
<groupId>com.bitwig</groupId>
8383
<artifactId>extension-api</artifactId>
84-
<version>[13,)</version>
84+
<version>[15,)</version>
8585
</dependency>
8686
</dependencies>
8787
</profile>
8888
</profiles>
8989
</project>
90-

settings.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*/
4-
51
rootProject.name = 'bitwig-extensions'

src/main/java/com/bitwig/extensions/controllers/akai/apc40_mkii/APC40MKIIControllerExtension.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
public class APC40MKIIControllerExtension extends ControllerExtension
4646
{
47-
private static final boolean ENABLE_DEBUG_LAYER = true;
47+
private static final boolean ENABLE_DEBUG_LAYER = false;
4848

4949
private static final int CHANNEL_STRIP_NUM_PARAMS = 4;
5050

@@ -215,8 +215,10 @@ public void init()
215215

216216
mTrackBank = host.createTrackBank(8, 5, 5, false);
217217
mTrackBank.setSkipDisabledItems(true);
218+
mTrackBank.setShouldShowClipLauncherFeedback(true);
218219

219220
mSceneBank = mTrackBank.sceneBank();
221+
mSceneBank.setIndication(true);
220222

221223
mTrackBank.cursorIndex().markInterested();
222224

@@ -239,8 +241,6 @@ public void init()
239241
sendBank.setSkipDisabledItems(true);
240242

241243
final ClipLauncherSlotBank clipLauncher = track.clipLauncherSlotBank();
242-
clipLauncher.setIndication(true);
243-
244244
for (int j = 0; j < 5; ++j)
245245
{
246246
final ClipLauncherSlot slot = clipLauncher.getItemAt(j);
@@ -440,9 +440,18 @@ private void createShiftLayer()
440440
for (int j = 0; j < 5; ++j)
441441
{
442442
final ClipLauncherSlot slot = clipLauncherSlotBank.getItemAt(j);
443-
mShiftLayer.bindPressed(mGridButtons[i + 8 * j], () -> slot.select());
443+
final HardwareButton clipButton = mGridButtons[i + 8 * j];
444+
mShiftLayer.bindPressed(clipButton, slot.launchWithOptionsAction("none", "continue_immediately"));
445+
mShiftLayer.bindReleased(clipButton, track.launchLastClipWithOptionsAction("none", "continue_immediately"));
444446
}
445447
}
448+
449+
for (int i = 0; i < 5; ++i)
450+
{
451+
final Scene scene = mSceneBank.getScene(i);
452+
mShiftLayer.bindPressed(mSceneButtons[i], scene.launchWithOptionsAction("none", "continue_immediately"));
453+
mShiftLayer.bindReleased(mSceneButtons[i], scene.launchLastClipWithOptionsAction("none", "continue_immediately"));
454+
}
446455
}
447456

448457
private void setLaunchQuantizationFromTrackSelect(final int x)
@@ -519,7 +528,7 @@ private void createUserLayers()
519528
{
520529
mUserLayers[userIndex] = new Layer(mLayers, "User-" + userIndex);
521530
for (int i = 0; i < 8; ++i)
522-
mUserLayers[userIndex].bind(mTopControlKnobs[i], mUserControls.getControl(i + mUserIndex * 8));
531+
mUserLayers[userIndex].bind(mTopControlKnobs[i], mUserControls.getControl(i + userIndex * 8));
523532
}
524533
}
525534

@@ -1560,23 +1569,27 @@ private void paintPads()
15601569
/*
15611570
* if (slot.isStopQueued().get()) { rgbLed.setBlinkType(RgbLed.BLINK_STOP_QUEUED);
15621571
* rgbLed.setBlinkColor(RgbLed.COLOR_STOPPING); } else
1563-
*/if (slot.isRecordingQueued().get())
1572+
*/
1573+
1574+
if (slot.isRecordingQueued().get())
15641575
{
15651576
rgbLed.setBlinkType(RGBLedState.BLINK_RECORD_QUEUED);
15661577
rgbLed.setBlinkColor(RGBLedState.COLOR_RECORDING);
15671578
}
15681579
else if (slot.isPlaybackQueued().get())
15691580
{
15701581
rgbLed.setBlinkType(RGBLedState.BLINK_PLAY_QUEUED);
1571-
rgbLed.setBlinkColor(RGBLedState.COLOR_PLAYING);
1582+
rgbLed.setBlinkColor(RGBLedState.COLOR_PLAYING_QUEUED);
15721583
}
15731584
else if (slot.isRecording().get())
15741585
{
1586+
rgbLed.setColor(RGBLedState.COLOR_NONE);
15751587
rgbLed.setBlinkType(RGBLedState.BLINK_ACTIVE);
15761588
rgbLed.setBlinkColor(RGBLedState.COLOR_RECORDING);
15771589
}
15781590
else if (slot.isPlaying().get())
15791591
{
1592+
rgbLed.setColor(RGBLedState.COLOR_NONE);
15801593
rgbLed.setBlinkType(RGBLedState.BLINK_ACTIVE);
15811594
rgbLed.setBlinkColor(RGBLedState.COLOR_PLAYING);
15821595
}

src/main/java/com/bitwig/extensions/controllers/akai/apc40_mkii/APC40MKIIControllerExtensionDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public UUID getId()
3939
@Override
4040
public int getRequiredAPIVersion()
4141
{
42-
return 11;
42+
return 17;
4343
}
4444

4545
@Override

src/main/java/com/bitwig/extensions/controllers/akai/apc40_mkii/RGBLedState.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,21 @@ class RGBLedState extends InternalHardwareLightState
2323

2424
public static final int COLOR_PLAYING = COLOR_GREEN;
2525

26+
public static final int COLOR_PLAYING_QUEUED = COLOR_YELLOW;
27+
2628
public static final int COLOR_STOPPING = COLOR_NONE;
2729

2830
public static final int COLOR_SCENE = COLOR_YELLOW;
2931

3032
public static final int BLINK_NONE = 0;
3133

32-
public static final int BLINK_PLAY_QUEUED = 12;
34+
public static final int BLINK_PLAY_QUEUED = 14;
3335

34-
public static final int BLINK_ACTIVE = 9;
36+
public static final int BLINK_ACTIVE = 10;
3537

36-
public static final int BLINK_RECORD_QUEUED = 12;
38+
public static final int BLINK_RECORD_QUEUED = 13;
3739

38-
public static final int BLINK_STOP_QUEUED = 12;
40+
public static final int BLINK_STOP_QUEUED = 13;
3941

4042
private static final Map<Integer, Integer> RGB_TO_COLOR_VALUE_MAP = new HashMap<>();
4143

src/main/java/com/bitwig/extensions/controllers/akai/mpk_mini_mk3/MpkMiniMk3ControllerExtension.java

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
public class MpkMiniMk3ControllerExtension extends ControllerExtension
2525
{
26+
static final boolean SHOW_KNOB_NAME = false;
27+
2628
public MpkMiniMk3ControllerExtension(
2729
final MpkMiniMk3ControllerExtensionDefinition definition,
2830
final ControllerHost host)
@@ -67,11 +69,15 @@ public void init()
6769
parameter.setIndication(true);
6870
parameter.markInterested();
6971
parameter.exists().markInterested();
70-
parameter.name().markInterested();
71-
parameter.name().addValueObserver(newValue -> {
72-
mShouldFlushSysex = true;
73-
getHost().requestFlush();
74-
});
72+
73+
if (SHOW_KNOB_NAME)
74+
{
75+
parameter.name().markInterested();
76+
parameter.name().addValueObserver(newValue -> {
77+
mShouldFlushSysex = true;
78+
getHost().requestFlush();
79+
});
80+
}
7581

7682
final String id = "K" + (i + 1);
7783

@@ -132,7 +138,6 @@ private void initHardwareControlPositions()
132138
surface.hardwareElementWithId("pad6").setBounds(90.25, 10.75, 28.5, 28.25);
133139
surface.hardwareElementWithId("pad7").setBounds(125.25, 10.75, 28.5, 28.25);
134140
surface.hardwareElementWithId("pad8").setBounds(160.5, 10.75, 28.5, 28.25);
135-
136141
}
137142

138143
@Override
@@ -152,22 +157,29 @@ public void flush()
152157
void sendSysex()
153158
{
154159
String sysexBitwig2 = "F0 47 7F 49 64 01 76 00 50 47 4D 3A 42 49 54 57 " // pG.Id.v.PGM:MPC.
155-
+ "49 47 00 00 00 00 00 00 09 01 00 04 00 00 04 01 " // ................
160+
+ "49 47 00 00 00 00 00 00 09 01 00";
161+
162+
sysexBitwig2 += String.format(" %02X", mOctave);
163+
164+
sysexBitwig2 += " 00 00 04 01 " // ................
156165
+ "00 00 03 00 78 00 00 00 00 02 01 01 24 00 10 25 " // ....x.......$..%
157166
+ "01 11 26 02 12 27 03 13 28 04 14 29 05 15 2A 06 " // ..&..'..(..)..*.
158167
+ "16 2B 07 17 2C 08 18 2D 09 19 2E 0A 1A 2F 0B 1B " // .+..,..-...../..
159168
+ "30 0C 1C 31 0D 1D 32 0E 1E 33 0F 1F ";
160169

161170
for (int i = 0; i < 8; ++i)
162171
{
163-
String name = "none - " + (i + 1);
164-
final RemoteControl parameter = mCursorRemoteControls.getParameter(i);
172+
String name = "K" + (i + 1);
165173

166-
if (parameter.exists().get())
174+
if (SHOW_KNOB_NAME)
167175
{
168-
final String paramName = parameter.name().get();
169-
if (!paramName.isBlank())
170-
name = paramName;
176+
final RemoteControl parameter = mCursorRemoteControls.getParameter(i);
177+
if (parameter.exists().get())
178+
{
179+
final String paramName = parameter.name().get();
180+
if (!paramName.isBlank())
181+
name = paramName;
182+
}
171183
}
172184

173185
sysexBitwig2 += configureKnob(70 + i, name);
@@ -209,4 +221,7 @@ String configureKnob(final int cc, final String name)
209221
private HardwareSurface mHardwareSurface;
210222

211223
private boolean mShouldFlushSysex = true;
224+
225+
// TODO: find out how to do octave tracking
226+
private int mOctave = 4;
212227
}

0 commit comments

Comments
 (0)