Re: Connect MIDI keyboard to SF2 player in LMMS - OpenBSD 7.2.

2022-11-08 Thread Brian Durant

On 11/8/22 17:15, Alexandre Ratchov wrote:

If you've multiple MIDI controllers, you could assign a MIDI channel
to each (most MIDI controllers have a knob to do so) and then route
them all to "midithru/0" so lmms or fluidsynth see them as a single
port. For instance:

midicat -d -q midi/0 -q midithru/0
midicat -d -q midi/1 -q midithru/0

Then, in lmms (or fluidsynth), configure each track's "Input channel"
setting to the corresponding input (click on the "keyboard" icon, then
the "enable midi input" button, then select the channel number).  If
you need a more complex MIDI routing, you could try the audio/midish
port.

Note that certain programs count channel numbers from 0 other from 1.


Hi again Alexandre,
OK, many thanks for that. I have tried to make this a little simpler by 
just using one device, that has both keys and pads. Here is the dmesg 
section:


umidi0 at uhub0 port 5 configuration 1 interface 1 "Nektar Impact LX25+" 
rev 1.10/0.32 addr 3

umidi0: (genuine USB-MIDI)
umidi0: out=1, in=2
midi0 at umidi0: 
midi1 at umidi0: 
ugen2 at uhub0 port 5 configuration 1 "Nektar Impact LX25+" rev 
1.10/0.32 addr 3


I ran the following:
$ midicat -d -q midi/0 -q midithru/0
$ midicat -d -q midi/1 -q midithru/0

It appears that it is necessary to use two terminals for this...
As suggested, I configured LMMS' Sf2 Player input channel to "1" and 
then enabled the midi input. I did the same with the Kicker plugin input 
channel, set it to "2" and enabled the midi input. I then set the action 
gear for each plugin to receive MIDI input on each. The Sf2 plugin input 
can be seen in the piano roll, where notes and velocity can be adjusted 
after the fact. The terminal running the $ midicat -d -q midi/0 -q 
midithru/0 command has MIDI output scrolling down the terminal.


While the pads produce the correct (drum) sounds when the Kicker plugin 
is open, when closed (and only the Sf2 and Kicker plugins are in the 
song editor panel) I only get grand piano sounds. Likewise, there is no 
scrolling output in the second terminal with the command $ midicat -d -q 
midi/1 -q midithru/0. Nothing appears in the piano roll either, when I 
chose "record". Not sure what is going on here...




Re: Connect MIDI keyboard to SF2 player in LMMS - OpenBSD 7.2.

2022-11-08 Thread Alexandre Ratchov
On Tue, Nov 08, 2022 at 11:31:24AM +0100, Brian Durant wrote:
> I am trying to connect my MIDI keyboard to the Sf2 Player, in LMMS. sndio
> MIDI is set under MIDI interface in the MIDI settings section of the LMMS
> preferences. DMESG gives me the following when I plug my MIDI keyboard into
> the computer:
> 
> umidi0 at uhub0 port 5 configuration 1 interface 0 "KORG INC. microKEY2" rev
> 1.10/1.02 addr 3
> umidi0: (genuine USB-MIDI)
> umidi0: out=1, in=1
> midi0 at umidi0: 
> 
> I have read the three bits of LMMS documentation on MIDI, and I am familiar
> with how to use fluidsynth to connect directly with my MIDI keyboard to the
> default soundfont:
> 
> $ fluidsynth /usr/local/share/generaluser-gs/GeneralUser_GS.sf2
> $ midicat -d -q midi/0 -q midithru/0
> 
> Unfortunately, none of this seems to work in LMMS. Clicking on the action
> gear for the Sf2 Player plugin shows MIDI input and output, but does not
> list my MIDI keyboard (as in Linux or Windows) so that I can bind it to the
> Sf2 Player. There is very little information about using MIDI instruments in
> the OpenBSD FAQ, and my knowledge of sdiod and jack are limited.

Basically, sndio MIDI attempts to look as MIDI hardware.

