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.

Main window, score editor, piano roll

Main window, score editor, piano roll

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"
The highlighted line is /usr/bin/pipewire - which means pipewire is used.

In the highlighted line – /usr/bin/pipe wire – Means pipewire is used

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:

qjackctl window

qjackctl 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:

qjackqtl Options -> General -> Main” title=”qjackqtl Options -> General -> Main” width=”887″ height=”650″ src=”https://habrastorage.org/getpro/habr/upload_files/070/034/184/07003418440c52078bdf745c054c2b02.png”/></p><p><figcaption>qjackqtl Options -> General -> Main</figcaption></p></figure><p>Next, go to the “Miscellaneous” tab and check/uncheck the boxes so that jack starts and stops without further ado (this is necessary to simplify the launch of rosegarden) – as shown by the arrows in the screenshot:</p><figure class=qjackqtl Options -> Miscellaneous” title=”qjackqtl Options -> Miscellaneous” width=”887″ height=”650″ src=”https://habrastorage.org/getpro/habr/upload_files/548/69d/657/54869d6573c05383096170ef26926e4a.png”/></p><p><figcaption>qjackqtl Options -> Miscellaneous</figcaption></p></figure><p>Click “Apply”, “OK” and exit to the main window, click “Run”. Errors that may occur will be described at the end of the article, if your error is not there – write in the comments, I will add it to the article.</p><h4>qsynth</h4><p>Next, you need to run and configure qsynth. Open the settings (which are “Setup”):</p><figure class=qsynth window

qsynth window

qsynth Setup -> MIDI” title=”qsynth Setup -> MIDI” width=”539″ height=”525″ src=”https://habrastorage.org/getpro/habr/upload_files/a41/f44/165/a41f441658aed738c0e49d6698e24362.png”/></p><p><figcaption>qsynth Setup -> MIDI</figcaption></p></figure><p>In the MIDI tab we set <strong>MIDI Driver</strong> like “alsa_seq”, remember, “MIDI Client Name” (it can be changed).</p><p>In the Audio tab, set <strong>Audio Driver</strong> like “jack”, remember “Jack Client Name” (you can also change the name).</p><p>Don't forget about the checkboxes for automatic connection of midi inputs and jack outputs.</p></div><div class=
qsynth Setup -> Audio, Soundfonts – the next tab, you won't get lost there even without arrows ;)” title=”qsynth Setup -> Audio, Soundfonts – the next tab, you won't get lost there even without arrows ;)” width=”539″ height=”525″ src=”https://habrastorage.org/getpro/habr/upload_files/7c4/f6b/c25/7c4f6bc254511b60ffd90d2b80540b4f.png”/></p><p><figcaption>qsynth Setup -> Audio, Soundfonts – the next tab, you won't get lost there even without arrows 😉</figcaption></p></figure><p>Next, in the Soundfonts tab, click the button <strong>“open”</strong>. If samples (soundfont) are installed from a repository, they are usually located in the directory <strong>“/usr/share/soundfonts/”</strong>.<strong> </strong>If from the Internet – where you downloaded it. We search <strong>.sf2</strong> files.</p><div class='code-block code-block-4' style='margin: 8px 0; clear: both;'> <script type=

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.

rosegarden window, rosegarden -> MIDI Device Control” title=”rosegarden window, rosegarden -> MIDI Device Control” width=”1366″ height=”737″ src=”https://habrastorage.org/getpro/habr/upload_files/6b2/cfe/30d/6b2cfe30ddffe871f5eeaec704c6933f.png”/></p><p><figcaption>rosegarden window, rosegarden -> MIDI Device Control</figcaption></p></figure><p>Now you can use it! In subsequent launches, rosegarden will automatically connect to the selected midi device (if it does not connect, there is an option for auto-connection in the settings: <strong>Edit -> Preferences -> MIDI -> MIDI Sync -> Automatically connect output to all devices in use</strong>). The interface is intuitive – it will take an hour to figure out the basics by pointing and poking at different buttons, but there are several features that are implemented rather illogically, but this should be discussed in a separate article.</p><h2>A small script</h2><p>To avoid opening and closing qsynth and qjackctl manually every time, it is enough to write a small script:</p><pre><code class=#! /bin/sh qjackctl & sleep 1 # если qjack/qsynth запускаются долго qsynth & sleep 1 # единицу нужно заменить на время их запуска rosegarden $1 killall qsynth killall qjackctl

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_outbut 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):

qjackctl Count

qjackctl Count

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)

qjackctl Options -> General -> Advanced -> Output Device” title=”qjackctl Options -> General -> Advanced -> Output Device” width=”887″ height=”650″ src=”https://habrastorage.org/getpro/habr/upload_files/899/c1e/79f/899c1e79feb9a9c1b2d2143f7a0ab70b.png”/></p><p><figcaption>qjackctl Options -> General -> Advanced -> Output Device</figcaption></p></figure></div>
</details>
<details class= 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.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *