Sharing files among different tools?

I wrote some code for a custom OSC handler, a way to grab a send device on a track and alter the Receiver value. I stuck it in my GLobalOscActions.lua but I might also add it to a tool.

I wanted to be able to do the same thing using my Launchpad so I added code to a MIDI-handling tool I wrote.

The code for locating the tracks and altering the send device is the same in both. In cases like these I’d prefer to have a single file with that code and reference in the various tools that use it. Then if I fix a bug or otherwise change it I only have to do it in one place.

Is there a way to do this in Renoise?

I can think of some workarounds (e.g. use a local build tool to copy shared files to all the places it needs to be and then package stuff up) but was curiuos if there was a more Renoise way to do this.

Is there a way to do this in Renoise?

Sort of. You have something called a “library”, which is shared code you can include across your tools.

Quoting from our github page:

Here are Lua files you want to share with other tools and developers, aka Lua code that was made to be reused in multiple tools. !! Note: Distributed XRNX files should never rely on ANY external Libraries!! If your tools depends on a library, copy and paste this library locally into your tool before distributing it: make sure your distributed tools are always self-contained! The “Libraries” folder should only used temporarily for developers who are working with the trunk.

Also, libraries are included once when Renoise starts. So if you are used to tinkering with code while Renoise is open (“reload all tools” :slight_smile: ), well then this is really not so attractive.

Personally, I just symlink the files I need to keep everything in one place.