Storing a table of tables in renoise.tool().preferences

How can I store a table of tables in a tools preferences?

The table looks like this:
{
“Minor” = { 1, 1, 3, 4, 4 … etc },
“Major” = { 1, 1, 3, 5, 6 … etc },
etc…
}

How do i format it such that’s it’s recovered upon each launch?

Do I need a DocumentList containing DocumentNumberLists?

Also if this table is not present in the tools preferences I’d like to load in a list of default values… (already stored in a table)… Is this possible?

Cheers,
Tristan

I’m not sure how to that but as long as you don’t want user defined scales you could just store them in a separate lua file called scales.lua and then put require “scales” at the start of you main.lua

The preferences file is xml so there is probably a different way to create nested data structures in that.

Nice suggestion but I am after user defined scales I’m afraid. It allows for the tool I’m writing to be used for fancy inversions etc.

think I’m nearly there now!

Have a glance at this tool:

I store stuff in preset files.

Awesome vV… think i’ll use precisely this method!

Trying to get the things recovered as part of the tool preferences really started to do my head in!

I think you can’t; bit sad as it’s getting written out to xml, a format that makes this kind of recursion/hierarchy really easy and human-readable.

Just keep one thing in mind:create a custom preset folder somewhere outside your tool-folder to keep your custom presets safe from deletion:
If people update a tool, the complete tool folder gets erased before being installed with new contents. Contents that were custom put there will be erased as well.
The tool i pointed to does it, but i have another tool which didn’t at first.