api v1 vs v2

Post Reply New Topic
RELATED
PRODUCTS

Post

hi!
i just received my newest controller, an akai apc40 mk2, and i need to make a tailor-made script for it for some upcoming live shows.. i haven't coded scripts for a long time, not since just after bitwig v1 (i think).. how much has changed in the api since then? is it still based on adding observers for everything you want to know about? what is the markInterested() methods for? anything (else) that has changed that i need to keep in mind?

Post

update...

ok, i tried jo just jump into it, and use my older scripts as a starting point..

i made this little script:

Code: Select all

loadAPI(1);
println("hello world!");
host.defineController("Skei","APC40mk2","1.0","91e2eae2-5f56-49c8-9c72-780341ffc751");
host.defineMidiPorts(1,1);
host.getMidiInPort(0).setMidiCallback(onMidi);
host.getMidiInPort(0).setSysexCallback(onSysex);

function init() {
  println("init");
}

function exit() {
  println("exit");
}

function flush() {
  println("flush");
}

function onMidi(status, data1, data2) {
  printMidi(status,data1,data2);
}

function onSysex(data) {
  printSysex(data);
}
and put it in /home/skei/Bitwig Studio/Controller Scripts
(this path is selected in Settings/Locations/My Controller Scripts)

started bitwig, opened the Controller Script Console, and saw that "hello world!" were printed.. so i assumed the script was being found and loaded by bitwig..

then i went on to select the script, but, nope.. no script in the dropdown menu..

Image

argh..
what now?

Post

last update for now.. something is fishy.. some caching issues, perhaps? btw: this is/was in linux..

i made a new directory called "skei" in "/opt/bitwig-studio/resources/controllers", and let it be empty.. the original script is in "/home/skei/Bitwig Studio/Controller Scripts/Skei"

now, the script suddenly appeared in the menu, and i can select it, and it seems to work.. i deleted the directory i just made, and things still work..

Post

ok, i'll figure it out myself, then.. :-/

Post

This forum seriously sucks in terms of helping fellow developers.

Post Reply

Return to “Controller Scripting”