Home › Forums › General › Programming › 2 last things to get
- This topic has 7 replies, 3 voices, and was last updated 11 years, 1 month ago by zeoka.
-
AuthorPosts
-
March 19, 2013 at 10:12 am #7318
Hi
I’ve finish my panel and before upload it i need last things to make it fully functionnal :
-scriptNameToRun() : i’ve tried but i’m wrong with just scriptNameToRun(“filter01”)
i just want launch scripts in others (This is for my version 2 panel) .
-insert delays in my script “called after panel finished loading” to launch several dumps at startup .I will calculate the exact delay i need with viewing a dump sequence in reaper…
The command is “Timer ” ? How it works please ?
Thank you very much
March 19, 2013 at 10:30 am #7320I’m afraid i don’t understand point 1 at all ???
For timers have a look at the: DEMO – Component Transforms and Animation panel in the Panels directory of the Ctrlr installation, it shows how to use timers “delays”
March 19, 2013 at 8:16 pm #7343Hi Atom !
The point 1 is just calling others scripts in a script i’ve tried the command scriptNameToRun().
Do i need to use function ?
I see time from time DEMO panels.
In “toogleRotate” i see timers but i don’t understand why there is any temporal thing in the panel
I click on and have to click off to stop rotate . what ‘s the number values ?seconds?
Why the first timer has two values ? It’s confuse for me sorry because you work very much for our understanding
March 19, 2013 at 9:37 pm #7345Again i got nothing, maybe someone can re-translate this for me?
Calling a function in Lua is simple: http://www.lua.org/pil/6.html in Ctrlr, methods are functions, as you can clearly see in the editor.
As for the timer example i really can’t be more clear then that, you got a simple example just adjust it to your needs, change it break it, fix it.
March 19, 2013 at 11:17 pm #7350This example should answer both questions.
Script1 = function(modulator, newValue)
otherScript() -- this will run the contents of some other Lua script named "otherScript"
timer:setCallback (xx, Script1Callback) -- "xx" is a unique ID number you make, followed by the callback script you'd like to run after some delay defined next...
timer:startTimer(xx,1000) -- xx = ID number of callback above, will run 1000 ms after the contents of this "Script1" script (delay).
end
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
March 20, 2013 at 9:05 am #7357Ooooh Msepsis you’re a killa !
I’ve bad interpreted your initial post ! It was not a command but a “whatever name ”
Thank you very much i understand clearly now the timer doesn’t need to stop !
I’d a doubt with the ID but it’s clear now.
Last night i was lost in google and LUA world It was too much 🙂
Big up
March 28, 2013 at 6:01 pm #7648—
— Called when the panel has finished loading
—
SendSnapshots = function(mod, value)Send = panel:getModulatorByName(“Send Program”):getModulatorValue()
if Send == 1 then
timer:setCallback (1, Program)
timer:setCallback (2, Sound01)timer:startTimer(1,500)
Program()
timer:stoptTimer(1)
timer:startTimer(2,1000)
Sound01()
timer:stopTimer(2)end
end
That ‘s doing the job but…..
Problem : the timers don’t stop . I ‘ve created a loop….
Any idea ?
March 30, 2013 at 2:43 pm #7716Hello i’ve doing this, based on virus panel script :
SendSnapshots = function(mod, value)
Send = panel:getModulatorByName(“Send Program”):getModulatorValue()
if Send == 1 then
BLABLA(–get mods values and send midi message)
timer:setCallback (1, Sound01)
timer:startTimer(1,80)Sound01 = function(timerId)
timer:stopTimer(1)BLABLA(–get mods values and send midi message)
end
timer:setCallback (2, Sound02)
timer:startTimer(2,160)Sound02 = function(timerId)
timer:stopTimer(2)BLABLA(–get mods values and send midi message)
end
etc……
end
end
This is working as expected now but i’ve a callback error at startup
Please why ?
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.