Novation SL MkII and Reaper (MIDIOSC bridge)

Home Forums General Programming Novation SL MkII and Reaper (MIDIOSC bridge)

Viewing 20 posts - 1 through 20 (of 35 total)
  • Author
    Posts
  • #70603
    fundorin
    Participant
      • Topics: 8
      • Replies: 66
      • Total: 74

      I’ve started this new thread to ask silly questions about my project and gather all knowledge in one place.
      The task is to be able to control Reaper with midi controller and get feedback from Reaper to the controller. Reaper can’t give midi feedback, so the panel will convert midi from SL to OSC and feed OSC to Reaper. Then, Ctrlr will take OSC feedback and send it back to SL to turn on LEDs and display info on LCD.

      #70605
      fundorin
      Participant
        • Topics: 8
        • Replies: 66
        • Total: 74

        Thx for your explanations, I see a bit better…
        – Based on user/fx/inst/mixer selection, I would set a variable so one knows at any time what is selected
        – Based on that variable, you could change all labels of the controls. When a contorl is modified, the corresponding OnChange Lua method will perform an if..then..elseif… to know what action to perform

        I’ve started this midi2osc bridge using oscii-bot, at first. Then, I’ve switched to Processing. Then, to VSTLua. Tried a bunch of other software (probably, every one) and got back to Ctrlr, cause it doesn’t scare me with programming scripts, as it did a year ago.
        So, I have half of the code ready to be transfered from script that was partially made in VSTLua to Ctrlr. Including four different modes.

        – LED ring behaviour: I’m not aware of the 6 possibilities. Do you mean for the same rotary button? If yes, then you need to build 6 images (each containing the same number of frames) and then I suppose you can switch the image resource according to the wished behaviour

        Yes, the same encoder. I’m defenitely going to switch images, if “tabless” tabs aren’t possible.
        This modes are available for encoder LEDs:

        I’ve also made a demo video long ago (better than pictures):

        – devices: I didn’t find a way to know if the smiley was happy or sad. I can only find if my synth is in the list

        What about setting your device as input and output after you found it in the list?
        It seems like I’ve seen something like this in Ctrlr source. It seems to be possible to do this with VstLua – https://dl.dropboxusercontent.com/u/8162257/nativemidi.lua, though I never tried. What about Ctrlr?

        P.S. I feel like I need to add a screenshot of my panel to this thread, in case someone else is interested. 😉

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

          Really cool! What are the things you would like help with (no promises…)?

          #70627
          fundorin
          Participant
            • Topics: 8
            • Replies: 66
            • Total: 74

            I have a couple of questions 😉

            1. How to change resource image of the modulator from script?

            2. How to set particular midi in and out from script, using getMidiDevicesList and/or modulator value?

            3. What is the code for “midi settings” window popup, in case that menu is hidden?

            4. How to add extra font for iuLCD modulator to replicate the one that is used for LCD by Novation?

            5. How to change icon of the standalone version? I’ve seen that this is possible in Snow Ed panel.

            6. How to handle double button presses with Lua script and how to differentiate them from single presses or holding the button?

            7. Is there a timer available in Ctrlr’s lua?

            P.S. More silly questions are coming! I wish there was Wiki for this type of questions.

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

              Yes it is a pain that there is no wiki and it is the reason I wrote my Step by Step guide (ongoing work on a 2.0 version with a lot of Lua explanations + memory blocks + timers + …). http://ctrlr.org/forums/topic/ctrlr-step-by-step-guide/

              1. I’ll check that one
              2. Don’t know
              3. Can you ask dasfaker? He is using that in his SnowEd panel I think but I don’t have the source. Maybe this is also done in other panels. Did you search the forum?
              4. You can add font as resource (as images) then use it in your panel. That’s the theory. I did it for my Pro2 panel and got issues and strange behavior so I decided NOT to do it but to provide the font separately when distributing the panel. People should install the font before using the panel and the font becomes an OS font.
              5. I guess you do that afterwards (Windows property)
              6. I think this is described in Juce API. I’m using a differentiation left/right and I’m pretty sure having seen single/double.
              7. Yes, there are. I’m using them in my Pro2 panel (Timers method containing all timers). You will also find examples in the forum.

              #70631
              fundorin
              Participant
                • Topics: 8
                • Replies: 66
                • Total: 74

                4. One can only use font from resources with uiLabel, but not with uiLCD. I’m having alignment issues, using uiLabel. I’ve made blue dots background to replicate SL’s LCD and can’t fit uiLabel properly, if characters number is less then 9 (9×8=72 as lcd is 72×2).

                5. Could you show me an example of how to use Juce API commands in Lua script? Would I be able to find the corresponding commands by myself in your DSI panel?

                I’ve read your guide, but it lacks of lua chapters, yet. The most important ones, as for me. Don’t you think it might be a good idea to create google docs document, so that selected forum members could edit your guide online?

                #70633
                dasfaker
                Keymaster
                  • Topics: 80
                  • Replies: 793
                  • Total: 873
                  • ★★★

                  What is the code for “midi settings” window popup, in case that menu is hidden?

                  There’s no code, it’s just a property of uiButtons, “Internal function this component should execute”

                  #70634
                  fundorin
                  Participant
                    • Topics: 8
                    • Replies: 66
                    • Total: 74

                    There’s no code, it’s just a property of uiButtons, “Internal function this component should execute”

                    Can’t find it. Is it “Link to PANEL property”?

                    #70635
                    dasfaker
                    Keymaster
                      • Topics: 80
                      • Replies: 793
                      • Total: 873
                      • ★★★

                      4. One can only use font from resources with uiLabel, but not with uiLCD. I’m having alignment issues, using uiLabel. I’ve made blue dots background to replicate SL’s LCD and can’t fit uiLabel properly, if characters number is less then 9 (9×8=72 as lcd is 72×2).

                      You’ll get into troubles, as Juce text is horizontally scaled always, monospaced fonts aren’t displayed correctly.

                      #70636
                      dasfaker
                      Keymaster
                        • Topics: 80
                        • Replies: 793
                        • Total: 873
                        • ★★★

                        In uiButtons, over “Component position and size”

                        #70637
                        fundorin
                        Participant
                          • Topics: 8
                          • Replies: 66
                          • Total: 74

                          You’ll get into troubles, as Juce text is horizontally scaled always, monospaced fonts aren’t displayed correctly.

                          I kinda solved this issue.

                          #70638
                          fundorin
                          Participant
                            • Topics: 8
                            • Replies: 66
                            • Total: 74

                            In uiButtons, over “Component position and size”

                            There’s no such option in uiImageButton, only in uiButton. How did you add midi jack image to the button? Or is it just placed below transparent uibutton?

                            #70639
                            atom
                            Keymaster
                              • Topics: 159
                              • Replies: 2945
                              • Total: 3104
                              • ★★★★★

                              I can add a font property to uiLCD i’m sure, as for JUCE’s font handling, i’m not touching that, i’m sure JUCE has done this much better then i would have ever done.

                              #70640
                              fundorin
                              Participant
                                • Topics: 8
                                • Replies: 66
                                • Total: 74

                                I can add a font property to uiLCD i’m sure, as for JUCE’s font handling, i’m not touching that, i’m sure JUCE has done this much better then i would have ever done.

                                No need to change JUCE’s font handling as I’ve already found out how to use monospaced font.
                                Font property for uiLCD would be nice, though I don’t understand the difference between uiLabel and uiLCD for now.
                                “Internal function this component should execute” option for uiImageButton would also be nice.

                                P.S. I’m waiting for OSC fixes in the new build more than anything else, so I can start working on the code, finally. As for me, everything else isn’t as important as properly working OSC subsystem.

                                #70641
                                atom
                                Keymaster
                                  • Topics: 159
                                  • Replies: 2945
                                  • Total: 3104
                                  • ★★★★★

                                  yeah i’m working on it, i need to make it right or ctrlr will crash, it’s an issue with pointers and type casting

                                  #70643
                                  atom
                                  Keymaster
                                    • Topics: 159
                                    • Replies: 2945
                                    • Total: 3104
                                    • ★★★★★

                                    i uploaded a new build for windows, this issue should be fixed now, however please see the DEMO – OSC panel for an example, you shouldn.t use the .s field to access strings, it’s all explained in the comments there.

                                    #70644
                                    fundorin
                                    Participant
                                      • Topics: 8
                                      • Replies: 66
                                      • Total: 74

                                      Thank you for the new version.
                                      Ctrlr crashes with demo panel and “pink log” only shows outgoing OSC from slider.

                                      From Reaper I call “Refresh control surface” action, which sends all necessary info to remote device via OSC (strings, numbers, floats).

                                      #70646
                                      fundorin
                                      Participant
                                        • Topics: 8
                                        • Replies: 66
                                        • Total: 74

                                        I see that you wrote in comments: “in lua we can’t use [] for strings”.
                                        In fact, I’ve succesfully used strings as table indexes with VSTLua and formatted them to my liking.

                                        #70647
                                        fundorin
                                        Participant
                                          • Topics: 8
                                          • Replies: 66
                                          • Total: 74

                                          I don’t get it. At some point I was able to get string names of the tracks with simple code:

                                          
                                          onOSCMessage = function(path, types, arguments)
                                          	console(path..' '..types)
                                          
                                          	if types == 's'then
                                          		value = tostring(arguments[0])
                                          	end
                                          
                                          	console(value)
                                          end
                                          

                                          But when I’ve tried to add floats and integers via elseif, Ctrlr crashed and now, after removing all elseif’s, Ctrlr still crashes with the above code.

                                          UPD. I’ve also found this comments:
                                          — +1 index since arguments is a 0 indexed array
                                          — and lua starts with 1
                                          Even if Lua starts with 1 by default, it can easily access table indexes under key “0”.
                                          “You can start an array at index 0, 1, or any other value: ” https://www.lua.org/pil/11.1.html

                                          #70649
                                          atom
                                          Keymaster
                                            • Topics: 159
                                            • Replies: 2945
                                            • Total: 3104
                                            • ★★★★★

                                            i don’t know what VSTLua is and the indexing of tables is something that’s in Lua, i make theese comments for other users so that they are aware of how this language works, this stuff can be done in many ways better/worse.

                                            As for Ctrlr crashing, i’ll investigate further

                                          Viewing 20 posts - 1 through 20 (of 35 total)
                                          • The forum ‘Programming’ is closed to new topics and replies.
                                          There is currently 0 users and 90 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