The computer's MIDI ports are named "midi/0", "midi/1", .. and (in the
default sndiod config) they correspond the "midi0 at ..." lines of
dmesg.

There are also software MIDI thru boxes refered as "midithru/0",
"midithru/1", ... For instance, when a program sends events to
"midithru/0" all other programs connected to "midithru/0" receive the
events.

By default programs use "midithru/0" as MIDI port.

Certain have no MIDI port selector, but the default port may be
changed with the MIDIDEVICE environment variable.

> The only way that I have found that I can get this to work, is if I run $
> midicat -d -q midi/0 -q midithru/0 from the command line, before I open LMMS
> and I then select MIDI input in the Sf2 Player action gear. However, this
> allows only for one MIDI instrument at a time. If I also want to connect a
> drumpad like the Akai MPK 218, would I run $ midicat -d -q midi/1 -q
> midithru/1 and how do I set MIDI input in the Kicker plugin to only get the
> MIDI signals from the drumpad and not the keyboard? Perhaps LMMS and sndio
> are only setup for something like the Akai MPK Mini MKIII?
> 
> Any help trying to wrap my head around how MIDI, sndio and jack work in this
> context is appreciated.
> 

If you've multiple MIDI controllers, you could assign a MIDI channel
to each (most MIDI controllers have a knob to do so) and then route
them all to "midithru/0" so lmms or fluidsynth see them as a single
port. For instance:

midicat -d -q midi/0 -q midithru/0
midicat -d -q midi/1 -q midithru/0

Then, in lmms (or fluidsynth), configure each track's "Input channel"
setting to the corresponding input (click on the "keyboard" icon, then
the "enable midi input" button, then select the channel number).  If
you need a more complex MIDI routing, you could try the audio/midish
port.

Note that certain programs count channel numbers from 0 other from 1.

You may need to set sndiod latency (ex. "-z 128" option) and lmms
buffer size (Edit->Settings set buffer size to 128).



Connect MIDI keyboard to SF2 player in LMMS - OpenBSD 7.2.

2022-11-08 Thread Brian Durant
I am trying to connect my MIDI keyboard to the Sf2 Player, in LMMS. 
sndio MIDI is set under MIDI interface in the MIDI settings section of 
the LMMS preferences. DMESG gives me the following when I plug my MIDI 
keyboard into the computer:


umidi0 at uhub0 port 5 configuration 1 interface 0 "KORG INC. microKEY2" 
rev 1.10/1.02 addr 3

umidi0: (genuine USB-MIDI)
umidi0: out=1, in=1
midi0 at umidi0: 

I have read the three bits of LMMS documentation on MIDI, and I am 
familiar with how to use fluidsynth to connect directly with my MIDI 
keyboard to the default soundfont:


$ fluidsynth /usr/local/share/generaluser-gs/GeneralUser_GS.sf2
$ midicat -d -q midi/0 -q midithru/0

Unfortunately, none of this seems to work in LMMS. Clicking on the 
action gear for the Sf2 Player plugin shows MIDI input and output, but 
does not list my MIDI keyboard (as in Linux or Windows) so that I can 
bind it to the Sf2 Player. There is very little information about using 
MIDI instruments in the OpenBSD FAQ, and my knowledge of sdiod and jack 
are limited.


The only way that I have found that I can get this to work, is if I run 
$ midicat -d -q midi/0 -q midithru/0 from the command line, before I 
open LMMS and I then select MIDI input in the Sf2 Player action gear. 
However, this allows only for one MIDI instrument at a time. If I also 
want to connect a drumpad like the Akai MPK 218, would I run $ midicat 
-d -q midi/1 -q midithru/1 and how do I set MIDI input in the Kicker 
plugin to only get the MIDI signals from the drumpad and not the 
keyboard? Perhaps LMMS and sndio are only setup for something like the 
Akai MPK Mini MKIII?


Any help trying to wrap my head around how MIDI, sndio and jack work in 
this context is appreciated.