Forum Replies Created
-
AuthorPosts
-
April 1, 2016 at 1:54 pm in reply to: Is it possible to prevent running the OnModulatorValueChange method? #68795
Thx! Simple…
I’ll use that if nobody (Atom…) comes with a Ctrlr built-in way of doing thisApril 1, 2016 at 11:01 am in reply to: How to make the difference between single click and double click on a uiListbox #68791As often, found it by myself after more than one hour searching (and trying to understand) in Juce API and Ctrlr classes.
As there was nothing on the forum about this, I’m posting the result here.In a OnMouseDown method, the second arg is event. You can use it as follows:
console("Click at X="..tostring(event.x)) console("Click at Y="..tostring(event.y)) if event.mods:isLeftButtonDown() then console("Left button pressed") end if event.mods:isRightButtonDown() then console("Right button pressed") end
Several other tests are available. Look at https://www.juce.com/doc/classModifierKeys
Pro2 librarian on its way 🙂
Hi, could you be more precise on what you try to achieve? Read sysex? write sysex? Simulate with rotary buttons?
If the latter then you can have one uiImageSlider modulator building the first message then use an OnValueChange method to adjust the potential values of the second uiImageSlider modulator.
Then with a third uiImageButton modulator you build and send your sysex message.
But I don’t know if this is what you want to achieve…April 1, 2016 at 9:03 am in reply to: How to make the difference between single click and double click on a uiListbox #68789Hi Carl!
Thx, I have indeed been thinking to this solution (classical programming one, as I’m doing 🙂 ) and I’ll use it if I don’t get an answer.
However, as we have the event object as variable, I suppose it is also exposing the different event types. I will look at this today. Must be hidden somewhere in the Juce documentation, I guess.Complementary request to above question:
In fact, I would like to track right-click versus left-click in the OnMouseDown method (or more precisely for WhenItemIsClicked method of an uiListBox)v1.3 published (different corrections)
I’ll include a librarian in the 2.0 as I’m doing that for the Pro2 panelYes.
Have a look at my Ctrlr step by step guideFound my mistake: two methods with the same name… grrrr…
So, the only issue remaining is the OnMouseDown event on a combo.
(I have also a question about differentiating single click and double click on a listbox but I create another post for that)
Hi again, Atom.
I made further investigation by building a separate panel (attached) as I thought it could be connected to the usage of Tabs.
Initially it was not working for the Listbox but suddenly (I don’t know why – this is not good as it still doesn’t work on my Pro2 panel) it worked.
It is not working for Combo indeed.Attachments:
You must be logged in to view attached files.Here is an example of Carl’s method to send data
function sendProgramDataDump(bank_number, patch_number) -- This variable stops index issues during panel bootup if panel:getRestoreState() == true or panel:getProgramState() == true then return end console("creating midi message...") MsgPrefix = "f0 01 23 02" -- This prefix send a Program data dump. This method is destructive : destination patch will be overwritten MsgSuffix = "f7" -- specify bank and patch number destination PatchBankHex = string.format("%.2x", bank_number) PatchNumberHex = string.format("%.2x", patch_number) PatchData = table.concat(PatchDataValuesTable, " ", 5, 443) MsgComplete = MsgPrefix.." "..PatchBankHex.." "..PatchNumberHex.." "..PatchData.." "..MsgSuffix panel:sendMidiMessageNow(CtrlrMidiMessage(MsgComplete)) console ("Program Data Dump sent to Prophet08") end
Use the same philosophy but use utils.packDsiData function for the PatchData…
Be patient, it will come after a few weeks…One way to do this (btw, I haven’t yet done it myself 😉 at the momennt I’m focusing on Reading messages) is to create a panel and put a uiImageButton on it. Set it to Momentary instead of normal so it will act as a push button.
Then open the Lua Editor and create methods as I explained above.
Attach the LoadProgram method to your button. It will remove the not necessary data and unpack the actual dump (you need to adapt the sizes to your Alesis case).
Then once you can read a file, you can try writing one.
As I said, look at Carl’s panel (Power08) or at the Virus panel made by dasfaker.
Good luck!Thx in advance Atom.
Sorry for the confusion above, I mixed uiCombo and uiLIstBox but there is the same issue (apparently).
I’m using Ctrlr on PC, version 5.3.186 (can also test on 5.3.174 that I have on another PC)-
I have a listbox containing patch names. I’d like to populate a uiLabel with the SelectedItem when the OnClick event would occur “Called when Item is clicked”.
To test, I have a simple OnClick method doing console(“Hello world”)
It doesn’t say Hello…-
I have tested the same with the “Called when a mouse is down on this component” and it is the same. No Hello…
-
Somewhere else, I’m using uiCombos. I wanted to display some help text when the user click on the label. I used the “Called when a mouse is down on this component” without success.
For this issue I found a workaround which is to put a uiLable on top of the label of the uiCombo and this is working fine…If not sufficiently clear, I can send you the panel in dev via message…
Thx again…Is it the same for a Listbox?
Can someone test and confirm?If confirmed, Atom, can you please remove all the not working properties? This is confusing and in fact frustrating (you imagine that something is working, prepare abd build it and then you are stuck…). Thanks in advance (great work with Ctrlr!)
Should this be the case then I suppose that the only way of working will the one illustrated in your DEMO – LISTBOX panel; I mean using separate buttons to retrieve the selected row. Right?
Another question: is there a way to code something in Juce and make that code working from Ctrlr? Sorry for maybe stupid question but I don’t understand how all the combination Juce-CTRLR is working (is there an explanation somewhere?)
Sorry, didn’t see your replies…
isPanelReady is a method as:-- -- Check if the panel is not busy to load or receiving a program -- isPanelReady = function() if panel:getBootstrapState() == false and panel:getProgramState() == false then return (true) else return (false) end end
Create a method that you call Miscellaneous and put the function inside it after deleting everything.
PanelLoaded is a separate method on his own in which I’m setting variables for all modulators. Atom explained in a post that it was the most efficient. If you use getModulatorByName, the system as to scan a table containing all modulators to find it. If the one you search is at the end, it will take time. Hence the PanelLoaded.
You need to select your panel and set the property “Called when the panel has finsihed loading” to PanelLoaded.
Good luck…
Hi,
saw your message in the chat… good that you put a post.
It looks like it is the same as DSI packing/unpacking.
Atom built some routine for that.
Otherwise you can also do as Carl did for the P08 panel.Here is what I’m doing…
Load method:
-- Called when a modulator value changes -- @modulator http://ctrlr.org/api/class_ctrlr_modulator.html -- @modValue new numeric value of the modulator -- LoadProgram = function(modulator, modValue) -- No action if the panel is in bootstrap or program states if not isPanelReady() then return end f = utils.openFileWindow ("Load Pro2 packed program dump", File(""), "*.syx", true) if f:existsAsFile() then Pro2PackedProgramData = MemoryBlock() f:loadFileAsData(Pro2PackedProgramData) FileSize = Pro2PackedProgramData:getSize() if FileSize == 1178 then --console("Loading DSI Pro 2 sysex program dump file...") bLoadingProgram = true -- Adapt LCD txtCurrentValue:getComponent():setPropertyString ("uiLabelText", "LOADING...") iBank = Pro2PackedProgramData:getByte(04)+1 if iBank<4 then txtBank:getComponent():setPropertyString ("uiLabelText", "U"..iBank) else txtBank:getComponent():setPropertyString ("uiLabelText", "F"..iBank) end modBank:setValue(iBank, true) LastBank = txtBank:getComponent():getProperty("uiLabelText") LastProgram = Pro2PackedProgramData:getByte(05)+1 txtProgram:getComponent():setPropertyString ("uiLabelText", "P"..LastProgram) modProgram:setValue(LastProgram+1, true) txtSavedValue:getComponent():setPropertyString ("uiLabelText", LastBank.." P"..LastProgram) LoadedProgramData = utils.unpackDsiData(Pro2PackedProgramData:getRange(6,1171)) FileSize = LoadedProgramData:getSize() --console("..Unpacked size is "..FileSize) if FileSize == 1024 then LoadProgramData(LoadedProgramData) end -- Starting a timer to reset bLoadingProgram to false after that all modulators have processed their OnChange function timer:setCallback (1, timerCallback) timer:startTimer(1, 200) else utils.warnWindow ("Load Pro2 packed program dump", "Invalid file") end end end
isPanelReady() is simply
-- -- Check if the panel is not busy to load or receiving a program -- isPanelReady = function() if panel:getBootstrapState() == false and panel:getProgramState() == false then return (true) else return (false) end end
LoadProgramData is like:
-- -- Set all modulators according to program parameters -- @LoadedProgramData MemoryBlock -- LoadProgramData = function(LoadedProgramData) -- No action if the panel is in bootstrap or program states if not isPanelReady() then return end -- *** Main *** txtProgramName:getComponent():setPropertyString ("uiLabelText", LoadedProgramData:getRange(378,20):toString()) -- *** Oscillators and Filters *** -- Oscillator 1 modOsc1Sync:setValue(LoadedProgramData:getByte(52), true) modOsc1Pitch:setValue(LoadedProgramData:getByte(0), true) modOsc1FineTune:setValue(LoadedProgramData:getByte(4), true) ... end
Packing will use the same philosophy but with the method utils.packDsiData
Good luck!
Yep but I don’t understand what means “taken by Juce”.
Isn’t it possible to program something?Anyway, my workaround works nice (except that Ctrlr is messing Send to Front and Send to Back – the last selected component is at the front even if pushed back… – so the trick is to secure that you move the label to the front and that you don’t touch the uiCombo before saving).
Any answer? Can this be corrected?
At the moment, I found a “bad” workaround that consists in adding a transparent empty uiLabel on top of the uiCombo label and handling the OnClick event.
As I have a lot of uiCombos, I would definitively prefered having this corrected.
All common properties between modulators/components should work in the same way…In general, when using a specific font for a panel, how to secure that a user of the panel sees things in the right way with the good font? Is it needed to provide the font file and ask the user to install it on his PC?
For example for the Pro2 panel I’m busy to build, I use Neo Sans Std which is corresponding to actual font used on the physical synth.Thx dasfaker and Possemo!
It works great! This will allow me to have only one method instead of several (one by type of parameter).Possemo, for your patch name handling, I wonder if it would not be simpler to use Lua table and/or Memoryblock getRange methods…
Any help? Thx
Thx for the explanations!
I was just curious about what it was. I’m using Lua and Midi messages for sending patches. So I’ll probably not be using snapshots… -
AuthorPosts