On Sun, Jan 15, 2023 at 07:35:49PM +0100, Brian Durant wrote:
> On 1/15/23 12:26, Alexandre Ratchov wrote:
> > On Sun, Jan 15, 2023 at 09:38:38AM +0100, Brian Durant wrote:
> > > The following command will connect a USB MIDI device:
> > > 
> > > $ midicat -d -q midi/0 -q midithru/0 &
> > > 
> > > A second device can be connected as follows:
> > > 
> > > $ midicat -d -q midi/1 -q midithru/1 &
> > > 
> > > Both output MIDI code in the terminal. (Note that redirecting both MIDI
> > > devices to midithru/0 doesn’t seem to pipe both devices through, but 
> > > rather
> > > only midi/0.) Adding the following command provides a way to convert MIDI
> > > code to sound using Fluidsynth:
> > 
> > Redirecting two ports to midithru/0 is supposed to work:
> > 
> > $ midicat -d -q midi/0 -q midithru/0   # in one terminal
> > $ midicat -d -q midi/1 -q midithru/0   # in another terminal
> > 
> > should merge the two inputs. Both terminals should show the events of
> > the corresponding input. If there's a synth on midithru/0
> > (ex. fluidsynth command below is running) it will produice sounds for
> > both inputs.
> 
> Hmm. Seems to be working now. However, this just means that MIDI signals go
> from both MIDI devices to one instance of fluidsynth. This of course means
> that both devices are sending MIDI code to one soundfont instrument. If run
> as:
> 
> $ midicat -d -q midi/0 -q midithru/0
> 
> and
> 
> $ midicat -d -q midi/1 -q midithru/1
> 
> MIDI input could be used to play different soundfont instruments - one for
> midi/0 and one for midi/1. Possibly something with the Fluidsynth "-L"
> option?

IIRC, you need "-p midithru/1" for the second fluidsynth instance.

> The problem is the same for LMMS. However, only one MIDI input is
> ever available. Enabling MIDI input and choosing different channels for SF2
> Player and Kicker do not provide a second MIDI input to choose from when the
> clicking the relevant plugin's gear icon in the "song editor" window. Not
> even when running midicat as I have suggested above. Hopefully this won't
> raise any hackles me writing this, but what I am describing is the normal
> expectation for using MIDI under Windows, Mac and Linux... I realize that
> this is achieved in various ways depending on the OS, but particularly the
> expected use case scenario that I describe for LMMS provides some challenges
> in OpenBSD.

I don't use lmms very often, but I'd recommend you to configure your
keyboards to use different channels (ex. 0 and 1) and route both of
them to midithru/0.

Then, in LMMS, for each track select the appropriate channel: click on
the piano icon, check "enable midi input" and select the desired
channel number (mind lmms counts starting from 1, so it would be 1 and
2 respectively).  This way each plugin will get the input from the
desired keyboard.

AFAIU, LMMS supports only one MIDI input, so you've to use channels if
you need to wire different keyboards to different plugins.

HTH

Reply via email to