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), 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.
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.
If you are able to see your MIDI controller when you run:
lsusb
then this guide should get you set up with the basics. It goes into quite a lot of detail and discusses possible errors you might face and I wouldn't want to skip anything or take credit away from it.
This command should display your controller:
cat /proc/asound/cards
You do not need WINE for any of this.
On Ubuntu 16.04, I then needed to do the following:
Add an audio group to run your software at the right priority:
sudo addgroup audio
Add yourself to the audio group:
sudo adduser $USER audio
Check what address your soundcard is on for output (it's usually hw:0):
aplay -l
Install Fluidsynth and a soundfont which will act as your synthesizer:
sudo apt-get install fluidsynth
sudo apt-get install fluid-soundfont-gm
Install JACK2 which will be the sound server that sits on top of Alsa:
sudo apt-get install jackd2
Run the JACK server, but allow it to bypass any concurrent pulseaudio process:
pasuspender -- jackd -d alsa --device hw:0 --rate 44100 --period 1024
Run the synthesizer with one of the default sounds:
fluidsynth --server --audio-driver=jack --connect-jack-outputs /usr/share/sounds/sf2/FluidR3_GM.sf2
Now check what ports your servers are running on. This should display your MIDI controller(note the number after client, I got 129
):
aconnect -i
And this should display the port for Fluidsynth(I got 128
):
aconnect -o
Connect the two(remember 129
and 128
are for illustrative purposes, use the port numbers you see in the above two commands):
aconnect 129:0 128:0
You should now be able to hear sounds when hitting the keys on your controller!
Best Answer
OK I figured out the smallest number of steps to get this midi keyboard working:
Install qsynth , Jack Control (called
qjackctl
) , and download Claudio_Piano.rar from here, unpack and save in a handy place.Launch Jack Control (
Applications
>Sound and Video
>JACK Control
on older Ubuntu versions, or search for it in the Dash in newer Ubuntu versions)Click the settings button on the right side of the Jack Control panel, in the settings switch on midi input by going into the
MIDI Driver
drop down near the bottom of the window and selectingseq
(alsa sequencer) and clickOK
.Load Qsynth, go into the setup, check
Enable MIDI Input
and turn the midi driver toalsa_seq
, in the audio tab ensure theAudio Driver
is set tojack
, in the sound fonts tab open your downloaded sound font from above. Click ok and reset the server when it asks.If Qsynth freezes, unfreeze by stopping the jack server and then starting it again.
Go back into the
JACK Audio Connection Kit
window and clickConnect
, here we are going to make sure in theAudio
tab that qsynth is connected to the system output (drag handles).In the Alsa tab we are going to connect our midi device to qsynth.
Back in Qsynth Click on the
Channels
button and watch carefully all the little lights beside each of the midi channels. Press keys on your keyboard and see which one lights up. Click on that row and set the name to Piano (or whatever your musical instrument is)Play keyboard with sound output.