Home › Forums › General › Programming › Advice before starting the project.
- This topic has 54 replies, 3 voices, and was last updated 12 years, 3 months ago by atom.
-
AuthorPosts
-
December 27, 2011 at 8:23 am #521
With the LUA available, you could create a sort of presets section, saved to a file (in xml format?) for a group of parameters?
So my question specifically is, you can create arrays of internal parameters and manage them through the API to save and recall them?
My project should contain roughly 16 tab groups (Track), each with an almost 512 parameters divided into more section.
But for every track we would be available to more group, such as the synthesis, should have a list with 16 options,
each option brings up a summary to the hardware, with the default parameters when called,
I would like to know if there is a system to save only these parameters group in a file without creating a preset, the internal preset manager will contain all parameters globally.
Why should I be able to do with the various sections such as: synthesis, effects, etc. etc..Thank you for your attention, hoping that you can do it.
January 1, 2012 at 12:05 pm #3622” title=”Sad” /> any answer?
January 1, 2012 at 4:09 pm #3623Try to split up sections by layers and show them to users based on what they want to do. Try to avoid LUA as much as possible (programming is always a trap). I can’t really give you specific advice cause it’s hard to know what’s in your head. Ask questions as you go on with the project.
January 1, 2012 at 10:47 pm #3624Thank you for your attention.
What most interests me know and if you can have the opportunity to save a group of parameters in a separate file, in any format, "txt" or "xml" or whatever.
And have a function to retrieve them with a browser or a panel that will be a list.
Thank you and excuse me if I can not explain very well.January 2, 2012 at 12:14 pm #3625there is the modulator list option that can export to csv, html, xml but if you want to "import" it later then it’s not for you, why do you want to export/import parameters ?
January 2, 2012 at 5:10 pm #3626"atom":n1a2z13g wrote:there is the modulator list option that can export to csv, html, xml but if you want to "import" it later then it’s not for you, why do you want to export/import parameters ?[/quote:n1a2z13g]
I try to give an example of use.
My synth has internally different machines for the synthesis, a section fx, and a section lfo.
each machine has different parameters for synthesis, for example: start the sample, the end of the sample, etc..
then save to a file only the synthesis section, and then recall it, but without changing the fx section, or LFO, which would eventually even they can be saved in separate files, so you have the sub-patch, for each group of parameters.
So you do not have a patch only saved as a program, but you can load presets for example only the synthesis section.January 2, 2012 at 6:14 pm #3627create a separate panel for each section, each panel will have it’s own programs and a program manager. That’s the only way to do it at this point. It might be later possible to connect panels using LUA. If you create one panel all parameters defined in it will be saved at each program save.
January 2, 2012 at 11:52 pm #3628I had a look at API
You think I can realize the function in LUA using this class?
Or maybe I’m missing something.
[code:320u68zb]class CtrlrLuaXmlElement
class CtrlrLuaMemoryBlock
class CtrlrLuaFile
class CtrlrLuaUtils
File CtrlrLuaUtils::openFileWindow
File CtrlrLuaUtils::saveFileWindow[/code:320u68zb]January 3, 2012 at 2:41 am #3629Well you can write stuff to files and read from them, but Ctrlr can’t create/delete modulators on the fly from LUA at this time. You can save some data in files like wave dumps, program dumps, samples and re-load them, but not really any Ctrlr structures.
I think it’s better to create your parts in each layer have them loaded and just show the user the part they’re currently editing. Even if I’d let LUA do the stuff you are missing it would be very slow and almost impossible to control in terms of Ctrlr being a plugin. It’s something i would not do this way.
January 3, 2012 at 2:50 pm #3630Atom, could you give us an example of how to use OpenFileWindow? Everything I’ve tried give me errors.
ThxJanuary 3, 2012 at 3:24 pm #3631[code:3alwjkje]
f = utils.openFileWindow ("open file", File(""), "*.*", true)
console (f:getFullPathName())
[/code:3alwjkje]January 3, 2012 at 5:20 pm #3632Thanks Atom. I can open the file, but how I work with the data? I want to open a sysex file and send this data to the midiMessageReceived, but I don’t know how to access the file data.
January 3, 2012 at 10:34 pm #3633I made a type-o in the code so you need to wait for the latest nightly but the code that will work will be
[code:w7zg8hie]
f = utils.openFileWindow ("open file", File(""), "*.*", true)
data = f:loadFileAsData()
— data is a CtrlrLuaMemoryBlock with the contents of the file
console (data:toHexString(1))
[/code:w7zg8hie]January 4, 2012 at 12:28 pm #3634It works fine.
Great, Atom.@ Tronic: Sorry for hijacking your post.
January 4, 2012 at 12:31 pm #3635Many thanks Atom,
but in fact I did not think of this as an opportunity to dynamically create the controls,
but take only the values ​​of various modulators in a group, create an array with them and then save to a file.I was trying to use this API function but without success:
[code:3mmu0lrq]luabind::object getModulatorsWildcard (const std::string wildcardMatch, const bool ignoreCase=true)[/code:3mmu0lrq]
[i:3mmu0lrq]Get an array of modulators by their name, the name is matched agains a wildcard expression.
So for example .getModulatorsWildcard ("*DEF", true) would return all modulators with names ending with DEF This isn’t a full-blown regex though!
The only wildcard characters supported are "*" and "?".[/i:3mmu0lrq]so as to have the list of controls based on Wildcard option, and then assign to an array, take the values ​​of the modulators and pass them as data to the file.
If you do not steal too much time, and you think it is a reasonable option, you could have an example of how to do this?
@dasfaker
do not worry, because they are indeed useful things for meJanuary 4, 2012 at 2:04 pm #3636sure thing i’ll post an example asap
January 4, 2012 at 6:34 pm #3637Again i had to do a small fix but the code that will work with the next nightly:
[code:bc1r74k4]
>>> table = panel:getModulatorsWildcard("joe*", false)
>>> console (type(table))
userdata
>>> o = table:getObject()
>>> console (type(o))
table>>> for k,v in pairs(o) do
console ("table key="..k)
modulator = o[k]
if modulator ~= nil then
console (modulator:getLuaName())
end
endtable key=3
joe1
table key=4
joe0
table key=5
joe2
[/code:bc1r74k4]January 4, 2012 at 8:32 pm #3638Thanks so much atom.
I’ll try to put down some code.January 5, 2012 at 8:31 am #3639I’m trying to save a file, but I can’t make it work. I’m using this:
f = utils.saveFileWindow ("Save File", File(""), "*.syx", true)
but it give me an error.
I’m not sure if those commands are registered and how to put it down:
f:replaceFileContentWithData (data)
data = f:loadFileAsData()January 5, 2012 at 10:28 am #3640"dasfaker":282zxkzh wrote:I’m trying to save a file, but I can’t make it work. I’m using this:f = utils.saveFileWindow ("Save File", File(""), "*.syx", true)
but it give me an error.
I’m not sure if those commands are registered and how to put it down:
f:replaceFileContentWithData (data)
data = f:loadFileAsData()[/quote:282zxkzh]yes same here.
I looked at the source code:
file: CtrlrLuaUtils.cpp
[code:282zxkzh]CtrlrLuaFile CtrlrLuaUtils::saveFileWindow(const String &dialogBoxTitle, const File &initialFileOrDirectory, const String &filePatternsAllowed, bool useOSNativeDialogBox)
CtrlrLuaFile CtrlrLuaUtils::openFileWindow(const std::string &dialogBoxTitle, const File &initialFileOrDirectory, const std::string &filePatternsAllowed, bool useOSNativeDialogBox)
[/code:282zxkzh]
openFileWindow(const std::string[/color:282zxkzh] &dialogBoxTitle,
saveFileWindow(const String[/color:282zxkzh] &dialogBoxTitle,
:” title=”Question” /> -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.