Bitwig JS API Method Stubs2014-04-18T20:05:15+00:00Hey all, I'm currently in the process of working on a manual conversion of the Bitwig Control Surface Scripting API into javascript method stubs complete with JSDoc. If you're working on any controller scripts this should be super helpful to you!
I use JetBrains Webstorm for my controller development, and so by including these stubs as an external library I get full code-hinting/autocompletion for anything Bitwig related. This is insanely helpful if you're planning on developing some code for an unsupported controller. This is the kind of auto-completion I'm talking about:
http://i.imgur.com/q7m2425.gif
Here's what I've got so far. There's still quite a lot to do and I'd appreciate some help if anyone feels generous with their time but if not I'll keep plugging away at it!
trappar/bitwig-api-stubs on Github
Good luck with those controller scripts!trapparhttps://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=325394
Would it make sense to include the factory tools from Bitwig Studio\resources\controllers\api\ as well?
I was at first baffled where those commands like printMidi etc. "come from" and only found them by accident - they are very helpful, especially for Midi handling...
I would actually love to extend this library with things that re-occur a lot in each and every script...
(Sorry, thinking out loud here since I'm currently trying to wrap my head around the whole thing).
Cheers,
Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi UrbanFlow.art · Instagram · YouTube
i would say it its better to include the api folder from bitwig path,
because that way you actually can check their implementations
Also very helpful are the extension of the String object and some of int2hex from there
I just had my first session with Volker on the API and those functions will be better integrated/documented in the future. They probably will also be extended over time, so if you have something you think would fit in there and that you use all the time, we would be open for suggestions/submissions
Cheers,
Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi UrbanFlow.art · Instagram · YouTube
Yeah I intentionally left out the api folder since it's available in raw javascript. If I had included it in mine then when someone included my script they wouldn't be able to also include the actual api scripts without having conflicts. I should probably add a note to the readme or something though which makes that more clear.
As far as adding general purpose helpful functions, I think that should probably be done separately as well. I don't want to force anyone to use anything, so I'd rather leave this library clean of anything that doesn't exist in the actual Bitwig API.
I do think that's a great idea though. If you come up with any useful functionality, I'd recommend creating your own repository on github and posting links here. I realize that if you haven't done it before that might sound like a lot to do.. but it's a great learning experience! (and it's also not all that difficult )
Yeah, sorry if I was unclear there.
I'm working with the Bitwig Team on improving the API documentation, structure and usability.
Since I myself only stumbled over the api script folder by accident, I guess others have the same problem which is why I would like to make it (more) visible in the API docs.
And since this library is very useful and probably could become even more useful, I would invite everybody to add to it if you think you have an idea/function that should be in there for all to use.
Since the API is still in flux, it makes at this moment in time more sense to add smaller helper functions than larger structures.
Cheers,
Tom
P.S. I'm learning this on the go myself so feel free to point out any misconceptions I might carry.
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi UrbanFlow.art · Instagram · YouTube