I added an option to store presets to “preferences.xml” but I fail to properly access them. Next time I open tool it doesn’t see anything, although the xml is not empty.

local presets = renoise.Document.create("Presets"){}  
``` This shows "nil". So how can you access data?  
EDIT: OMG! Problem solved. I spent a lot of time and Renoise even crashed once but it turned out that the answer is short and simple. Just chooose another filename and it loads easily  

local presets = self:load_file(“Presets.xml”)

EDIT: It's not working again. Strange...

I’m sorry I missed the part about “load_from” loading only already existing properties. So to load a preset I have to create dummy tables in the beginning. Like that, right?

local presets = renoise.Document.create("Presets") {}  
for i = 1,6,1 do  
local preset_dummy = renoise.Document.create("Preset_"..tostring(i)) {  
name = "-",  
--other fake values  
presets:add_property("Preset_"..tostring(i), preset_dummy)  

And to store new preset I have to delete the fake one but I can`t.


returns error

So what should I do? This is so ridiculously complicated.

Finally! I got this. I guess the code should be

local presets = renoise.Document.create("Presets") {}  
local preset_ = {}  
for i = 1,6 do  
preset_["preset_"..i] = {}  
preset_[i] = renoise.Document.create("Preset_"..i) {   
is_used = false,  
--fake values  
presets:add_property("Preset_"..tostring(i), preset_[i])  

and ```
local function store_preset()
local new_preset = renoise.Document.create(“Preset_”…tostring(preset_index)) {
is_used = true,
–real values
presets:add_property(“Preset_”…tostring(preset_index), new_preset)