AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
I'm just starting out. I'm interested in getting device parameter settings fora track. I'm wrapping my head around how to do this with the async nature,
four callbacks per parameter, and the limitation of having to call
markInterested or add...Observer in the init() method. I don't understand how
to get a handle on let's say a track the user hasn't created yet.
I have had success following around the user's mouse clicks, track/device
selections, and parameter settings with this...
Code: Select all (#)
public void init() {
final ControllerHost host = getHost();
final CursorTrack track = host.createCursorTrack("track", "track", 0, 0, true);
final PinnableCursorDevice device = track.createCursorDevice("device", "device", 0, CursorDeviceFollowMode.FOLLOW_SELECTION);
track.name().markInterested();
device.name().markInterested();
device.addDirectParameterIdObserver(ids -> {});
device.addDirectParameterNameObserver(2048, (id, name) -> {
host.println(
String.format("param name %s %s %s %s", track.name().get(),
device.name().get(), id, name));
});
device.addDirectParameterNormalizedValueObserver((id, value) -> {
host.println(
String.format("param norm %s %s %s %s", track.name().get(),
device.name().get(), id, value));
});
}
Code: Select all (#)
param name track 1 Humanize CONTENTS/TIME Time Range
param name track 1 Humanize CONTENTS/VELOCITY Velocity Range
param name track 1 Humanize CONTENTS/CHANCE Note Chance
...
param name track 1 Drum Machine CONTENTS/MASTER_VOLUME Master Volume
param norm track 1 Drum Machine CONTENTS/MASTER_VOLUME 0.0
...
param name track 1 EQ-2 CONTENTS/LO_GAIN Lo Gain
param name track 1 EQ-2 CONTENTS/LO_FREQ Lo Freq
...
param norm track 1 EQ-2 CONTENTS/LO_GAIN 0.3604651162790698
param norm track 1 EQ-2 CONTENTS/LO_FREQ 0.2528114845985827
...
param name track 2 Velocity Curve CONTENTS/X1 Middle Velocity Input
param name track 2 Velocity Curve CONTENTS/Y0 Minimum Velocity Output
...
param norm track 2 Velocity Curve CONTENTS/X1 0.6487603305785123
param norm track 2 Velocity Curve CONTENTS/Y0 0.49504950495049516
...
param name Master Peak Limiter CONTENTS/CEILING Ceiling
param name Master Peak Limiter CONTENTS/GAIN Input Gain
...
param norm Master Peak Limiter CONTENTS/CEILING 0.9916666666666667
param norm Master Peak Limiter CONTENTS/GAIN 0.5
...
the user clicks is this...
Code: Select all (#)
final DeviceBank bank = track.createDeviceBank(2048);
bank.itemCount().markInterested();
track.name().addValueObserver(name -> {
for (int i = 0; i < bank.itemCount().get(); i++) {
final Device d = bank.getItemAt(i);
d.addDirectParameterNormalizedValueObserver((id, value) -> {
host.println(String.format("(bank) param norm %s %s %s %s",
track.name().get(), device.name().get(), id, value));
});
}
});
Code: Select all (#)
This can only be called during driver initialization
vGz: This can only be called during driver initialization
at XCG.eg(SourceFile:396)
at com.bitwig.flt.control_surface.proxy.ControlSurfaceObject.checkIsInitializingDriver(SourceFile:295)
at com.bitwig.flt.control_surface.proxy.DeviceProxy.addDirectParameterNormalizedValueObserver(SourceFile:1751)
at com.jalopymusic.println.PrintlnExtension.lambda$init$1(PrintlnExtension.java:29)
selected, but get parameter names and values for all devices on the track.
