Virtual Midi Port/Cable

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
d.healey
Established Member
Posts: 205
Joined: Fri Sep 22, 2017 8:33 pm

Virtual Midi Port/Cable

Postby d.healey » Tue Dec 24, 2019 12:47 am

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
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

User avatar
christobal
Established Member
Posts: 19
Joined: Sun Sep 01, 2019 12:58 pm

Re: Virtual Midi Port/Cable

Postby christobal » Tue Dec 24, 2019 9:31 am

Doesn't jack +aj2midi and Carla do this? Or am I thinking of something else?
OS: Ubuntu Studio 19.10
Audio Interface: Focusrite Scarelett 2i4 2nd Gen.
Amp: Echolette M40
Keys: Alesis V49
Strings: Martin D15M, Yamaha FG-180(1966), Alhambra 5P, Yamaha Revstar, Fender Bass
Mic: Shure SM57

User avatar
bluebell
Established Member
Posts: 1242
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: Virtual Midi Port/Cable

Postby bluebell » Tue Dec 24, 2019 9:39 am

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 – https://soundcloud.com/suedwestlicht

rghvdberg
Established Member
Posts: 958
Joined: Mon May 12, 2014 7:11 am

Re: Virtual Midi Port/Cable

Postby rghvdberg » Tue Dec 24, 2019 10:48 am

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

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

This is how they show up under the jack midi tab
Schermafdruk van 2019-12-24 11-47-44.png


hope this helps
You do not have the required permissions to view the files attached to this post.

User avatar
d.healey
Established Member
Posts: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Tue Dec 24, 2019 12:15 pm

Thanks. I've been working entirely with JACK MIDI. I'll install a2j.
David Healey
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

User avatar
d.healey
Established Member
Posts: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Tue Dec 24, 2019 12:55 pm

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
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

rghvdberg
Established Member
Posts: 958
Joined: Mon May 12, 2014 7:11 am

Re: Virtual Midi Port/Cable

Postby rghvdberg » Tue Dec 24, 2019 2:45 pm

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: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Wed Dec 25, 2019 12:50 am

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
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

Kott
Established Member
Posts: 134
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Virtual Midi Port/Cable

Postby Kott » Wed Dec 25, 2019 10:59 am

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: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Wed Dec 25, 2019 12:38 pm

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
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

Kott
Established Member
Posts: 134
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Virtual Midi Port/Cable

Postby Kott » Wed Dec 25, 2019 1:19 pm

there is option in qjackctl that allows inserting any command which will executed after start:
Screenshot_20191225_231705.png

it works for me
it can be necessary add "killall a2jmidid" to shutdown script for preventing spawning new instances after restart of the jackd
You do not have the required permissions to view the files attached to this post.

Kott
Established Member
Posts: 134
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Virtual Midi Port/Cable

Postby Kott » Wed Dec 25, 2019 1:37 pm

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: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Wed Dec 25, 2019 11:53 pm

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
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.

Kott
Established Member
Posts: 134
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Virtual Midi Port/Cable

Postby Kott » Thu Dec 26, 2019 12:18 am

This is very odd.

Should we cast Rui (rncbc) for help? :)

User avatar
d.healey
Established Member
Posts: 205
Joined: Fri Sep 22, 2017 8:33 pm

Re: Virtual Midi Port/Cable

Postby d.healey » Thu Dec 26, 2019 12:25 am

Kott wrote:This is very odd.

Should we cast Rui (rncbc) for help? :)


Yes, but how?
David Healey
Patreon - HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 1 guest