Virtual Midi Port/Cable

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Virtual Midi Port/Cable

Post by d.healey »

How do we add virtual MIDI ports/cables in GNU/Linux? On Windows I used LoopBe but I'm assuming there is a built in way on GNU/Linux.

Thanks.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
christobal
Established Member
Posts: 108
Joined: Sun Sep 01, 2019 12:58 pm
Has thanked: 21 times
Been thanked: 11 times

Re: Virtual Midi Port/Cable

Post by christobal »

Doesn't jack +aj2midi and Carla do this? Or am I thinking of something else?
OS: Manjaro
Amp: Echolette M40 / NG51S Tape Echo
Strings: Martin D15M, Yamaha FG-180, Alhambra 5P, Yamaha Revstar
User avatar
bluebell
Established Member
Posts: 1910
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Virtual Midi Port/Cable

Post by bluebell »

d.healey wrote:How do we add virtual MIDI ports/cables in GNU/Linux? On Windows I used LoopBe but I'm assuming there is a built in way on GNU/Linux.

Thanks.
There are 2 worlds: ALSA MIDI and JACK MIDI. For JACK MIDI to work you need a running jackd instance.

Those worlds can be connected with a2j, e.g. "a2j_control start".

Both can be extended over the network with different tools.

Connections can be made with commandline tools and graphical tools, e.g. qjackctl.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: Virtual Midi Port/Cable

Post by rghvdberg »

There's an ALSA module called snd-seq-dummy which creates virtual midi ports

On my ubuntu system there's
/etc/modprobe.d/snd-seq-dummy.conf

contents of this file

Code: Select all

# Enable 4 ALSA MIDI-Through ports
options snd-seq-dummy ports=4
THe virtual ALSA midi ports show up in qjackctl like this
Schermafdruk van 2019-12-24 11-41-27.png
Schermafdruk van 2019-12-24 11-41-27.png (37.62 KiB) Viewed 4579 times
To connect jack midi apps to these ports you indeed need a2jmidid , but Ubuntu Studio Controls takes care of that automagically by ticking a box. Cadence can do the same.
Schermafdruk van 2019-12-24 11-44-35.png
Schermafdruk van 2019-12-24 11-44-35.png (76.85 KiB) Viewed 4579 times
This is how they show up under the jack midi tab
Schermafdruk van 2019-12-24 11-47-44.png
Schermafdruk van 2019-12-24 11-47-44.png (37.16 KiB) Viewed 4579 times
hope this helps
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

Thanks. I've been working entirely with JACK MIDI. I'll install a2j.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

rghvdberg wrote:There's an ALSA module called snd-seq-dummy which creates virtual midi ports

On my ubuntu system there's
/etc/modprobe.d/snd-seq-dummy.conf
I don't have this. Is there a way to add it or would it require me to install a different kernel?
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: Virtual Midi Port/Cable

Post by rghvdberg »

d.healey wrote: ... I don't have this. Is there a way to add it or would it require me to install a different kernel?
For the record : I'm on Ubuntu 19.10 with kxstudio repos added.
I've also installed the kxstudio-default-settings package which adds the snd-seq-dummy.conf file

But you can do this all manually
  1. First check if the module isn't loaded already
    notice the underscore ( _ ) instead of -

    Code: Select all

    lsmod | grep snd_seq_dummy
    snd_seq_dummy          16384  8
    snd_seq                69632  14 snd_seq_midi,snd_seq_midi_event,snd_seq_dummy
    
  2. if not try

    Code: Select all

    sudo modprobe snd-seq-dummy
    
    (yes there it is - not _ ... thank you linux)
  3. and once again check if the module is loaded by running the first command
  4. if succesful you could manually add the /etc/modprobe.d/snd-seq-dummy.conf file
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

Thanks, that worked! How do I get a2j to auto-start? I tried "a2jmidid -e &" as a command to run after startup in qjackctl but it didn't seem to make a difference. Does it require a system restart to take effect?
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Virtual Midi Port/Cable

Post by Kott »

a2j can work only when jackd is started
not sure that starting a2j* just after qjackctl is enough, even if qjackctl starts jackd automatically, so, maybe you need to insert some "sleep" in your command
Cadence can handle this case
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

Kott wrote:a2j can work only when jackd is started
not sure that starting a2j* just after qjackctl is enough, even if qjackctl starts jackd automatically, so, maybe you need to insert some "sleep" in your command
Cadence can handle this case
Well the method recommended by the qjackctl dev is to use it as a post startup script - https://www.rncbc.org/drupal/node/212 - but it doesn't seem to make a difference. I'm wondering if I need to enable some other JACK setting too.

I don't really want to install cadence because I don't need all of the other stuff it comes with. I just need a JACK settings control and the a2j bridge.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Virtual Midi Port/Cable

Post by Kott »

there is option in qjackctl that allows inserting any command which will executed after start:
Screenshot_20191225_231705.png
Screenshot_20191225_231705.png (62.77 KiB) Viewed 4547 times
it works for me
it can be necessary add "killall a2jmidid" to shutdown script for preventing spawning new instances after restart of the jackd
Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Virtual Midi Port/Cable

Post by Kott »

Sorry, I didn't read your post closely. This option doesn't work for You.

As some advice, it can be debugged:

strace -f qjackctl 2>/tmp/out

then search for a2jmidi in /tmp/out file
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

Kott wrote:Sorry, I didn't read your post closely. This option doesn't work for You.

As some advice, it can be debugged:

strace -f qjackctl 2>/tmp/out

then search for a2jmidi in /tmp/out file
Nope didn't see anything in the out file. I think I'll give in and install Cadence.
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Kott
Established Member
Posts: 818
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 65 times
Been thanked: 122 times

Re: Virtual Midi Port/Cable

Post by Kott »

This is very odd.

Should we cast Rui (rncbc) for help? :)
User avatar
d.healey
Established Member
Posts: 610
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 274 times
Been thanked: 100 times

Re: Virtual Midi Port/Cable

Post by d.healey »

Kott wrote:This is very odd.

Should we cast Rui (rncbc) for help? :)
Yes, but how?
David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
Post Reply