New "LuaCATS" definition for the Renoise API

There (finally) is a really great Lua Language Server implementation available at https://luals.github.io/, along with extensions for VSCode and NeoVim, which makes editing Lua in general a lot easier.

To make it usable with the Renoise API, I’ve started converting the old Renoise API definitions to the LuaCATS format and published them here:

I’m also planning to add some very basic auto-completion and typing information to Renoise to make it easier to write new scripts.

It would be great to make this a community effort, so contributions are welcome!

15 Likes

Mh, does it mean Renoise will be able to detect code changes automatically?

Changes to main.lua file are already tracked when there’s a _AUTO_RELOAD_DEBUG definition.
See https://github.com/renoise/xrnx/blob/master/Documentation/Debugging.txt#L152

The type definitions won’t change anything here.

1 Like

Oh very nice, thx for the hint!

I once did something similar for vscode intellisense by scraping/reformatting the API docs. I am guessing this is the first step here too?

A lazy question to get a quick start and see if I understood it all:
Is this mainly for autocompletion, tooltips and possibly snippets eventually? The latter I would imagine to be quite powerful when learning the API.

EDIT: “LuaLS provides various features for Lua in code editors, such as autocompletion, type hovers, dynamic type checking, diagnostics and more”. It would be interesting to see what it can do in practice in addition to autocompletion/tooltips.

PS. I must say it would be a big leap to switch from the excellent native editor, given the issue with auto-reloading when editing ‘required’ files. But it might be worth it!

@taktik What you need in concrete?

As far i understand it right it is a comment type definition system for supporting intellisense, code suggestion and automatik codecompletation for Renoise LUA Scripting enviroment in VSCode? Is this correct? And you need help defining these comment types for existing Renoise LUA Functions right?

Yes, i could help you, but i dont have a Github account. That why i cannot fork your project. but i could download it as zip, do the job and could you give the overworked files via Discord. Is that ok for you? If so we should speak about sharing work, thats none of the files workenend from us both same time.

happy tracking :slight_smile:

Yes, exactly. Simply give it a try with the definitions which are already there renoise.app() in vscode.

I must say it would be a big leap to switch from the excellent native editor

I’ll try to integrate the most basic auto-complete and hover type info into the Renoise built in editor as well, but can’t promise anything here. We won’t be able to compete with vscode’s feature set, and actually should not even try to :slight_smile:

Yes. Rewriting the old docs to use the LuaCATS annotations is quite some work. Probably someone could try to writie a script which semi-converts the old annotations to the new ones. This needs to be manually edited afterwards then anyway.

See definitions/library/renoise/application.lua at main · renoise/definitions · GitHub for an example. I’ve manually converted (well, rewritten) this one already.

2 Likes

Can you meet me at Themes & Stuff Discord? There could we speak in german and via voice. Would be ease all.

happy tracking :slight_smile:

Some pointers that might save someone a minute or two when using Windows:

The .vscode folder should be in your tools’ folder (…xrnx/) and the settings.json file should be formatted like this with forward slashes in the path:

{
    "Lua.workspace.library": ["C:/downloaded_repos/definitions-main"]
}

Then “add folder to workspace” in a fresh window and select the folder of your tool. Start typing “renoise.app():”

luacats

4 Likes

This is pretty neat. I’ll see how I can contribute.

One more question here: If I update any other script (not main.lua), and then save main.lua again, without added changes to it, will the whole thing still reload after switching to Renoise GUI again?

I saw this when it was posted, and I began to wonder - is this how Renoise might get granular/wavetable functionality? Just askin’. Took another look, I’m probably just dreamin’.

@taktik Do you still need help mate? You dont react on my question. I cant fork your git repo because i dont have any Git Account anymore. But i could download the git repo and help converting the files and upload it to Discord for you?

Yes, exactly. But it would indeed be neat if Renoise would check if any lua file in the bundle got modified and not only the the main.lua file.

No sorry, this has nothing to do with granular/wavetable functionality in Renoise.

No sweat then. I’d like to keep the collaboration on github. It is easier for me to manage.

1 Like

@taktik Thanks for the clarification - I’ll keep on dreamin’ :smiley:

2 Likes

We plan on including some native renoise granular and crossfading wavetable instruments in the next renoise release :slight_smile:

To be clear, these will be utilizing the current capabilities of renoise - so it’s stuff we can already do now - but will allow for some nice sonic possibilities for renoise users without having to reinvent the wheel and do all the setup work

5 Likes

Neat!

What’s up with that granular synthesis and other crap.
Can’t you put anything together anymore?
Something that would have a head and a heel? :rofl:

here

2 Likes

Just sent a pull request with the remaining definitions!

1 Like

The entire API is now converted and ready for use. Thanks a bunch to @unless for the help!

See remaining TODOs at GitHub - renoise/definitions: LuaCATS definitions for the Renoise Lua API for what’s still missing.


This really makes Lua editing a joy. Would be great if you guys could help testing all this to fix errors or missing docs.

6 Likes