Forum Replies Created
-
AuthorPosts
-
Hello Josh
1. Click on the canvas of your panel and add a component, an uiToggleButton to your canvas.
2. From dropdown menu go to: Panel -> Panel mode. Now you are in edit mode.
3. Click on your uiToggleButton to edit this button. Go to the item “called when the modulator value changes. When in the dropdown menu the item “propertyIDs/Names” is checked, you will not see “called when the modulator value changes”, but instead the technical property description “luaModulatorValueChange”.
On the left in this field you can see three icons. When the mouse is moving over them you can see that there is one to edit the selected method, one to remove the selected method and one to add a new method.
4. Click on this last one and fill in your chosen name for this new method. By instance: myDumpFromSynth.
On the far right of this field there are arrows to open the available methods. Choose myDumpFromSynth.
5. Now click on the “edit selected method” icon and the lua editor is opening showing you the bare bones of the selected method myDumpFromSynth.
BETWEEN the lines, the first beginning with “myDumpFromSynth = function” and the last one with only “end” you have to complete your method.
It should be something like this (this example is for a Roland synth):myDumpFromSynth = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source) mD = {} mD = CtrlrMidiMessage({0xF0, 0x41, 0x0F, 0x2B, 0x11, 0x00, 0x06, 0x00, 0x00, 0x01, 0x20, 0x59, 0xF7}) -- REQUEST PATCH MESSAGE panel:sendMidiMessageNow(mD) -- SENDS THE DUMP REQUEST MESSAGE end
After completing this step you open the lua editor drop down menu and click on “File –> save and compile all”.
Close the lua editor.6. Leave the edit mode in Ctrlr by clicking again on Panel -> Panel mode.
Go to the dropdown menu item “Tools” and click on “MIDI Monitor”. This will open this monitor. Go to the dropdown menu of this monitor and check in the menu item “View” three sub items: “monitor input”, “monitor output” and “show RAW data size”.
When clicking on your uiToggleButton you should see the incoming midi you requested. Otherwise there is something wrong with you sysex request in the myDumpFromSunth method.7. Go in edit mode and click on the withe canvas (not on a component). In the edit panel is an item “Called when a panel receives a midi message”. When in the dropdown menu the item “propertyIDs/Names” is checked, you will not see “Called when a panel receives a midi message”, but instead the technical property description “luaPanelMidiReceived”.
Here, you open a new method with the name “midiMessageReceived” according to the procedure described above.
So here you have to catch the midi flow your synth has sent. Between all the midi flows you can identify the right flow when you know its data size (you can read this size in the midi monitor as described above) or using some of its address bytes.
This method should be something like this:-- -- Called when a panel receives a midi message (does not need to match any modulator mask) -- @midi CtrlrMidiMessage object -- midiMessageReceived = function(midi) local s = midi:getSize() local Id1 = midi:getLuaData():getByte(5) local Id2 = midi:getLuaData():getByte(6) if s == 138 then --s = size if Id1 == 0x00 then -- first address byte if Id2 == 0x06 then -- second address byte mData1 = midi:getData() console (string.format ("size(dec.)=%d Id1(hex)=%x Id2(hex)=%x", s, Id1, Id2)) mData2 = midi:getData():getRange(0, 135) console(midi:getData():toString()) end --if Id2 end -- if Id1 end --if s end -- function
8. Some notes about the console:
8.1. From dropdown menu go to: Panel -> LUA console
8.2 Click on the bottom part of the Console
8.3 type console(“Hello world”)
8.4 The text “Hello world” should appear on the upper part of the Console.
8.5 If this works, you can try using console(“Any text”) in LUA code you use for your Panels.Cheers,
ThomasHi Jsh,
Some pointers:
For sending a modulator value using lua to an external midi device:
-first you have to make some lua code to catch the actual midivalue of the modulator that controls the portamento
-thereafter you have to make code to insert that value into the sysex formula your midi device understands
-and last but not least your code must continue with a structure to send this sysex to the right memory area in your midi device
All these steps are usually written in one lua code structure (a lua method).For receiving the actual midi value of a memory address in your midi device and to send its value to a ctrlr modulator:
you have to make a structure in lua to ask your device for sending the right sysex and then you have to make lua code to extract the value bytes out of this information and to send it to the modulator.It sounds quite complicated.
And yes it is.
But after studying some panels (all panels using lua have a lot of such structures), it will turn out to be mostly the same and therefore not that difficult.Thomas
- This reply was modified 3 years, 8 months ago by samoht.
@Dnaldoog:
Possemo made me think and that is why I can now understand your code 🙂It’s also possible that cc 28 handles mdi values -127 to 0 (7bits) and cc60 handles 0 to 127 (also 7 bits)
In this case, both cc’s are 7 bits. So there has te be then a constructor that is switching both CC’s at 0How can I add a slider as above (256 res MSB/LSB) with a value of -127 to +127?
Currently I have tried adding ” / 64″ to the modulatorvalue and value but it does not seem to have any effect on the displayed values.
In the panel of the slider there is a field where you can set the minimum value of the slider (you have set it to -127) and another field where you can set the maximum value (you have to set it to 127).
In the field where the modulator value is calculated from incoming midi you have to add -127
In the field where the midi value is calculated from the modulator value you have to add +127
This all assuming your real midi values are going from 0 to 254Behind the “a” that follows the word “for” , there have to be rectangular brackets surrounding i.
I am unable to show these in code in WordPressAlso is it possible to show the values inside the center of the circle rather than below/above etc?
I don’t think so. Maybe using Lua but that will be complicated.
- This reply was modified 3 years, 8 months ago by samoht.
How can I add a slider as above (256 res MSB/LSB) with a value of -127 to +127?
This topic has been discussed many times in this forum. You can use the search function (keywords: offset displayed values) Also you can study the documentation about expressions in Ctrlr. It is under the topic “documentation” of this website.
Is it possible to change the text size for the button text (independently)? And/or the text size for all modulators specifically (by font size/number) rather than with a knob?
Yes, there is a knob in the panel of each component that looks like a mini-modulator and that will do what you are asking for.
- This reply was modified 3 years, 8 months ago by samoht.
a={} for i=1 , 512 do a = "block"..i.."=()" end for k,v in ipairs(a) do print (v) end
a={} for i=1 , 512 do a = "block"..i.."=()" end
a[9] –> block9=()
I was talking to Atom about that the other day and his creation (…)He has no problem with people creating panels and making money by selling them
.
Really?
I know, some time ago, he was begging here on the forum for some money so he could buy an old Apple to give some support for that platform . So far I know, the response in the forum was not that great. Unless there are many silent benefactors.
Nevertheless he feels really good when people are paying licenses for Juce to make money with panels made with his free software, used by them, while he in vain is begging for an old apple to give some support for this free software?
He must be a really self-denying man.
An example for the forum.I’m not sure, but maybe Steinberg vst sdk plugin is also part of Ctrlr. Licence:
Lua licence:
Lua is free software distributed under the terms of the MIT license reproduced here. Lua may be used for any purpose, including commercial purposes, at absolutely no cost. No paperwork, no royalties, no GNU-like “copyleft” restrictions, either. Just download it and use it.
The spirit of the Lua license is that you are free to use Lua for any purpose at no cost without having to ask us. The only requirement is that if you do use Lua, then you should give us credit by including the copyright notice somewhere in your product or its documentation. A nice, but optional, way to give us further credit is to include a Lua logo and a link to our site in a web page for your product.
I would add here, that those who take money for ther panels (which is allowed by Roman and probably somewhat legal) should think about what Ctrlr in fact is (…)
In my opinion, it is important to be aware of all licenses, certainly not to forget the Juce license:
The core JUCE modules (juce_audio_basics, juce_audio_devices, juce_blocks_basics, juce_core and juce_events) are permissively licensed under the terms of the ISC license. Other modules are covered by a GPL/Commercial license.
Yes, the day may come that ctrlr stops working. Would be a shame indeed. But there will always be vm’s. Or that might be the day to take the plunge and do the same thing in juce itself. Or Hise.
Even worse, the day will come that we ourself will stop working in this world, but that’s not quite the point.
Ctrlr is open source software and it is for free. You cannot blame Atom for a lack of love for this project: he is the only one who is contributing to its development, and this not only in the past: the last public build is dated may 2020.
I suppose most of us do not have the skills to contribute, but maybe some of us lack also the idealism to give for free some of their skills, of their time, of their heart for the sake of all men, for those without skills, without money, for the good men and for those who have a long way to go to become the best person they can be.July 26, 2020 at 10:33 pm in reply to: Native Linux file dialogs fixed in newer Zenity version #119291Hi dreamer
I’ve not yet tried to build Ctrlr myself. So far I’m using the precompiled stable version.
Of course I am interested in this topic.Currently, however, another problem is on my mind. I was thinking about a way to work around the Zenity problems with utils.saveFileWindow ()
As for linux I am puzzling about the use of the linux command line program ‘amidi’ in Lua using os.execute or io.popen (and of course resulting in specific Linux versions of the panels created in this way)
For a newbie to Lua and Ctrlr, it’s not that easy to figure out all these problems. Nevertheless it supports the learning process. But some help is of course always welcome.July 22, 2020 at 11:16 pm in reply to: Native Linux file dialogs fixed in newer Zenity version #119232Hello Martin,
hello Dreamer,I’ve been testing fedora 32 with ctrlr stable.
I had to disable the os native file open/save requester since enabling this option did freeze the gui.
The most weird thing is that utils.saveFileWindow() had to be set to true (sic!) to avoid a crash when trying to write.Now the good news:
when disabling the os native file open/save requester, en when setting utils.saveFileWindow() to true, there are no crashes when writing files and the gui does not freeze when opening or saving a file. So almost all goes fine, except, when closing and restarting Ctrlr after saving a file using utils.saveFileWindow(), the save requester opens again without demand, but, merciful, after clicking cancel, Ctrlr loads as expected, no crashes.July 20, 2020 at 6:03 pm in reply to: Native Linux file dialogs fixed in newer Zenity version #119209Hi Martin,
Thank you for reporting.
I am considering to give Fedora 33 a try.
Are there any specialties to know when building Ctrlr under Fedora?Hi xerhard,
Also similar problems in the Kaos distribution (KDE based as name suggests, and and as a whole updated to very recent packages).
Mouse problems in the gui,
file = utils.saveFileWindow, even set to false, has the weird effect that the data can be written, but that Ctrlr always crashes after a restart of Ctrlr (immediately after the restart opening a save requester and then when clicking cancel or save the crash occurs).
- This reply was modified 3 years, 9 months ago by samoht.
Just to complete Donaldoogs excellent code to prevent you to loose debugging time as I (newbie to Lua and Ctrlr) did:
t = {} — as I found you have to declare the Lua table first (otherwise Ctrlr crashes)
local offset,t=8,{}
local sizeOfData=midi:getData():getSize()-1
local result=sizeOfData-offset
midi:getData():getRange(offset,result):toLuaTable(t)for i,v in ipairs (t) do
console(String(i..”,”..v))
end -
AuthorPosts