Controlling a drum machine with SuperCollider, MIDI, and Monome Norns

Sometime in late 2020, we found ourselves venturing deeper into the world of SuperCollider as a composition tool for Bit Graves. In particular, we discovered the unorthodox ways in which SuperCollider can express rhythm, and started to use that rhythm in our music. Eventually, we wanted to move those beats onto an analog drum machine, in a live performance setting, without a laptop.



The following essay describes our process of figuring this out, and contains some SuperCollider code samples from different parts of our journey, as well as some videos of live sets where we used this tech.



Rhythm cartography with SuperCollider

Our earliest experiments started with just a laptop: Making different rhythms by using a SuperCollider patch to trigger software sounds. SuperCollider models rhythm as a stream of events— playing a note is one event— and as a composer your role is to describe that event stream as a composition of patterns.



Simple SuperCollider patterns are rigid, predictable structures. This pattern makes one sound every one second, forever; a computer heartbeat.



Pbind(*[
	\dur: 1,
]).play;



Simple patterns give rise to complex patterns. The more you nest, chain, and stack them, the more you strain against predictability into some realm of semi-predictability, where the listener begins to struggle to stay oriented. Like zooming a map outward from a city block to a neighborhood, to a metropolis, the basic patterns cease to be in focus, but the system still seems to obey some incomprehensible structure. The listener searches for any musical accent or repeated cue in an effort to localize, to find some center. We began to seek out grooves right around this boundary space between predictability and disorientation.



Pbind(
	\instrument, \bgScatter,
	\dur, Pn(
		Pshuf([
			Pn(0.1, 16),
			Pn(0.1, 8),
			Pn(0.05, 12),
			Pn(0.15, 4),
		])
	),
	\gain, Pn(
		Pshuf([
			Prand([1, 0.7, 0.5, 0.25], 4),
			Pwrand([1, 0], [0.75, 0.25], 4),
			Pseq([1, 1, 1, 1]),
		]),
		inf
	),
	\freq, Pn(
		Pwrand([10000, 8000], [0.9, 0.1])
	),
).play();

(You need to define a synth called \bgScatter to play this yourself.)



These patches trigger software sounds: The computer decides both when rhythmic events happen and the sound to make when they happen. Here's Bit Graves playing a live set in January 2021, where the percussive sounds are made by SuperCollider, including the specific patch shown above.





MIDI translations

We love our MFB Tanzbar drum machine, and at some point we asked ourselves if we couldn't move our SuperCollider patterns out of the laptop and into the Tanzbar. Then we could inject the rhythmic complexity we wanted into the noisy, breathing medium of a purpose-built sound circuit. SuperCollider would still decide when events happen, but the Tanzbar would determine how they sound.



Thanks to Dave Smith, almost all electronic music machines have spoken the same language for the last forty years. This includes both SuperCollider and our beloved Tanzbar. Theoretically all we would need is to connect the laptop and the drum machine with a cable. So we began to convert our patterns into MIDI messages, the universal format understood on both ends.



Pchain(
	Ppar([
		Pbind(
			\midicmd, \noteOn,
			\chan, mapping.chan,
			\note, mapping.hh,
			\amp, Pn(
				Pshuf([
					Prand([1, 0.7, 0.5, 0.25], 4),
					Pwrand([1, 0], [0.75, 0.25], 4),
					Pseq([1, 1, 1, 1]),
				]),
				inf
			),
		),
		Pbind(
			\midicmd, \control,
			\chan, mapping.controlChan,
			\ctlNum, mapping.hh_tune,
			\control, Pn(
				Pwrand([127, 64], [0.9, 0.1])
			),
		),
	]),
	Pbind(
		\type, \midi,
		\midiout, mOut,
		\dur, Pn(
			Pshuf([
				Pn(0.1, 16),
				Pn(0.1, 8),
				Pn(0.05, 12),
				Pn(0.15, 4),
			])
		),
	),
).play();

The previous pattern, refactored to send MIDI messages. “mapping” contains constants we looked up from the MFB Tanzbar manual.



We ran into some challenges. In particular, the official MFB Tanzbar manual is originally in German, and the Engish version is sometimes wrong. Likewise, the SuperCollider documentation includes at least one mistake, incorrectly listing val instead of control to send MIDI cc parameters. Nonetheless, we eventually got all our bits in a row and managed to get our laptop to send shimmering, staggering, spiraling sound patterns to our Tanzbar's Berlin kicks and snares.



Harnessing norns

The last step in our journey was to get the laptop out of the picture. For the last couple of years, we've used a monome norns for live performances. (We also recorded our self titled album with it.) The norns is a tiny linux computer whose physical form, hardware, and software are hyper-specialized to function only as a musical instrument. We use norns instead of a laptop to run our patches on stage because it gets out of the way and because, literally and metaphorically, it won't try to download macOS Catalina in the middle of a set.





We moved our SuperCollider patch onto the norns, we unplugged the Tanzbar MIDI cable from our laptop, and we plugged it into the norns instead. Then we pressed play and nothing happened.



A key strength of norns is that it's supported by one of the best communities of people on the entire internet. In that spirit, norns is designed to encourage the community to collaborate and share musical software with other norns(es) in the world. It turns out that this introduced some tradeoffs in the way SuperCollider works on the norns: All MIDI devices are automatically claimed by the norns firmware, in order to offer them to the lightweight lua scripting layer built into the norns, and are thus rendered inaccessible to SuperCollider, which is intended purely as a sound engine and not as a control layer. In short, we weren't using SuperCollider as the norns authors designed.



Our short term solution has been, then, to modify our norns to stop doing that. Since the software built into the norns is open source, we found the file responsible for claiming incoming MIDI devices, broke it, and recompiled it, and the next time around our Tanzbar came to life.



It's not ideal to recompile the norns firmware, because it means nobody else can use our patches without recompiling their own norns firmware. So we're also investigating norns polls as a more community-friendly way to stream our rhythms.



Here's part of a live set where we use the full stack, albeit with a very simple rhythm: A SuperCollider patch running on the norns controlling the MFB Tanzbar (and making a bunch of other sounds).





The Future

Now that we've started using this set of sonic tools, we expect to write a body of music this way. We'll try it out at our next shows, and if it still feels good a bit further down the road, it's likely we'll record some of this music for our next release. At the moment, there are still several paths to explore that could both hone our approach and expand the realm further.



We don't need to stop at drums. Because norns is the “brain” of our live setup, we can (de)synchronize more musical events in addition to percussion, both software sounds and hardware sounds.



The Tanzbar, being a dedicated sound machine, features a bunch of physical knobs to shape the sound live. You can change the tune of the kick drum. You can change the decay of the snare. Although we could choose to control every single parameter with a computer program, it's more likely we'll write music that incorporates a blend of computer control and human input. We usually discover our best sounds from the moments of spontaneous improvisation that happen when we play together.



There's room to improvise on the software side as well. TidalCycles and Orca offer new and different ways to reason about musical structure, with an emphasis on changing the structure live. We've got a few TidalCycles experiments floating around the studio, but nothing has yet graduated into something we use live.



Lastly, although this essay is focused on using a hardware drum machine, synthesizing software drum sounds is also a fascinating and deep topic in which we've hardly scratched the surface, but may write about later.



Read more essays about our process and listen to our sounds via bitgraves.com. Please get in touch if you have any questions or ideas about anything here!

Published by Ben Roth (ben) 4 years ago on Monday the 8th of February 2021.

To reply you need to sign in.