linux

Announcing McLaren MIDI Kit – RTP-MIDI library for your own projects

  • by

The McLaren Synth Kit — https://github.com/mclarenlabs/McLarenSynthKit — now includes an RTP-MIDI engine that you can include in your own projects. The engine is the same one that is in our well-known rtpmidi product! We’re providing the library so that you can set up RTP-MIDI connections as you like.

Background

We sometimes receive requests from users to add features to McLaren Labs’ rtpmidi product to handle connections in a certain way. Some users might want to automatically find a particular endpoint or address. Another user might want automatic re-connect in a certain situation. Others want to experiment by translating events from non-MIDI sources into note events sent to a synthesizer on their network.

Read More »Announcing McLaren MIDI Kit – RTP-MIDI library for your own projects

Arduino AppleMIDI and McLaren rtpmidi

  • by
SparkFun ESP2866 “Thing Dev” board

One of our customers brought to our attention an implementation of RTP MIDI for Arduino. With this sketch, you can use an Arduino to send and receive MIDI over Ethernet and WiFi. It is compatible with McLaren Labs’ rtpmidi, so you can use it to send MIDI from an Arduino to your Raspberry Pi.

Read More »Arduino AppleMIDI and McLaren rtpmidi

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

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)

Why McLaren Labs uses Objective-C

McLaren Labs was started with the idea that music and media creation on Linux should be as easy and fluid as Mac OSX. We had been inspired by AVFoundation and the modular way its pieces fit together. We loved being able to build media pipelines with sources and sinks that cleaned up after themselves when you were done with them them.

Many of the facets of the OSX components we liked were provided by ObjC features enabled by the Clang compiler and LLVM tool suite. LLVM has revolutionized language development by paving the way for Swift and Rust. Back at the time we were getting started, Swift on Linux was gaining traction and we considered adopting it. However, after some initial explorations with Swift and libdispatch, we discovered that libdispatch just wasn’t ready with Swift on Linux. That was in 2015 – Swift on Linux is much more mature. The equation might be different today … but it might not too.

Read More »Why McLaren Labs uses Objective-C

Yamaha MD-BT01 Bluetooth MIDI adapter to Raspberry Pi

  • by

The Yamaha MD-BT01 is a nifty little MIDI 5-pin DIN to Bluetooth adapter.  It plugs into the MIDI In/Out ports of MIDI controllers to connect wirelessly to a computer with Bluetooth.  A typical use for this adapter is to connect legacy MIDI keyboards to a computer without using a 5-pin MIDI to USB adapter on the computer.  Since most computers have Bluetooth built in these days, this makes for a tidy work-area since it eliminates at least one of the cables in your MIDI studio.


The MD-BT01 has a very smart appearance – it consists of just two large plugs connected by a single wire.  It runs off of the current already provided by the 5-pin MIDI signal.  Just plug it in, and it advertises itself as a Bluetooth MIDI connection point.    Since it uses the Bluetooth MIDI standard, it can connect to many different devices.  We tested it with Raspberry Pi and it works fine with Raspbian Stretch.  If you have followed the steps in our previous article (https://mclarenlabs.com/blog/2019/01/15/korg-microkey-air-37-bluetooth-midi-keyboard-with-raspberry-pi/) then your Pi is ready to go.
Read More »Yamaha MD-BT01 Bluetooth MIDI adapter to Raspberry Pi