<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>MIDI on Michael Dugmore</title>
        <link>https://michael-dugmore.pages.dev/tags/midi/</link>
        <description>Recent content in MIDI on Michael Dugmore</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-gb</language>
        <lastBuildDate>Sun, 29 Nov 2026 16:53:01 +0000</lastBuildDate><atom:link href="https://michael-dugmore.pages.dev/tags/midi/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Pocket Pulse: Turning My Phone Into a GarageBand MIDI Controller</title>
        <link>https://michael-dugmore.pages.dev/p/pocket-pulse-phone-midi-controller/</link>
        <pubDate>Sun, 29 Nov 2026 12:45:00 +0000</pubDate>
        
        <guid>https://michael-dugmore.pages.dev/p/pocket-pulse-phone-midi-controller/</guid>
        <description>&lt;img src="https://michael-dugmore.pages.dev/p/pocket-pulse-phone-midi-controller/sequencer-live.png" alt="Featured image of post Pocket Pulse: Turning My Phone Into a GarageBand MIDI Controller" /&gt;&lt;p&gt;I like messing around in GarageBand, and I kept having the same minor thought: it would be nice to have another touch controller on my desk for tapping out drum beats or playing synth lines, without buying more hardware that I don&amp;rsquo;t really need.&lt;/p&gt;
&lt;p&gt;I already had a multi-touch screen in my pocket. I didn&amp;rsquo;t particularly want to shop around for iOS apps, mess with Bluetooth MIDI pairing, or install a bunch of drivers. I mostly just wanted to see if I could throw together something simple: run a command on my Mac, scan a QR code on my phone, and start playing.&lt;/p&gt;
&lt;p&gt;That little experiment turned into &lt;strong&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/mdugmore/pocket-pulse&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pocket Pulse&lt;/a&gt;&lt;/strong&gt;, a browser-based MIDI controller, XY synth, and 16-step sequencer that talks to GarageBand over local Wi-Fi.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m sure there are plenty of different ways to build something like this, and almost certainly better ones already out there. This is just my take on it. What surprised me is how much I&amp;rsquo;ve actually enjoyed playing with it since building it. I&amp;rsquo;ll sit down to tweak one small thing, test a few pads, start a drum loop, and end up spending twenty minutes just jamming and making fairly questionable music.&lt;/p&gt;
&lt;h2 id=&#34;still-enjoying-the-low-barrier-to-experimenting&#34;&gt;Still enjoying the low barrier to experimenting
&lt;/h2&gt;&lt;p&gt;This is really just a continuation of what I was writing about &lt;a class=&#34;link&#34; href=&#34;https://michaeldugmore.com/p/family-planner-vibe-coding-the-whole-story/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;almost a year ago when I built our family planner&lt;/a&gt; with coding agents. None of that is new anymore, it&amp;rsquo;s just become my normal way of poking at side projects.&lt;/p&gt;
&lt;p&gt;Even so, I still appreciate how much it lowers the barrier for small experiments like this. A few years back, an idea like a phone-controlled MIDI surface would probably have stayed on the &amp;ldquo;maybe one day&amp;rdquo; list. Not because any single piece is impossibly hard, but because of the time and friction involved in gluing it all together: looking up Core MIDI boilerplate in Swift, sorting out multi-touch Pointer Events in the browser, writing a Standard MIDI File exporter from scratch. Each one is an evening of yak-shaving on its own.&lt;/p&gt;
&lt;p&gt;Being able to get past that boilerplate quickly means I can stay in the fun part, which is experimenting. Try an idea, see how it feels on a phone screen, decide it&amp;rsquo;s missing something, and try the next thing. It makes it easy to build small, slightly silly tools purely out of curiosity.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a quick demo of where it&amp;rsquo;s got to so far:&lt;/p&gt;
&lt;figure style=&#34;margin: 1.5rem 0;&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34; poster=&#34;sequencer-live.png&#34; style=&#34;width: 100%; border-radius: 12px; display: block;&#34;&gt;
    &lt;source src=&#34;pocket-pulse-demo.mp4&#34; type=&#34;video/mp4&#34;&gt;
    Your browser doesn&#39;t support HTML5 video. You can &lt;a href=&#34;pocket-pulse-demo.mp4&#34;&gt;download the demo video here&lt;/a&gt;.
  &lt;/video&gt;
  &lt;figcaption style=&#34;text-align: center; font-size: 0.9em; opacity: 0.8; margin-top: 0.5rem;&#34;&gt;
    &lt;em&gt;Terminal QR pairing, 8 drum pads, the XY synth, and the 16-step sequencer.&lt;/em&gt;
  &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class=&#34;video-wrapper&#34;&gt;
    &lt;iframe loading=&#34;lazy&#34; 
            src=&#34;https://www.youtube.com/embed/6KZ5PtJtuJg&#34; 
            allowfullscreen 
            title=&#34;YouTube Video&#34;
    &gt;
    &lt;/iframe&gt;
