HISE Logo Forum
    • Categories
    • Register
    • Login

    Affecting midi CC values using a UI element? [solved]

    Scheduled Pinned Locked Moved Scripting
    17 Posts 2 Posters 689 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.
    • A
      andioak
      last edited by andioak

      How can I affect the internal midi CC value of a controller using a knob on the ui?

      I got this:

      onControl:

      if (number == mod_wheel)
          {
          	Synth.sendController(3, value); // sending ui-knob´s value to CC3
          }
      }
      

      When I then try to "Synth.getController()" ... well I find no such thing. Just the Message.xxxx stuff. They only work in the onController CB, and by doing the above we do not get a onController call.

      What´s the answer?

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

        Generally you shouldn't use the generic onControl callback (it's deprecated) use a standalone callback per control. Although this is not related to your question.

        What do you get if you put Console.print(value); inside that if statement?

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

        A 1 Reply Last reply Reply Quote 0
        • A
          andioak @d.healey
          last edited by andioak

          @d-healey Thanks for replying.

          I get what you´d expect, the correct value outputted, as any other ui control. Although the value is the input value of the ui control, so the instigator so to speak. I cannot really verify that I am actually affecting the CC of the synth, cause I find no actual getControllerValue or any equivalent that can be accessed via the onControl or outside of the onController callback. Not yet anyway.

          Why is the onControl callback deprecated? Cause it´s faster with inline functions?

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

            @andioak Because we have the newer individual callbacks which are easier to maintain in larger projects. If you use the generic callback in a large project you end up with a massive switch statement which is quite messy and isn't very reusable.

            Why do you want to use a CC to control a knob?

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

            A 1 Reply Last reply Reply Quote 0
            • A
              andioak @d.healey
              last edited by andioak

              @d-healey said in Affecting midi CC values using a UI element?:

              Why do you want to use a CC to control a knob?

              That´s not the question. I want to control a midi CC using a ui-knob. Not the other way around. But now that you say it, I want that too. To control a ui-knob using a CC, the mod wheel.

              Like Kontakt or most virtual instruments update the mod wheel on the ui when you use the keyboard´s mod wheel.

              So it´s both ways I want to do. The first thing now is the updating of the internal CC when I use the ui-knob.

              Maybe I know this already, the CC assignment? Perhaps it has to be connected and saved in the presets?

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

                Oh I get it now. HISE can't send MIDI out, so you can't do that.

                Like Kontakt or most virtual instruments update the mod wheel on the ui when you use the keyboard´s mod wheel.

                That you can do. Just change the knob's value in the on controller callback.

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

                A 1 Reply Last reply Reply Quote 0
                • A
                  andioak @d.healey
                  last edited by andioak

                  @d-healey said in Affecting midi CC values using a UI element?:

                  Oh I get it now. HISE can't send MIDI out, so you can't do that.

                  Hmm, what can I not do? I dont want to control the midi keyboard at all, just control the internal midi cc´s value using the ui.

                  That you can do. Just change the knob's value in the on controller callback.

                  Okay, thanks. I´ll try that out.

                  1 Reply Last reply Reply Quote 0
                  • A
                    andioak
                    last edited by

                    One little thing: the Message and MessageHolder, are they only accessible in the onController callback?

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

                      @andioak They are available in all the MIDI callbacks, on note on, on note off, on controller.

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

                      A 1 Reply Last reply Reply Quote 1
                      • A
                        andioak @d.healey
                        last edited by

                        @d-healey said in Affecting midi CC values using a UI element?:

                        @andioak They are available in all the MIDI callbacks, on note on, on note off, on controller.

                        Aha, jeeez. Thats great but I need to set a midi cc from a ui element, but the thing is that the statement Synth.sendController(3, value); does not generate a onController callback. So perhaps I have to go through a onNote callback and use a key instead? I mean I could generate a note and read the velocity via a conversion, right? (seems elaborate)

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

                          @andioak said in Affecting midi CC values using a UI element?:

                          Thats great but I need to set a midi cc from a ui element,

                          Not possible, no MIDI out from HISE.

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

                          A 1 Reply Last reply Reply Quote 1
                          • A
                            andioak @d.healey
                            last edited by

                            @d-healey said in Affecting midi CC values using a UI element?:

                            Not possible, no MIDI out from HISE.

                            Where would that go out from HISE? I don´t get that comment.

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • A
                              andioak
                              last edited by andioak

                              What is this about then:

                              Synth.sendController(3, value);

                              That´s an internal change of a cc to the synth api.

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

                                @andioak I'll make a snippet, give me a few minutes.

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

                                A 1 Reply Last reply Reply Quote 0
                                • A
                                  andioak @d.healey
                                  last edited by

                                  @d-healey Thanks.

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

                                    HiseSnippet 1132.3oc4W0saaaCElxNLq1cInsnXXWJTrKb.5BrW+YCnWTm3DWXzlDiH2rcW.iDkMQnHUonxhWQe21ivdT5av1gTxVxqBotBsaCXN2Dd34b3GO767QpwJoOMIQpPNslLOlhb9Zr2bgd1fYDl.M5.jy13iHIZpxMyz9yiIIIz.jiSyWXL3zZCj826e99DNQ3SKLgPmIY9zWwhX5Bqi6+RFmOjDPmvhJ48i6OxWJFH4xT.OMwcQwD+KISoGSLt0.ib17v.lVp7zDMMA4rw9xf4dyj+pHy+yXIrK3TyfdHOHQYlGJ4AFDa9ezfYLdv3E66DDxAOtnJzLqJbe7Qr.1R6EUi6XmvsHhx0CmF2D75US34TBdajAu6h87UrXcwLFrca7HAbPERfifxvJyWTiPG7.I3gPuaD4R5PELXYDcdZ2tOz8Ic6tyy1ps4OlfyDT2vTgulIEtRwKExK5YxfRx63KihkBHWOz8JBOktyVse6VsaYIO6lPEA4NxopNOZgOPpemM8KvwTpdvhD04A1E3A6.gqyid.gyu.HAcVc0MIpDvNVpomH5rS621tU62018uOUXXkyUBgUMsgbpto.6HRitfpVr4V3HbJsJMXy0iF3mUSJ4nTLRvzmDSyGWPT5UAQAkWTMTlbDBtpsDlsyILdbV.UgXPR9JrshhrfeYS3uedezqGc.QSVjFHivpDSUZlYy3b.8JnkNiG1Be.M4RsL15a94Hng7QWzqWtf8mzedgDvn9I54lRylVGQQrf.NcrLgYJ8kkP.IoXO1uAthw81sK3onrtSD45x6ojzvP10VMjPFOJQC3ZTDHsfbtG90IT2.ZHIkqcStDxCP7ujFLQZ8G8gsefHfLHkSzqpLXjCymv.1xsfl1LArIlWVt7SPtnakxEUxBVS3dW7Xl1eV03sQE3E3Ceowat36V3CCCo95BvtAd3uTWk15AksyfxswdfHnUTyBjuwN18mIWQceAUPUlhZua3Rw+XcuTLdsuT7DeMr7STDQRrLYkD6QiXSflvjxFA58PE8MmZNkKaefjnpbp2+7gvlrxX7H5TkktrWjLUnWgdzrV29sZWSI+q3pvM9W3l5O+sdeQUJ9DdXQiwevq+tCvuih4zCEWQ4fnuEu2CT4spiKrtJg+HoPFOSJX9kYCmRAM1oSopx6iJ2b6o0vM7EVte+SobJoLy965+JfQRTPMidS0klqWcY8djUkmceKNCttltT2+So1u7Hzv6KdaS9QnsYnvZuONfAciIDKhJNUGAL.k1DTYcjEI8X66gJl6V88hjR8rUUzX8yoSmsxKOp3BlZeb9Y4Rvl++7RvSkoZlX5QDn+EdwDFNT8f6d7o.RDBJGVHrSCy4d13tlwYW9HBrC9S3W9j8Licxmr2hI+GYMhH9J449YjSSK9srVf8sv94jsfuqEF6t7EvXbW66HCXm66aJ2eeODp5X9gZDyipQLOtFw7jZDySqQL+XMh4mtwXLRT6kpkQYshfgwGZ+RDGmCEFkHKqG8W.tk3YTC
                                    

                                    The Synth.sendController() function sends controller messages to the internal synth. So you can controller MIDI modulators. If you expan the gain modulators in the snippet and move the knob you'll see the CC modulator on CC3 being affected.

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

                                    A 1 Reply Last reply Reply Quote 1
                                    • A
                                      andioak @d.healey
                                      last edited by

                                      @d-healey
                                      Thanks for the snippet, yes I see how it is modulated now! So the UI to internal cc is solved, many thanks.

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

                                      36

                                      Online

                                      1.7k

                                      Users

                                      11.7k

                                      Topics

                                      102.1k

                                      Posts