modulatorMappedValue does it work like this?

Home Forums General Using Ctrlr modulatorMappedValue does it work like this?

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #69577
    Peter_EP
    Participant
      • Topics: 5
      • Replies: 19
      • Total: 24

      I have a sysex message to send that sets master “tune”, however the thing is not linear so I can’t use “modulatorValue” so I need to go via a look-up table, like this:

      Slider/Modulator Value to be sent
      -99…………………..45
      -50…………………..35
      0…………………….0
      +50………………….150
      +99…………………..257

      It’s mad I know, in the past I made a table (array) used the slider value to address the mapped value. I assume “modulatorMappedValue” will do this. My question is what code do I need?
      I can create a table thus:

      TuneLookupTable = function(modulator, numericModulatorValue)
      
      TuneValue = {}
      TuneLookUp[1] =45
      TuneLookUp[2] = 35
      TuneLookUp[3] = 0
      TuneLookUp[4] = 150
      
      numericModulatorValue = TuneLookUp [ numericModulatorValue ] <-!????
      return numericModulatorValue

      I’ve usege LUA to crate a method and put that table in there, I assume the “return” gets put into modulatorMappedvalue, but what about the value coming into the method? At the moment I have a big crash as I think I’m addressing some array “key” out of range, so I need to bring in from the modulator the value on the slider, which I though was numericModulatorValue, but I guess not as that is teh source of my crash.

      • This topic was modified 7 years, 9 months ago by Peter_EP.
      • This topic was modified 7 years, 9 months ago by Peter_EP.
      #69582
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        A table isn’t necessary. You can use a fixed slider and insert there the mapped values, in field “Slider content”. The format is:

        0 = mappedValue1
        1 = mappedValue2

        For negative numbers, maybe you will need to mess with expressions, there are several topics related:
        http://ctrlr.org/forums/topic/negative-values-in-hex-which-expression/
        http://ctrlr.org/forums/topic/korg-z1-negative-values/
        http://ctrlr.org/forums/topic/creating-a-slider-with-positive-and-negative-values/

        #69583
        Peter_EP
        Participant
          • Topics: 5
          • Replies: 19
          • Total: 24

          Thanks for the tip but… where do I find “slider content” field? I’ve looked down the list of properties for uiSlider
          The categories I have are:
          Modulator,
          MIDI,
          Component Generic,
          Component.
          Under which of those four would I find “slider content”, closest seems to be having to enter sysex for every entry, in the MIDI section.

          Going back to my original question, I also need to add a time delay so I would like to try my Method (function call)

          I am using version 5.2.44 on XP 32

          I have changed to uiFixedImageSlider component and it is there. 🙂
          But I just want the slider to look like the standard slider, I don’t need the image resource thing, which seems to lose the standard slider look.

          • This reply was modified 7 years, 9 months ago by Peter_EP. Reason: added version
          • This reply was modified 7 years, 9 months ago by Peter_EP. Reason: found uiFixedImageSlider
          • This reply was modified 7 years, 9 months ago by Peter_EP. Reason: added just want standard slider look
          #69587
          Possemo
          Participant
            • Topics: 14
            • Replies: 638
            • Total: 652
            • ★★★

            why not use uiFixedSlider? And then… why do you use a Ctrlr version from stone age?

            #69592
            Peter_EP
            Participant
              • Topics: 5
              • Replies: 19
              • Total: 24

              You know, when I was experimenting yesterday with this, I tried all the sliders and I’m sure with uiFixedSlider there was no “Slider Contents” option!!

              BTW: if anyone can help with the Method call athat would be good as I will need that for other sysex commands too.

              When I installed crtl, I thought I was getting the latest version, maybe something went wrong.

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

                What are the typical usages for uiFixedSlider?
                Somewhere isn’t this a contradiction? A slider (something moving) that is fixed…

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

                  I think it’s due to fix values, as fix means correct or set right, adjust.
                  The fixed slider lets you set the output values, instead 0-127 you can output anything.

                  • This reply was modified 7 years, 9 months ago by dasfaker.
                  #69598
                  Possemo
                  Participant
                    • Topics: 14
                    • Replies: 638
                    • Total: 652
                    • ★★★

                    @Peter_EP: sometimes the nightlybuilds are not sorted by date, newest is
                    Ctrlr-5.4.2.exe. It think should work on WinXP.


                    @goodweather
                    : yea that’s what I thought too for a long time. But Fixedsliders are very powerful. They aren’t fixed at all. But you can fix the vaules. For the Matrix1000 panel I had to make an awkward valuelist list like this:

                    -63=65
                    -62=66
                    -61=67
                    -60=68
                    -59=69
                    -58=70
                    -57=71

                    Here, a value of 125 will set the parameter to -3.

                    The first value is just display, you could make an entry like this: HelloWorld=3. The second value is the modulators MAPPED value. In Lua you get and set this by :setValueMapped(value, false, false) and :getValueMapped(). You still have the normal modulator value: the first entry has modulator value 0, the second 1, and so on.

                    • This reply was modified 7 years, 9 months ago by Possemo.
                    • This reply was modified 7 years, 9 months ago by Possemo.
                    • This reply was modified 7 years, 9 months ago by Possemo.
                    #69602
                    goodweather
                    Participant
                      • Topics: 45
                      • Replies: 550
                      • Total: 595
                      • ★★★

                      OK. Thanks to both of you.

                      I have never used that because I’m solving it in a different (maybe easier?) way.
                      I’m always using uiImageSliders with some OnChange method. In that method I’m performing the transformation.
                      In your case Possemo, value = param – 128.
                      If special calculation then series of “elseif”…

                      When I have special values, I’m still using uiImageSliders but with content as
                      Osc1+Osc2=0
                      Osc1=43
                      Osc2=85
                      which is indeed a series of fixed values…

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

                        So you are doing it with Lua scripts, sure not a bad idea. But how do you make the display? I mean showing -34 instead of the real value? With graphics? I never used Imagesliders, I am too lazy to make the graphics…

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

                          A display is a uiGroup. Each element is a uiLabel that I call lblxxx when not changing and txtxxx when changing. I just change the uiLabelText property.
                          Pretty straightforward and I think quite flexible due to the coding…

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

                            I see. I think it will be interesting to study the code of your panel when it is finished. I hope you don’t plan to make it closed source…

                            #69615
                            Peter_EP
                            Participant
                              • Topics: 5
                              • Replies: 19
                              • Total: 24

                              Thanks for the interest, I am making progress, ctrl is excellent.

                              I now downloaded the Ctrlr-5.4.2.exe and looked in the About box: it says Version 5.3.201

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

                                yes the about box has not been updated, but it is the newest ver. For me (on Win10) it works quite well.

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

                                  Of course Possemo! I will publish it in .bpanelz.
                                  As we are all learning by looking at each other’s panel, all panels should be published in an open way. This is also a recognition to the work done by atom in my opinion.
                                  I’m busy with final testing of the librarian.

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

                                    yea, for the enduser it is nice to provide ready to use instances, but when you would like to look into the cracks work .bpanelz is great. Btw. I am on final testing of a Matrix1000 panel

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