To display a virtual piano on Linux that shows played MIDI notes from a physical keyboard, you can use the following tools:
Use a USB A-to-B cable (commonly referred to as a printer cable) to connect the USB host port on your keyboard to a USB port on your computer.
- Ensure that the
alsa-utils
package is installed, which includes theaconnect
utility for managing ALSA (Advanced Linux Sound Architecture) MIDI connections. On Debian/Ubuntu-based systems:
sudo apt-get install alsa-utils
- After connecting the keyboard, verify that your system recognizes it as a MIDI device.
- Open a terminal and run the following command to check if the MIDI device is detected:
You should see your keyboard listed as a MIDI input device. For instance, the output would be something like this:
aconnect -i
From this output, the MIDI device entryclient 0: 'System' [type=kernel] 0 'Timer ' 1 'Announce ' client 14: 'Midi Through' [type=kernel] 0 'Midi Through Port-0' client 20: 'Digital Keyboard' [type=kernel,card=1] 0 'Digital Keyboard MIDI 1'
Digital Keyboard
is the related entry to the connected keyboard.
The Virtual MIDI Piano Keyboard (VMPK) is a popular tool for displaying MIDI notes visually as you play them on a physical keyboard.
- On Debian/Ubuntu-based systems:
sudo apt-get install vmpk
After installing VMPK, follow these steps:
- Open VMPK: Launch the VMPK application.
- Connect to the MIDI Device:
- Go to
Edit
->MIDI Connections
. - In the connections window, make sure
Enable MIDI Input
checkbox is selected. - In
Input MIDI Connection
, select your physical MIDI keyboard, for instanceDigital Keyboard:0
. This step ensures that the notes you play on your physical keyboard are recognized by VMPK. - Click on the
OK
button to save the configuration.
- Go to
If you need more control over MIDI routing or have complex audio/MIDI setups, you can use JACK alongside QjackCtl for managing connections.
- On Debian/Ubuntu-based systems:
sudo apt-get install jackd qjackctl
- Start JACK: Open
QjackCtl
and clickStart
. - Connect MIDI Devices:
- Open the MIDI tab in QjackCtl's connections window.
- Connect your physical MIDI keyboard to VMPK.
As you play your physical keyboard, you should now see the notes being visualized on the virtual piano in VMPK.
- Install VMPK for a virtual piano display.
- Use QjackCtl for more complex routing and connections, though it’s optional for simpler setups.
- Ensure that your MIDI keyboard is properly connected and recognized.
This setup provides an intuitive way to visualize the MIDI notes you play, making it a useful tool for music practice, production, and learning.