Linux Music Making – Sonic Pi, LMMS, AKAI MPK USB MIDI

      Kommentare deaktiviert für Linux Music Making – Sonic Pi, LMMS, AKAI MPK USB MIDI

I am not a musician, not at all. I love music! And for year I feel the craving for being able to make my own music, but have not found the right means for it, yet. Over 30 years ago I started a bit with the guitar and indeed had some fun with it! But it cost a lot of time for me to practice and I never really mastered it. I still own some guitar (acoustic concert and western as well as an e-guitar with ampl) and over the years tried again and again but it never really worked for me.

Sonic PiSonic Pi

Maybe three years ago I learned about Sonic Pi, a system running on a Raspberry Pi to program music, even capable of live coding, i.e. changing the music while the code is being evaluated and plaid! That seemed very promising so I tried that. I knew that I can understand coding, so maybe this was my way? Turned out, also not so much. My problem was that I know coding, right, but for being able to code something at least I need to have a pretty good idea of the goal or outcome. And that I did not have. Sonic Pi and the behind the scenes working Supercollider synthesizer are awesome! I would really recommend trying these out. But it still did not work for me.

A smaller annoyance for me with Sonic Pi is also that it requires Jack. Jack is a pretty common requirement for a lot of music software but not what you usually find on your Linux laptop or workstation. And since Jack is mutually exclusive with Pulse Audio, which is the most common audio framework for other use cases, this becomes a bit of a problem. You can work around that with tools like pasuspender but then while using Sonic Pi and Jack you can not get any other common audio from your system. The new Pipewire audio system has the potential to solve this problem, let’s see.

LMMS

Some weeks ago I then came across a post on Hackaday’s blog that really resonated with me: Are Hackers Being Let Down In Education? In school and whenever I was about to learn something about music I felt exactly like the author describes it – in many cases it did not make sense to me and I also felt unable to ask the right questions. In that article the author also mentions a program I was not yet aware of: LMMS

LMMS is a cross platform (Linux, Windows, Mac) so called DAW – Digital Audio Workstation. It integrates audio generation and mixing capabilities with synthesizers, effects and means to edit sequences for base and drum as well as melody. Years back I marveled at synthesizers like the classic Yamaha DX7 or Korg M1. At that time, the late 1980s and early 1990s, way out of my financial reach – and also beyond my musical capabilities. I never learned how to play the piano so those 50, 60 or more white and black keys were mostly a mystery to me – and honestly also kind of scary, so many of them! But the sounds these produced really got me hooked! Quite a dilemma.

Now with LMMS many things seem to become more accessible for me, finally! As for the synthesizer I do not need super expensive gear anymore, I can use my laptop! The digital sound processing is comparably easy and any kind of decent CPU can handle this easily today. It has become more a software than a hardware problem. LMMS comes with a broad variety of synthesizers kind of built in and can support even more using so called VST plugins. The editor for the drum/baseline as well as the melody scores are pretty intuitive and visual. Just by clicking you will quickly figure it out. And you get pretty instant feedback, which I also like a lot! You can have the drum pattern or melody playing in a loop all the time and add or remove notes etc. For me who I do not know anything about music theory a perfect way to start exploration just by trial and error! And while trying and playing I’d recommend to use headphones or you can quickly super annoy your roomie 😉

Using mouse and keyboard you can do pretty much everything, there is no inherent limitation, but there is a practical one. Sometimes you just want to explore sounds or how notes sound together. And you may also want to play around with expression, i.e. how hard you play a sound – softer or hard and powerful. This is pretty complicated to achieve with just keyboard and mouse. You can, but you have to manually change parameters like velocity for each note / sound and your PC keyboard is also pretty limited for playing whole chords.

LMMS is included in e.g. in Debian Linux, installation is as simple as this:

sudo apt install lmms

MIDI Keyboards – AKAI MPK

So I looked, like I already did a number of times before, for so called MIDI master keyboards. In former times MIDI set a standard for interfacing electronic musical instruments, like keyboards, synthesizers, effect generators etc. It is a pretty simple and straight forward serial interface. Back in the days even some computers implemented it, like the Atari ST, which is why the ST along with software like Cubase became a pretty common guest in smaller but also professional music studios. Today the protocol remains but it is driven over the USB interface, so most of the current MIDI keyboards can be directly connected to your computer via USB. Linux supports the MIDI USB class so most (if not all?) of these USB MIDI keyboards pretty much work out of the box with Linux and Linux MIDI enabled software.

