Ihave a Korg Nanokey, and I'd like to make it produce sound in ubuntu. I've read that means I should be using Rosegarden, and that Rosegarden uses JACK, but does not install it. (Although checking out Ubuntu Software Center, apparently some components of JACK are installed by default?)
I understand there can be a lot of work setting up JACK without it fighting the default sound server. Can someone give me a step-by-step method for what I need to do to plug in my midi machine and hear music when I press keys as simply as possible (without messing up pulseaudio, ie, so I can still access Skype and ordinary desktop stuff)? I'm fine installing JACK, but I'd like to sandbox it a little if it has the chance of messing up regular desktop.
If you just want to get your keyboard to play sound, this is very simple, and you won't need JACK nor Rosegarden for that. These tools are great if you want to record MIDI signal, write notes, and route audio between separate applications, but you don't need that to play sound with your keyborard.
Download/Install a synthesizer. There is a large variety of sound synthesing applications for Ubuntu. You may like ZynAddSubFX (really powerful one), FluidSynth or QSynth (support soundfonts), AMSynth, AMS. Make sure to browse Ubuntu Software Center for synthesizer that will grab your interest.
Tell the system to pass data from your keyboard to the synthesizer. You need to create a link between your keyboard and your synthesizer, so that MIDI signal is passed to it. You can either use aconnect tool, or one of it's graphical backends (which are simpler to use), like aconnectgui or kaconnect. While aconnect is installed by default, you can get the other two from Software Center. Once you connect your keyboard, and synthesizer, follow to the final step...
Press a key on your keyboard. You will hear some sound! If not, make sure if your system sound is not muted, and that our speakers are connected. Also, some synthesizers require you to choose an instrument before they produce any sound.
Fine tune your synthesizer settings. You will most likely not enjoy the initial sound of the synthesizer. In case of ZynAddSubFX, this will be a plain sine wave, boring! However, you can easily browse a great collection of timbres, and you can customize them fully. All synthesizers provide you lots of customisation, it's worth to spend some time choosing what you like most.
MIDI on Linux is highly modular and, as a result, initially overwhelming. It's nice to have a low-complexity solution working before you bother with optimizations, but unfortunately Ubuntu doesn't come with a default working configuration. Here's the simplest way that I have found...
From the Keyboard GUI you can select different instruments (see Program). From the Qsynth GUI you can manipulate the volume (see Gain) as well as Reverb/Chorus effects. There is also a Panic button in case the reverb goes off the rails.
This was specifically tested on clean install of Ubuntu Studio 18.04, but similar steps worked for Ubuntu MATE 16.04, with a notable automatic configuration difference being that Qsynth -> Setup -> Audio -> Audio Driver defaulted to jack in Ubuntu Studio but to alsa on Ubuntu MATE.
On both 16.04 and 18.04, I have experienced weird static when Qsynth initially starts working with alsa. This static seems to affect all audio sources, but it somehow works itself out in a minute or two (at least partially).
I later tried this setup on a less powerful CPU and noticed a similar static that did not seem to resolve over time. [As an aside, I noticed that this static correlated with the ALSA plug-in [qsynth] line glitching in and out in the Applications tab of Sound Preferences].
Apparently, the CPU can't always keep up with the required burst rate, so a little extra buffering is needed to prevent underruns. Presumably the are other settings that could also affect this.
Go to Settings->General->Input/Output and make sure the Audio/MIDI settings are sensible, then open a soundfont and select an instrument under Presets and it should be ready to play music from your MIDI controller, or from the built-in virtual keyboard.
4.1 Go to Connect -> ALSA. In the left column find out your keyboard and connect it to qsynth that lies in the right column. Also make sure that in the first column (AUDIO), qsynth is connected to your speakers (right column).
To extend the accepted answers point 4 "Tell the system to pass data from your keyboard to the synthesizer" I'll just quote the Arch wiki which helped me immensely by giving simple to the point instruction:
I've been using Ubuntu since 2006, but even after 13 years I still dualboot with Windows. There's still a few things that keep me from goingLinux-only. Mostly that's games, but there's a few other things that Linux unfortunately does not excel at. One of those things is anything relatedto music and sound.
I have an M-Audio Keystation Mini32 that I like to use for, well, simplyplaying some notes. On windows, it's pretty much plug-and-play. On Linux,that's not quite the same experience, tho it was less cumbersome than Iinitially thought it would be.
Qsynth is a GUI wrapper around the fluidsynth software synthesizer.This will be the application that actually converts MIDI signals toaudible sound. You will need at least one soundfont file to be ableto hear anything. Thankfully, the qsynth package on Ubuntu comeswith the fluid-sountfont-gm package which provides a soundfont file.
Jackd is where things get hairy.Jack is an 'audio connection kit', that allows applications to connectsound streams to other applications. It comes with a server, jackd,that performs all the routing between applications (which then functionas jack clients).
Stay in the the "advanced" tab, while opening a terminal. By default,jackd is assuming your output device lives on card 2, with subdevice 0.This isn't always the case, and in my case, actually changes at eachreboot. Unfortunately this means I may have to re-configure jackd ateach reboot.
Which device you are looking for depends on your situation. If you have connected your PC to a TV, it's going to be one of the HDMIdevices. If you used the headphone jack, it's going to be the Analogdevice. In any case, the format is going to be hw:card,subdevice.
If, at this stage, you get an error stating Cannot write socket fd = x err = broken pipe,that means your setup uses the wrong output device. It may be a bit of trialand error figuring out which output device you need.
Now, we are almost done configuring things. We now need to go backto qjackctl. Now, hit connect. Go to the Alsa tab - strangly not the Midi tab. You'll see your midi device listed on the left side, and qsynth listed on the right side. You'll want to connect both. Select both, then hit the connect button, and a line connecting your midi device to qsynth should show up.
This is due to jackd not working nicely with pulseadio. Pulseadio is the sound server that practically all other applicationsuse. While jackd is active, applications using pulseadio will notproduce any audio.
For one, I don't understand why pulseaudio-module-jack doesn't come asat least a recommended package when installing jackd. It seems to me that running jackd and pulseaudio at the same time on a modern Linux desktop is a very logical thing to do. It would be even greater if jackd would comepreconfigured with pulseaudio working out of the box.
While playing instruments, we usually want our latency to be as low as possible.To get the lowest latency possible, you should grant realtime priority to jack (or actually, you should use a realtime kernel as well). Doing so, however, means youhave to configure your user to be able to grant realtime priority.
thank you very much. I was able to connect my CME XKey Air with Bitwig by your method. (Ubuntu (xubuntu) 22.04.3). It is still necessary to recompile BlueZ. This solution (viewtopic.php?t=23610&start=15) will only work for special USB WIDI Sticks.
@audio-dsp: Welcome to the forums. FYI: the page you referred to is for Ubuntu 16 which is from 2016 and has long since been deprecated for newer Ubuntu versions. I tried Bluetooth Midi once and it worked out of the box. AFAIK no need to update Bluez (which is ver. 5.53 on my old Ubuntu distro).
Result should show libasound2 dependency
If it doesn't show a dependency on *libasound2, then midi support is not compiled in
(On my system it still does not show libasound2 even after compiling)
Install dependencies (Also check the section of the tttapa page and be sure to include those dependencies)
sudo apt -y install python3-docutils libical-dev libreadline-dev libudev-dev libdbus-1-dev libasound2-dev build-essential
ZynAddSubFX is easiest to use when you want to output a single instrument, as it does not require samples or soundfonts. When you want to play a MIDI stream with multiple instruments, such as a General MIDI file, FluidSynth or Timidity++ are an easier fit. FluidSynth has a nice GUI, but you will have to search for a suitable soundfont to go with it. TiMidity++ is a bit harder to install and use, but you can easily install a sample set for it from the repostories.
Still that wiki, it tells people how to fix TiMidity if it uses too much CPU. Well, when I play the above 15-instrument midi, my 10+ years old CPU barely shows any usage. The CPU graph is flat at the bottom, barely see any dent.
Thank you! This worked great for me in Linux Mint 17, installed the packages timidity and freepats, and now it plays MIDI files right out of the box. Now I can check what my LilyPond experiments sounds like.
3a8082e126