← All posts

My Agents Are Writing the Soundtrack

Giving Rowan its music, effects and voices.

I want Rowan’s towns and countryside to have their own music. A place should feel familiar when I return to it, and a fight should change the mood without making every encounter sound like the end of the world.

Rowan is the single-player fantasy RPG I’m building with coding agents. In the last article, I showed how we’re developing its painted materials. The agents are also writing its music, with a system that turns their compositions into playable recordings.

Writing the music

The agent writes a score as text. It specifies the notes, their lengths, the instruments playing them and how the parts fit into sections. Tempo sets the pace, and dynamics tell an instrument when to play softly or with more force.

A renderer reads that score and plays recorded instrument samples from VSCO 2 Community Edition, a freely available orchestral library. The agent supplies the composition and arrangement. The library supplies the sound of the flute, violin, harp and other instruments, and the renderer assembles their notes into the finished audio.

That gives the game-building agent something it can work on directly. A melody, its accompaniment and the shape of a piece are written parts it can revise. I can ask for a quieter passage or a different instrument carrying the tune, and the change can be made in the score.

For example, the countryside theme starts its main flute melody with three rising notes. The score records each note with its duration. At this piece’s tempo, those three one-beat notes fill one bar.

D4/1 G4/1 B4/1 |
Ferrow Meads flute part, 104 BPM.

The composition also gives the tune to the violin in a later section, with a different flute line above it. The notes and arrangement provide ways to develop a theme as it repeats. The instruments still need room to breathe, and the result needs to be heard as music.

Two places

These are the orchestral versions of our first two themes. They demonstrate the approach we’re using to build out the soundtrack. Each preview plays through the loop boundary so you can hear how it returns to the beginning.

Lanternhold is the working town at the start of the game. Its theme puts the melody on clarinet, with violin, harp, cello and touches of horn and percussion. The score gives the violin its own passage, then brings the parts together again.

Lanternhold The town theme, played with the VSCO orchestra.
The party outside Lanternhold’s timber market hall at dusk, with lit lanterns and the great rowan beside it.

Ferrow Meads is the countryside outside town. Its three-beat pulse and flute melody give it a different character. Harp, strings and light percussion support the tune, with a quieter middle section before it returns.

Ferrow Meads The countryside theme, played with the VSCO orchestra.
The party approaches a timber bridge over the Ferrow, with open meadows and willows on the far bank.

We tried other ways of supplying the instrument sounds. I’ve chosen the recorded orchestra as the foundation for Rowan’s music. The written scores let us keep developing the compositions with a consistent set of instruments.

The same system can write a brief phrase for gaining a level or completing a quest. Those moments need an ending of their own. Background music needs to repeat naturally and leave space for what the player is doing.

Sounds of action

I’ve selected MOSS-SoundEffect for the game’s sound effects, including weapons, footsteps, creatures, spells and environmental sound.

For these requests, we describe the physical event: what makes the sound, what it touches, how close it is and how it unfolds. A leather boot landing on grass and a sword swinging through the air need different attacks and endings. The generated recordings are prepared into individual effects or repeating backgrounds for the game to use.

These examples come from the selected MOSS approach. The short sequences include variations of the same action.

Sound effects
  • Sword swing A quick blade movement through the air.
    Listen to Sword swing
  • Footstep on grass A leather boot landing in grass.
    Listen to Footstep on grass
  • Boar call An aggressive snort and squeal.
    Listen to Boar call
  • Gathering fire The preparation of a fire spell.
    Listen to Gathering fire
  • Fire release A brief fiery burst with a crackling tail.
    Listen to Fire release
  • Countryside ambience A repeating background for the Meads.
    Listen to Countryside ambience

Their use matters as much as the individual recordings. A spell’s arrival should be heard at its target. A creature’s call should help place it in the world. Effects need to remain distinct when several party members are fighting together, with the music leaving room for warnings and actions.

People in the world

The characters use Qwen’s voice-design model. We describe a voice and give it Rowan’s dialogue. That lets the warden, trader, farmer and adventurer have different deliveries while speaking the world’s own lines.

These four voices are approved for the sound package. Each sample below is one complete line.

Character voices
  • Warden Charter keep you.
    Listen to Warden
  • Trader Good trade to you!
    Listen to Trader
  • Farmer Fair morning to you.
    Listen to Farmer
  • Adventurer For Lanternhold!
    Listen to Adventurer

Building outward

The score renderer and instrument kits are now part of the game’s maintained tools. The agents have a musical direction for the areas, combat and short event cues, alongside the selected systems for effects and speech.

The larger soundtrack and its integration are still being built. I want to hear these choices working together while moving through the world: the town giving way to the countryside, combat interrupting exploration, and a familiar theme returning when the fight is over.

My Agents Are Writing the Soundtrack
0:00
4:15