The Songbook, or what 60 genres are made of
How intensive genre research plays a critical role in Songcode’s generations
The Songbook is the core research catalogue that all Songcode generations are composed from. For each of the 60 genres in the Songcode Studio, it holds what the best-loved music in that genre is built on: its harmony, its forms, the shape of its hooks, its grooves and bass lines, who plays in its band and how its songs grow from the first bar to the last. Every new song is written with it, so a house song sounds like house and the next house song sounds like a different one.
This post covers the problem that started it, what we read and found over five rounds of study, and the line the Songbook never crosses.
Five songs, one song
Early in development, we noticed that when we generated songs with the same genre selected and the same written prompt, five out of five times they would come out identical. This may seem like an expected and good result, but for a music generator it’s quite bad. The same prompt within a single genre should reflect the breadth and variety of musical creativity, and early versions of Songcode didn’t.
| prompt | what came back, five times out of five |
|---|---|
| house, “warm late-night house loop” | A minor, 122 bpm, Am7 Fmaj7 Dm7 Em7 in some order |
| lo-fi, “rainy sunday afternoon” | F major, 76 bpm, Fmaj7 down to Dm and C |
| trap, “dark trap beat” | F♯ minor, 140 bpm, F♯m to D to C♯m |
| synthwave, no prompt at all | A minor, 100 bpm, Am, F, C, G, two bars each, all five identical |
| synth pop, “a hook you can hum” | A minor, about 117 bpm, every hook rising A, B, C |
| solo piano, “a sad piano piece” | D minor, 72 bpm, every theme opening A, G, F |
Two of the five synthwave loops even had the same title. Here they are, one after the other.
Nothing was broken. A language model writes the most likely next thing, and the most likely synthwave loop is a good synthwave loop. Ask it for one a hundred times and it gives you that loop a hundred times. Telling it to be more varied didn’t help either: it moves to its second favourite and stays there. When we wrote one loop in each of the 60 genres, they came back in 17 keys, and 14 of them were in A minor.
We decided the variety had to come from knowing the genre better, and the only way to know 60 genres better was to study them. Thus, the Songbook was born.
What we read
Some of what makes a genre has been measured. Trevor de Clercq and David Temperley hand-analysed 200 songs from a list of the greatest rock songs and counted every chord. The tonic takes about a third of them, the four chord about a fifth and the five chord a sixth, with the flat seven ahead of the six. In their data the four chord goes home to the one chord more often than the five does, which a classical harmony textbook would not lead you to expect. Their follow-up found that rock melodies lean on the first and fifth notes of the scale, and that the flat seventh turns up more often than the leading tone.
Shuqi Dai, Huan Zhang and Roger Dannenberg looked at the structure of about 900 pop songs. Phrases run four or eight bars, repeated material covers half to nine tenths of a song, sections tend to end on the keynote, long notes close phrases, and a five-to-one closes more than half of all sections. Hubert Léveillé Gauvin traced chart singles from 1986 to 2015: intros fell from over 20 seconds to about 5, tempos rose about 8% and the hook arrives sooner. Maria Witek and her colleagues found that a medium amount of syncopation gives listeners the most pleasure and the strongest urge to move, more than a little or a lot. Anders Friberg and Andreas Sundström measured swing: about 3.5 to 1 at slow tempos, falling to even 8ths as the tempo climbs.
Most of a genre has never been put in a table. For that we read how its own producers, players and writers describe their craft, and the books its historians wrote: Simon Reynolds on rave, Lloyd Bradley and Michael Veal on reggae and dub, Joseph Schloss on how beats are made, Mark Butler on electronic dance music, Mark Levine on jazz harmony, Samuel Adler on orchestration, and about forty more. The full list is at the end.
Five rounds
We wrote a page of research for every genre, then went back four more times as listening showed what was missing.
The first round covered what a genre’s songs are built from: the chord loops it uses and how they move, its forms, the shape and rhythm of its hooks, its grooves, its bass lines and the small production habits it’s known for. Written with it, the same 60 prompts came back in 35 keys. We also measured how alike the lead lines were by the intervals they shared. With no prompt, synthwave fell from 0.54 to 0.21 and lo-fi from 0.50 to 0.11. Synth pop and rock barely moved, because sung hooks that move by step share intervals whatever you do.
The second round asked what a listener names a genre by. For most genres it’s fewer things than you’d think, and they’re seldom the chords. Synthwave’s chord loops are four-chord minor loops like half of pop. What makes it synthwave is a big gated snare, a bass pumping on the root and a saw lead that slides into its long notes. That round also added depth: about 180 more grooves, 140 more bass lines, more forms, and the meters genres are known for, such as the six of a slow soul ballad and the waltz of a folk song.
The third round was structure. Every full song had been asked to run three and a half to four and a half minutes whatever its genre, so a hyperpop song and a techno song were sent the same length. Now each genre has its own sense of how long its songs and sections run and how they rise, open and end.
The fourth round was the band. Earlier songs were a four-piece plus whatever the writer remembered, so the horn section in a funk song came or didn’t come by habit. The research now says who sits in each seat and how they play it. In funk the chords usually go to rhythm guitar, 16th-note scratches with one open ninth chord a bar, and sometimes to clavinet, short stabs that fall between the guitar’s hits. That round wrote down 1,162 instrument entries across the 60 genres.
The fifth round was the orchestra. An orchestral song with seventeen stems still sounded small, and when we listened closely it was a chamber group playing orchestral instruments: one line a section, everything in the middle of the stereo field in the same reverb. So we studied how a real orchestra divides one piece of music among eighty people. A romantic symphony orchestra carries about 60 strings, set 16, 14, 12, 10 and 8 from first violins to basses. Played loud, one trumpet carries as far as two horns, and one horn as far as a whole string section, so an orchestra gets louder by adding families from lightest to heaviest, not by turning up. Heard from the hall the stage is narrow, so nothing should sit far out to the sides. The loved concert halls ring for about 1.8 to 2.1 seconds with an audience in them, and the first reflection arrives inside 25 milliseconds.
Two smaller studies sit beside those: which genres are heard through a bed of rain, crackle or birdsong and how far back it sits, and how the heaviest electronic genres stack and swell their sounds to hit as hard as their records.
The line it never crosses
The Songbook holds what many songs share. It never holds a song.
A chord progression written as numerals, a form, a melodic contour and a rhythmic tendency are ideas that thousands of songs share and nobody owns. Those are what the research records. It holds no melody, no lyric, no riff and no drum pattern transcribed from any record, and the parts of Songcode that write songs contain no song title, artist name or record label. A test fails the build if one appears. Every hook is written new for each song.
Two of the papers we read were built on large datasets of popular music. We read them for their findings. Neither dataset was downloaded, opened or used, and every figure in the Songbook is our own estimate, checked by ear.
None of this changes Songcode’s core mission: never train a music model on the backs of artists, generate and share music as code, and enhance human creativity. The Songbook’s written research will continue to support this mission for years to come.
Sources
- Trevor de Clercq and David Temperley, “A corpus analysis of rock harmony”, Popular Music 30/1, 2011.
- David Temperley and Trevor de Clercq, “Statistical analysis of harmony and melody in rock music”, Journal of New Music Research 42/3, 2013.
- Shuqi Dai, Huan Zhang and Roger Dannenberg, “Automatic analysis and influence of hierarchical structure on melody, rhythm and harmony in popular music”, 2020.
- Hubert Léveillé Gauvin, on intros, tempo and the hook in chart singles, 1986 to 2015, 2018.
- Maria Witek and others, on syncopation, pleasure and the urge to move, 2014.
- Anders Friberg and Andreas Sundström, on swing ratios and tempo, 2002.
- Sergio Oramas and others, “MGPHot: A dataset of musicological annotations for popular music (1958-2022)”, Transactions of the International Society for Music Information Retrieval 8(1), 2025. Read for its findings; the dataset was not used.
- Matthias Mauch, Robert MacCallum, Mark Levy and Armand Leroi, “The evolution of popular music: USA 1960-2010”, Royal Society Open Science 2(5), 2015. Read for its findings; the dataset was not used.
- David Temperley, The Musical Language of Rock; Walter Everett, The Foundations of Rock; Allan Moore, Song Means; Nicole Biamonte, “Triadic modal and pentatonic patterns in rock music”; David Huron, Sweet Anticipation.
- Mark Butler, Unlocking the Groove; Anne Danielsen, Presence and Pleasure; Mitchell Ohriner, Flow.
- Mark Levine, The Jazz Theory Book; Paul Berliner, Thinking in Jazz; William Caplin, Classical Form; Robert Gjerdingen, Music in the Galant Style.
- Simon Reynolds, Energy Flash; Dan Sicko, Techno Rebels; Tim Lawrence, Love Saves the Day; Bill Brewster and Frank Broughton, Last Night a DJ Saved My Life; Jeff Chang, Can’t Stop Won’t Stop; Joseph Schloss, Making Beats; Lloyd Bradley, Bass Culture; Michael Veal, Dub; Ruy Castro, Bossa Nova; David Toop, Ocean of Sound; Keith Potter, Four Musical Minimalists; Karen Collins, Game Sound; Robert Walser, Running with the Devil.
- Samuel Adler, The Study of Orchestration; Nikolai Rimsky-Korsakov, Principles of Orchestration; Leo Beranek, Concert Halls and Opera Houses; Open Music Theory, “Core principles of orchestration” and its pop harmonic schemas.