Forum Replies Created
-
AuthorPosts
-
I’m using at the moment r1305 in standalone mode, so far without problems. No need to compile or so, just double click the dmg, double click the installer and drag Ctrlr to wherever you want it to live. I don’t use Logic, I’m using Digital Performer. At this/my stage of panel development it is not relevant which DAW. I have yet to discover though if an AU instance of my panel “to be” will actually work in Digital Performer. If I find problems I will post them, for sure π
You can of course use Ctrlr at the end for analyzing MIDI data, but (correct me if I’m wrong) MIDIOX (for windows) is also a great help for learning what is going on with MIDI in and out. For Mac I’m using Sysex Librarian, but that program is (only?) OK for getting sysex dumps.
OK. TIA!
Thanks! Do I have to wait until you have added that class or is there another way to get user input?
Thanks! I show the code here, so other forum members can also benefit.
function storePerformance()
if panel:getBootstrapState() then — avoid showing the dialog window at startup
return
end
inputPerformanceName() — calls the dialog window to input user text
mySysex = CtrlrMidiMessage({0xF0, 0xB0, 0x75, 0x00, 0x13, 0xF7})
panel:sendMidiMessageNow(mySysex)
end
——————————————————————-
function inputPerformanceName()
perfName = utils.askForTextInputWindow(“Performance Name”,””,”Grand Piano”,”New name:”,false,”OK”,”Cancel”)
pn = string.format(perfName)
console(pn)
end
Still my question how to know which button (OK or Cancel) is clicked. I try of course to find out myself, but it saves time if someone points me in the direction where to look π
Stille the same error (see attachment in message above). Probably I use the wrong parameters in ‘replaceWithData(…)’, but I don’t really understand what ‘bool replaceWithData(LFile&, MemoryBlock const&)’ or ‘bool replaceWithData(File const&,void const*,int)’Β means. I guess ‘bool‘ means the result is true or false, and ‘int‘ means the number of bytes in de data, but the rest?
Strange thing (at least to me) is also that this panel starts, when loaded, with a dialog window asking to save the file. When I cancel the panel is further loaded. My intention was to start saving (or loading) a file when a certain button is clicked.
The whole idea behind all this is that my device does allow to change the name of a what is called ‘performance’ (meaning a set of sounds and effect settings) but there is no way of retrieving this name (at least it is not documented AFAIK). So I want to save this changed name in a file and load (and show) it when needed.
Hopefully the right link:Β http://pastebin.com/VDMPkTKu
OK, code added to pastebin.com. (Expires after one day.) Title: ‘save/load data in CTRLR’. (I didn’t know this site, nice and handy, thanks!)
I have the feeling I’m still stumbling in the dark, or at best in the twilight zone π with Ctrlr. I don’t seem to get the hang of it, especially when I try to do real programming stuff. No problems when dealing with Lua scripting relating to knobs, sliders and MIDI. But for example this file saving and loading stuff is really frustrating me, because nowhere can I find information on how to write the right code lines. I used ‘replaceWithData’ but then I get an error message which to me looks like something from outer space ;-). See attached screen print.
Attachments:
You must be logged in to view attached files.OK, thanks for the quick reply! Maybe time to update the documentation that comes with the Win install of Ctrlr?
BTW, I did this in Win7. I tried this also in OSX. I started Ctrlr without any panel (trashed preferences first) and then opened this panel. Immediately (so not even showing my panel) it shows a Save file dialog window. I enter a name, click OK and Ctrlr crashes…
I have copied the example code written by atom in this thread. I have a button on my panel which calls function ‘test1’ and this function calls ‘saveToFile’ with the data from the example:
function test1()
saveToFile (CtrlrLuaMemoryBlock ({0x57, 0x48, 0x41, 0x54, 0x20, 0x57, 0x4f, 0x55, 0x4c, 0x44, 0x20, 0x4a, 0x4f, 0x48, 0x4e, 0x20, 0x4d, 0x43, 0x43, 0x4c, 0x41, 0x49, 0x4e, 0x20, 0x44, 0x4f, 0x3f}))
end
Β When executed it shows a dialog which asks for a filename to save (with extension ‘mww’). So far so good. But when I click OK I get ‘a nil value’ error. See attachedΒ screen print. What could be the problem?Attachments:
You must be logged in to view attached files.Yeah, I did use it. I have also ‘Programming in Lua’ by Roberto Ierusalimschy and ‘Beginning Lua Programming’ by Kurt Jung & Aaron Brown. So I start understanding Lua in general, but as always the devil is in the details… BTW (and sincerely not to offend you) but the authors of Lua like you to write Lua and not LUA, because the name refers to Lua meaning ‘moon’ Β and not to an acronym or so (http://www.lua.org/about.html).
Thanks again. I will study this documentation and hopefully it gives me a better understanding of Lua in Ctrlr!
Thanks for your reply, but sorry those links didn’t lead to an answer and maybe you over estimate the intelligence of my questions ;-). I’m just looking for information on using the right syntax for writing Lua scripts in/for Ctrlr. For example (again) the ‘convention’ for writing ‘utils.’ instead of Β ‘panel: CtrlrLuaUtils: etc.’ Β (or something similar) I did find in this case by searching the forum. If the information hadn’t been on this forum I guess I never had found the answer… Knowing where to look for these things may save me (and others?) a lot of time.
Maybe my question is not clear. So let me rephrase the question π Is the syntax of Lua for Ctrlr documented or is ‘utils.’ an exception?
Well, nowadays I’m not such an Apple Mac believer anymore, but because I originally started with (Digital) Performer for Mac (before they had a Windows version) as my main DAW I stick to Mac. Using both systems on one computer (I’m using VMWare Fusion to run Win7 and XP) Β has many advantages though, especially when developing/testing Panels and using/learning Lua. And don’t forget MIDI-OX (Windows only), which is great for analyzing all kinds of MIDI-messages.
You’re right, won’t make that mistake again. BTW more then 25 years ago some voice in the back of my head, maybe the DEVIL, told me to start using Apple products, mainly because (I BELIEVE) they were the first to provide a simple MIDI interface which one could connect to a Mac without any hassle π I still use it in my setup… See attached jpg.
Attachments:
You must be logged in to view attached files.This Demo crashes on my Mac with r1274 (OS 10.7.5). Works OK on Win7. Need the crash report?
Indeed a very good idea, especially to be able to add some explanation about a panel. Would this also be the place to upload a not yet perfect finished panel, so people can add comments or can help with further development?
About the name, as it is about development of panels, so a name should make that clear in a way: ‘Panel Β Development’ or maybe ‘Panel Home’ (a bit dull I admit) or ‘Panel Depot’ (a bit better?) π
-
AuthorPosts