HISE Logo Forum
    • Categories
    • Register
    • Login

    Code a midi cc direct to a slider?

    Scheduled Pinned Locked Moved General Questions
    11 Posts 4 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tod SlaughterT
      Tod Slaughter
      last edited by

      Code a midi cc direct to a slider? Or does it need to be midi learned from the interface?

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Tod Slaughter
        last edited by

        @tod-slaughter you can code it, just set the slider's range to 0-127 and in the on controller callback assign the CCs value to the slider

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart
          last edited by Christoph Hart

          Yes, you can use the onController callback for this:

          function onController()
          {
              if(Message.getControllerNumber() == 71)
              {
                  Knob1.setValueNormalized(Message.getControllerValue() / 127.0);
              }
          }
          

          EDIT: David was faster than me, but my solution works with all slider ranges :)

          1 Reply Last reply Reply Quote 1
          • Tod SlaughterT
            Tod Slaughter
            last edited by

            @Christoph-Hart

            Unfortunately that doesn't work for me

            HiseSnippet 1204.3oc2X8zaaTDEeV6LsXWbfJBRbBsJBjbDgfcZZJHTUbhSbkUiiMYSCTwgxjcm0dT1clkcmMfopRbgy70gOF7ofKboG3N7lYs8ttrjX6FnUrQZkeu48dyu48u4soWnvlFEIBQFkNYX.EY7lXqgb4flCHLNp89HikwcHQRZnYBq8FFPhhnNHCihOPwvnzRH8yy2YOhGgaSSYgPmJX1zCY9LYJ2dMdHyyqEwgdByOiza0nssf2T3IhA7TDWCEPrOmzmdDQIVALx3FG3vjhPKIQRiPFKsmvYn0.w2wSj+TVD6LOphnNxBLTB6VBOGEhU+F0b.yyo23ycDBYf6k5EJl3EVA2g4vlvO0a715ELS0Hq+vnvkAu5KH7Lx.ukRf2swV1gr.Y5JJrcKbaNDnbI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ynEqqnMFsX8wK9exd3SrCEOwN4yXTIxuglCbt45+Y.kvcTzlS99EkuwGld3I11Jm8GCdm70Xy4Vi6L2Zr0bqwcmaM1dt03dysFe5kngZTscigVnI2TAL5cPRmQiIcaMJh9K.sre0BA
            
            
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @Tod Slaughter
              last edited by d.healey

              @tod-slaughter Hi Tod. Don't use addControl in your main interface script, add all of your controls using the interface designer. Then in your script use content.getComponent() to get a reference to the control and store it in a variable. Your use of addControl isn't the problem here though, it's just not best practice.

              The problem here is you haven't got a reference to Knob1 so in your onController callback there is nothing to assign the value to. You need to do const var Knob1 = Content.addControl() or use getComponent as I mentioned above.

              After you get a reference to the control you will hit another problem, the middle value you have set for the knob is invalid, it must be set to a value between the knob's minimum and maximum.

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              1 Reply Last reply Reply Quote 0
              • F
                fellowfinch
                last edited by

                Apologies for reviving an old topic;

                Whenever I hit a problem or a feature implementation I like to dig through the forum. I want to code a midi CC to a filter's cutoff running through my Sampler.

                To my understanding it should be done like this?

                I put this in my MIDI scrip editor for Sampler1 (onController section)

                function onController()
                {
                    if(Message.getControllerNumber() == 1) //using modulation wheel
                    {
                        knbFiltr.setValueNormalized(Message.getControllerValue() / 127.0);
                    }
                }
                

                on my main Init page for the UserInterface

                I've put this

                const var knbFiltr = Content.getComponent("knbFiltr");
                

                referencing my cutoff Filter knob.

                ...reading @d-healey reply I also put in the init of the script processor

                const var knbFiltr = Content.addControl()
                

                trying to compile it states function does not exist.
                I'm sure I missed something dumb here :) still learning...

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @fellowfinch
                  last edited by

                  @fellowfinch Why do you want to script this instead of using a modulator?

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    fellowfinch @d.healey
                    last edited by

                    @d-healey good question...

                    too fresh out of the oven when it comes to HISE work I'm afraid, so probably didnt even realize that was the way too go. Will look into using modulators next.
                    thank you!

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @fellowfinch
                      last edited by

                      @fellowfinch

                      HiseSnippet 1164.3oc2X0saaaCElJ1LaNcyXMnnn6NcwtHEnnvdqqa.CX04OWXz5DmH2rcW.iDULgoH0nnxh2v.F1U698B0GgArWj9FrcHkcjTifiiW2R17EFhjmC424muygRCTReZRhTgbZLbRLE47AXuIB8nsGQXBTucPNMw8IIZpxMapslDSRRnAHGmZO2LgSi5H6u27rsHbhvmlOEBcjj4SeIKhoymcPmWv37tj.5PVTAoeRmd9Rw1RtLEvSMbKTLweL4T5dDiXqfQNqta.SKUdZhll.xrkLXh2H42Kxj+HVB6DN0LnMxC1nroQaOhwCFLyVSPHG7fbKuVlkeObeV.6h4y8.ejcA2bMJ5CbVYdPp80.RNEfT8LHcWrmuhEqyWwfm6f6If.RHAb0EgRlrHmWi2VBBHzONhLl1UACtPgMdZqVOxE96geUXpvWyjBWoXOoltuXiGt1OtVi09o0be6kBCqbMywnjbNUU4xlnqZdJtgHM5Dp5QtmQ3ozKDDL+x9zUWLepelUWPPonmfo2OlNcbWIOv3qLOe4H.ZpayDKlhPPTsMRzbZjviyBnJDC1j2C+Bg7j1HK3uHK90G2A8pd6PzjYaCrivoDSUZlwXb1gdFvIxBvMv6PSFqkwVYihkBy46z7JOzygTXmP37lXd3qgGRzSLtjUsBfhXAAb5.YBy3xKx8.tbrG6G.Qw31OtEHonHgMhbdQaIIMLjctk7Ex3QIZ.O8h.NIxYc7qRntAzPRJW6lLF1GNSLlFLTZkOdlqsWfQXKGJOioMPtU.uFxKMq2DbD1M5Hq2DcYt.vBkAobhtL0zTCZ5BFCsHevjzK.Gvjh0ntF70VykutnP7t3ALs+npw3JUfQHu4eBLNsJ2Gh2MLj5qyAXcb2ucYKos3Geyri+NXOlfZawXO76aG69MjyntOmJnJiyq8b5x76KZWl3EtKy99Z33GpHhjXYRoM1iFwFBjxjhSBo8cUzu6PSzr37aKIpJW5MOqKXjUpiGQmproEaFISE5RoA0JGGpuXkAKyHJHeE8bpeCzF7cCs5Fj4WpSciYXziEEyo6JNixgh8VLt9rhZylsbhceoPFORJX9Ei5GRgZrmdJUUD6UZPap0v8ixm4dcNjxojhYveRmWBYdDE3mnKou35eqkJiWO.mAWWCaz8+tUrq8+5J1UkZuNdfjOIKQsKiCMrsfnANav7JViPlhdoTget25W+iNGTL7VN07AcNHkvy8t+7Y+xus4VrXImn9654uhL45KX5w8wWXTt2hp+XJNme8po0etzkttRTBM2FRrvH2G2CJeozFkJ1ra1ltm8R7kZpEIk5Qka6x5T5BdEth46rH3hyuMYo2tqA8w3oI8tljsa2XsI9faH.dnLUyDm1m.sLMuQDjJ5AWqymBfSHn7DyKGshIaMabKy3r60IBrC9S32zEaaF6Lcw1yV7ekyHh3qjG6mQoLL722NCX2B6m9nAtuYr6a+xll2WCX3G66Wdqtjhe5xp3msrJ9jkUwOeYU7oKqhewxp3Wd0JZJ.uYpVFkwMPn9C109wAbb1UXpyZoIn+B.Mknyh
                      

                      Right click on the knob to assign the CC you want.

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      F 1 Reply Last reply Reply Quote 0
                      • F
                        fellowfinch @d.healey
                        last edited by

                        @d-healey omg...

                        this is way easier...apologies for such dumb questions, I guess I complicate too much for pretty straight to the point solutions.

                        I assume this can be changed even by the user?

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @fellowfinch
                          last edited by

                          @fellowfinch Yes

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          49

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          101.8k

                          Posts