How to really get all slots of a device?

Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,
I try to get the slot device chain of a device.
The only way I found for this is:

Code: Select all

cursorDevice.addSlotsObserver(function(on){
     cursorDeviceSlots = on;
});
To get the first device in the first slot of the cursorDevice i use:

Code: Select all

cursorDevice.selectFirstInSlot(cursorDeviceSlots);
The definition of addSlotsObserver says that the callback function gets a string array.
I found out that it actually gets a single string with only the name of the first slot!!!

When testing it with

Code: Select all

println(cursorDeviceSlots[1]);
I would expect to get the second device slot name of the cursorDevice (e.g. "SIDE" for the mid-side split device). But it prints the second character of the first slot name ("I").

What's wrong here?
Or is there a deicated method somewhere to get the device slot of a device? (just wondering that there is a DeviceSlot class but no method to get an DeviceSlot object)

Post

I don't have try it, but guess the answer from your result.

cursorDevice.addSlotsObserver(function(){
cursorDeviceSlots = arguments;
});

Post

Also the fact that 'cursorDeviceSlots[1]' is returning an 'I' means that cursorDeviceSlots is a string and you are accessing a character array.

I don't think I have used this observer but it seems you have a problem with how you are declaring your callback function.

Mike
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves

Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine

Post

jhorology wrote:I don't have try it, but guess the answer from your result.

cursorDevice.addSlotsObserver(function(){
cursorDeviceSlots = arguments;
});
Hey, thank you. That worked fine!
I also tried:
cursorDevice.addSlotsObserver(function(first, second){
println(first+", "+second);
});
-> prints "MID, SIDE" when I select the Mid-Side Split.
TeotiGraphix wrote:it seems you have a problem with how you are declaring your callback function.
Maybe I'm just not used to the js terms but "single string array" let me think of a single variable which contained multiple strings.
SlotsObserver.PNG
TeotiGraphix wrote:I don't think I have used this observer
Would really like to know: is there a proper way to get the slot device chain of a device? (I'm using cursorDevice->selectFirstInSlot ATM.)
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Controller Scripting”