&lt;/div&gt;

&lt;h2 id=&#34;keeping-the-architecture-simple&#34;&gt;Keeping the architecture simple
&lt;/h2&gt;&lt;p&gt;Before adding any features, I wanted the simplest path I could think of from a finger tap on a phone to a note in GarageBand:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Phone browser → WebSocket over Wi-Fi → Node.js → Swift over stdin → Core MIDI → GarageBand
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s no native iOS app and no frontend build step, just plain HTML, CSS, vanilla ES modules, and one npm dependency (&lt;code&gt;ws&lt;/code&gt;).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The phone browser&lt;/strong&gt; sends a small JSON message over WebSocket when a finger touches or lifts off a control.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Node.js server&lt;/strong&gt; (&lt;code&gt;server.js&lt;/code&gt;) serves the static files, checks the session token, and writes three space-separated numbers to a child process&amp;rsquo;s &lt;code&gt;stdin&lt;/code&gt;. A kick drum hit at velocity 100 is just &lt;code&gt;144 36 100&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Swift bridge&lt;/strong&gt; (&lt;code&gt;midi-bridge.swift&lt;/code&gt;, around 100 lines) reads &lt;code&gt;stdin&lt;/code&gt;, packs those three bytes into a Core MIDI packet, and sends it through a virtual MIDI source called &lt;strong&gt;Pocket Pulse&lt;/strong&gt;. GarageBand picks it up on whatever software instrument track is selected.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Again, you could definitely do this other ways (native app, network MIDI, all in Swift, etc.), but keeping the boundary between Node and Swift to three numbers on a line made it very easy to follow and debug.&lt;/p&gt;
&lt;h2 id=&#34;starting-with-drum-pads&#34;&gt;Starting with drum pads
&lt;/h2&gt;&lt;p&gt;The first version was just eight drum pads mapped to standard General MIDI notes (kick on 36, snare on 38, closed hat on 42) with an octave offset (&lt;code&gt;-12&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;+12&lt;/code&gt;) for kits that sit elsewhere.&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
  &lt;img src=&#34;drum-pads.png&#34; alt=&#34;Pocket Pulse drum pads&#34; width=&#34;340px&#34; /&gt;&lt;br/&gt;
  &lt;em&gt;The eight drum pads with custom layouts and MIDI learn.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;Once I started trying different GarageBand drum kits and percussion patches, fixed presets got limiting pretty quickly. So I added a &lt;strong&gt;pad editor&lt;/strong&gt; where you can rename a pad, set an exact MIDI note, or use &lt;strong&gt;MIDI learn&lt;/strong&gt;. Learn mode briefly listens to any physical MIDI keyboard plugged into the Mac, waits for the next note you press, and assigns it to the pad.&lt;/p&gt;
&lt;h2 id=&#34;adding-the-xy-synth&#34;&gt;Adding the XY synth
&lt;/h2&gt;&lt;p&gt;After the pads worked, I wanted to see if a phone screen could be a fun surface for playing synths as well.&lt;/p&gt;
&lt;p&gt;I split the horizontal axis into vertical &lt;strong&gt;scale lanes&lt;/strong&gt; (Major, Natural minor, Major/Minor pentatonic, or Chromatic) with root notes highlighted so it&amp;rsquo;s easier to stay in key. Touching higher up gives a higher attack velocity, and sliding sideways moves to the next note.&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
  &lt;img src=&#34;xy-performance.png&#34; alt=&#34;Pocket Pulse XY synth performance view&#34; width=&#34;340px&#34; /&gt;&lt;br/&gt;
  &lt;em&gt;Performance view on the XY synth with two-finger chords and scale lanes.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;Using &lt;strong&gt;Pointer Events&lt;/strong&gt;, each finger gets its own pointer ID, tracked pitch, and a trail on an HTML canvas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sliding into another lane releases the previous note (as long as no other finger is holding it) and triggers the new one.&lt;/li&gt;
