HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I send MIDI to the MIDI output?

    Scheduled Pinned Locked Moved General Questions
    9 Posts 3 Posters 357 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      I made a simple transposer and built it as a VSTi.
      When I test the plugin, it has a MIDI out but it does not pass any MIDI.
      How do I get the MIDI out (both the transposed MIDI and all of the other MIDI messages thru)?

      I see this in the manual, but I'm not sure where to place it (the code):

      Screenshot 2024-10-22 at 9.44.12 PM.png

      You can listen to orchestral my orchestral mockups here:
      https://www.virtualvirgin.net/

      VirtualVirginV 1 Reply Last reply Reply Quote 0
      • VirtualVirginV
        VirtualVirgin @VirtualVirgin
        last edited by

        So I added that code after the transposed MIDI note on message,
        built the plugin again, and when I test the VSTi it passes the note on, with the transposition,
        but how should I get all of the rest of the MIDI messages to the output?
        Can I forward them all using something simple, or do I have to specify every single message type to pass is separate scripts (CC, PC, Pitchbend, Aftertouch etc.)?

        You can listen to orchestral my orchestral mockups here:
        https://www.virtualvirgin.net/

        ulrikU VirtualVirginV 2 Replies Last reply Reply Quote 0
        • ulrikU
          ulrik @VirtualVirgin
          last edited by

          @VirtualVirgin set the

          Message.senToMidiOut()
          

          on all the midi callbacks, onNotOn, onNoteOff and onController
          all cc pass the onController callback

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

          1 Reply Last reply Reply Quote 0
          • VirtualVirginV
            VirtualVirgin @VirtualVirgin
            last edited by VirtualVirgin

            @ulrik said in How do I send MIDI to the MIDI output?:

            @VirtualVirgin set the

            Message.senToMidiOut()
            

            on all the midi callbacks, onNotOn, onNoteOff and onController
            all cc pass the onController callback

            Thank you :)

            So, this works, but it does not cover the full extent needed for a MIDI plugin.
            When testing, my VSTi now passes the transposed note on and note off messages properly, as well as passing on any CC messages, but a MIDI plugin needs to act as a thru for any remaining MIDI messages.

            So I still need to get Program Change, Aftertouch, Pitch Bend, Bank Select, MMC, MTC, MIDI Clock, SysEx etc. forwarded directly to the plugin MIDI output.
            Is there some function to route all of these directly to the output stage?

            You can listen to orchestral my orchestral mockups here:
            https://www.virtualvirgin.net/

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

              @VirtualVirgin said in How do I send MIDI to the MIDI output?:

              Is there some function to route all of these directly to the output stage?

              You need an if statement (or possibly more than one, or a switch) to check what message is coming through, and only if it's one you are interested in do you do anything with it, and let the others pass through unaffected.

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

              VirtualVirginV 1 Reply Last reply Reply Quote 0
              • VirtualVirginV
                VirtualVirgin @d.healey
                last edited by

                @d-healey said in How do I send MIDI to the MIDI output?:

                @VirtualVirgin said in How do I send MIDI to the MIDI output?:

                Is there some function to route all of these directly to the output stage?

                You need an if statement (or possibly more than one, or a switch) to check what message is coming through, and only if it's one you are interested in do you do anything with it, and let the others pass through unaffected.

                So I'm trying to figure out what this means.
                I need all of the MIDI messages to proceed to the output. HISE is blocking them by default at the output unless the "Message.sendToMidiOut( )" is present for the messages.
                How do I qualify the "if" to just include all of the messages, as there is no "else".
                I don't need to filter any of the messages here.
                I only see references in the API to Program Change and Aftertouch, but not for the plethora of other messages which can be transmitted. If noteOn and noteOff and Controller need explicit references to send to MIDI out, then I also need explicit references for the other messages? How do I tell it to forward MTC or MIDI Clock to the output if there are no API references to them? Is there a term to refer to all MIDI messages?

                You can listen to orchestral my orchestral mockups here:
                https://www.virtualvirgin.net/

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

                  @VirtualVirgin said in How do I send MIDI to the MIDI output?:

                  How do I qualify the "if" to just include all of the messages, as there is no "else".

                  Flip it around. The default is to let a message pass. So your if should be to stop messages passing.

                  As an example, this will allow all notes except middle C to pass through the on note on.

                  if (n == 60)
                  {
                      return Message.ignoreEvent(true);
                  }
                  
                  Message.sendToMidiOut();
                  

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

                  VirtualVirginV 1 Reply Last reply Reply Quote 0
                  • VirtualVirginV
                    VirtualVirgin @d.healey
                    last edited by

                    @d-healey
                    Right, but that only works for the other note messages. That doesn't pass all of the other types of MIDI messages I am referring to. They do not pass to the output stage by default.
                    So I see where to address the noteOn, noteOff and Controller messages by giving them the "Message.sendMidiOut( );", but where do I address the PC, Aftertouch, Pitch bend, MTC, MIDI Clock messages etc. with this statement?
                    I don't see a "function onProgramChange" or "function onPitchBend". Do I create these somehow?

                    You can listen to orchestral my orchestral mockups here:
                    https://www.virtualvirgin.net/

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

                      @VirtualVirgin not sure about clock but after touch and pitch bend are controller messages so you can access them in on controller.

                      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

                      27

                      Online

                      1.7k

                      Users

                      11.8k

                      Topics

                      102.8k

                      Posts