akai apc key 25

RELATED
PRODUCTS
Bitwig Studio 5

Post

i just bought myself another midi controller (akai apc key 25), which i plan to use for live performances.. since there is no official script available for it, i started to code my own.. but, it's been a while since i did the pcr-300 script, and also, that one was much easier (no clip launcer, no lights to turn on/off).. i decided to start wth 'emulating' the ableton live script, and then, when (if?) i get that working, start tweaking it to my own liking..

i got the shift button, knob mode, and softkeys (the 8 buttons below the button grid) mode selection stuff working.. so i can now play an instrument with the keyboard, and use the knobs to control track volume, pan, sends and macro controls..

but, i'm struggling with the clip launcher.. i feel i'm stumbling around blindfolded, just trying things without actually knowing what's going on 'behind the scenes'..

it would (could?) make everything so much easier if someone could give me a little overview of what's needed to get a clip launcher coded, where in the documentation to look, what classes to examine, and so on.. some pointers to where i should start digging..

anybody?

- tor-helge

Post

Do you have any other controllers that already have scripts written for them? I found the best way to learn the scripting for bitwig was to pick apart a script that was already working.

If not, you can look into the framework4bitwig (google it) that mike and moss wrote. It's really a great starting point and has most of the underlying code written already so you just have to add your custom views.

Post

well, i want to understand the internals, what is actually happening behind the scenes, and why.. not just blindly copy some lines, and hope for the best :-/

that was what i meant with "stumbling around blindfolded, just trying things without actually knowing what's going on behind the scenes"

but.. i have been browsing the controller api, and thought something like this should work:

Code: Select all

const NUM_TRACKS = 8;
const NUM_SENDS = 3;
const NUM_SCENES = 5;

trackBank = host.createMainTrackBank(NUM_TRACKS,NUM_SENDS,NUM_SCENES);
clipLauncer = trackBank.getClipLauncherScenes();
clipLauncer.setIndication(true);
but i get an error:

Code: Select all

TypeError: Cannot find function setIndication in object com.bitwig.flt.control_surface.intention.sections.AbstractTrackBankSection$14@67910daa. (apckey25.control.js#172)
looks like i need a ClipLauncherSlots, not a ClipLauncerScenesOrSlots...
hmmm..

Post

tor.helge.skei wrote:well, i want to understand the internals, what is actually happening behind the scenes, and why.. not just blindly copy some lines, and hope for the best :-/

that was what i meant with "stumbling around blindfolded, just trying things without actually knowing what's going on behind the scenes"
yes, I understand that. I wasn't telling you to copy and paste, I was telling you to read the code that has been written and figure out how that code works. Then apply the same principles to your script. In my mind that's a much easier way of learning this api that shooting in the dark without looking at any examples.

Post

yeah.. thanks for trying to help.. but, i learn a lot better by first understanding the basic, the fundamentals, and _then_ look at examples.. i work and think more "bottom-up" than "top-down", hehe..

btw, i found that this:

Code: Select all

for (var i=0; i<NUM_TRACKS; i++) {
  var track = trackBank.getTrack(i);
  var clipLauncer = track.getClipLauncherSlots();
  clipLauncer.setIndication(true);
}
made the 8*5 grid/square appear on the screen!
so, there is a clip launcher per track?

Post

tor.helge.skei wrote:yeah.. thanks for trying to help.. but, i learn a lot better by first understanding the basic, the fundamentals, and _then_ look at examples.. i work and think more "bottom-up" than "top-down", hehe..

btw, i found that this:

Code: Select all

for (var i=0; i<NUM_TRACKS; i++) {
  var track = trackBank.getTrack(i);
  var clipLauncer = track.getClipLauncherSlots();
  clipLauncer.setIndication(true);
}
made the 8*5 grid/square appear on the screen!
so, there is a clip launcher per track?
Hmm, I'd have to look at the api (at work I can't) I honestly can't remember. You seem to be making good progress though, so I'm sure you'll get it :D . Good luck!

Post

well, well..

did a marathon learning/coding session yesterday, and got the script for akai apc key 25 close to finished.. it works almost exactly like how it does in ableton live:

https://www.youtube.com/watch?v=9yr7aeg354U
except for a couple of things..
  • the knobs are using "soft takeover" mode
  • i changed the device controls to macro controls
  • there's no cycling between sends (it only handles the first send)
  •  stop all clips only stops the clips inside the clip launcher window (the rectangle on the screen)
  • and, i haven't added the cursor buttons yet :-)
