Aratu music written to play, and to change while it plays

Aratu

Aratu is a language for writing music on a computer keyboard and hearing it at once, the way a musician thinks: in bars, beats, notes and chords. Change the text while it plays, and the music changes with it. It has a course, a manual and an editor in the browser, in Portuguese, Spanish and English.

▶ Open the editor

Aratu course

  1. Welcome to Aratu

    Aratu is a way to write music on the computer keyboard and hear it at once. You write the way a musician thinks: in bars, beats, notes and chord symbols.

  2. The bar and the tempo

    Every Aratu piece starts by saying two things: its meter and its tempo. meter: 4/4 is the time signature: four beats in a bar.

  3. Dividing the beat

    So far every beat had one symbol, a quarter note. But music divides beats: two eighths, four sixteenths, triplets. In Aratu that takes one rule.

  4. The drums

    Each drum has a short symbol. The symbol decides the sound, whatever the line is called. Each line also has a name, written before the =.

  5. Rests and long rests

    Silence is music too. In Aratu every rest is written with the same sign, -, and its length comes from the same rules as sounds: a - takes one part of the…

  6. Compound and irregular meters

    So far the beat was always a quarter note, and a bar had two, three or four of them. In this lesson the beat changes size: in 6/8 it divides in three, in 7/8…

  7. Brazilian percussion

    The drum kit has one symbol per piece. Brazilian percussion is different: each instrument has a line of its own, named after the instrument, with its own…

  8. Notes and melodies

    So far there were only drums. Now, notes. A note is written with its name and its octave: c4 is middle C on the piano.

  9. Rhythm in a melody

    The rhythm rules work for notes too, with one care: two notes in the same beat go in brackets. [c4 d] is two eighths in one beat.

  10. Chords and strumming

    A progression is written as a lead sheet, on a line called chords. Each bar between bar lines has its chord: On its own, the chords line plays each chord…

  11. Harmony by degree

    In the last lesson chords had names: Am, F, C, G. Harmony students often think another way: not "A minor" but "the sixth degree of the key".

  12. Dynamics and articulation

    Dynamic marks are the score's: ppp pp p mp mf f ff fff, and also sfz and fp. Inside a bar, a mark sits on its note with a colon, and holds from there on:

  13. Repeats and jumps

    A score's repeat signs are written in Aratu too. |: and :| enclose a passage that is played twice: Listen: the first two bars twice, then the ending.

  14. Sections and form

    A song has parts: intro, verse, chorus, ending. Each part comes back more than once, and their order is the form of the piece.

  15. Motifs, sequences and rows

    Much music is made of a few ideas used many times: a motif that comes back, rises or falls, turns upside down.

  16. Tempo: rit, accel, fermata and pickup

    The tempo can change at a bar marked with at bar: rit to 60 over 2 bars is a ritardando to 60 over two bars (rall works too).

  17. Expression: swing, rubato and humanize

    A computer plays every note in its exact place. A musician does not: they swing the eighths, breathe in a phrase, never hit twice the same way.

  18. Playing live

    In Aratu, playing live means changing the text while the music plays. A few ideas make it easy. A pattern is a named group of lines, prepared ahead.

  19. Changes in the right place

    In the last lesson the music changed when you changed the text. Often, though, the change is decided ahead of time: the fill in bar 8, the drums dropping out…

  20. Chance

    A loop that repeats exactly the same every time soon sounds mechanical. A drummer never plays two bars quite alike: a hi-hat note drops out, another appears.

  21. Sounds and effects

    So far each part played with the sound Aratu chose for it. Now you choose: a piano, a steel-string guitar, a slap bass, a synthesizer.

  22. Numbers that move

    A DJ turns the filter knob slowly and the whole dance floor feels the music opening up. A guitarist rocks the pedal and the sound sweeps back and forth.

  23. Mixing the whole piece

    With several parts playing together, there is still the job of the person at the mixing desk: putting each instrument at the right volume, each in its place…

  24. Project: a maracatu

    Now you have everything to build a whole piece. We will build, part by part, a groove inspired by the maracatu de baque virado of Recife, in Brazil, in a…

Aratu manual

  1. The Aratu manual

    Aratu is written the way a musician thinks: in bars, beats, note values, chords and score words.

  2. 1. A first piece

    The first lines set the frame of the piece: meter, tempo and key. Each part follows. There is no main, no braces to balance before the music plays, and no…

  3. 2. Rhythm: beats and their parts

    Three rules describe every rhythm in a bar. Rule 1. A space separates beats. A line in 4/4 has four groups.

  4. 3. Compound and additive meters, tuplets

    The beat is not always a quarter note. These are the meters where it changes size or groups another way, and the tuplets that cross beats.

  5. 4. Drums

    Each drum has a line, and each line follows the rhythm rules. The symbol decides the sound, whatever the line is called:

  6. 5. Brazilian percussion

    A line named after an instrument reads its strokes, with the same rhythm rules: Upper case accents and (p) is a ghost stroke, as on the drums.

  7. 6. Melodies

    Notes are written in lower case, with the octave: c4 is middle C. Sharps and flats follow the letter: f#4, eb4. Solfège works too: dó4 ré4 mi4 or do4 re4 mi4.

  8. 7. Chords and strumming

    A progression is written as a lead sheet, on a line called chords. The rule of sharing works one level up: chords that share a bar divide it equally.

  9. 8. Harmony by degree

    Chords by degree. In Roman numerals, from the key at the start of the piece (C major when there is no key:): upper case is major, lower case minor, and the…

  10. 9. Dynamics and articulation

    Dynamic marks are the score's: ppp pp p mp mf f ff fff, and sfz, fp. Inside a bar, a mark sits on the note it starts with a colon, with or without a space…

  11. 10. Tempo and time

    When a change happens. A change with at bar N: happens at that bar. A change written on its own happens where the piece starts or, while you play, at the next…

  12. 11. Feel: rubato, swing and humanize

    Rubato means robbed time, and robbed time is given back. piano: rubato 10% stretches and shrinks the beats inside each bar and arrives at the bar line on…

  13. 12. Repeats and jumps

    The repeat and jump signs of a score, and repeating a beat. |: and :| mark a passage played twice, unless x says how many times.

  14. 13. Patterns, sections and form

    Material is prepared in advance and given a name: Sections are named parts of a piece, and a form line orders them: A section holds parts and lines the way…

  15. 14. Motifs, rows, lists and transformations

    Short named ideas used many times: motifs, twelve-tone rows, melody lists, and the transformations that change them without rewriting them.

  16. 15. Playing live

    While a piece plays, you change it; you do not rewrite it. The stage. To play in front of an audience, the Stage button in Play (or Ctrl+Shift+F) leaves only…

  17. 16. Chance

    A loop that repeats exactly the same soon sounds mechanical. Chance gives it life: the computer decides, a little at random, what to play each time round.

  18. 17. Sound and effects

    Each part has a sound and a chain of effects, written as signal flow: Every number that sets a parameter is also a control: the editor draws a knob beside it…

  19. 18. Numbers that move

    Parameters that move. bass.lowpass.cutoff = 300 Hz -> 4000 Hz over 4 bars takes the cutoff from 300 to 4000 Hz over four bars and leaves it there, like a…

  20. 19. Mixing

    Each part has volume (0 to 1) and pan (-1, hard left, to 1, hard right), like the faders and pan knobs of a mixing desk: drums.volume = 0.5, guitar.pan =…

  21. 20. Quick reference

    Write Means meter: 4/4, tempo: 96, key: A minor the frame of the piece space next beat cc, cccc, ccc eighths, sixteenths, a triplet in one beat _ hold - rest…

  22. 21. In English, Portuguese and Spanish

    Every Aratu keyword can be written in English, Portuguese or Spanish, with or without accents, in upper or lower case.

Inside Aratu

  1. Inside Aratu

    This part is for people who program, or who want to know how Aratu works underneath. It gives technical names to the things the course and the manual explain…

  2. 1. What kind of language it is

    Aratu is a declarative language: the text describes what sounds, not a list of orders carried out one after another.

  3. 2. The lexicon: the words of the language

    The lexicon is the set of words, or tokens, Aratu recognises. Each line is a statement. Inside braces, ; separates statements on one line, and // starts a…

  4. 3. The grammar: the kinds of statement

    The grammar says how the words go together. Each statement has one of these shapes (what is between ⟨ ⟩ is a place to fill):

  5. 4. Naming things

    This table is the heart of this part: for each thing in Aratu, the name it would have in programming, and what it is like.

  6. 5. From text to sound

    When you edit, the text goes through these stages, each in a module of the compiler (written in Rust and brought to the browser as WebAssembly):

  7. 6. The data: what comes out of the compiler

    The IDE talks to the compiler through a few functions the WebAssembly exports (aratu_compile, aratu_render, aratu_check, aratu_grid, aratu_voices), exchanging…