Forum Replies Created
-
AuthorPosts
-
I posted on github this afternoon about the same (Send is not working since several months)… Thx atom!
Hi Peter, no panic there are some possibilities (cross-fingers)…
- you have probably your last good save (as for all dev work, it is good to often save
- make use of Save versioned that is saving a separate panel file with versioning info in the name. Be aware that you are staying in your current panel file
- go to your AppData/Roaming/Ctrlr directory. This is where the Ctrlr temp files are located but also the file Ctrlr.settings that Ctrlr is using when opening so that you retrieve your last situation. This is a text file in xml so you can visualize it in Notepad. Check for starting and end tags. <uiWindowManager/> indicates the end of the Ctrlr general state and just after you will find <panel name= that indicates the start of the panel data. It goes until the end where you see </panel> (this is of course the case when you leave Ctrlr with one or more panels still open in it). As it is text data, you should be able to take it, identify the method with the issue and remove the bad line. Try not touching the tags as it could make the file unreadable. An XML editor could also help but it is not mandatory
- Q2: I don’t know. You can load it as a resource (works with font and images, I don’t know for components). But you can also just create a uiCustomComponent and then put your code in many different methods related to it and that you activate with properties callbacks
- Q3: to re-use, the simple method I found was to do a copy/paste between the different panels. The only thing needed is to create the second method manually.
Good luck with your recover…
Here it is my friend…
I didn’t do it with a uiSlider but with a momentary uiImageButton “BankProceed” so you may have to adapt the situation and code.The philosophy of a timer is that it loops at a specific time interval until it is stopped (I have now a section on this in the coming Step by Step guide 2.0).
So, in the BankProceed_OnChange method linked to “Called when the mod value changes” property you start the timer and set the time interval (remember that I declared all my modulators at panel load to avoid calling getModulatorByName during processing):-- -- Called when a modulator value changes -- @mod http://ctrlr.org/api/class_ctrlr_modulator.html -- @value new numeric value of the modulator -- BankProceed_OnChange = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source) -- No action if the panel is in bootstrap or program states if not isPanelReady() then return end sSelectedBank = txtSelectedBank:getComponent():getProperty("uiLabelText") iAction=modBankAction:getComponent():getValue() if iAction == 1 then ... -- Receive bank from Pro2 (not possible with one command for the moment) elseif iAction == 4 then if sSelectedBank == "" then utils.warnWindow("Receive bank from Pro 2", "Error: you must have a bank selected to perform a Receive. Select a bank by left-clicking on its label then retry the Receive action.") return elseif sSelectedBank == "Disk 1" or sSelectedBank == "Disk 2" then utils.infoWindow("Receive bank from Pro 2", "Disk 1 and Disk 2 banks cannot be received from Pro 2...") return else if isPro2Ready() then mbTemp=MemoryBlock() bReceivingBank = true -- Receiving from Pro2 program by program; done with a 150ms loop timer iCounter = 0 modHideProgressBar:getComponent():setVisible(false) timer:setCallback (3, timerCallback) timer:startTimer(3, 150) else utils.warnWindow("Receive bank from Pro 2", "Warning: no connection to your Pro 2.\nClose the panel, Ctrlr and your Pro 2 then switch the Pro 2 ON, open Ctrlr and the panel in this order.\nBank not received from Pro 2...") end end end end
Then you have a separate Timers method that can contain a function timerCallback handling all your timers.
Each timer is refered to by a TimerId. In this case, I started Timer 4.-- -- All timer related functions -- function timerCallback(timerId) -- Load program timer if timerId == 1 then ... -- Send bank timer elseif timerId == 4 then sDestination = txtSelectedBank:getComponent():getProperty("uiLabelText") mbProgram = MemoryBlock() if sDestination == "User 1" then mbProgram = mbUser1:getRange(iCounter*1178, 1178) elseif sDestination == "User 2" then mbProgram = mbUser2:getRange(iCounter*1178, 1178) elseif sDestination == "User 3" then mbProgram = mbUser3:getRange(iCounter*1178, 1178) elseif sDestination == "User 4" then mbProgram = mbUser4:getRange(iCounter*1178, 1178) end msgProgram = CtrlrMidiMessage(mbProgram) panel:sendMidiMessageNow(msgProgram) iCounter = iCounter + 1 txtProgress:getComponent():setPropertyString("uiLabelText", tostring(iCounter+1).." %") modProgressBar:getComponent():setValue(iCounter,true) if iCounter == 99 then timer:stopTimer(timerId) iCounter = 0 modHideProgressBar:getComponent():setVisible(true) -- Loading a bank should not change the current program on the synth or the panel, so restoring previous buffer if LoadedProgramData ~= nil then --if string.sub(sLastBank,1,1)=="D" then mbTemp= MemoryBlock ({0xF0, 0x01, 0x2C, 0x03}) --else -- mbTemp = MemoryBlock ({0xF0, 0x01, 0x2C, 0x02, tonumber(string.sub(sLastBank,-1))-1, iLastProgram-1}) --end mbTemp:append(utils.packDsiData(LoadedProgramData)) mbTemp:append(MemoryBlock ({0xF7})) panel:sendMidiMessageNow (CtrlrMidiMessage(mbTemp)) utils.infoWindow("Send bank", sDestination.." bank sent to Pro 2 and previous buffer restored.\nBank and Program numbers may not be correct.\nYou may need to save the buffer into a user program...") else utils.infoWindow("Send bank", sDestination.." bank sent to Pro 2 but previous buffer could not be restored...") end end ... end
In my case, I need to load 99 programs.
Everything within “elseif timerId==4 then” is executed at each timer loop with the 150ms interval except when reaching the end (if iCounter==99) where I stop the timer loop and end the processing.Hope it will help you 🙂
Good! Not really what you initially described but good that you have your solution…
Not sure if the following may help you…
OnMouseUp seems only available for uiCustomComponent…
If the issue is to send a series of same messages with some time in between you can achieve this with a timer. I’m using this to send 99 programs of the same bank for example.
To have this working with mouse, you need to add a method in the “Called when mouse is down on this component” property. You use this OnMouseDown method then fire a timer that will perform the action at a specific time interval (same as above).If this is what you need, I can provide you some example of code…
Of course Possemo! I will publish it in .bpanelz.
As we are all learning by looking at each other’s panel, all panels should be published in an open way. This is also a recognition to the work done by atom in my opinion.
I’m busy with final testing of the librarian.A display is a uiGroup. Each element is a uiLabel that I call lblxxx when not changing and txtxxx when changing. I just change the uiLabelText property.
Pretty straightforward and I think quite flexible due to the coding…OK. I’m using a PC so can’t help you.
Best is to register a bug (under Development menu on ctrlr.org page)…OK. Thanks to both of you.
I have never used that because I’m solving it in a different (maybe easier?) way.
I’m always using uiImageSliders with some OnChange method. In that method I’m performing the transformation.
In your case Possemo, value = param – 128.
If special calculation then series of “elseif”…When I have special values, I’m still using uiImageSliders but with content as
Osc1+Osc2=0
Osc1=43
Osc2=85
which is indeed a series of fixed values…What are the typical usages for uiFixedSlider?
Somewhere isn’t this a contradiction? A slider (something moving) that is fixed…Hi, do you have the correct size for each frame in your image? What kind of image are you using (try with .png).
Good luck!Hi!
Yes this should work. I’m using similar code to display some help on the current tab…
You could also allocate your sysex to a single variable (msgTimbre for example) within each “if” then use sendMidiMessageNow outside at the end.
Anyway Lua is executed fast so this won’t make any difference…
Good luck!OK. When my Pro2 panel will be ready in standalone, for sure I’ll try the VST and I may face this issue…
Well…
It worked fine until I realized that I lost the bidirectional behaviour of my panel…The solution I found was to reset the Input devices at panel load and this is working fine (no double execution of MidiMessageReceived for one message and bidi is OK):
-- Reset Midi INPUT devices to avoid having MidiMessageReceived method called twice -- If resetting Controller devices then the bidirectional behaviour is lost (most probably a bug) sMidiDevices = panel:getProperty("panelMidiInputDevice") panel:setPropertyString("panelMidiInputDevice", "-- None") panel:setPropertyString("panelMidiInputDevice", sMidiDevices)
Hi guys,
I experienced the same on Ctrlr Standalone and on MidiMessageReceived.
Searching on the forum I found the workaround that consists in resetting the Midi devices on panel load. The proposal was to reset the Controller devices.
BUT this was then removing the bidirectional behaviour of my panel.The solution I found was to reset the Input devices at panel load and this is working fine:
-- Reset Midi INPUT devices to avoid having MidiMessageReceived method called twice -- If resetting Controller devices then the bidirectional behaviour is loss (most probably a bug) sMidiDevices = panel:getProperty("panelMidiInputDevice") panel:setPropertyString("panelMidiInputDevice", "-- None") panel:setPropertyString("panelMidiInputDevice", sMidiDevices)
So, maybe that you try resetting the Output devices instead to solve your send issue?
Easy but the sysex transmission is usually going so fast for single program that this is not needed…
It could be useful if you have to load a complete bank of sounds.I’m using a simple uiLabel modulator that I’m changing the text.
You have also utils.infoWindow() to confirm “Patch loaded”OK… I’m quite sure it is a bug…
Instead of using the workaround I mentioned when initiating the post (checking a few bytes), I did as daimondamps mentioned in its topic http://ctrlr.org/forums/topic/large-sysex-dump-problem/: resetting and restoring the Midi devices with PanelLoaded().
So, just add the following code in PanelLoaded() and midiMessageReceived() will be only executed once:
sDevices = panel:getProperty("panelMidiControllerDevice") panel:setPropertyString("panelMidiControllerDevice", "-- None") panel:setPropertyString("panelMidiControllerDevice", sDevices)
Works fine 🙂
June 22, 2016 at 8:42 pm in reply to: I need a way to send 4 non standard midi messages using one knob or combo box #69483You can also build your message as:
msg = string.format("F0 01 2C 06 F7") panel:sendMidiMessageNow(CtrlrMidiMessage(msg))
June 22, 2016 at 5:39 pm in reply to: I need a way to send 4 non standard midi messages using one knob or combo box #69480Then I see 2 options…
- create a uiImageSlider (if for example each effect can go from 0 to 127 or 255 or whatever) or a uiImageButton (if you prefer a switch)
- Option 1: create a “OnChange” method that you will attach to the “Called when modulator change” property. In that method you will insert the following code:
mbTemp= MemoryBlock ({0xF0, 0x01, 0x2C, 0x03}) -- Replace this with the first part of your sysex mbTemp:append(value) -- add this at the right position if the value is changing when you turn the knob mbTemp:append({0xF0, 0x01, 0x2C, 0x03}) -- Replace this with the end of your sysex panel:sendMidiMessageNow(CtrlrMidiMessage(mbTemp)) -- To send to your synth
- Option 2 (didn’t test this myself – search on the forum for example): at modulator level you can enter a sysex string in the Midi – Sysex formula property. I suppose there is a way to specific that one digit should be the current value of the modulator…
Good luck…
June 22, 2016 at 11:59 am in reply to: I need a way to send 4 non standard midi messages using one knob or combo box #69478Do you want to send all at once or each separately (for example having a button setting the value of each effect)?
I have the latter on my Pro 2…
Let me know and I explain you any of the option. Rather easy in fact… 🙂 -
AuthorPosts