My music taste is pretty diverse but what I would be very interested in to be making on my own is more like electronic music, like dance or trance. Or in the style of Kraftwerk or Jean Michelle Jarre. That type of stuff. I am also more of a rhythm rather than melody driven type. So I was less looking at keyboards like full sized pianos with 90+ keys but more at keyboards with some reasonable number of keys but plus some additional controllers for mixing, effects and, what quite some have these days, drum pads.

Pretty quickly I found the AKAI keyboards which seemed to have good reviews overall and offer a lot at comparably affordable prices. You can easily spend a lot of money for these keyboards! A lot as in several hundred and even over a thousand US$/EUR! But like I wrote before, I am not at all a professional, I am still fairly in my infant stages of music development so spending that much money would not be justified. By reading some reviews and looking at the market I settled on either the AKAI MPK Mini MK3:

(c) AKAI

or the MPK249:

(c) AKAI

(Actually the Mini color combo above is exactly the one I got, red/black/white. There are more but I liked that.)

The MPK Mini MK3 retails for about 100 US$ or EUR, the MPK249 is much more professional and thus also quite more expensive, in the 350 US$ / EUR range. For a beginner like me I thought a budget of about 100EUR to get started is OK, 350, *meh*, a bit too much already. So I first settled on the Mini and ordered it from a German retailer (actually Thomann Music Store, which I can recommend, good prices, good service and fast). But at the same time I found an eBay auction for an MPK249 which was still pretty low! I made a bid for 155EUR and won! Wow! And man, how lucky I was, this is still in as good as new shape! So now I have both and can compare side by side.

I have to admit I have not yet done much with either of them so this is still pretty superficial. The first thing I can say is that both work nicely with Linux and LMMS. All Midi events are understood, I can use all keys, the drum pads, the knobs, sliders and push buttons. All working. I still need to get used to the Midi way of working, there are obviously different types of event messages, either as keys (with notes) or as Control Change message or as Program Change message. With key events you also get a velocity, i.e. how ‘hard’ the key was hit, which then of course can change how the selected instrument will sound.

AKAI MPK Mini MK3

The MPK Mini is pretty neat since it is pretty small and light weight, easy for taking with you on a trip. At the price point of roughly 100 US$/EUR for a new device you can not expect much but you already get quite a lot, like two octave keys (2 x 12 + 1), 8 endless knobs, 8 drum pads, a pitch/bend joystick (two axis), an arpeggiator (which is fun to play with) and a small white OLED for some feedback and settings. When you hammer on the drum pads you can see the velocity value on the OLED or when you operate the pitch/bend joystick you also see the values there.

AKAI is a pretty professional maker of such devices for years, they have a ton of experience and also listen to their users. And their users demand a bit flexibility, i.e. to be able to configure certain aspects of their devices. While the keyboard keys themselves are pretty fixed, they have a classic layout which is also bound to what they actually mean, i.e. certain notes. Other control things are not that fixed and users would like to configure these – like the function and meaning of the drum pads or the control knobs or the parameters of the arpeggiator. On the MPK249 you can configure these right on the keyboard itself, which features a 20×4 text LCD screen and a rotary button to tune parameters – endless cryptic menus. But it works!

Not so much on the MPK Mini. On the Mini you can program these buttons and knobs but not on the device itself but through Midi messages. Now, Midi is a pretty transparent protocol, it is not very hard to sniff and so it got reverse engineered and some nice tools being developed, like MPK3 Settings, for Linux and GTK+:

Awesome! Finally, everything in one Window, easy to understand and pretty obvious. Compiled and worked right out of the box, attach the keyboard, fire off the application and here you go! Very nice. The settings can be permanently stored in up to eight banks which can be switch on the keyboard itself. Or you can play and test settings with one bank in the RAM of the keyboard. And you can save them to a file too.

But there is one more thing. The drum pads as well as the keyboard detect the velocity when you press them. The velocity is used as a notion of how hard the key was pressed. It is actually measured by the time of travel of the key, i.e. the time from starting the key’s downward movement until it hits the bottom. This time then gets translated into the Midi velocity message for the key press and a synthesizer can use this extra information to modulate the tone, like making it louder and probably also to change the tone a bit, like a harder attack or pitch.

The MPK Mini has pretty tough keys, i.e. they are actually pretty hard to press. This for me results in pretty low velocity values which again result in pretty low volume notes in the track. For the ones that are not used to playing an analog piano like me, having to apply that force to the keys can be a bit distracting – for me it is, definitely. Many such keyboards thus allow to change the velocity curve of the keys. The velocity curve is, as far as I understand it, a curve mapping the key press timings to velocity values. It is made like a curve because a linear mapping of time = velocity maybe does not sound natural? Or something like that. Anyway, you can change that curve, also on the MPK Mini but only in a hidden menu of the OLED. To access that menu you need to press the “Full Level” button on the keyboard for about ten seconds and then you will see a tiny menu like this, here showing the factory defaults:

