HISE Logo Forum
    • Categories
    • Register
    • Login

    MIDI Learn 2024

    Scheduled Pinned Locked Moved Scripting
    9 Posts 4 Posters 330 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
      aaronventure
      last edited by

      I would like to roll my own MIDI Learn UX.

      Right clicking will offer "Learn MIDI..." which will then pop up a separate window where the user can enter the number or it will enter itself on controller, and will also display all currently mapped controllers.

      Can I somehow plug into the built in MIDI learn functionality? I'm aware of the floating tile that shows the mappings, but since I'd like to change the UX of mapping a control, I'd need a method to link a control and a controller #.

      If not, what's the next best thing, just calling setAttribute on UI controls from down the line? What if the UI script is deferred, are the control callbacks executions still synchronous?

      My noteOn, noteOff and Controller functions in the UI script trigger repaints of certain panels, so I figured it's a good idea to defer the UI script. This means I have to call setAttribute on controller from my logic script down the line.

      In this case it looks like this:

      • create global object to store CC mappings
      • in Performance script, check on controller for array index, if not undefined, set value of that control using setAttribute (which should trigger the callback of the control as well, if I'm not wrong). I'll need to manually calculate the value based on min, max and midpoint

      Anyone have any better solutions or have worked on their own CC mapping implementations?

      d.healeyD clevername27C 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @aaronventure
        last edited by

        @aaronventure

        MidiAutomationHandler is what you want I think:

        Link Preview Image
        HISE | Scripting | MidiAutomationHandler

        A scripting object for manipulating the MIDI control assignments

        favicon

        (docs.hise.audio)

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

        Christoph HartC 1 Reply Last reply Reply Quote 1
        • Christoph HartC
          Christoph Hart @d.healey
          last edited by

          Yup, that class should provide you all you need to implement your own MIDI learn UX. You don't need to roll your own MIDI logic, but just pass a JSON object with the MIDI CC numbers and what processor attribute from your interface you want to control.

          A 1 Reply Last reply Reply Quote 1
          • clevername27C
            clevername27 @aaronventure
            last edited by

            @aaronventure Are you SEO'ing your post? 😅

            A 1 Reply Last reply Reply Quote 1
            • A
              aaronventure @clevername27
              last edited by

              @clevername27 Yes!

              1 Reply Last reply Reply Quote 1
              • A
                aaronventure @Christoph Hart
                last edited by

                @Christoph-Hart How does this work with persistence? Do I have to keep a copy of the object that I'm then updating, sending to the handler and storing in my own persistent storage solution? Any gotchas?

                d.healeyD Christoph HartC 2 Replies Last reply Reply Quote 0
                • d.healeyD
                  d.healey @aaronventure
                  last edited by

                  @aaronventure You could write it to a json file.

                  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
                    aaronventure @d.healey
                    last edited by

                    @d-healey Global mappings and project backwards compatibility unfortunately aren't part of the same universe.

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

                      @aaronventure said in MIDI Learn 2024:

                      How does this work with persistence?

                      Midi Mappings are stored in a preset so you don't have to do anything. The JSON objects are just temporary objects that you need for manipulating the data model (or display stuff on the UI).

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

                      21

                      Online

                      1.8k

                      Users

                      12.0k

                      Topics

                      104.8k

                      Posts