Home › Forums › General › Programming › There is a 'ctrlr for dummies'? i'm lost!
- This topic has 19 replies, 5 voices, and was last updated 7 years ago by human fly.
-
AuthorPosts
-
August 3, 2015 at 3:15 am #54033
Hi, i’m francesco
In these days i have spare time and i look into ctrlr.
I’m a web developer, i know php, css, html, javascript… there is something that I know i can use to start with ctrlr?For the first experiment i want to do a bit of panel design… starting from zero, i want to have 2 tabs…
Where to start?
Thanks!!August 3, 2015 at 4:05 am #54038We’re in the process of writing one
The Puppeteer
http://godlike.com.auAugust 3, 2015 at 4:23 am #54039Thanks!
i go to read…August 3, 2015 at 4:49 am #54040hey wow i have understand the tabs! thank you!
Now i wont to know if is possible change the aspect of the tabs, instead of tabs, make a buttons..August 3, 2015 at 5:49 am #54046Done with lua!!
August 3, 2015 at 5:57 am #54047sometimes i have a problem to select element (in this case the main container buld with tabs)… why?
August 3, 2015 at 6:00 am #54048ok, selection is possible via modulator list.
August 3, 2015 at 7:19 pm #54081for some reason, my lua doesn’t work…
i have a method like this
function BtnSlctVoice1(mod, value) panel:getComponent("VoicesTabs"):setProperty ("uiTabsCurrentTab", 0, false) panel:getComponent("BtnSlctVoice1"):setProperty ("componentDisabled", 1, false) panel:getComponent("BtnSlctVoice2"):setProperty ("componentDisabled", 0, false) panel:getComponent("BtnSlctVoice3"):setProperty ("componentDisabled", 0, false) panel:getComponent("BtnSlctVoice4"):setProperty ("componentDisabled", 0, false) end
when i click on the button, i have this error
At line [2]: [string "BtnSlctVoice1"] Error message: [string "BtnSlctVoice1"]:2: attempt to index a nil value
i use this code to make the button switch trough the tabs
August 3, 2015 at 7:30 pm #54082You must use panel:getModulatorByName(“modName”):getComponent():setProperty….
August 3, 2015 at 7:41 pm #54083i don’t understand…
someone can check my lua code?Attachments:
You must be logged in to view attached files.August 3, 2015 at 7:56 pm #54086The elements you put on the panel are modulators. So to get access to them, use panel:getModulatorByName(“VoiceTabs”):getComponent()…
not panel:getComponent(“VoiceTabs”)
August 3, 2015 at 8:09 pm #54087Thanks dasfaker… now i have another problem.. the panel does not open more .. … i don’t get any error, i try to load my test.panel or a previously saved version… but nothing happens..
August 3, 2015 at 8:58 pm #54091ok, i have redone from scratch and now works.
but, i have another question.my structure is composed by a main tab (with 2 tab)
inside one of this tab i have another tab with 4 tabs..now this 4 tabs are visible always, not only in one of the main tab container…
August 3, 2015 at 9:05 pm #54092Done!
August 3, 2015 at 9:16 pm #54093I had troubles opening the panel, and I think it’s because all your functions are changeTab = function(mod, value), in all the methods.
The name of the function must be the same as the method’s name, so for example, selectPerformance method must have function selectePerformance = function(mod, value).
August 3, 2015 at 9:39 pm #54095the code
selectePerformance = function(mod, value)
is the same as
function selectePerformance(mod, value) ?As a good practice, is better to use the tabs for the different section of the editor or using layers?
August 3, 2015 at 9:45 pm #54096I think I understood that the tabs are not containers, the elements are still hidden whit lua and the layers
August 3, 2015 at 10:16 pm #54099the code
selectePerformance = function(mod, value)
is the same as
function selectePerformance(mod, value) ?It’s not the same.
The first one is the function that is executed when a method is called.
For instance, in a modulator’s property “called when the modulator value changes”
you can create a method called “modValue”. This method must have a function called “modValue = function(mod, value)” that is executed every time the modulator change it’s value.The second one is for your own functions, for instance
function loadInitValues(argument1, argument2)
April 10, 2016 at 7:28 pm #68943You must use panel:getModulatorByName(“modName”):getComponent():setProperty….
Totaly correct. I have also adapted the Step by Step Guide.
This was a beginner’s mistake I did several months ago. Sorry for this.Since then, I’m following Atom’s advice to declare all modulators at panel load in order to avoid calling the panel:getModulatorByName(“modName”) method each time (can take time when you have a lot of modulators because Ctrlr has to scan a table for each name).
So, at panel load I use for example:modOsc1WaveLeft = panel:getModulatorByName("Osc1WaveLeft") modOsc1Pitch = panel:getModulatorByName("Osc1Pitch") ...
And in the different methods I just use:
modOsc1Pitch:getModulatorValue() modOsc1WaveLeft:getComponent():setEnabled(false) modOsc1WaveLeft:getComponent():setProperty...
Will explain that in the Step by Step guide 2.0
April 14, 2017 at 4:50 pm #71832hi, resurrecting this: you say ‘at panel load..’
do you mean ‘Called when panel has finished loading’ ?there are some other ‘panel’ entries there, i do not know
what to use. i think i should initialize my panel on
start-up to refresh views and called default values to
modulators – without sending any midi messages –so: are you saying that one should declare all the modulators
-or at least all that are mentioned in lua methods?- at startup,
ie: ‘when panel has finished loading’ ?
just declare, and end ?what about panel refresh/repaint? how does that work? what is
purpose of? -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.