That sinking feeling that nothing is what it seems like the name means it is.

56 posts since 21 Nov, 2018

Post Fri Jul 30, 2021 3:09 pm

In software development, and computer science (the academic side) they often say that "Naming Things is One of the Hard Problems".

My initial few days of playing around with bitwig scripting and its amorphous and labyrinthine APIs, one wonders who (outside the bitwig core team) can figure out what the difference between these three different ways of launching a clip are, and what integer values mean in the context of any of these objects.

One could rather use a diagram, to sort out what a track, a track bank, a slot, a slot bank, and all these things even are.

Borrowing code from all over because one can't figure it out and then trying to puzzle out the weird results, surely there is a better way.

Code: Select all

// when do you want to directly call this:

// and when do you want to getChannel and then get clipLauncherSlots and launch from this?        
Are the integers going in there really absolute column numbers? Or some relative column based on some offset inherent in the trackBank.

One wonders why the API doesn't have transport.playClipAt(row,column). For the sake of keeping us sane.

Back to reading the shitty Java API DOCS that make NO SENSE. A Channel. What is a Channel. It has something to do with a track. What's a track and what's a track bank. DAW users can Guess what a Track is. It's probably one of those horizontal rows in the daw. Maybe?

User avatar
151 posts since 12 Apr, 2020

Post Fri Jul 30, 2021 4:40 pm

i know the feeling man.... but its just a matter of diving deep into the API concepts. Its not an open document model like ableton. its this controller model that is bitwig specific and you have to create many of the objects and observe/mark properties of those during the init().

Dive deep into it here... Moss has done a great job breaking it down. ... O3luQCFQR2

Careful in the documentation lots of things are depreciated. it needs some work. great to come here and ask questions :)

Some example of what you are trying to do... its Java but you should be able to translate to JavaScript...

init code...

Code: Select all

    Signal setting_do_me = host.getDocumentState().getSignalSetting("Do Me", "Status", "Do me");

    CursorTrack cursor_track = host.createCursorTrack("cursor track", "cursor track", 5,20, true);;

    track_bank = cursor_track.createSiblingsTrackBank(1, 4, 20, true, true);
    Track channel = track_bank.getItemAt(0);
    slot_bank = channel.clipLauncherSlotBank();
and the callback to launch slot...

Code: Select all

  private void doMe() {
    int   rand_int = (int) Math.floor(Math.random() * 4);
    host.println("slot_bank: " + rand_int);


Topic Starter

56 posts since 21 Nov, 2018

Post Sat Jul 31, 2021 11:42 am

Thanks! I really appreicate MOSS breaking all this down for us Mere Mortals! :-)

That's over 15 episodes so far and the playlist with them all is linked here ... 3%9Fgraber

204 posts since 18 Sep, 2020

Post Tue Aug 03, 2021 6:59 am

The API is of the less glamorous parts of Bitwig and there are many things to wonder, it's true. Once you get to know it it's not all terrible, though. Ask us questions here or on Discord, we've already gone through the anger phase. :)

I can't tell from your code snippet, but if you are doing it in JS then life does get significantly better with Java.

Return to “Controller Scripting”