How to write music on linux. Rosegarden without dancing with tambourines
I will tell you how to make a penguin play your notes with minimal effort. Yes, this article is not about sound recording, mixing, mastering, but about such a wonderful tool as rosegarden – a midi sequencer, a note editor.
What we have
To write notes and then play them, you don't need an RT (real time) kernel or any special system settings. What's important is what the system uses to output sound. In Linux OS, either pulseaudio or the more modern pipewire are used by default. You can find out which sound subsystem is used using the alsa-info utility (supplied with the alsa-utils package):
alsa-info.sh --stdout | grep -B 1 "Running - Yes"
If you use pulseaudio I recommendfinally already, update the distribution (pipewire is used by default in modern versions of popular Linuxes) or install pipewire manually (although this is not the least effort), because it is an extremely wonderful thing, with which everything works without problems, “out of the box”; with it, even without jack (another sound subsystem), you can play music, but we will install it anyway, because a lot of music software works through it.
What is needed
You actually need to install the following packages (the necessary dependencies will be pulled up, the names may differ in your distribution, although most likely they are exactly like this):
qjackctl qsynth rosegarden
You will also need a soundfont – a set of samples for midi instruments. You can install the “standard” one. soundfont-fluid – this is what the package is called in arch-based distributions, in debian-based – fluidr3mono-gm-soundfontyou can search in repositories titanic (soundfont-titanic in AUR), or find some on the Internet .sf2 file.
First launch
qjackctl
We launch qjackctl and see something like the following window:
Stop (button “Stop”) if the sound server starts automatically; open “Parameters”. In the tab “General -> Main” we are interested in two options: “Driver” and “MIDI Driver”, set them “alsa” and “raw” respectively, the rest – as needed:
That's it, we click “OK”, qsynth may say that the engine needs to be restarted – we agree.
rose garden
Jack and Qsynth are up and running – now we can open our rosegarden. To connect to the midi synthesizer, you need to open “MIDI Device Management” (upper left arrow in the screenshot) and select the name of the midi client qsynth from the available outputs, which we remembered earlier. To make sure that the sound and midi are OK, hover the cursor over the keyboard and sound wave icons in the lower right part of the window.
save to a file, for example, “rg” and grant permission to run:
chmod +x rg
make a shortcut/launch icon on the desktop.
Errors
jack server won't start
The problems can be very different – you need to look at the logs (or “Messages” in the qjackctl window). The most common are dbus and pulseaudio. Pulseaudio can be safely disabled/paused before starting qjackctl: pasuspender -- qjackctl
(pasuspender is part of the pulseaudio-utils package) or pulseaudio --kill
. D-Bus – needed put away checkboxes in qjackctl settings: Options -> Miscellaneous -> Enable D-Bus Interface And Options -> Miscellaneous -> Enable jack interface to D-Bus;
jack interferes with sound playback in other applications running pulseaudio
You need to install the package pulseaudio-module-jack
and configure the script to run in qjackctl: Options -> Scripts and Log -> Run script at startup and insert the following line there: pacmd set-default-sink jack_out
but for this you will need to enable dbus… (I myself have not encountered this problem, so I will give a link to a site discussing this issue);
rosegarden does not play notes / writes that there are problems with sound / problems with midi
If jack and qsynth started correctly, most likely the necessary inputs and outputs simply did not connect to each other – you need to connect them manually. In the qjackctl window, open the “graph” and connect everything as shown in the screenshot (remember your MIDI Client Name and Jack Client Name):
everything works, but there is no sound
It is there, just not where you expect..) Open the “graph” from the previous spoiler and connect the green outputs to the desired device with green inputs (speakers, headphones or bluetooth – here is the name of the device). Or in the qjackctl parameters select the output device: Options -> General -> Advanced -> Output Device (usually you need hw:0 or hw:Generic,0)
complains about the system timer
I encountered this problem a couple of years ago, on an old version of Debian, I don't remember exactly what helped, but this problem can be ignored – it is not critical. It is worth trying to update; load the snd-rtctimer module: sudo modprobe snd-rtctimer
and restart rosegarden (at least that's what the error message suggests); try different timers in the sequencer settings: rosegarden -> edit -> options -> midi -> sequencer timer.
Conclusion
I hope everything works for you! Inspiration and patience to everyone in mastering this wonderful program (by the way, it can also print notes, via lilypond and in pdf). At first it may seem that it somehow does not do what is needed, but you need to spend time to figure out how to change the pressing force, display the controller lines, apply strokes, understand that the “record” button is not for exporting notes to an audio file… All this will pull on a separate article, but for now – do not lose the tonic!
P.S.
You can simply record the result using jack_capture 😉
Examples of what you can write here (yes, this is my site, yes, everything is done in rosegarden, yes, I want exactly this design!) In general, I advise you to download a couple of midi files of famous tracks from the Internet (from “Pirates of the Caribbean”, for example) and see how it all looks in notes/midi.