Rows and settings
What goes inside a stem of a Songcode track. Step grids, pitch rows, lines, the settings that shape a sound, values that move, swing and feel, with the edits worth trying first.
The inside of a stem is rows and settings. Rows say what plays and settings say how it sounds. This page teaches enough of both to read any track Songcode writes and to change one with confidence. The song format covers the track around the stems.
#Read one stem
stem hats: club {
hat [xxxx xxxx xxxx xxxx]
velocity [100 40 65 45]
chance 88%
highpass 420hz
}
| part | meaning |
|---|---|
stem hats: club | A stem named hats, playing the club drum kit. |
hat [xxxx xxxx xxxx xxxx] | A closed hi-hat on all sixteen steps of the bar. |
velocity [100 40 65 45] | How hard each hit is played, hit by hit, looping: every beat goes loud, quiet, medium, quiet. |
chance 88% | Each hit plays 88 times in 100. |
highpass 420hz | A highpass filter at 420 Hz, removing the low end. |
To change it: swap hat for openhat, thin the row to [x.x. x.x. x.x. x.x.], change the kit name, or move the filter. Press update to hear it.
#Step grids
A step grid is the row a drum machine shows. One character is one step, and spaces only group the steps so you can count them.
| mark | meaning |
|---|---|
x | A hit. |
X | An accented hit, 1.3 times as hard. |
o | A soft ghost hit, a little under half as hard. |
f | A flam: the hit, with a soft grace stroke just before it. |
. | A rest. |
- | Hold the note before. |
2 to 8 | That many hits inside the step: a roll. |
% | The same as the bar before. |
The number of steps in a bar sets the note value. In 4/4, 16 steps are 16th notes, 8 are 8ths, 12 are triplets, 4 are quarters and 1 is the whole bar.
stem drums: live {
kick [x... ..x. x... ....]
snare [.... x... .... x..o .o.. x... ..o. x...]
hat [x.xx x.x. xxxx x.22]
}
|ends a bar. A row one bar long repeats every bar, and a row two bars long repeats every two.- On a drum kit each row is a lane, named for its drum:
kick,snare,clap,hat,openhat,rim,cowbell,lowtom,midtom,hightom,crash,ride,shakerandtambourine. - A closed hat cuts an open hat on the same kit.
- Every group in a bar is the same size. A group of three among fours is an error.
In an odd meter the steps group the way the meter’s beats do:
meter 7/8, beats: 2+2+3
stem kick: club {
kick [x. .. x..]
}
#Pitch rows
A part that repeats, such as a bassline, a stab, a pad or an arpeggio, keeps its rhythm and its pitches in two rows. The rhythm is a step grid called rhythm. The pitch row beside it is read hit by hit: the first pitch goes to the first hit.
| row | holds | example |
|---|---|---|
notes | Note names with their octave. eb is E flat and f# is F sharp. | [c2 eb2 f#3] |
degrees | Steps of the track’s scale. 8 is the octave above, and b7 is the seventh lowered. | [1 3 5 b7 8] |
tones | Notes of the chord the chart is on. root is its root, all is the whole chord, and numbers count its notes from the root. | [root] [1 2 3] [all] |
stem lead: sawlead {
rhythm [x.x. x.x. x-x. x... x.x. x.x. x--- ....]
degrees [1 3 5 7 5 3 4 1 3 5 8 7]
octave 4
}
- A bar holds one pitch, used for every hit in it, or exactly as many pitches as it has hits.
- Pitches joined with
+sound together:c3+eb3+g3, ortones [2+3+4]for a chord without its root. - A
~after a pitch slides into the next note. octavesays wheredegreesandtonessit.
Keeping the two rows apart means you can change the groove without touching the tune. A bass written as tones [root] follows the chord chart and never names a note, so changing a chord in the chart moves the bass with it.
#Lines
A line carries rhythm and pitch together. Melodies are written this way, and so is anything that does not repeat on a grid.
stem melody: nylon {
line [mp c4/4 d4/8 e4 f4/4. g4/8 a4/2 r/4 b4 < c5/4 b4/8 a4 g4/4 e4 f d4/1]
}
| mark | meaning |
|---|---|
c4/4 | A pitch, then its length: /1 whole, /2 half, /4 quarter, /8, /16, /32. |
/4. | A dot adds half. |
/12 /6 /24 | Triplets: 8th, quarter and 16th. |
e4 | No length: the same as the note before. |
r/4 | A rest. |
c4+e4+g4/2 | A chord. |
~ | Tie to the next note, or slide when the pitch changes. |
' _ ! | Staccato, held for its full length, accent. |
(c5/8 d5 e5) | A slur: one bow or one breath. Each note runs into the next and the next has no attack of its own. It may cross bar lines. overlap in the settings below sets how far. |
d5/g | A grace note. It is played just before the note after it and takes no room in the bar. |
g5/2:trill | An ornament on that note. See the table below. |
pizz arco stacc marc | A way or a style of playing, standing between notes like a dynamic and holding until the next one. See ways of playing and styles of playing. |
pp p mp mf f ff | Dynamics, standing between notes. |
< > | Get louder or quieter, ending at the next dynamic. |
5: | A bar number at the start of a bar. The app checks it. |
Every bar adds up to the meter. A bar that is short or long is an error that names the line, the bar and both totals.
#Ornaments
An ornament follows its note after a colon, one to a note.
| ornament | what is played |
|---|---|
:trill | The note and the one above it in the key, in quick turns, ending on the note. |
:mordent | The note, the one above, and back, quickly, at its start. |
:turn | The note above, the note, the note below, the note. |
:roll | The same note struck again and again for its whole length: a mallet roll, a timpani roll. |
:bend | The pitch scoops up into the note from a semitone below. |
:fall | The pitch drops away at the end of the note. |
:slide | The pitch glides from this note into the next one. |
stem fiddle: violin {
line [(d5/8 e5 f#5 g5) a5/4:trill b5/g a5/4 (g5/8 f#5) e5/4:turn d5/2:fall]
}
In the stems view an ornament is one note with its mark, the way it is written, and a slur is the notes it joins. Editing the notes there writes the same marks back into the code.
#Ways of playing
Some recorded instruments were recorded played more than one way. A word between notes picks one, and it holds until the next word:
| word | short form | what it is |
|---|---|---|
pizzicato | pizz | Strings plucked with the finger. |
spiccato | spic | Strings played with short bounced bow strokes. |
tremolo | trem | Strings bowed fast back and forth on one note. |
staccato | stacc | Winds, brass and saxophone tongued short. |
muted | mute | A trumpet or horn with a mute in; a power chord palm-muted. |
normal | arco, ord | Back to the instrument’s ordinary sound. |
stem cello: cello {
line [pizz c3/4 g3 e3 g3 arco (c3/2 d3) e3/1]
}
technique pizzicato as a setting does the same for the whole stem, or for a section inside a block. Sounds lists which instruments have which ways. Asking for one an instrument does not have is an error that names the ones it has. Pizzicato, spiccato, staccato and marcato notes are short, so a slur does not join them.
#Styles of playing
A style is what the player does with a note, so it needs no recording of its own. Each has its name from the score and a plain word, and both work everywhere:
| word | short form | plain word | what the player does |
|---|---|---|---|
staccato | stacc | short | Short and clean. The note speaks at once and stops at once, for a little under half its written length, with no swell. |
spiccato | spic | bounce | The bow bounced off the string: nearly all start, very little body. Bowed strings only. |
marcato | marc | punch | Hammered. A hard, louder start that drops back to a firm body, with a gap before the next note. |
tenuto | ten | held | Held for its full length at one level, barely parted from the next note. |
portato | port | pushed | Pulsed inside one bow or one breath: each note leans in and eases, and none of them stops. |
normal | arco, ord, detache | Back to the ordinary stroke, which swells in and sinks away. |
stem violins: violins {
line [stacc c5/8 d5 e5 f5 marc g5/4 g5 ten a5/2 port g5/4 f5 arco (e5/2 d5) c5/1]
}
stem riff: crunch_guitar {
line [short e3/8 e3 e3 e3 punch g3/4 a3 held e3/1]
}
On bowed strings, winds, brass and choirs a style sets the whole shape of the note: how it starts, whether it holds or drops back, and how it ends. On every other pitched instrument it sets how long the note sounds and, for punch, how hard it is hit. The ' mark on a note is one staccato note and _ is one tenuto note, whatever style stands. technique marcato sets a style for the whole stem or a section. Code written in the stems view comes back with the score names.
Two lines in one stem sound together as two voices, which is how a piano gets two hands:
stem piano: epiano {
line [e4/4 g4 c5/2 d5/4 b4 g4/2]
line [c3/2 g2 g2/2 b2]
}
#Themes
A melody that comes back gets a name. let names a line above the stems, and any line can then quote it among its notes: as it is, or changed.
key a minor
let theme = line [a4/4 b4/8 c5 e5/4. d5/8 c5/2 a4/2]
stem lead: sawlead {
line [theme theme(up 2) theme(first 1bar) e5/2 d5 c5/1]
}
That line is six bars: the theme, the theme a third higher, its first bar, and two bars of new notes. The changes go in ( ) after the name.
| change | what it does |
|---|---|
theme(up 2) theme(down 3) | Moves it by steps of the key. The shape stays and so does the key, which is how a sequence is written. It needs a key line. |
theme(up 7st) theme(down 1oct) | Moves it by semitones or by octaves, exactly. |
theme(inverted) | Upside down around its first note: what rose now falls. |
theme(reversed) | Back to front. |
theme(slower) theme(faster) | Every length doubled, or halved. |
theme(first 4) theme(last 3) | Its first or last notes, rests counted. |
theme(first 1bar) theme(last 2bars) | The same cut, by bars. |
theme(up 1oct, first 1bar) | Several changes, made left to right. |
- A quote takes the room its notes take and brings its own bar lines. A two-bar theme fills two bars wherever it starts, and a note that would cross a bar line is carried over it, tied.
- A short theme sits among other notes:
[motif motif(up 1) g4/2]. The bar still has to add up. upanddowncount in the key of the section the line is written for, so a section with its own key moves the theme inside that key.- A theme carries its dynamics with it.
reversedleaves them behind. - A theme may quote another theme. A name cannot look like a note or a dynamic: not
c4,r,pormf. - An accompaniment figure is a theme too.
let figure = line [c3/8 g3 e3 g3 c3 g3 e3 g3], andfigure(up 3)is the same figure on the fourth degree of the key.
A stem whose line quotes a theme is code in the stems view: edit notes turns the quotes into the notes they play.
#Settings
A setting is a word and a value with its unit. The unit is part of the value, so 400hz cannot be read as bars, seconds or an amount.
#Notes
| setting | what it does |
|---|---|
velocity 96 | How hard each note is played, from 1 to 127. 100 is the sound at its catalog level. |
octave 3 | The octave the stem plays in. |
transpose 12st | Moves the stem by that many semitones. |
chance 90% | Each hit plays that often and is dropped the rest of the time. |
pulse 20% | Leans the stem on the beat: the first beat of each bar plays that much louder, the middle of the bar half that much, and notes between beats half that much softer. 0% is off. It goes up to 50%. |
humanize 8 | Moves each note’s velocity up or down by as much as 8. It never moves a note in time. |
loose 10ms | Lets each note land up to that far early or late, a different amount every note. 0ms is on the grid. See swing and feel. |
vary 100% | For recorded sounds: how much one note differs from the next. 100% is what a recording does when the line is left out, 0% plays every note identically, and it goes up to 200%. See recordings that sound played. |
allow breath | Lets this stem break a rule of what a person can play: range, reach, hands, breath, speed, or all. Written once, at the top of the stem. |
length 50% | Plays each note for half its written length. |
glide 60ms | Every note slides in from the pitch of the note before, over that time. |
behind 8ms ahead 4ms | Plays the stem that much late or early. See swing and feel. |
choke hats | Puts this stem and hats in one cut group: a note in either one cuts off whatever is still ringing in the other. A kit stem with hat and openhat rows does this to itself with no choke line. |
take 3 | Which recording of a percussion sound plays, counted from 0. |
voicing open | How a chord is spread. See the table below. |
straight | The stem ignores the track’s swing. |
legato | Every note of the stem runs into the next, as a slur does for one phrase. |
overlap 60ms | How long a joined note and the next one sound together. It applies to notes under a slur and to a legato stem: one fades out as the other fades in, and a recorded instrument starts the later note past its own attack, so a string line does not swell from nothing at every note. Left out, it is a quarter of the note’s length, never under 30ms or over 80ms. Very slow music can take 100ms to 150ms, and it goes up to 250ms. 0ms joins the notes with nothing shared. |
bow 40% | For bowed strings. Every bowed note swells in as the bow gets the string moving and sinks as the bow slows before the next note. This is how fast the bow does it: a low number is a slow bow, so each note blooms and fades, and a high number speaks at once and holds. Left out, the bow follows the dynamics: slow on soft notes, immediate on loud ones. It can move: bow ramp(20%, 90%). Plucked and bounced notes are not shaped. |
breath 40% | The same for winds, brass and choirs: how fast the air starts and tails off on each note. |
strum 20ms | A chord’s notes start one after another, that far apart, from the lowest up. direction: up starts from the top, and direction: alternate goes down then up, chord by chord. |
pedal chord | A sustain pedal, for instruments whose notes ring (piano, harp, vibraphone, guitar). chord holds every note until the chord chart changes, bar holds to the end of the bar, and off stops each note dead when it ends. Left out, the instrument rings as it always has. |
technique pizzicato | The stem’s way of playing or style. |
| voicing | what it does |
|---|---|
close | Four voices in close position with the root underneath. |
rootless | The same without the root underneath. |
open | The second voice from the top drops an octave. |
wide | The bass sits an octave lower and the top an octave higher. |
shell | Root, third and seventh only. |
smooth | Each chord is turned over so its notes sit as near as they can to the chord before, the way a pianist’s hands move. |
#Envelope
| setting | what it does |
|---|---|
attack 400ms | How long a note takes to reach full level. |
decay 200ms | How long it takes to fall from there to the sustain level. |
sustain 60% | The level a held note settles at. |
release 1.5s | How long a note takes to fade once it ends. |
A short decay with sustain 0% is a pluck. A long attack and release is a pad.
#Filter
| setting | what it does |
|---|---|
lowpass 700hz | Removes what is above 700 Hz and makes a sound darker. |
highpass 240hz | Removes what is below 240 Hz and makes room for the kick and bass. |
bandpass 1.2khz | Keeps a band around 1.2 kHz. |
resonance: 30% | A detail of any filter: a peak at the cutoff. |
contour: 3oct | A detail of any filter: the envelope moves the cutoff by that many octaves on each note. |
#Tone
| setting | what it does |
|---|---|
voices 5 | Stacks that many copies of the oscillator. It acts on the plain waves, such as sawtooth. |
detune 20cents | How far apart those copies are tuned. |
fm 4, ratio: 2 | Frequency modulation. fm is the amount, and ratio is the modulator’s frequency as a multiple of the note’s. |
vibrato 5hz | A wobble in pitch, five times a second. depth: 30cents sets how wide. |
tremolo 4hz | A wobble in level, four times a second. depth: 40% sets how deep. |
vowel a | A vowel shape on the sound: a, e, i, o or u. |
chorus 40% | Two slowly moving copies of the sound, left and right, mixed in by that much. rate: 0.8hz sets how fast they move. |
phaser 0.5hz | A phaser sweeping at that speed. depth: 60% sets how far. |
#Tone controls
| setting | what it does |
|---|---|
lowshelf 120hz, gain: -3db | Turns everything below that frequency up or down. |
highshelf 8khz, gain: 2db | Turns everything above it up or down. |
bell 2khz, gain: -3db, width: 1oct | Turns a band around that frequency up or down. width is how wide the band is. |
Each needs its gain, and a stem takes one of each.
#Dirt and space
| setting | what it does |
|---|---|
drive 40% | Overdrive. |
bitcrush 8bits | Reduces the bit depth. |
reverb 40% | How much of the stem goes to a reverb. The room is the one on the reverb row of the mix table. |
reverb 40%, decay: 2s, tone: 4khz | The same, in a room of the stem’s own. decay is how long it rings and tone is how bright it is. |
delay 25%, time: 3/16, feedback: 40% | Echo. time is the gap between echoes, as a note value or a time, and feedback is how long they go on. |
#Moves
| setting | what it does |
|---|---|
fade in fade out | Fades the stem in or out across the block it sits in. In the stem’s own body that is each section the stem plays in. |
trim -3db | A level change on the stem’s notes, usually inside a block. The stem’s fader stays its row in the mix table. |
Level and pan are not stem settings. They live in the mix table: a row for the track, and blocks there for the parts where they change. Swing is the track’s. A stem that sets any of them is an error that says where it goes.
#Lists
Two settings can take a list in place of one value: velocity and take. The list is read hit by hit and loops, like a pitch row.
stem bass: sawtooth {
rhythm [xxxx xxxx xxxx xxxx]
tones [root]
octave 1
velocity [110 60 85 60]
}
stem perc: conga {
rhythm [..x. .x.. ..x. .x.x]
take [0 2 1 3]
}
velocity [110 60 85 60]on 16th notes is an accent on every beat.take [0 2 1 3]plays a different recording of the conga on each hit: an open tone, a slap, a mute. Recorded percussion, the textures, the ambience beds and theliveandrockkits have several takes. Every other kit has one, andtakeon it raises a warning. Therockkit picks a take by itself from how hard a hit is played, so a ghost note (o) is a soft recording and an accent (X) a hard one;takeoverrides that.- A list that is shorter than the bar goes round again, so three values against four hits land somewhere new each bar.
- On a drum kit, a list is read for each lane on its own.
- A list may carry
|to line up with the rhythm’s bars.
Every other setting takes one value. To move a filter over time, use ramp or sweep, below.
#Values that move
A value can move over time. Two calls cover it:
| call | meaning |
|---|---|
ramp(500hz, 6khz) | Go from the first value to the second across the block it sits in. |
sweep(300hz, 1.2khz, every: 16bars) | Go there and back, once in that many bars. |
stem pad: ensemble {
rhythm [x]
tones [all]
lowpass sweep(600hz, 2.5khz, every: 8bars)
in break {
lowpass ramp(500hz, 6khz)
}
last 1bar into peak {
highpass ramp(240hz, 2khz)
}
}
A ramp inside in break runs across the break. A ramp inside last 1bar into peak runs across that one bar. You never work out how long it lasts.
A filter that moves runs smoothly, through held notes too, so one long chord can open across a whole section. A crescendo or diminuendo in a line swells through a held note the same way. Level and pan do as well: fade, a trim or pan that moves, and every move in the mix table. Any other effect (reverb, delay, drive) takes its value at the moment each note starts.
#Swing and feel
swing 58%
stem snare: live {
snare [.... x... .... x..o]
behind 8ms
}
stem hats: live {
hat [x.xo x.xo x.xo x.22]
velocity [100 70 30 85]
ahead 4ms
}
stem arp: synthpluck {
rhythm [x.x. x.x. x.x. x.x.]
tones [1 2 3 2 1 2 3 2]
straight
}
- Swing is one number for the whole track.
50%is straight and66%is a full triplet. It runs from50%to75%and delays every second 16th note. - It applies to every stem. No stem sets its own amount. A stem that must stay rigid says
straight. swing 66% 8thsswings the 8th notes, the way jazz and shuffles do.behindandaheaddrag one stem a few milliseconds late or push it early. Neither goes past30ms.- Timing is exact unless the track says
loose.loose 8msat the top of a track lets every note land up to 8 ms early or late, most of them close to the grid and a few further out. A stem can set its own amount, andloose 0msputs one stem back on the grid. It stops at30ms.humanizevaries loudness only, andchanceonly drops hits. loosemoves what you hear, not what is written. The piano roll and the code still show each note on its step.loosecomes last. It is added after swing and afterbehindorahead, so a stem that isbehind 20mswithloose 10mslands 10 to 30 ms late. With both at their limits a note can be 60 ms from its step.- The same seed gives the same looseness. Every play, every audio export and every MIDI export of a track has each note in the same place.
- Accents carry the groove.
X,xandoin a grid and avelocitylist are where most of a track’s feel is written. - A digit is a roll.
2222at the end of a bar orx.33in a hat row.
Swing wants to be heavier at slow tempos and lighter at fast ones. The app warns when a track’s swing is heavy for its tempo, and the track still plays:
line 3: swing 70% is heavy at 120 bpm: 16ths this fast usually sit at 54 to 58%
#Recordings that sound played
A recorded instrument never plays two notes exactly alike. The app does this on its own, for every recorded sound:
- It rotates recordings. The rock kit has up to four recordings of every drum at every strength, the electric bass four of every note, the power chords two and the palm mutes three. Each note takes the next one.
- It borrows a neighbour. An instrument with one recording of each note plays a repeated note from the recording next to it, retuned, every other time.
- Level and tuning stray a little. Each note is up to 0.7 dB louder or quieter than written (1 dB on the rock kit) and up to 3 cents sharp or flat.
- Soft notes are darker. A pitched recording played under full velocity loses some of its top, the way an instrument does when played gently.
- A bow or a breath shapes each note. A bowed string, a wind, a brass instrument or a choir swells into a note and sinks away before the next, fast when the note is loud and slow when it is soft.
bowandbreathset it by hand, a style of playing replaces the shape with its own, and notes under a slur cross over with no gap.
vary on a stem scales the first four. vary 0% turns them off and plays every note as recorded. vary 200% doubles the strays. Synthesised sounds are not touched. The pattern of strays does not come from the seed: it is fixed, so an export sounds the same every time. vary changes sound only, so it is not in a MIDI export.
#Played by a person
A stem on a real instrument (a piano, a guitar, a violin, a trumpet, the live and rock kits) is checked against what one person could play on it. Synths, drum machines and found sounds are not.
| rule | what it catches |
|---|---|
range | A note the instrument does not have: an f3 on a violin, whose lowest string is g3. |
reach | Notes that exist but not under one hand: a piano hand wider than a 10th, a guitar chord no hand can fret, two violin notes that are not on neighbouring strings. |
hands | More at once than the player has: two notes on a flute, three sticks on a drum kit, a power chord stacked on another, three notes held under one bow. |
breath | A wind player or a singer going too long without a rest to breathe (a flute about 12 seconds, an oboe or clarinet 16, a singer 15). A loop runs round into itself, so a flute that never rests in an 8-bar loop is caught. |
speed | Notes faster than the instrument is played one by one. A roll (2 to 8 in a step) is not counted: it is a tremolo or a buzz. |
How the check thinks about each instrument:
- Every stem on one keyboard, harp or kit is one player. A piano split into a right-hand and a left-hand stem has two hands between them, five fingers each, each hand within a 10th.
- A guitar has one note per string, and a chord is a shape the fretting hand holds within five frets, with a barre. Basses are the same on four strings.
- A bowed string sustains two notes on neighbouring strings. Three or four are struck short.
- A drummer has two hands, the right foot on the kick and the left foot on the hi-hat pedal or a second kick pedal. A closed hat that the hands have no room for is the foot, as the jazz hat on 2 and 4 is. A crash takes the place of the hat on its beat, and a fill takes the hands off the hats.
A problem is an error with its place in the song, and the stem still plays. When it is meant (a piano with three hands, a flute that never breathes), write allow with the rules it breaks at the top of the stem:
stem lead: flute {
allow breath
line [c5/1 d5/1 e5/1 f5/1]
}
allow range, speed on its own line at the top of a track covers every stem, and allow all waives all five.
#Chance and the seed
chance, humanize and loose draw from the track’s seed. The same seed gives the same track, so the same hits drop on every play and an export matches what you heard. Change seed 7 to seed 8 and a different set of hits drops.
#Edits worth trying first
| to do this | change this |
|---|---|
| Faster or slower | the number in tempo 130 |
| A different key | the key line |
| Different chords | the chords row. Every stem written with tones follows it. |
| A different drum kit | the kit name after each drum stem’s colon |
| A different instrument | the sound name after the stem’s colon |
| Darker or brighter | the number in lowpass |
| Quieter or louder | the stem’s row in the mix table, or its fader in the stems view |
| More or less pump | depth and recover on the duck row |
| Busier or sparser | the marks in the row, or chance |
| More space | reverb and delay |
| A fill at the end of a phrase | a bar 8 of 8 { } block with a busier row |
| Remove a part | delete its stem, or mute it in the stems view |
If an edit breaks a stem, the status line says which line and why. That stem falls silent and the other stems keep playing. If nothing in the new code can play, the last working version carries on. See errors.