Interactive Music: Our “Musical Phrase System” 14/12/2018

Hello! I’m Kyle Okaly, and I created all the music and sound throughout Valleys Between. In the past I’ve worked as both a film/game composer and a programmer, but rarely both on the same project. The team at Little Lost Fox has been amazing to work with for many reasons, but the one most relevant here is that they let me experiment with some cool ideas in programming the audio I created. As a result, we ended up with an interactive music system that is fairly interesting (in my very biased opinion!) and subtly deeper than it may initially seem.


Before we dove into discussing the technical aspects of how music would work in Valleys Between, the team and I figured out a general aesthetic that we would aim for. The consensus was something that we felt matched the tone of the visual art and gameplay best: something calm, simple, melodic, understated, and beautiful. I created a few mockups, we went back and forth with feedback and impressions, and we singled out a few themes we liked.

Once we had a pretty clear idea of what the music should sound like, I began thinking about interesting ways to deliver it. One of the goals for the audio in Valleys Between was to make the game feel more tactile and interactive, so I was very interested in borrowing some ideas from procedural music to base some aspect of our score on player input. Certain styles of music may lend themselves to procedural generation more naturally than others, and our choices didn’t seem like a great fit: we had melodic themes that we wanted to be recognizable, we had clear tonal centers and well-defined chord changes, and (maybe worst of all) it was important that the tone remained peaceful, meditative, relaxing—pretty much the opposite of “unpredictable”.

Don’t get me wrong, I thought these were the perfect stylistic choices for the game, but I still wanted to figure out a way to make the music feel reactive and give the player the sense that they were guiding or shaping it in some way. I’ll spare you the details of every attempt along the way and summarize the system we ended up with, which I unofficially refer to as our “Musical Phrase System”.

How It Works

All player actions in Valleys Between are performed by either swiping up or down on a tile, so the entirety of player input can be thought of as a stream of swipes. We decided to connect the frequency of these swipes to the amount of ongoing musical activity. Since our goal was to maintain a relaxing, zen-like state, this system was less about “ramping up” the music during active periods and more about letting the music fade into the ambience of nature during periods of inactivity.

  • All gameplay music is divided into short “musical phrases”, around 10 seconds each.
  • For each musical phrase, there exists one base layer and four additional layers: one for each in-game season.
  • Base layers contain a melody and minimal accompaniment. They are simple and sparse.
  • Seasonal layers add one or more distinct instruments to their associated base layers. They each evoke different moods, depending on the season.
  • Each phrase has associated data; this includes the chord associated with the beginning of the phrase and any chord changes that occur within the phrase.
  • For each chord that occurs in any phrase throughout the game, there exists one or more “inactive phrases”. These are longer musical tracks (20 seconds or more) that don’t define any rhythm or tempo and contain notes that outline a particular chord. These feel very ambient and peaceful.

When gameplay begins, only ambient nature sounds can be heard. When the first player action occurs, the base layer of the first musical phrase begins playing. If another player action occurs before the phrase has finished, the appropriate seasonal layer is added. This achieves “maximum musical activity”, which is also sort of “standard musical activity”—if you’re actively playing the game, you will likely be in this state for the majority of your experience.

When a musical phrase ends, the next phrase begins immediately. (They feel seamless—the player isn’t meant to hear them as separate phrases, but as one continuous musical track.) If no player action has occurred recently, the next phrase will begin with one less layer. When the final layer of a phrase is removed, instead of playing the next phrase, we trigger an inactive phrase that matches the chord of the next phrase. If a player action occurs during this inactive phrase, the next phrase is immediately triggered.

Since the inactive phrase doesn’t imply any rhythms, beginning the next phrase at any point during it feels natural, and since its notes work within the chord of the next phrase, any overlapping notes sound “correct”. If an inactive phrase finishes without any player interaction, all music is once again silenced, and we are left with nature ambience until the next player action.

Check out this video to step through the process in real time:


While designing this system, we struggled to find the right balance between interactivity and music that felt calm and natural. I experimented with much shorter phrases—a few seconds and a few notes each—and while this felt like notes were more often triggered directly by player action, it also inevitably felt choppy and strange when actions were performed at certain intervals. It became clear that the music shouldn’t change much if actions were being performed often, so the best opportunity for direct musical feedback was after a period of inactivity.

This actually worked quite well with the spirit of the game. One of the main themes is developing a closer bond with nature, and early in the process we decided that the music should leave some room for ambient natural sounds to occasionally be the focal point. Rather than building softer segments or gaps into a pre-defined musical track, these nature-focused moments are now entirely user-defined. By simply stopping for a while to listen, the music will gradually become less complex, and eventually fade away completely.

As a side note, many sound effects are also programmed to take advantage of the musical phrase system: since each phrase is keeping track of the current chord, different variations of certain musical sound effects are played depending on the current chord.

I had a blast working on this with Little Lost Fox, and I learned a lot throughout the process. Creating something new based on an idea—a theoretical “that would be cool”, rather than a concrete “this has worked in the past”—is always an adventure. No matter how well-formed the idea may seem, the end result is rarely what was expected going in, and the process of getting there is even harder to predict.


The start of a new adventure 13/12/2018


Hello! I’m Niamh – a producer, a game designer, a technical artist and generally the person who picks up tasks that nobody either wants to do or knows how to do. So perhaps it’s fitting that I’m the first one to post in our new blog!

Nine months ago we set out on a journey to create our studio called Little Lost Fox, and release a small mobile game called Valleys Between. It’s been a surreal 9 months, and I can honestly say that is has felt simultaneously like the fastest and the slowest 9 months in history.

We’re just past the 1 week milestone of Valleys Between being available worldwide on the App Store (cue the bubbles and party poppers!). It’s been a tumultuous and reflective week here in the office – as I’m told is pretty frequent post-release! We’re currently in the planning phase for our next steps for Valleys Between and for the studio, so hopefully we’ll be able to share more about what we’re working on in future posts, as well as news about the Android release.

If you haven’t already, you can check out Valleys Between on the App Store now and/or watch our launch trailer!

The plan is to use this blog to not only talk about news and the studio, but also take a look at some of the cool things we’ve made, how we’ve implemented certain things, and some of the challenges we’ve faced. For the team and I, this is not only our first shipped game (challenge #1) but the first studio that we’ve managed (challenge #293), so in later blog posts I’ll be talking a little more about some of the lessons we’ve learned along the way.

As this is our first foray into talking about the behind the scenes of the studio, if there’s something you’re particularly interested in hearing about drop us a a comment, a message on Twitter, Facebook or send us an email!