Hello,
First of all, I want to say that I am new here, I have been using Ctrlr for a few months and this is my first comment in this forum. I would like to congratule the developers on their work and also all the people participating on this forum, through which I have been able to solve many of my doubts and problems about programming.
I am now finishing one panel, but I am unable to implement the last functionality for it, that is creating presets.
The panel controls a reverb processor. The reverb algorithm is composed of a number of parameters that are controlled by the panel. What I am trying to do is to save and load presets (the current value of the parameters in the panel), to make the users able to store their favorite algorithm´s configurations.
When using the panel, I store the values of the parameters in a table (array), so that the table contains all the values of the modulators that represent the parameters. (when a modulator changes its value, the table is updated).
Thus, I have thought that the best way to achieve this is to create an external file for each preset in which the table will be saved. A preset would be loading the panel with a particular table (values for the parameters)
My question is, how to create a file from a lua method, and how to read/write on it? I need a method in which a .txt (for example) file is created and written with the current table, and another one in which an existing file is read in order to update panel´s data.
I would be very grateful if anyone could help me with particular code to write/read/create a txt file from a lua method. Also, giving some examples of other panels doing this or suggestions about how to achieve it would be a great help.
Thank you!