Saturday, February 24, 2024

Seventeen, Going on Eighteen

No time for a major post to celebrate this blog's seventeenth anniversary. But I thought I'd post this fun video I made a little over a year ago. It's been on my list of things to blog about for all of that time, and I'd still like to say more about it, but the basics are as follows:

I'd created a worksheet for an Intro to Music Theory class which provided a series of arpeggios. The students' job was to identify the triad quality represented by each arpeggio. As usual with a worksheet, I made some effort to create a semi-random sequence of triads so there wouldn't be any obvious pattern to help students guess the answers. This also means that the patterns created were intended not to have any clear functional relationship from bar to bar. But...I noticed while absent-mindedly playing the page for the class that I kind of liked the way the unintentional progression progressed. 

So, I tweaked a couple of minor things, added a bass line, and soon had produced this fun little bit of ambient music. 



Of course, the blog has been sustained over these seventeen years by all manner of accidental inspirations, so aimless and random as this might seem, it kind of fits the spirit of MMmusing. Happy MMmusing Day!

UPDATE: I meant to add that this little "accidental composition" reminds me of the theme song for the "Cautionary Tales" podcast. (You may hear that theme used in context around the 3:10 mark here.) Has a similar off-kilter progression and a similar way of building up layers. So, if you have an off-kilter podcast and are looking for a theme song, let me know!

Saturday, February 3, 2024

Whose Fault Is It Anyway?

One of my favorite parts of teaching middle school boys the past five years is that we spend a quarter of every fall semester slow-watching Into the Woods. In my opinion, it's a perfect musical for this transitional age - a show that is constantly exploring what lies "in-between" the safety and familiarity of childhood/home and the excitement and danger found in wishing for more freedom and responsibility.  Every middle schooler lives in this transition between kid and grownup.

In addition to watching, we do multiple projects which give the students a hands-on opportunity to engage with Sondheim's musical ideas. This year, I found a good deal of success getting groups of four students to learn a central section of the big "Your Fault" number in which characters argue back and forth in rapid-fire fashion. (Believe me, rapid-fire argument comes naturally to these boys - but they don't usually do it with a beat.) The students also work on digital audio projects - using a Garageband-like educational platform called Soundtrap - in which they are provided with motifs from the show which they can re-mix by looping, changing instruments, changing tempo, adding beats, etc. 

