![]() Second, there was a noticeable lag between when I moved the slider and when my volume changed. First of all, it was inconvenient to have a seperate Electron application that I needed to run constantly in the background. While my prototype was working, there were a few issues. This worked, so my first prototype was complete! MIDI in Objective-C Using the above code, here's an example of the output I saw: The following code connects to my controller and tells the browser to log any messages it sends:Ĭonst midiAccess = await navigator.requestMIDIAccess() Ĭonst input = ("-511226250") I played around, taking a lot of inspiration from Smashing Magagzine's brilliant article, and was able to read data coming from my device. This has fairly limited support, unfortunately, but has been available since 2015 in Chrome. With that in mind, I turned to Web MIDI, an API exposing MIDI devices to JavaScript. Learning new languages is fun, but I decided that working with audio drivers in an unfamiliar language might be a bit too ambitious! I only have a small amount of Objective-C experience, so where possible, I wanted to stay in languages I was familiar with. A proof of concept, with Web MIDI and AppleScript I also like the size, which works well beside my MacBook on my desk. It only costs around £35 ($43.22 USD at the time of writing), which I see as a fairly reasonable price. I chose the Behringer X-TOUCH MINI, available on Amazon. The ControllerĪs the name suggests, MIDI controllers all use the same protocol, so the choice of controller isn't too important. What matters is that this provides the audio driver and UI code for mixing applications. There's a great look at the internals here, and while understanding those isn't needed for the rest of this post, they're interesting regardless. This open source project provides the application level control I was looking for. I recently found a solution, using the open source BackgroundMusic project, and my own code to interface with a MIDI device. I've seen this done in Windows, but never in Mac. This would allow me to turn Spotify down when I'm concentrating, or turn up a Slack call if I'm struggling to hear. Using a MIDI controller to mix Mac application volumesįor a while, I've wanted control over the volume of individual macOS applications, using a physical controller. Oliver Dunk 23 years old, Developer Relations Engineer at Google
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |