I have 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.
I've looked through a couple resources, but I'm not sure what's outdated, but the following looked helpful...
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.
My step-by-step would be to:
Plug in your MIDI device to your computer. If that's a USB MIDI keyboard, just plug the USB, if it has only MIDI plug, you may want to use a MIDI to USB device.
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.
Launch the synthesizer. Of course it has to be running to produce sound.
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), likeaconnectgui
orkaconnect
. 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.
Proceed to play. Good luck and have fun!
I have also once written an article on general workflow for music production with external keyboard on Ubuntu, it should be useful in your case. Here's the link.
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...
Qsynth -> Setup -> Sountfonts -> Open
:FluidR3_GM.sf2
Virtual MIDI Piano Keyboard -> Edit -> Connections
->Enable MIDI Thru on MIDI Output
: (checked)Input MIDI Connection
: (Your Controller)Output MIDI Connection
:FLUID Synth
At this point, you should be able to play notes from either your external MIDI controller or from the virtual piano GUI (the GUI works even if you don't have an external controller).
From the Keyboard GUI you can select different instruments (see
Program
). From the Qsynth GUI you can manipulate the volume (seeGain
) as well as Reverb/Chorus effects. There is also aPanic
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 tojack
in Ubuntu Studio but toalsa
on Ubuntu MATE.Glitchy static with ALSA [SOLVED]
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 ofSound Preferences
].This led me to play around with some Qsynth Settings, and I found something that seems to solve both static/glitch problems (maybe with a trade-off of a minor latency increase):
Qsynth
->Setup
->Audio
->Buffer Size
:128
Qsynth
->Setup
->Audio
->Buffer Count
:8
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.
vmpk
loses its connection toQsynth
when the settings are changed. The quickest way to experiment with changing settings is to close and restartvmpk
to force a reconnect.Alternative: "Polyphone" application (not in Ubuntu repositories)
I've got my eye on Polyphone as a (nearly) all-in-one solution (essentially a superset of qsynth+vmpk). Although it isn't in the Ubuntu repositories so far (as of 19.04 Disco), it was easy to build from source on 18.04 (also, there is a pre-built Ubuntu .deb provided).
The package doesn't include a default soundfont (it is a soundfont creator/editor), but you can get one with
sudo apt install fluid-soundfont-gm
(at/usr/share/sounds/sf2/
) -- or try downloading from the application's "Online repository" (but this may require an account).Go to
Settings->General->Input/Output
and make sure the Audio/MIDI settings are sensible, then open a soundfont and select an instrument underPresets
and it should be ready to play music from your MIDI controller, or from the built-in virtual keyboard.I don't know about Rosegarden, but you can run qjackctl from the package manager. Amsynth is an easy little way to make sound midi->jack.
I don't know how to run jack and pulseaudio at the same time - ie running chrome through jack (looking into it right now, actually). My experience in 12.04 is easy so far to make sound.
Find out about your sound card:
We will be using card1, device0, thus hw:1,0
My pipeline scenario that finally worked, using
jack-control (qjackctl)
andqsynth
was:MIDI
tab, I selectMidi Driver: alsa-seq
. InAudio
tab I selectAudio Driver: jack
.Fire up jack server with
jackd -R -d alsa -d hw:1,0
Open
qjacktctl
and:4.1 Go to
Connect
->ALSA
. In the left column find out your keyboard and connect it toqsynth
that lies in the right column. Also make sure that in the first column (AUDIO
),qsynth
is connected to your speakers (right column).4.2 Back in the main
qjackctl
window Go tosetup->settings->advanced
and in the right column, chooseOutput Device
(speakers) andInput Device
(Midi keyboard)By this step I was able to hear my keyboard. An overall screenshot of the setup follows
PS: In this scenario no other application can use the speakers at the same time.
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:
Find the ID of your Midi Keyboard using
aconnect --input
, example:Find the ID of your Synthesizer or whatever using
aconnect --output
, example:Route your input to your output using
aconnect 28 128