This year, to give them more opportunity to interact with "Your Fault," I entered all the notes in MIDI format for the five characters and the piano reduction of the accompaniment. Once I had this complex two-minute ensemble reduced to data, I knew there was a lot of potential energy for me to do something creative. For starters, I just made this simple re-mix, meant to sound kind of silly and lighthearted. (It's all saxes with a beat, bringing out the playfulness of the back and forth but minimizing the angst.):



Nothing fancy. Though it certainly takes some of the humanity out of the characters, I really like the way it showcases the mechanical ingenuity of Sondheim's restless ensemble. When characters are running around performing this on stage, trying to make lyrics clear, it's almost impossible to achieve rhythmic perfection. That's fine, but I like hearing the argument in pure musical form.

Somewhere along the way, I had the idea that it would be fun to use this data for an animation of the scene, and over the past couple of weeks I've been spending idle hours making my own little "Your Fault" machine using my old friend Scratch. There's a lot more I could do with this (believe me, I have so many ideas), but I've arrived at a very satisfying stage, so am sharing what I have.

The primary concept is to use the MIDI data (basically, information about which notes to play and when) to trigger simple movements for the characters. Since this song is fundamentally about characters pointing at each other and saying "it's your fault," the movements are mostly just about facing and pointing in the right direction, and the characters also bounce nervously in response to each note they "sing." I also added cartoon-like captions with the lyrics. One of the most fun aspects of the project is watching the way the lyrics interact with each other from the four-plus corners of the frame. No matter what the tempo, the movements and lyrics are always cued precisely by the same data which cues the note changes. 

Because MIDI is so flexible, I couldn't resist creating the option to re-assign instruments and volume levels for the characters. Unfortunately, Scratch doesn't really have many great sounding instruments, so the choices aren't that great, but among other things, it's easy to effectively mute a character (or the drums or whatever) if you want to try playing a role yourself. Feel free to give it a try here:



Note that if you follow this link, you'll find instructions for how to customize playback.

You may view a demo run-thru and then some demo of setup features, following by a blistering marimba run here:


If you don't mind me patting myself on the back, I'll walk through some of the things I had to accomplish. Scratch is a fun, flexible environment, but not exactly made to do what I was trying to do. Although Scratch objects can be told to play x pitch for y number of beats, it's not naturally designed to run multiple parts at once, and getting the data into Scratch takes some creativity as well. It's not remotely as simple as saying, "Hey, Scratch, play this MIDI file."

As mentioned, I had a head-start in that I already had all of the notes entered as MIDI, using a different program. (A fun cheat here is that, though Sondheim's music is highly chromatic and constantly changing keys, I didn't have to worry about enharmonic spellings. For MIDI purposes, a C-sharp or D-flat will sound the same in this context, so I didn't need to worry about precise note spelling as I hastily played the notes in.) Because I don't really have a good method to have a single part play multiple notes, I did have to spend some time simplifying the accompaniment to be two single-line parts. That was fun, but I didn't knock myself out looking for perfection. I think what I have gets the job done.

Although MIDI data like this is pretty darn simple, I had to use a little command-line tool called "midicsv" to convert from its natural binary state into a text-based file I could manipulate in a spreadsheet. In Excel, I created a few simple functions which allowed me to turn the information for each character into simple lists of pitches and rhythms. Scratch then has a simple way to important such lists into variable sets, so I had the fuel I needed to run the machine.

The rest was basically a matter of creating the cartoonish characters (did not invest a lot of time in that!) and their various poses, identifying which lyrics trigger which movements, and designing an interface for the user to adjust parameters. Again, Scratch doesn't necessarily have this stuff built in, so everything from the volume/tempo sliders to the highlight boxes which show instruments selected had to be created from...well, from scratch. (This usually means writing functions that, for example, keep the slider bar moving horizontally with the mouse, but don't let the vertical position change and don't allow the slider to go past the two endpoints.)

One thing that makes this different from most Scratch projects I've designed is that I wanted to make this mobile-friendly. The older version of Scratch wouldn't even work on mobile devices, but since 2019, projects can run on mobile, with varying degrees of success. This means that simple keyboard commands don't work very well (those are generally easier to program), but anything which reacts to mouse clicks also works pretty well with finger control on a phone. Since the dialogue boxes Scratch uses to solicit text input are pretty ugly and take me out of the imagination world a bit, I like having all the controls accessible from within the little world I've made.

As I've written before, what really makes all of this satisfying is to experience the ways in which coding are similar to composition. It's always about figuring out how to create a structure based on a web of interrelationships. When the design works, the result can feel like magic even if it's grounded in math. Sometimes this is due to a truly creative, unique solution to a problem (like when a composer writes an amazing melody) and sometimes it's just the satisfaction of using standard formulas effectively (as when a composer uses established principles of harmony and voice-leading).

Of course, there are MUCH more robust languages with which to program that would create higher-quality results all around. But aside from the fact that the childlike Scratch aesthetic suited the subject matter, it also makes me feel more connected to know how the internal mechanics work. Having to think specifically how to create functions which read, react to, and sync MIDI-like numbers is a more hands-on experience than using pre-programmed plug-in functions - just as it's more satisfying to create a musical composition by choosing all the pitches than it might be to use pre-fabricated music loops. This program will definitely glitch sometimes, especially if you push the tempo up over 150 (hint, hint), but it's remarkable to me how well it holds up considering all the decision-trees I know it's processing and how many notes have to be triggered in such little time.

I now have a pretty cool set of music projects created in Scratch. This one is most similar in scope and function to "Poppy Bach," which plays a three-voice Bach fugue and gives the user a wide variety of customization and view options. But I'd encourage you to check out each little scratch-world found in this gallery

While I'm here, it's also worth pointing out another "Your Fault" project I created within the class context a few years ago. In this case, I had done some editing of the audio from the filmed 1987 Broadway production, so that the music stays reasonably close to an unchanging beat, which means I could easily drop in other beats and sound effects. Although I should probably re-edit to turn down the drums a little, I think this is pretty fun!


As an epilogue, I'll note that the great musical humorist Peter Schickele (inventor of PDQ Bach, etc.) passed away recently. As I've thought about his legacy, I thought about how much he and Victor Borge and Igudesman and Joo and Two Set Violin all benefit from the generally ultra-serious attitude with which those in the classical music world think of "playing" music (even music intended to be lighthearted). All of these comedians have become popular and established enough that their audiences take great delight in the irreverent treatment they display towards the canon, but I continue to wish we cultivated a more genuinely playful attitude in general.

There's a lot of mistrust about what happens when musical ideas are reduced to math. While I agree that something is lost when we take singing actors out of a number like this, I think this process enable us to appreciate something about the craftsmanship beneath the surface. (Also, again, this program will stumble every now and then so it's not so mathematically pure due to my own human frailties as a programmer! Take that, AI.)



Monday, December 25, 2023

Once upon a time...

Once upon a time, I wrote my first twenty-first century fugue back in December, 2015. (I do have one ancient twentieth century fugue as well.) I've played this fugue at some point just about every year since, but have never been happy with the original piano recording I made on an out-of-tune piano. So, the other day when I found time on a beautiful Steinway to record my new "O come, all ye faithful" fugue, I did a few takes of Fugue in Royal David's City and definitely improved on the old version. (A better organ version is still on the to-do list.) 

Just in case you don't know the original tune which famously opens every King's College Lessons and Carols service, here it is. Some of the verses are printed below as well.

MMerry Christmas!




1 Once in royal David’s city
stood a lowly cattle shed,
where a mother laid her baby
in a manger for His bed:
Mary was that mother mild,
Jesus Christ her little Child.

2 He came down to earth from heaven
who is God and Lord of all,
and His shelter was a stable,
and His cradle was a stall:
with the poor, and meek, and lowly,
lived on earth our Savior holy.

3 And our eyes at last shall see Him,
through His own redeeming love;
for that Child so dear and gentle
is our Lord in heav'n above,
and He leads His children on
to the place where He is gone.

4 Not in that poor lowly stable,
with the oxen standing by,
we shall see Him, but in heaven,
set at God’s right hand on high;
when like stars His children crowned
all in white shall wait around.

Saturday, December 23, 2023

Old Faithful

This will be short, but as the year comes to a close, I've used an old technique to get me to do something I otherwise might not do. In this case, I submitted a new Fugue on Adeste Fideles as title of the prelude for tomorrow afternoon's second Christmas Eve service. The fact that this fugue didn't yet exist was just a way of writing a check that I'd have to cash.

For better or worse, the check has cleared, and I even have a couple of recordings to show, one a rather overblown virtual organ fest and the other a quiet run-through on piano this morning. As with all of the two-dozen or so hymn fugues I've written in the past few years, I've often thought of these as primarily functional and flexible, so I like the idea that this fugue can reach a grand and triumphant conclusion - or remain a mostly calm, contemplative piano meditation. 

What with the busyness of the holidays and three church services tomorrow, I haven't exactly perfected this piece or the recordings, but these will have to do for now. Merry Christmas!



Thursday, December 21, 2023

'Tis the Season

Back in 2014, the 50th anniversary year for Terry Riley's iconic aleatoric masterpiece In C, I was inspired by a pun (as so often) to create a holiday homage. It may have been that the pulsing C's which traditionally anchor performances of Riley's work first reminded me of jingle bells. I can't remember for sure, but once I made the "In C  → In Season" connection, there was no going back. Best of all, I think it really works.

Rather than the 53 generic riffs in C Major that Riley devised, I used melodic snippets based on well-known seasonal tunes. Thus, part of the game of listening is to hear these various melodies emerge from the texture and intermingle in unexpected ways. You may read about the origins of In Season here, and I highly recommend a visit to this dedicated page which includes an embedded virtual performance and links to the score and instructions. 

Although I forced some family members to play along back in '14, I've never assembled a real performance...until this year, when the combined high school and middle school bands at the school where I work performed it. I don't have a recording yet of that performance, and I likely wouldn't share it anyway as it was necessarily under-rehearsed. And, though I think it was a real success, I realized how challenging it is to perform for young musicians. They've spent so much of their early years of training learning to play at the right time, with a clear sense of meter and how things fit together. Although In Season demands a very strong sense of rhythm, it's not easy to play confidently when the concept of a downbeat quickly evaporates.

So, I had the idea of creating a new virtual performance for the blog this year. Just as performing this music is more challenging than a quick glance at the score might suggest, creating a decent virtual performance was/is..a big headache. Since my 2014 virtual performance mostly featured orchestral instruments, I decided to go more with a mallets/electric/plucked/synth ensemble this time. I hoped it would be easier to get satisfying sounds, but creating a good mix that feels "of the moment" is daunting no matter what instruments are used.

By the far, the most fun and instructive (for me) aspect of creating this was working from start to finish in a DAW (Digital Audio Workstation) rather than a score-based setup. The advantage of the DAW is that each of the fourteen melodies can be encoded as a MIDI loop which can be dropped onto a beat grid and then looped as desired simply by dragging. No worries about messy ties over barlines. There was still a lot of decision-making about when to pause a given instrument and how to think about having it converse with the others. In our recent performance with students, I emphasized often the important of having them take many breaks simply to listen rather than play constantly. This was in part to keep them from being overwhelmed. With MIDI, the "players" can go on forever without a break, so I had to make decisions about putting spaces in - fewer still than would be likely in any live performance.

Look, the truth is, I could easily spend dozens of hours perfecting this, but at some point I had to remember I had a family and settle for something which is still spontaneous in many ways. I did have fun converting the DAW "score" into an interesting visual as well. Although the "notes" are tiny, it's color-coded so you can see which track is doing what. (You'll have to determine for yourself what the instruments are, but they should go more or less left to right across the stereo spectrum.*)

