Code. Music. Live.
What the "regular" amplifier does is interface with Sonic Pi, which is awesome software that'll make sound and music driven by code. Sonic Pi comes with an IDE of sorts that you can use to program the composition you'd like to play, and get immediate feedback from hearing how your code is translated into audio. It's a great way to lose track of time for a night or two (or more). However, I was envisioning controlling my audio from the code examples directly. I didn't want to have to work within the IDE.
Enough Coverage To Beat The Band
In the earlier post on dependency injection, I created a PracticeAmplifier class that did nothing so I could use it in tests, rather than the "regular" amplifier.
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
A simple command line interface for Sonic Pi, written in Ruby
To get around using the IDE directly, I found the sonic-pi-cli gem. Its principal use case is to be used directly in the terminal. However, it's a gem, and written in ruby, and the core functionality is available in a class that you can use in any of your code.
Stringing Code Together to Play Music
4 projects | dev.to | 9 Mar 2021
Ask HN: Are there any music composition programs for Linux beginners?
1 project | news.ycombinator.com | 15 Jun 2022
Resources/Reading on Music Tech?
1 project | reddit.com/r/computerscience | 14 Jun 2022
The Floppotron 3.0
2 projects | news.ycombinator.com | 13 Jun 2022
Sonic Pi on Chromebook
1 project | reddit.com/r/SonicPi | 4 Jun 2022