So there are five values, v1 to v4 and “Black bal”. The values can be changed with the rotary knobs 1 to 5, knob 1 controlling v1, 2 v2 etc. and 5 controlling “Black bal”. So far I figured out that you can change v1 to v4 in 0.2 steps and that v1 > v2 > v3 > v4 and the maximum to be 40.0 and the minimum 1.0 for the V values and 0.5 to 2.0 for the “Black Bal”. The “Black bal” is, I guess, a kind of offset factor for the black keys. Other AKAI keyboards also allow to change the velocity curve but in other ways so the description for these does not really match the Mini. I tried a pretty linear setting now with 40, 30, 20, 10 and Black Bal set to 1 which for now is acceptable for me. Need to play more with it. When you press a key the little menu will disappear and switch back to the regular display but you can still continue to tune the values with the knobs which will also bring back the menu. By pressing the “Full Level” button again for about 10 seconds the new values get stored permanently and the keyboard returns to normal operation, all button backlight LEDs will briefly flash when done.

None of these values affect the drum pads though, which is kind of sad since I also find these pretty hard to press reliably, I still have to fully compare all of that with the MPK249 but I already found that on the MPK249 you can change the thresholds and velocity sensitivity of the drum pads too. The MPK Mini is a more hacker toy for me right now and it is a bit easier to use kind of everywhere, like on your couch or even on a small desk. The MPK249 is a lot larger and heavier but also the much more professional thing. Maybe I also still have a bit too much respect to use it more – it is a pro device and I am not at all a pro? Anyway…

One more tool I also found pretty useful to get an understanding of the Midi messages landing in Linux and this is ‘midisnoop’, which is a Qt application basically verbosely displaying all incoming Midi events, like this:

You can also see here that besides the velocity the drum pads also emit ‘Pressure’ which is sometimes also called aftertouch, i.e. even after fully pressing the pad you can further modulate – the tone for example. Some keyboards also provide this aftertouch effect for the regular keys, but the Mini does not have this, the MPK249 has. Midisnoop, as well LMMS, is included e.g. in Debian Linux, to install just do

sudo apt install midisnoop

Sounds

So once all that is set up of course you want to make some noise! The built in synthesizers of LMMS offer something for pretty much everyone. You can use the typical sound generating synths like an FM synth or special ones that sound like a Game Boy or old 8-bit computers. Or you can use arbitrary PCM samples (basically wave files) as sounds which can also get translated up and down, pretty fun! A great collection of such samples can be found on Github, made by TeaBoi and contributors, the libre sample pack. LMMS comes with a metric ton of presets for all kinds of things and also another ton of samples to use, like all kinds of drums etc.

But the most fascinating I found are soundfonts. Like a font for writing / printing a soundfont can be understood as a collection of sounds. Instead of a design for each letter it contains sounds for each note. Soundfonts exist for a long time already and have been pretty popular in the days of wavetable sound cards where you load such a soundfont into the soundcard and it would then take care of synthesizing real sounds from it per note, i.e. for playing so called midi files, i.e. complete arrangements stored in Midi protocol, notes and velocities etc.

There are truely amazing soundfonts out there and many of them are totally free! Anything from ambient noises and sounds, all kinds of instruments up to choirs and voices in really really good quality. You can easily spend hours and hours just exploring these soundfonts! And LMMS plays them just beautifully and with these becomes the most amazing and versatile music development tool you can imagine. Don’t like the sound of the piano? Change the soundfont! Need a new percussion set? Get another soundfont!

A huge collection of free and mostly super good soundfonts that work nicely in LMMS I found at Zanderjaz: https://www.zanderjaz.com/downloads/soundfonts/ Wow! With this collection alone almost anyone should have more than enough to create almost anything. Another truely amazing soundfont is Jeux: https://www.realmac.info/jeux1.htm Ever wanted to play a huge church organ? Then Jeux is for you, incredible! Listening to the examples I was blown away! And now I can access all that on my tiny computer, using LMMS and the Jeux soundfont, wow!

The downside of all that is that at least I can get lost easily in just exploring all the sounds, samples, examples etc. without creating anything on my own. It also gets overwhelming quickly, way too many choices! But right now I have a lot of fun with it and will hopefully at some point be able to condense some own inspiration out of it.

Resume

With the keyboards, LMMS and and virtually endless resources of sounds I have found a huge playground to play on 🙂 I just need to be careful not to get lost in all the options. Looking at and listening to examples from the LMMS sharing portal there isn’t just a world to be explored, these are galaxies over galaxies! A whole new universe. Exciting!