HISE Logo Forum
    • Categories
    • Register
    • Login

    Keep hitting walls, wouldn't mind some help or ideas.

    Scheduled Pinned Locked Moved General Questions
    c++floating tilemidi
    10 Posts 4 Posters 697 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.
    • jonhallurJ
      jonhallur
      last edited by

      WARNING, wall of text.

      I have been trying to make a little plugin that can take the modulators in HISE and send them out as a MIDI CC messages.

      Sending MIDI out of HISE is possible when exporting your project as a MIDIFX plugin. Unfortunately when running as a MIDIFX plugin none of the modulators run, neither the Global Modulators or the scriptnode ones.

      @d-healey mentioned in a thread that I could get the global modulators to work using the flag ENABLE_ALL_PEAK_METERS=1, but that meant that I had to use the FX plugin type instead of MIDIFX, which again meant no MIDI out.

      So I ventured into the C++ code and hacked around in the processBlockCommon in HISE's MainController as detailed in this post where I could block HISE from clearing the MIDI buffer, so that you can create MIDI events using the JS code. But that meant maintaining my own fork of HISE develop branch which is not ideal.

      Then @Christoph-Hart published the Message.sendToMidiOut() which I thought would be my savior, so I threw away my fork and continued to work on the now FX plugin, since I'm still dependant on Modulators and scriptnode.

      I soon found out that, if I understood it correctly, that it was only meant to echo/modify the MIDI input back out to the MIDI buffer and I could not add any CC values anywhere, as doing so outside of the onController() callback it will generate an error in the JS output log. In my context I'm not expecting any CC input into the plugin, so the callback would be a useless place for me to generate my CC.

      But I realized that I could use/abuse the sendToMidiOut() function he added to the MainController to do exactly what I wanted to do, but I had to do that in C++ which is fine.

      So I added a floating tile with it's own C++ code as describe in the ExternalFloatingTile tutorial which, yet again worked like a charm. I could have my own timer in C++ where I could add any MIDI message I wanted and for a while it was beautiful, I thought I had cracked the problem, right until I tried to close down the Plugin UI inside my DAW. You see, when the UI is not visible, HISE calls the destructor of my C++ floating tile and for my poor plugin to work I now have to make sure it is visible somewhere on the screen at all times.

      So now my options is to go back to maintaining a fork, blocking the clearing of the MIDI buffer, unless someone has the silver bullet that will save me. I would really appreciate any ideas if anyone of you have any.

      Sorry for the long post.

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

        and for my poor plugin to work I now have to make sure it is visible somewhere on the screen at all times.

        Relying on the UI to be open for the plugin to work as expected is a really bad design choice.

        ENABLE_ALL_PEAK_METERS=1

        The flag you're looking for is EnableSoundGenerators and is a project setting that you need to turn on for the FX plugin you'll export.

        if I understood it correctly, that it was only meant to echo/modify the MIDI input back out to the MIDI buffer and I could not add any CC values anywhere

        No, the idea is that you can call this method from any MIDI callback of any sound generator and it will put it in the output MIDI buffer of the plugin. This way you can also sent out artificial events that are processed by a child sound generator.

        jonhallurJ 2 Replies Last reply Reply Quote 0
        • d.healeyD
          d.healey
          last edited by d.healey

          @d-healey mentioned in a thread that I could get the global modulators to work using the flag ENABLE_ALL_PEAK_METERS=1,

          You sure I said that? I don't see how that flag would help.

          Christoph got there first.

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

          jonhallurJ 1 Reply Last reply Reply Quote 0
          • jonhallurJ
            jonhallur @Christoph Hart
            last edited by

            Relying on the UI to be open for the plugin to work as expected is a really bad design choice.

            Truer words were never spoken.

            It was not my intention to make that as a design decision. A while back you helped me with a problem I had with SysEx and you suggested using the floating tile as a means to get more functionality using C++ and it was good.

            I just didn't realize that it was code that was garbage collected when it was out of sight.

            1 Reply Last reply Reply Quote 0
            • jonhallurJ
              jonhallur @d.healey
              last edited by

              You sure I said that? I don't see how that flag would help.

              Christoph got there first.

              ae775183-7c64-4bdc-96fd-66791bcfc73d-image.png

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

                @jonhallur I'm not DanH :)

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

                DanHD jonhallurJ 2 Replies Last reply Reply Quote 0
                • jonhallurJ
                  jonhallur @Christoph Hart
                  last edited by

                  No, the idea is that you can call this method from any MIDI callback of any sound generator and it will put it in the output MIDI buffer of the plugin. This way you can also sent out artificial events that are processed by a child sound generator.

                  I do not fully understand the basic structure of HISE, and how parent-child relations ship works. I also do not know the difference between an event and an artificial event. There might be some pretty easy, "just use this one simple trick", that I can not see since I'm not familiar with the architecture.

                  I was just wondering if I was heading the right direction here, since I'm so close to get everything working, I was thinking if there were any things I was not understanding correctly (which apparently there were a few)

                  1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey 🖐

                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                    https://dhplugins.com/ | https://dcbreaks.com/
                    London, UK

                    1 Reply Last reply Reply Quote 1
                    • jonhallurJ
                      jonhallur @d.healey
                      last edited by

                      @d-healey said in Keep hitting walls, wouldn't mind some help or ideas.:

                      @jonhallur I'm not DanH :)

                      I apologize profusely.

                      jonhallurJ 1 Reply Last reply Reply Quote 1
                      • jonhallurJ
                        jonhallur @jonhallur
                        last edited by

                        @d-healey @DanH

                        I my defense you are both very helpful and have the same initials.

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

                        42

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.8k

                        Posts