Forum Replies Created
-
AuthorPosts
-
Thanks for your patience atom.
I would now like to ask you, I have not found any way to get a list of files in a folder.
I was trying out the functions of the library "os" the LUA, but again I think that it is not present.
This time I tried it with a blank panel … ” title=”Smile” />
or can I use something else?ok sorry, now I understand why.
"table", in another of my methods, had been reassigned, and since the variables are propagated, it pointed to it, not to the original function of the library.so my mistake, not a bug, sorry for the inconvenience
an advice for all the fools like me
I think that for safety you should not name the "table" with the name, table, or it will reassign another function to it.possible dependence of some framework 3.5 or 4?
” title=”Sad” />
I’m on Win7 x64ideas about what I could do to understand why it does not work on my system?
this or as your I get this
[code:1zh8ch0v]>>> t = { 3,2,5,1,4 }
table.sort (t, function(a,b) return a<b end)
console (table.concat(t, ", "))
ERROR: [string "t = { 3,2,5,1,4 }..."]:2: attempt to call field ‘sort’ (a nil value)[/code:1zh8ch0v]This is the error I get
[code:vcbxvife]ERROR: [string "t = { 3,2,5,1,4 }..."]:2: attempt to call field ‘sort’ (a nil value)[/code:vcbxvife]maybe I forgot to specify that I use the WINDOWS version
tested on both the 32bit and the 64bit"Tronic":25ajj46r wrote:I was unable to have the ability to manage the table, with the functions sort, insert, and so on.
[/quote:25ajj46r]
added this to bug list [LINK][/url:25ajj46r]this code works well for me, even if I press cancel,
but the large files, passed to the console output, freeze CTRLR.
instead seems to load fine without assigning them to the console output.
buffer console too small?@dasfaker
thanks, it works
I had not thought about this possibility.atom I confirm that I was unable to have the ability to manage the table, with the functions sort, insert, and so on.
I take this opportunity to ask another question:
how to prevent a lua function is executed when you start the application?
I have assigned the lua function to the modulator, it is immediately executed when the application starts.I could not resist to understand how we could do, and that is the function in LUA
I hope it will be useful[code:1sjvtmtd]– @Tronic~2012
—
— Called when a modulator value changes
—function K3m_Sysex_Formula(modulator,value)
— Get modulator Value
modulator = panel:getModulatorByName("Synth-2")
value = modulator:getModulatorValue()— Binary Manipulation
if value < 0 then — Check if modulator value is negative
absvalue = value*-1 — Make value always positive
bin = CtrlrLuaBigInteger(absvalue) — Assign bin to class BigInteger
bin:setBit(7,true) — Set only one bit to 1
else
bin = CtrlrLuaBigInteger(value)
bin:setBit(7,false)
end— Split Byte to two separate Byte
msb = bin:getBitRangeAsInt(4,4) — Get only 4bit and make it integer
lsb = bin:getBitRangeAsInt(0,4)— Create & Send Sysex Message
sysex = CtrlrMidiMessage({0xF0,0x40,0x00,0x10,0x00,0x01,0x08,msb,lsb,0xF7})
panel:sendMidiMessageNow(sysex)— Debug
byte = bin:toString(2,
console (string.format("Value=%d Byte=%s msb=%02x lbs=%02x",value, byte, msb, lsb))end
[/code:1sjvtmtd]As always, thank you.
functions you posted work well.To pass data to the file to be saved, the only method I’ve found is = ‘data: loadFromHexString ("f0 00 f7")’
other options?another question, but the functions table.insert, table.remove, table.sort etc. are not present?
Then when ready will post my work.
need to split the value of the knob and MSB4bit LSB4bit
setting the maximum value to 24, and the minimum value at -24
with the formula
F0 40 00 10 00 01 04 ms ls F7
but unfortunately only works for the positive part
because for the negative part should be added only the first bit, so that it is negative,
but I do not know how to add only one bit to sysex byte.I had a look at the manual
http://soundprogramming.net/manuals/Kawai_K3_Manual.pdf – page 49
and it seems that you have set it correctly.
I believe that the center parameter is 7, not 0"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” />Thanks so much atom.
I’ll try to put down some code.Many 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 meI 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]"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.Thank 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. -
AuthorPosts