Order of events when loading a panel

Home Forums General Programming Order of events when loading a panel

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #69020
    goodweather
    Participant
    • Topics: 45
    • Replies: 550
    • Total: 595
    • ★★★

    Hi,
    can someone (will most probably be you Atom 🙂 ) explain the order of events when opening a panel? It would be useful as a confirmation to me but also for beginners.
    Or connected question: what events are triggering the OnValueChange methods?
    Or other connected question: apparently all modulators positions are saved (how? where?) at panel close and restored at panel open. I think this is causing my problems (I prefer to start clean each time OR in the way I want). Is there a way to prevent this automatic restore of modulator values?

    My issue:

    • I have a PanelLoaded method used for Called when the panel has finished loading. It contains only modulator declarations like modOsc1Sync = panel:getModulatorByName("Osc1Sync") and initial settings of variables
    • I have a central isPanelReady function checking for BootStrapState and ProgramState
    • Each OnValueChange methods of modulators has a check for isPanelReady
    • Despite of this, the OnValueChange methods are executed when I open my panel and I don’t understand why…

    Temporary workaround I’m using: I set a timer at the end of PanelLoaded method and when the timer time elapse I have my correct welcome screen (instead of modulator changes informations).

    Thx for your help!

    #69037
    Possemo
    Participant
    • Topics: 14
    • Replies: 638
    • Total: 652
    • ★★★

    To prevent automatic restore of modulator events I can provide you a funny solution: when you insert enough modulators into the panel it breaks the “save all values” feature. They will have no value at all (resp. 0). I tried this the hard way on my SuperJX panel. I wanted to keep the vaules and did not know at which point I broke the feature so I reconstructed the panel from scratch – and it happened again at a specific number of modulators. But I did not count them, so I cannot say exactly how much modulators are needed. On the other hand – it did not broke on my Moog Source panel which has a lot of uiLabels but very few sliders. So I guess it needs a certain amount of sliders to break the feature.

    Just to say: a uiLabel has a modulator-value too even if it is not used for anything (it is always 0).

    • This reply was modified 6 years, 1 month ago by Possemo.
    #69040
    Possemo
    Participant
    • Topics: 14
    • Replies: 638
    • Total: 652
    • ★★★

    About your question “where are the vaules saved”: They are simply saved in the panel xml file. When you save a panel (instead of export) you get an xml file which you can look at. Each modulator has its values saved there (if it is not broken):

    modulator modulatorCustomIndex=”0″ modulatorCustomIndexGroup=”0″ modulatorIsStatic=”1″ name=”UpperToneName” modulatorVstExported=”0″ modulatorValue=”0″>
    …snip

    when it is broken, “modulatorValue=0” is gone.

    • This reply was modified 6 years, 1 month ago by Possemo.
    #69043
    goodweather
    Participant
    • Topics: 45
    • Replies: 550
    • Total: 595
    • ★★★

    Thx Possemo.
    I also searched further in the forum and found different topics about “statedata” allowing to save (on panel close) and restore data (on panel open) together with the panel. It is in ctrlr.settings file. Apparently the save/restore of all modulators changes can be disabled using the Preferences.
    I will explore this further.

    Ctrlr is a great tool but the lack of documentation is really a pain and I’m loosing a lot of time due to that. Having a forum is very good but not enough.
    We can see that people (me included) are asking things that have been somewhat replied/asked before. The problem is that the answers are not all the time complete and thus this pushes for re-asking the same…
    It’s the reason I’m completing my Step by Step guide bit by bit based on all basic things I need/read.

    #69044
    goodweather
    Participant
    • Topics: 45
    • Replies: 550
    • Total: 595
    • ★★★

    Hi again,
    well… I didn’t find In Preferences the ability to prevent a restore on panel open…

    What I also noticed is a difference of behaviour:

    • I save the panel, leave it open then close Ctrlr completely. When I restart Ctrlr, the panel opens fine and the last executed instructions are the ones from the timer I’m starting after my “PanelLoaded” method. Good (and I tend to put more and more in that timer to be sure to have exactly the displays I want, probably not the best idea but OK for now)
    • I save the panel, close the panel BUT leave Ctrlr open. When I re-open the panel, the display is messy (I have overlapping labels that are set visible/invisible acc. to situations. Here they are all visible) and the last executed instructions are from some OnChange methods, the current tab is absolutely not the one defined in PanelLoaded

    So, really confused about the order of events in those different situations but supposed to act in the same way…

    #69054
    Possemo
    Participant
    • Topics: 14
    • Replies: 638
    • Total: 652
    • ★★★

    your Step by Step guide is much appreciated. Ctrlr with Lua is very powerful and quite easy to understand if you know all the commands that are needed for a particular task. Well documented panels with a lot of comments in the Lua code would be very helpful as well for beginners.

    #69057
    goodweather
    Participant
    • Topics: 45
    • Replies: 550
    • Total: 595
    • ★★★

    Thx for your kind words, Poss!
    Yep, I’ll add a lot of Lua stuff into the 2.x version of the guide and in my panel I put a lot of comments as well.
    I know what to write, etc… Just a matter of priority and time.
    I think I’ll work on it during summer vacations or earlier if my Pro2 panel gets correct enough to be published (I’m now working on initial setup with stateData, Save and on the librarian)

    #85939
    KreditovichNof
    Participant
    • Topics: 0
    • Replies: 1
    • Total: 1

    где можно взять кредит

    взять кредит поручителей и справок[/url]

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Programming’ is closed to new topics and replies.
There is currently 0 users and 79 guests online
No users are currently active
Forum Statistics
Threads: 2,495, Posts: 17,374, Members: 77,605
Most users ever online was 12 on January 22, 2019 3:47 pm
Ctrlr