Re: Using external MIDI input and output.
Posted: Sat Mar 24, 2018 1:15 am

That's what happens with Chromium, Vivaldi, and Opera in Linux.
Code: Select all
void MidiPort::processOutEvent( const MidiEvent& event, const MidiTime& time )
{
// mask event
if( isOutputEnabled() && realOutputChannel() == event.channel() )
{
MidiEvent outEvent = event;
if( fixedOutputVelocity() >= 0 && event.velocity() > 0 &&
( event.type() == MidiNoteOn || event.type() == MidiKeyPressure ) )
{
outEvent.setVelocity( fixedOutputVelocity() );
}
m_midiClient->processOutEvent( outEvent, time, this );
}
}
Code: Select all
@@ -146,10 +146,12 @@ void MidiPort::processInEvent( const MidiEvent& event, const MidiTime& time )
void MidiPort::processOutEvent( const MidiEvent& event, const MidiTime& time )
{
// mask event
- if( isOutputEnabled() && realOutputChannel() == event.channel() )
+ if( isOutputEnabled())
{
MidiEvent outEvent = event;
+ outEvent.setChannel(realOutputChannel());
+
if( fixedOutputVelocity() >= 0 && event.velocity() > 0 &&
( event.type() == MidiNoteOn || event.type() == MidiKeyPressure ) )
{
Thanks for looking into this! I'll try the patch out.Moosfet wrote: ↑Sat Mar 24, 2018 6:12 amSo I was able to make it work the way that I expect by doing this:
The channel number isn't an attribute of an event, its just the channel that it is received or transmitted on. So I can't think of why simply assigning the output channel when the note is output would ever be the wrong thing to do. Indeed, everything seems to work correctly after this change, in particular input channel filtering still works.Code: Select all
@@ -146,10 +146,12 @@ void MidiPort::processInEvent( const MidiEvent& event, const MidiTime& time ) void MidiPort::processOutEvent( const MidiEvent& event, const MidiTime& time ) { // mask event - if( isOutputEnabled() && realOutputChannel() == event.channel() ) + if( isOutputEnabled()) { MidiEvent outEvent = event; + outEvent.setChannel(realOutputChannel()); + if( fixedOutputVelocity() >= 0 && event.velocity() > 0 && ( event.type() == MidiNoteOn || event.type() == MidiKeyPressure ) ) {