Making MIDI Music with my electric piano and iPad

by Marcel Garus · 2021-12-29 · 1 minute read · available at mgar.us/midi-music

I've played piano for a long time, but only recently discovered that my electric piano has a MIDI port at the back! Using it is a lot of fun: By connecting the piano to my iPad, I can play music through the iPad. This allows me to change instruments, and record and arrange music.

Piano connected to the iPad via MIDI

Here's how arrangements looks like in the GarageBand app:

Screenshot of GarageBand on my iPad

Of course, some instruments (such as oboe or violin) sound bad, but percussion and plucked instruments generally have a good sampling quality.

Here is an example song making use of different keyboards, drumpads, and effects:

Thanks for reading!

If you liked this article, feel free to share it using this shortlink:

By the way, I wrote other articles about interesting topics. Here's an article I recommend:

Meta Strings

2022-02-22 · 2 minute read · programming language design

Most programming languages have the concept of a string, a representation of text in the program. In some languages, you can even integrate code expressions in strings:

"Hello, {name}!\n"

Special characters like { or \ indicate that the following characters are not part of the string literal itself, but should instead be interpreted in a different way – they are escape sequences.

This approach comes with some problems: Now, to actually use { or \ in the string, you have to escape those as well. This is okay, but makes strings with lots of special characters ugly. For example, to the regex that matches words ending with \ can be written like \w\\+, but inside a string it becomes even more bloated:

"\\w\\\\+"