Software

Announcing McLaren Synth Kit

The “McLaren Synth Kit” is an Objective-C framework for using MIDI and Audio on Linux computers with the GNUstep programming environment. It is distributed as a project including libraries, headers and example programs at https://github.com/mclarenlabs/libs-mclaren-alpha. You can use it to experiment with sound synthesis for your own personal projects. The project is designed to provide ready-to-compile examples after you clone the repo.

Working with sound is a delicate endeavor. The Synth Kit does a lot of the low-level work of opening devices, managing an audio thread and copying MIDI events to and from dispatch queues. This leaves the audio programmer free to think about designing sounds as a graph of processing units, called Voices.

Standard Voices in the Synth Kit provide envelopes and oscillators of various types, filters and a reverb algorithm. Using the features of modern Objective-C (blocks, ARC and dispatch queues) the Synth Kit makes programming sounds easy, or at least “easier.”

Read More »Announcing McLaren Synth Kit

VSCode, Ubuntu Snaps and ALSA Sound Development

Here at McLaren Labs we like to try all sorts of tools and development environments to see how they work together. We’ve been using vscode (https://code.visualstudio.com/) on and off for about a year, but only recently decided to try using it for a more complete edit/debug/run cycle for an Objective-C Synthesizer project. We ran into an unexpected interaction between the Snap environment of vscode and the ALSA (Advanced Linux Sound Architecture) PCM interface.

The Symptoms

What we discovered was that when running a program that attempted to access an ALSA sound device was that the program malfunctioned. It worked correctly in a “normal” terminal, however.

We reproduced the behavior using the default aplay command that is available in alsa-utils. See the screenshot below for what should appear in a terminal when it is run, playing an Ubuntu standard sound called “Front-Left”. Unless otherwise specified, this command opens the “default” sound device.

If your Ubuntu sound system is set up correctly, you will hear a woman saying “Front Left” … and it will come out of your front-left speaker.

Read More »VSCode, Ubuntu Snaps and ALSA Sound Development

Enabling memlock for rtpmidi on Ubuntu 20.10

  • by

In version 0.5.2 of McLaren Labs’ rtpmidi, we made the use of locked memory the default. Locked memory dedicates fixed RAM to the rtpmidi process, and prevents it from being swapped to disk. The use of locked memory (through the mlockall() function call) can be a benefit to realtime applications like MIDI and Audio, but its use can be to the detriment of other processes. So it should be used carefully.

On Ubuntu 18.04 and 20.04 enabling memlock as the default option seemed benign enough. On Ubuntu 20.10, however, this default caused problems. With memlock enabled, the process printed strange errors and aborted. Example:

***MEMORY-ERROR***: rtpmidi[2023]: GSlice: failed to allocate 8176 bytes (alignment: 8192): Cannot allocate memory

Ubuntu 20.10 (Groovy Gorilla) accounts for locked memory pages differently, and even though the memory limit is higher, with all things accounted for, it is not enough.

Read More »Enabling memlock for rtpmidi on Ubuntu 20.10

Run rtpmidi as a service on Raspberry Pi

A service is a program that the operating system automatically starts when it boots. On the Raspberry Pi “buster” operating system, the daemon that starts and stops services is called “systemd.” You can read about creating services here:

https://www.raspberrypi.org/documentation/linux/usage/systemd.md

McLaren Labs rtpmidi can be run as a service so that whenever you start your Raspberry Pi rtpmidi can be ready to go. This is especially useful in a headless system where you want rtpmidi to route incoming RTP MIDI sessions to a specific MIDI destination.

One of our customers wanted to know how to do this, so we wrote up this HOWTO guide. Here we will show how to create a service that

  • listens for incoming RTP-MIDI connections
  • connects to MIDI Alsa port 128
  • announces itslef on UDP Port 5006
  • logs its output to Syslog
Read More »Run rtpmidi as a service on Raspberry Pi

McLaren Labs rtpmidi Version 0.5.0

  • by

This month McLaren Labs releases rtpmidi version 0.5.0 for Ubuntu and Raspberry Pi. This release brings some great new features, and also provides a few performance and installation improvements.

More MIDI message types … including SysEx

McLaren Labs rtpmidi has always supported the following message types with full Journal capability for sending and receiving. (Note: The Journal is part of the error correction mechanism that recovers lost messages that occur when sent over a network.)

  • Note On, Note Off
  • Control Change
  • Program Change
  • Pitchwheel
  • System Reset

With this release, we also add the following to provide a complete set of MIDI message types including System Exclusive.

Read More »McLaren Labs rtpmidi Version 0.5.0

The State of Network MIDI (2019)

Network MIDI was invented sometime around 2004 to send MIDI messages over an IP network. To handle network loss, a protocol known as RTP-MIDI was created and documented as RFC-4695. Network MIDI is built into OSX computers and iOS devices. Apple music creators think nothing of connecting MIDI equipment using Ethernet and WiFi, instead of MIDI cables.

Sometime around 2009, Network MIDI was built into iPads and iPhones. This made building touch-based control surface Apps easy, and ensured they integrated with MIDI Workstations over WiFi. While this capability created many cool demos, the unpredictable latency and jitter of WiFi made MIDI-over-WiFi not attractive where timing is important. MIDI-over-Bluetooth became a standard in the last few years, and seems to be the preferred method for sending MIDI over wireless links.

But Network MIDI persists, and new implementations of the protocol as software pop up, as do new hardware products implementing the protocol. This article is a round-up of some of the implementations available in 2019.

Read More »The State of Network MIDI (2019)