How do I send MIDI to the MIDI output?
-
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):
-
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.)? -
@VirtualVirgin set the
Message.senToMidiOut()
on all the midi callbacks, onNotOn, onNoteOff and onController
all cc pass the onController callback -
@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 callbackThank 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? -
@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.
-
@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? -
@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();
-
@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? -
@VirtualVirgin not sure about clock but after touch and pitch bend are controller messages so you can access them in on controller.