&lt;li&gt;Multiple fingers let you play chords on the screen.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance view&lt;/strong&gt; hides the extra controls so you get more space to play.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also added a basic &lt;strong&gt;arpeggiator&lt;/strong&gt; (ascending or descending) that steps through whatever notes you&amp;rsquo;re holding in eighth-note intervals. This is probably the part I spend the most time messing around with. Picking a synth patch in GarageBand and dragging a couple of fingers around the screen is a very easy way to lose track of time, even if you&amp;rsquo;re not much of a keyboard player.&lt;/p&gt;
&lt;h2 id=&#34;a-16-step-sequencer-to-jam-over&#34;&gt;A 16-step sequencer to jam over
&lt;/h2&gt;&lt;p&gt;Next, I wanted a simple way to keep a beat going so I could play the synth over the top of it. That turned into the &lt;strong&gt;16-step sequencer&lt;/strong&gt;:&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
  &lt;img src=&#34;sequencer-live.png&#34; alt=&#34;Pocket Pulse 16-step sequencer&#34; width=&#34;680px&#34; /&gt;&lt;br/&gt;
  &lt;em&gt;The 16-step sequencer with swing, accents, A–D pattern slots, and queued bar changes.&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Off / Hit / Accent&lt;/strong&gt; on each step (tap to cycle).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Swing&lt;/strong&gt; (&lt;code&gt;0–50%&lt;/code&gt;) to shift every off-beat sixteenth note, using the same timing logic in &lt;code&gt;sequencer.mjs&lt;/code&gt; for both live playback and MIDI export.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pattern slots A–D&lt;/strong&gt; saved in &lt;code&gt;localStorage&lt;/code&gt;. When stopped, tapping a slot lets you edit it. While playing, tapping another slot queues it for the next bar so you can switch patterns without stopping the beat.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Browser drums vs. GarageBand MIDI:&lt;/strong&gt; Because GarageBand only focuses one software instrument track at a time, I added a small Web Audio API drum synth (&lt;code&gt;drums.js&lt;/code&gt;) in the browser. That way you can run a drum loop in the browser while the XY pad plays a GarageBand synth, or switch the output to &lt;strong&gt;GarageBand MIDI&lt;/strong&gt; to drive GarageBand&amp;rsquo;s own kits instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MIDI export:&lt;/strong&gt; If a pattern actually turns out alright, &lt;strong&gt;Export MIDI&lt;/strong&gt; downloads it as a one-bar &lt;code&gt;.mid&lt;/code&gt; file (including tempo, swing, accents, and custom pad pitches) that you can drag straight into GarageBand.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;a-couple-of-practical-annoyances&#34;&gt;A couple of practical annoyances
&lt;/h2&gt;&lt;p&gt;Using a phone as a wireless MIDI controller throws up two boring problems pretty much straight away:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Typing local IP addresses on a phone is a pain.&lt;/strong&gt; On startup, a small Core Image script (&lt;code&gt;qr-code.swift&lt;/code&gt;) prints a scannable QR code straight into the terminal. Each launch generates a fresh 36-character token placed after &lt;code&gt;#&lt;/code&gt; in the URL. Because URL fragments aren&amp;rsquo;t sent in HTTP requests, the token stays in the browser and is only used when opening the WebSocket. Traffic is still plain HTTP/WS though, so it&amp;rsquo;s strictly for a trusted home network.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Phones lock themselves mid-chord.&lt;/strong&gt; Nothing ruins a jam faster than a stuck synth note. The browser releases all held notes if you switch tabs or lock the screen, and the Node server tracks &lt;strong&gt;per-client note ownership&lt;/strong&gt; with a 15-second ping/pong heartbeat. If a phone drops off Wi-Fi without closing cleanly, the server sends note-off for whatever that device was holding (and if two phones are holding the same pitch, it only stops when the last one lets go).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;where-it-goes-from-here&#34;&gt;Where it goes from here
&lt;/h2&gt;&lt;p&gt;Pocket Pulse is open source under the MIT licence at &lt;strong&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/mdugmore/pocket-pulse&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;github.com/mdugmore/pocket-pulse&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve got a Mac with GarageBand (or any other Core MIDI DAW), Node.js 22+, and Xcode Command Line Tools, it&amp;rsquo;s quick to try out:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone https://github.com/mdugmore/pocket-pulse.git
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; pocket-pulse
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npm ci
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npm start
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s no grand plan for it. I&amp;rsquo;ll probably keep tinkering with it as I play around and think of things I want (maybe mapping Y-axis drag to MIDI CC filter sweeps, or trying out Linux/Windows bridges if the mood strikes). If anyone else wants to poke at it or send a PR, great. Otherwise, I&amp;rsquo;m quite happy just using it to make questionable music on the sofa and seeing what else I can bolt onto it next.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