I realize a skeptic might look at this or Riley's piece and figure it's all kind of random and silly (I know because I was an In C skeptic for decades!), but there is a real order and sense of structure which I believe emerges. You can see the fourteen snippets below. Here's what I wrote back in 2014:

I think [the] large-scale structural aspect of In C is under-appreciated (at least it was under-appreciated by me for decades), and in a small way, I've tried to create some structural flow within my holiday jumble. Most obvious is that the more rhythmically busy patterns occur in #6-11, bookended by the two longest and slowest fragments, #5 and #12. (Note also that #5 ascends and #12 descends.) #3 leads very naturally into #4, both by shared dotted rhythm and the G-F-E connection. #4 ends with the same rising G-C that begins #5. Only C-D-E-F-G are used through the first five fragments. A appears only in #6 and #8-12, with the leading tone B appearing only in the climactic #10-12. (There's a sense in which 9-11 transitions into A Minor, the relative minor of C, and then the expansive #12 brings us back to C.) The final fragment, #14, is the only one not to include C, so it serves as a kind of implied dominant that might lead back...


Having now been through this piece many times with students and via virtual work, I can affirm that these features consistently shine through, although I hope new and interesting things happen each time as well. Give it a listen! Then go play it!



* The instruments used are basically an acoustic guitar, an electric guitar, a synthy guitar, an electric piano, a harp, a synthy keyboard, marimba, bells, vibraphone, synth, and electric bass.