What Is An Api?


(.xrns) #1

for us who’re starting out with lua scripting in renoise, there are some concepts that many people seem to take for granted that everybody knows (or will look up), so here’s the first concept i’ll explore in this Beginner’s Lua Sandbox subforum:

http://en.wikipedia.org/wiki/Application_programming_interface

[b]

so from a beginner’s point of view, i expect that “Renoise Lua scripting API” is almost like a hardware MIDI controller’s interface

there’s room for creativity, but only within the physical limits that taktik and the other renoise developers have decided

for example, it seems that they have decided not to let us shut down the renoise application itself (the running instance in memory) through lua scripting commands

that’s part of the API design so to speak


Glossary
(rhowaldt) #2

for a bit of a sneak peek into more advanced territory, to get an idea of the limits of the API, this might be a useful subforum: https://forum.renoise.com/c/renoise-tool-development, and the API wishlist thread in particular: https://forum.renoise.com/t/the-api-wishlist-thread/29285


(rhowaldt) #3

also, see the Introduction.txt > “The XXX.API files in this documentation folder will list all available Lua
functions and classes that can be accessed from scripts in Renoise.”

so, it is as simple as that, right?


(danoise) #4

Yes, the various API’s in Renoise (song, application, osc, midi etc.) all serve to expose certain existing methods in Renoise.
When you access an API feature, the API is serving as an interface between your script and the compiled code in Renoise.

The API defines the expected/allowed values you can set from your script, so you don’t break (or should be able to) anything, even if you try to assign invalid, out of range values.
In such a case, the scripting module will return an error, but you shouldn’t be able to cause Renoise to crash.

When a number of different API’s exists, this is because each one cover a specific area, but they are all accessible at any time.


(rhowaldt) #5

thanks danoise, that was a really good and thorough explanation.