also, the code is a bit hackish at the moment - need to clean it up and refactor it a little.. but if you want to try it, here it is (preliminary version):

https://www.dropbox.com/s/advrdjrvxk3vk ... 5.zip?dl=0

i will add the few missing things, and then start tweaking it, add functionality (multiple pages, where the clip triggering is one of them), and change things so that it works well in a live/performance setting..

- tor-helge

Post

* added cursor buttons and scrolling clip launcher..
* 'stop all clips' actually stops all clips, not just the ones inside the clip launcher grid/matrix

https://www.dropbox.com/s/advrdjrvxk3vk ... 5.zip?dl=0

- th

Post

i wasn't really satisfied with how the apc key 25 script worked, so i rewrote it from scratch..
Image

* the four arrow buttons (bottom left) moves the clip launcher (the 8x5 grid on the screeen)

* the next four bottons ('knob ctrl') are momentary toggles.. you can adjust the volume, pan, send and macro parameters for the 8 tracks in the current clip launcher view, by holding the relevant button down, and tweak the knobs..

* the 5 'scene launch' buttons (column to the right) momentarily switches the 8 bottom buttons (arrows/knob ctrl) to track-specific functionality: stop clip, solo, rec arm, mute and select..

* 'stop all clips' have been repurposed as a 'lock' switch. press it while you hold either one of the 'knob ctrl' buttons, or one of the 'scene launch' buttons to lock that mode.. press it again, or select another mode to unlock..

* you can also hold 'shift' when you tweak a knob, to reset the value to its default..

* and finally, 'shift' + the 'scene launch' buttons, well, launch scenes..

i have a bunch of other ideas, and plan to add some more stuff to it.. but first i will try this setup for a while in 'real life', so i can get a better feeling for it.. maybe i need to swap some things around, or whatever..

and, btw, the knobs are still using "value scaling" takeover mode (like this). i might add the other two modes too, and have an option in the controller settings for it, but it will have to wait..

download: https://www.dropbox.com/s/advrdjrvxk3vk ... 5.zip?dl=0

- tor-helge

Post


Post

Hi tor.

Absolutely great work! I have hoping so much that someone would make an api for this little keyboard, it works so great with BWS. I think there was even a script floating about a while ago but I don't know what happened to it.

The speed with which you acheived your goal is impressive too. I looked at coding but I just don't have the right (any) brain for it. I dare say you have made a better script than Akai did for ableton!

Can I submit a feature request, which I am sure you are already considering (feels cheeky but here goes):

*This is one thing that Akai neglected from their own script which peeved a lot of people off: 'device select'. Would it be possible to impliment holding 'device' and then using the 'left' and 'right' arrow keys to move left and right through the devices. Perhaps even, and this is only an after-thought, with the addition of pressing 'shift' whilst holding 'device' when you are on a device that you would like to lock, similar to the akai40 mk2 ability?

Sorry if the ability to move left and right between devices is already there and I have missed it and again great work on this script!!

All the best,

Gfb.

Post

sorry for being so slow to answer... ben real busy :-/
first, thanks for the comments..
then, your feature request.. well, i have been planning to add a few different modes to the script, with the current setup being one of them.. maybe pressing 'shift' + 'stop all clips' (which i have re-purposed as a kind of 'lock' buton) to go into 'alternative mode', and then the 5 right-most (green) scene buttons selecting one of these modes.. for example step sequencer, device select/control, system/keys, etc.. i'll keep your suggestions in mind when i dive into that :-)
- tor-helge

Post

Hi Tor,

I looking to buy a APC Keys, good job on what you've done so far :tu:
I was hoping to have the functions that are in the bigger APC scripts where you can do many of the things you can do in push, are they in your script too?

Cheers

Post

Hello thanks for this very nice script. Is there a feature update available ?

Post

thanks for all nice comments and stuff..

a new version is almost here..

i have been testing the script in more "real-life" like situations, and tried to streamline it for live/performance use, and at the same time, add in as many features as i could.. i also encountered a few api bugs and problems on the way, that i had to work around.. and i also added a few things i think is pretty unique to this :-)

the script is becoming pretty big, with multiple pages and modes, so i think i might need to do another rewrite, but i'll post this version first, so that other people can try it out, and maybe come up with ideas and suggestions and stiff..

yesterday i was trying to write some kind of documentation, and also make a video to show what it can do..
will post it all pretty soon..

- tor-helge

Post Reply

Return to “Controller Scripting”