Aratu a language for musical performance and algorithmic composition

17. Sound and effects

▶ Open in Aratu to hear and change the examples

Each part has a sound and a chain of effects, written as signal flow:

bass: synth.saw -> lowpass -> reverb
bass = | c2 _ c2 eb2 | f2 _ g2 bb1 |
bass {
  reverb.mix = 0.42
  lowpass.cutoff = 800 Hz
  lowpass.resonance = 0.3
}

Every number that sets a parameter is also a control: the editor draws a knob beside it, shaped by the parameter (a cutoff knob reads in hertz on a logarithmic scale, a mix knob from 0 to 1). Turning the knob rewrites the number, so saving the text saves the performance. Hold Shift for finer steps. A number written in another unit keeps it: 1.2 kHz turns in kilohertz, 40% in percent.

The effects are Manguebyte's, and go in the chain in any order (bass: synth.saw -> eq -> chorus -> delay); the engine always runs them in the same order, from the filter to the delay:

Effect Parameters
the part volume (0 to 1), pan (-1 left to 1 right), reverb.mix (how much goes to the mix's reverb, 0 to 1)
highpass, lowpass cutoff (20 to 20000 Hz), resonance (0 to 1)
eq low_gain, mid_gain, high_gain (-24 to 24 dB), low_freq, mid_freq, high_freq, mid_q
drive amount (0 to 36 dB), output, mix, shape (0 smooth, 1 soft, 2 hard, 3 folded, 4 tube)
bitcrush bits (1 to 16), rate (Hz), mix
compressor threshold, ratio, attack, release, knee, makeup, mix
chorus, flanger, phaser mix, rate, depth, and more: voices, feedback, stages…
tremolo, autopan rate, depth, shape (0 sine, 1 triangle, 2 square, 3 and 4 saw), sync (in beats)
delay time (in s or ms), feedback, mix, damping, pingpong, sync (in beats)
tube (valvula) drive (0 to 24 dB), output, mix: Manguebyte's drive with its tube curve (shape 4), which flattens the top of the wave sooner than the bottom and adds even harmonics; a chain has the tube or the drive

Beside eq, tube, drive, lowpass and highpass in a chain, the editor draws the effect's curve from the part's numbers: the response of the equalizer and the filters, from the lows to the highs, and how much the drive and the tube flatten the sound. The eq's curve, clicked, opens an equalizer whose points for the lows, mids and highs are dragged; the numbers are rewritten in the code, or written under the chain when they are not there yet.

Sounds. Each sound has a code, written at the head of the chain: bass: bass.slap -> reverb, drums: drums.808, piano: piano.grand. The Sounds panel, beside the messages in Play, lists them all by family (drum kits, keyboards, mallets and bells, plucked strings, bowed strings, basses, winds, voices, synthesizers), plays a bar of each and puts the code in the text with a click. A code that does not exist is reported, with the closest one: "did you mean bass.slap?". Without a code, drums, guitar and chords pick their own.

Some sounds play the accent their own way: in bass.slap a plain note is the thumb and an upper-case one is a pop, the string pulled (| e2 E3 e2 E3 |); in bass.acid upper case opens the filter, like the TB-303's accent.

The sounds marked recorded (pianos, harpsichord, pipe organ, harp, marimba, vibraphone, xylophone, glockenspiel, kalimba, tubular bells, tenor sax, harmonica, recorder and the acoustic kit) are recordings from the Versilian Community Sample Library, in the public domain (CC0), fetched the first time a piece uses them. While they arrive, a similar synthesized sound plays instead. They come at the rate they were recorded, in stereo (the harmonica, recorded in mono, in mono). The pianos, the pipe organ, the harp, the marimba, vibraphone, xylophone and glockenspiel, the tubular bells, the tenor sax, the harmonica and the acoustic kit's drums (all but the open hi-hat and the side stick) have recordings at two or three dynamics: the softer a note, the softer and darker the recording it plays, and the louder, the brighter (f, ff and an accent on mf reach the loudest; on the kit, a ghost note (s) plays the softest). On the organ the two are registrations, a quiet one and a loud one; on the harmonica the loud recordings are played accented. On the upright piano and on the kit, notes recorded more than once play their takes in turn.

Alesson's recorded kit (drums.alesson) was recorded by Alesson Queiroz and is in the public domain too (CC0). Its kick, snare and crash are recordings, with several takes of each that take turns; on the snare, a ghost note (s) and the softest dynamics play a light stroke, and accents a harder one. The other drums (hi-hats, ride, toms) are synthesized.

Manguebyte's engine. Every sound in the panel plays through Manguebyte's engine, the ecosystem's audio engine, running in the browser: the recorded ones in a sampler; guitars and basses (guitar.nylon, guitar.steel, bass.finger, bass.slap) as modelled strings; the electric piano and the bell (keys.epiano, keys.bell) in FM; the organ (keys.organ) through its rotating speaker, whose speed is organ.rotary (0 stopped, 1 slow, 2 fast); the 808 bass (bass.808), the acid (bass.acid) and the synthesizers (synth.*); the electronic kits (drums.808, drums.909, drums.606, drums.cr78, drums.trap, drums.house, drums.techno, drums.dnb, drums.lofi, and drums.modeled, whose drums are modelled as they play) on its drum machine; the poly.* codes, its polyphonic synthesizer's presets; the celesta and the steelpan (mallets.celesta, mallets.steelpan) as modelled bars; the bowed strings (strings.*, also in pizzicato), the winds (flute, clarinet, sax, trumpet, trombone) and the voices (choir.aah, choir.ooh, voice.solo) as modelled instruments. Each part has its effects in the engine, and the mix goes through a shared reverb, a glue compressor and a limiter. The Brazilian percussion (pandeiro, zabumba, triangle, agogô, surdo, tamborim, alfaia, gonguê, ganzá, cuíca and cajón), the golpe and the hand clap play on Manguebyte's drum machine, modelled, the same on every kit: when a part's own sound has no keys for them (drums.kit, drums.acoustic, a guitar for its golpe), a drum machine plays them beside it, with the part's effects and numbers. A stand-in engine plays a recorded voice whose download failed; if something goes wrong in a performance, the switch in the Sounds panel turns Manguebyte off and everything plays in the stand-in.

A sound plays only once it has been downloaded. When you press Play or Listen, Aratu waits for the piece's sounds to arrive, and a notice at the bottom of the screen shows which are downloading. A sound changed while the music plays comes in when it arrives; until then the one before goes on. If a download fails, or gets no answer in 60 seconds, the same notice says which sound, why, and what plays instead: the stand-in engine's copy or a similar sound.

Parameters can change by bar like anything else: at bar 16: bass.reverb.mix = 0.65.