

With a bit of luck, your song will now play. Here the number “3” in “hw:3,0” is the same “3” as in /dev/snd/midiC3D0 Now we are ready to start Mplay.jl using the helper script in the src directory: Mplay.jl/src$ bash Mplay.sh -device="hw:3,0" song.midi The result should look like this: $ aconnect -l Then I can connect the output of client 28 to the input of client 128 like this: $ aconnect 28:0 128:0 My virtual midi devices are clients 28 to 31 and fluidsynth is client 128 (these numbers might be different on other systems). This is done using aconnect from alsa-utils.įirst we need an overview of our system: $ aconnect -lĬlient 28: 'Virtual Raw MIDI 3-0' Ĭlient 29: 'Virtual Raw MIDI 3-1' Ĭlient 30: 'Virtual Raw MIDI 3-2' Ĭlient 31: 'Virtual Raw MIDI 3-3' Ĭlient 128: 'FLUID Synth (5104)' Now we need to connect fluidsynth to the the virtual midi device. Here the device “hw:0” is the soundcard on the motherboard, so the sound will come out of the headphones I plugged in the jack on the front of the computer. Then I can run fluidsynth in “server mode” (it blocks the terminal): $ fluidsynth -server -audio-driver=alsa -o =hw:0 /usr/share/sounds/sf2/FluidR3_GM.sf2
Mplay linux install#
On Ubuntu I get them like this (we will need alsa-utils also): $ sudo apt install fluidsynth fluid-soundfont-gm alsa-utils I use fluidsynth together with the FluidR3 GM soundfonts. We also need a software synthesizer to turn the midi code into a sound signal. The number “3” in “midiC3D0” is important, and depends on the number of physical soundcards on the system. dev/snd/midiC3D0 /dev/snd/midiC3D1 /dev/snd/midiC3D2 /dev/snd/midiC3D3 On my system they show up like this: $ ls /dev/snd/midi* To create a “virtual midi device” I do $ sudo modprobe snd-virmidi snd_index=1 Mplay.jl writes to a “raw midi device”, and Ubuntu does not have those on by default. Here’s how I got Mplay.jl to work under Linux (Ubuntu 20.04).
