Music studies

While music itself is pleasant to listen to, the theory behind it, along with maths for processing or synthesizing it, as well as the process of performing it, can be quite fun.

Music theory

Music theory for nerds is a great starting point.

Some of the related and interesting research areas are those of music origin and purpose, such as evolutionary musicology, and how it's perceived by humans: psychoacoustics, music psychology, music and emotion.

Generation and processing

The PCM format is to audio basically what netpbm/PPM/PGM/PBM/PNM is to graphics: very simple and straightforward, can be played with ffplay and others, easy to generate programmatically and write into a file without any encoder libraries, as well as to read without a special decoder.

DCT/DFT are often involved in processing (and in compression, also similarly to graphics), Mel-frequency cepstrum can be useful and/or interesting to look into.

Analysis

Audacity is handy for checking the spectrum and notes in it, for music transcription and other checks.

MIDI keyboard

To practice playing piano using a MIDI keyboard, one needs at least a software synthesizer and some music scores.

The keyboard in this case is M-Audio Keystation 88 MK3, which worked easily with Linux (5.10, Debian), Windows 10, and an Android tablet (Samsung Galaxy Tab A8, connected with a USB-A-to-USB-C adapter). For a synthesizer, I've used Yoshimi on Linux, LMMS (mostly with its sf2/soundfont plugin) on Linux and Windows, and Synthesia (not in F-Droid repositories, and I don't have a Google account, but grabbed an apk from their website) on Android.

MuseScore allows to compose sheet music and export it into MIDI rather quickly and easily, and there's a few more editors and converters of that kind available from Debian repositories.

PianoBooster looks like a nice trainer, akin to GNU Typist, but I found it quite annoying that it counts it as a mistake if you press a key too soon, so switched back to just reading scores and playing from those.

I use my computer screen to read sheet music, with the keyboard stand placed behind my computer chair, so it has to be zoomed in (Xfce's zooming in is quite handy when software can't zoom in on its own), and scrolling is needed for larger compositions, but the regular computer keyboard and mouse are out of reach. The MIDI keyboard has directional keys, messages from which come from a separate MIDI port; I haven't found readily available software (possibly LMMS plugins) helping to scroll the notes from a MIDI keyboard, but it took just a small script to achieve:

import mido
from xdo import xdo

# apt install python3-mido python3-xdo libportmidi-dev python3-rtmidi

# perhaps can be done in bash, with something like amidi + xdotool

# https://gitlab.com/dkg/python-xdo/-/blob/main/xdo/__init__.py
# https://gitlab.com/cunidev/gestures/-/wikis/xdotool-list-of-key-codes

# print(mido.get_input_names())

mapping = {
    96: 'Page_Up',
    97: 'Page_Down',
    98: 'Left',
    99: 'Right',
    100: 'space'
}

x = xdo()

with mido.open_input('Keystation 88 MK3:Keystation 88 MK3 MIDI 2 24:1') as port:
    for msg in port:
        # print(msg)
        if msg.note in mapping and msg.velocity == 127:
            x.send_keysequence_window(mapping[msg.note])

Scores

IMSLP.org is a nice source of public domain or otherwise freely available scores (including solo piano arrangements).

Composition

Music composition seems to be rather similar to poetry, and to arts in general: a creative process, but one can reuse a musical form, learn and use a variety of approaches and tricks (by analyzing existing works, in addition to just reading about techniques), experiment and try things out.

Ryan Leach on YouTube makes nice videos explaining the composition process. David Bennett Piano brings up plenty of interesting subjects and analyzes songs.

On singing

While I don't sing, a brief look into it suggests that as with most of other skills, it's primarily about learning and practicing, even though it may seem rather natural (even more so than sports). The exercises do look and sound awkward though -- maybe that's why they are rarely talked about.