goodweather

Forum Replies Created

Viewing 20 posts - 321 through 340 (of 550 total)
  • Author
    Posts
  • in reply to: Lua Basics for Ctrlr – Beginners #71902
    goodweather
    Participant
      • Topics: 45
      • Replies: 550
      • Total: 595
      • ★★★

      You are not doing anything with the arg “value” so you can remove it.
      Are you sure count has a value?
      Insert under the local count= line a console output as:
      console(tostring(count))

      in reply to: How to get the mouse event object in any method? #71891
      goodweather
      Participant
        • Topics: 45
        • Replies: 550
        • Total: 595
        • ★★★

        I remember it took me some time to find and now I had to search again a bit 😉
        Ctrlr, Juce and Lua are requesting a lot of attention and reading 🙂

        So if you looked at the Juce MouseEvent class at https://www.juce.com/doc/classMouseEvent , you are very close…
        One of the parameters concerned by a mouse event is the class ModifierKeys (you can click on that word in the Mouse event page) and being on that page (https://www.juce.com/doc/classModifierKeys) you have the description of that class including its functions.
        There you will find all the different tests whereof isLeftButtonDown()

        Good that you raised this question. I will add a chapter on this in the Step by Step guide 2.0 (now I’m working on it).

        in reply to: How to get the mouse event object in any method? #71885
        goodweather
        Participant
          • Topics: 45
          • Replies: 550
          • Total: 595
          • ★★★

          Hi,
          there are different things to take into account…
          – you must create methods based on the different mouse event templates (componentLuaMouseDown, componentLuaMouseMove…) so you will get a first argument that is the component in focus and a second argument that is the event)
          – as you know, Ctrlr is based on Juce and you will thus find a lot of info on many things in the Juce documentation available at https://www.juce.com/doc/classes. For mouse event, for example it is at: https://www.juce.com/doc/classMouseEvent
          – you will also find the list of included Juce functions in the Ctrlr source code at https://sourceforge.net/p/ctrlrv4/code/HEAD/tree/nightly/Source/Lua/
          In the JuceClasses folder you can find for example LMouseEvent.cpp that lists the available mouse functions.

          So combining those 3 things and taking the time to read you will find and understand quite a lot. I learned Ctrlr like that without knowing anything about Juce…
          Then as usual, trial and error + other panels + atom’s DEMO panels.

          Example OnMouseMOve:

          — Called when the mouse moves over a component

          OnMouseMove = function(component,mouseEvent)

          mousePosition = string.format (“x=%d y=%d”, mouseEvent.x, mouseEvent.y)
          mousePositionX = mouseEvent.x
          mousePositionY = mouseEvent.y

          end

          Good luck and good reading 😉

          in reply to: Lua Basics for Ctrlr – Beginners #71879
          goodweather
          Participant
            • Topics: 45
            • Replies: 550
            • Total: 595
            • ★★★

            Yep and you can add a Visual Basic flavor as I’m doing in my code by indicating the type of variable in the variable name BUT don’t forget that variables in Lua do not have a type (Integer, float, string…).

            Examples:
            modCutOff as variable having a CutOff modulator assigned to it
            iBank as variable to indicate a bank number
            sBank as variable to indicate a bank name
            PatchInit()
            CutOff_OnChange()
            CutOff_OnClick()

            I’m doing this to remember what I used the variables for as I’m using most of the time global variables that are valid thru all methods (in opposition to local ones that are only valid in the current method) – you raised that question somewhere…

            Once again, not necessary but much more easier to read and maintain your code afterwards 🙂

            in reply to: Modulator and Component questions #71869
            goodweather
            Participant
              • Topics: 45
              • Replies: 550
              • Total: 595
              • ★★★

              Yep! Thx Mr.ToR 😉

              in reply to: Called when the panel has finished loading #71857
              goodweather
              Participant
                • Topics: 45
                • Replies: 550
                • Total: 595
                • ★★★

                Well, that’s the idea. You initialize the panel with the method called with that property “Called when the panel has finished loading“.

                What other things can happen? Well, basicaly anything you want (you are programming!)…
                Typicaly, initializing means defining variables, setting initial values, etc…

                Please note that I remember having had surprises with SetVisible not working well all the time or not initializing well and I used work arounds most of the time unless I was sure the method was working well.

                in reply to: Lua Basics for Ctrlr – Beginners #71856
                goodweather
                Participant
                  • Topics: 45
                  • Replies: 550
                  • Total: 595
                  • ★★★

                  Hi human fly, just following in diagonal your long posts…
                  Seems you are learning programming, learning Lua and learning Ctrlr at the same time…
                  Nice effort!

                  What are you trying to do?
                  I have now one week off and will attack the Step by step guide 2.0 (I know I said that since some time but sometimes I wish having 48 hrs a day).

                  The answer to a lot of your questions are in:
                  – lua.org web site
                  – Juce class index: https://www.juce.com/doc/classes
                  – Ctrlr code (end of .h files list the available functions and arguments) https://sourceforge.net/p/ctrlrv4/code/HEAD/tree/nightly/Source/
                  – the existing panels. For example for LEDs, look at my Pro2 panel. Take the image from your temp directory, use it in your panel with same frame size and copy the methods by securing also the assignments I’m doing with other methods).

                  in reply to: Modulator and Component questions #71855
                  goodweather
                  Participant
                    • Topics: 45
                    • Replies: 550
                    • Total: 595
                    • ★★★

                    Actualy, my question is from some time ago when I was discovering Ctrlr. I still don’t have the exact answer fro mAtom but we can say that a modulator is some kind of higher object having properties and that it contains a component which has also properties.
                    Atom defined different components with different properties.

                    So, you can see this as a way to handle a common layer of properties (the modulator) and a specific layer of properties depending on the component you use.

                    Maintenance wise, you only need to manage the modulator properties at one place.

                    This is my guess…

                    in reply to: Methods don't copy between Panels! #71742
                    goodweather
                    Participant
                      • Topics: 45
                      • Replies: 550
                      • Total: 595
                      • ★★★

                      For the moment, the only method I found was copy/paste… but I agree that this would be a great enhancement 🙂

                      in reply to: Trigger Button for UIimageButton ? #71724
                      goodweather
                      Participant
                        • Topics: 45
                        • Replies: 550
                        • Total: 595
                        • ★★★

                        OK. Then I can guide you…
                        – start Ctrlr
                        – open my panel and create a new panel or open yours
                        – select Panel – Lua editor
                        – Create a group Panel methods and a method Miscellaneous
                        – copy/paste the code from my method of the isPanelReady = function() in that method
                        – Compile the method and save your panel
                        – Create a method called Timers
                        – copy only the top of my Timers method (in case you will need a timer)

                        function timerCallback(timerId)

                        if timerId == 1 then
                        timer:stopTimer(timerId)
                        end
                        end
                        – Compile the method and save your panel
                        – create a button in your panel and look at what I did for example for the buttons in the Programs info tab
                        – you can take my image from the your_user/appdata/roaming/ctrlr/ some cryptic string folder. Each panel gets a temp folder where the current images are stored. One of those will contain my images…
                        – add the image as resource and check it is displayed
                        – save your panel
                        – to send Midi messages, look at RequestProgramDump under Midi methods group
                        – try sending something and check if your synth sees it
                        – if you need a timer, look at Juce to find which methods to use (I gave the link in the step by step guide)

                        Good luck!

                        in reply to: Trigger Button for UIimageButton ? #71719
                        goodweather
                        Participant
                          • Topics: 45
                          • Replies: 550
                          • Total: 595
                          • ★★★

                          Ha ok. You want to send a quick ON-OFF.
                          I have never done this but I can guess how to do it…
                          – I’m using uiImageButton with 2 frames (Led off – Led On). Values are False True
                          – Button mode = momentary
                          – Called when the modulator value changes: MyButton_OnChange (this is just my syntax, put whatever you want)
                          – in that method you could send 2 Midi messages after each other (Lua is very fast) or if needed send one message then start a timer and in that timer send the second message

                          Did you try that?

                          in reply to: Trigger Button for UIimageButton ? #71712
                          goodweather
                          Participant
                            • Topics: 45
                            • Replies: 550
                            • Total: 595
                            • ★★★

                            What do you exactly mean? This is already possible…

                            in reply to: DSI Pro 2 panel #71708
                            goodweather
                            Participant
                              • Topics: 45
                              • Replies: 550
                              • Total: 595
                              • ★★★

                              Version 1.00 published
                              First non beta version.
                              Compare button added
                              Programs info tab added
                              Manual adapted
                              http://ctrlr.org/dsi-pro2-editor-and-librarian/

                              In the pipe: make it VST, morphing between 2 programs…

                              in reply to: DSI Pro 2 panel #71694
                              goodweather
                              Participant
                                • Topics: 45
                                • Replies: 550
                                • Total: 595
                                • ★★★

                                Hi mosen, yes I coded the panel with NRPN as with CC you are far from covering whole Pro2 parameters.
                                I made a Pro2 editor and not a Pro2 controller for Ableton 😉
                                Now, OK…I didn’t know Ableton was limited to CC. I started using it but now i’m trying Studio One.

                                Please bear in mind that at the moment, I didn’t check the possibility to use the Pro2 panel as VST and I didn’t export it under VST format.
                                This is on my to-do list and will be done soon.

                                I’m now finalizing the v1.0 that will include Programs info and comparisons.
                                Started to look at morphing but will do the VST stuff in parallel.

                                I’ll add on my todo-list a limited CC based version of the editor (as VST).

                                Thx for the feedback!

                                in reply to: combo: how is value range set? #71563
                                goodweather
                                Participant
                                  • Topics: 45
                                  • Replies: 550
                                  • Total: 595
                                  • ★★★

                                  You need to play with the 2 last numbers in “Component position and size” and also with “Label width” (when the label is on the left side).
                                  Have a look on my Pro2 panel…

                                  in reply to: Ctrlr Manual Notes and Requests #71542
                                  goodweather
                                  Participant
                                    • Topics: 45
                                    • Replies: 550
                                    • Total: 595
                                    • ★★★

                                    Thx for the suggestion, I’ll take this in consideration.
                                    The big issue is that I’m just a user and guessing / experimenting as you.
                                    Only Atom knows the real meaning and behaviour of each property.
                                    Therefore, I’m writing the guide as a guide and not as a reference manual.
                                    Didn’t have time to work on it but I made the new structure for the 2.0 guide.

                                    Will restart working on it…

                                    in reply to: Issue with getModulatorValue #71417
                                    goodweather
                                    Participant
                                      • Topics: 45
                                      • Replies: 550
                                      • Total: 595
                                      • ★★★

                                      I have now done the same test during my lunch 🙂
                                      I answered a bit fast yesterday by following what you did…

                                      You need in fact to retrieve the value of the Components and not the Modulator!
                                      So, you should use the following code that works fine

                                      console(tostring(panel:getModulatorByName("typeRoom"):getComponent():getValue()))
                                      console(tostring(panel:getModulatorByName("typeHall"):getComponent():getValue()))

                                      In my panel, I do all panel:getModulatorByName(“name”) in a method called at panel load. This is more efficient when you have a large number of components (getModulatorByName is searching line by line in a table of all components so better doing this only once)

                                      So:

                                      modReverbRoom = panel:getModulatorByName("typeRoom")
                                      modReverbHall = panel:getModulatorByName("typeHall")

                                      Then in my code I just use

                                      console(tostring(modReverbRoom:getComponent():getValue()))
                                      console(tostring(modReverbHall:getComponent():getValue()))
                                      in reply to: Issue with getModulatorValue #71399
                                      goodweather
                                      Participant
                                        • Topics: 45
                                        • Replies: 550
                                        • Total: 595
                                        • ★★★

                                        Without looking further, I would advise you to reduce the size of this problem…
                                        In a new panel, create 2 uiToggleButton (I’m using uiImageButton – not sure it is the same but it works fine for On/Off things).

                                        In the console check you get the correct value:

                                        console(tostring(panel:getModulatorByName("typeRoom"):getModulatorValue()))
                                        console(tostring(panel:getModulatorByName("typeHall"):getModulatorValue()))

                                        Then group them as radio button and do the same check.

                                        in reply to: DSI Prophet 12 panel #71397
                                        goodweather
                                        Participant
                                          • Topics: 45
                                          • Replies: 550
                                          • Total: 595
                                          • ★★★

                                          Hi, I proposed to share the work with gearhound_nm (sent some details in PM but I didn’t get reply yet).
                                          I can adapt the panel but you need to give me data and input according to the instructions I will give you. THen you will also do the testing.
                                          I send you a PM with some details.

                                          in reply to: How to add new lua? #71379
                                          goodweather
                                          Participant
                                            • Topics: 45
                                            • Replies: 550
                                            • Total: 595
                                            • ★★★

                                            Hi human fly, please read and have a look at my Ctrlr Step by Step Guide.

                                            I started a v2 containing much more and better explanations based on my DSI Pro2 panel and a lot of Lua but don’t find the time to complete it yet. Will have to wait some business trips and long nights at the hotels…

                                          Viewing 20 posts - 321 through 340 (of 550 total)
                                          Ctrlr