Examples
Fifteen complete pieces made from code, each with a player.
On this page
Every example is a BoxLang script that makes a complete piece of sound from code, with no samples and no licensing questions: all the music is original. The clips below are short renders at 96 kbps; the scripts make the full pieces. Each is one readable file in examples/, covered by tests that render it and measure what it sounds like.
bx-audio pieces # the list
bx-audio render house --out=house.mp3 # render one, with its own settings
bx-audio explorer # play them all in the browser
Pop Drive
Upbeat pop. Voices, a beat grid, kick pump and mastering. A port of a numpy script, checked against the original.
bx-audio render pop-drive --out=pop-drive.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 8 to 56 | 28 |
--bpm | Tempo | 90 to 150 | 128 |
--style | Style | pop, drive | pop |
Lofi
Lofi hip hop. Swing, humanised timing, tape wobble and vinyl crackle over jazzy seventh chords.
bx-audio render lofi --out=lofi.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 8 to 32 | 16 |
--bpm | Tempo | 60 to 95 | 78 |
--swing | Swing | 0.5 to 0.7 | 0.58 |
--seed | Seed | 1 to 99 | 7 |
House
House. Four on the floor with sidechain pumping, a rolling bass, stabs, a riser and a drop.
bx-audio render house --out=house.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 16 to 48 | 32 |
--bpm | Tempo | 118 to 130 | 124 |
Ambient
Drone and pads. Slow envelopes, inharmonic bells, noise swells and a very large reverb.
bx-audio render ambient --out=ambient.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 4 to 24 | 12 |
--bpm | Tempo | 36 to 70 | 48 |
--seed | Seed | 1 to 99 | 5 |
Techno
Techno. A hypnotic groove in F sharp minor: hard kick, rumble bass, a resonant acid line and echoing stabs.
bx-audio render techno --out=techno.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 16 to 48 | 32 |
--bpm | Tempo | 124 to 145 | 132 |
Synthwave
Synthwave. A night drive: pulsing bass, a gated snare in a huge room, wide pads, an arpeggio and a lead melody.
bx-audio render synthwave --out=synthwave.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 16 to 48 | 32 |
--bpm | Tempo | 85 to 120 | 100 |
Cinematic
Trailer music. Tension, a build, one silent beat, then a huge boom, taiko drums and a theme. Ends on a ringing hit.
bx-audio render cinematic --out=cinematic.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 16 to 40 | 24 |
--bpm | Tempo | 70 to 120 | 90 |
Chiptune
8 bit game music. Original music for an imaginary console: two pulse channels, a triangle bass and noise drums. Five tracks, from an overworld theme to a boss fight.
bx-audio render chiptune --out=chiptune.mp3
| Setting | Range | Default | |
|---|---|---|---|
--track | Track | overworld, cave, boss, title, victory | overworld |
--loops | Loops (0 is the track's own) | 0 to 4 | 0 |
Game sound effects
Sound effects. A jump, a coin, a laser, an explosion and more, made from pulse waves and noise. Hear them all in the sampler or one at a time.
bx-audio render sfx --out=sfx.mp3
| Setting | Range | Default | |
|---|---|---|---|
--sound | Sound | sampler, jump, coin, laser, explosion, powerup, hit, blip, alarm, gameover, footstep | sampler |
--seed | Seed (the noise in the explosion, hit and footstep) | 1 to 99 | 1 |
Jazz
Swing blues. A trio on a twelve bar blues in F: walking bass, ride, piano comping and an improvised solo. Change the seed for another solo.
bx-audio render jazz --out=jazz.mp3
| Setting | Range | Default | |
|---|---|---|---|
--choruses | Choruses | 2 to 6 | 3 |
--bpm | Tempo | 100 to 180 | 132 |
--swing | Swing | 0.5 to 0.75 | 0.64 |
--seed | Seed | 1 to 99 | 4 |
Rock
Rock. Distorted power chords, a bass guitar, drums with fills and crashes, and a pentatonic solo from a seeded generator.
bx-audio render rock --out=rock.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 16 to 48 | 32 |
--bpm | Tempo | 100 to 160 | 128 |
--seed | Seed | 1 to 99 | 3 |
Voice-over
Narration over music. A trailer style announcement: a text to speech voice over music that ducks under it. Needs the speech engine, so it runs from the command line.
bx-audio render voiceover --out=voiceover.mp3
| Setting | Range | Default | |
|---|---|---|---|
--voice | Voice | text | joe |
--text | Lines, separated by | text | |
--duck | Music ducking in dB | -24 to 0 | -12 |
--bpm | Tempo | 80 to 130 | 100 |
Trailer soundtrack
A scored video. Music cut to an exact length, a voice-over with captions, ducking, mastering to a loudness target and chapter markers. Needs the speech engine, so it runs from the command line.
bx-audio render trailer --out=trailer.mp3
| Setting | Range | Default | |
|---|---|---|---|
--seconds | Length in seconds | 8 to 40 | 15 |
--voice | Voice | text | joe |
--text | What the voice says | text | none |
--target | Loudness target | streaming, podcast, game, broadcast, cinema | streaming |
Game audio
A scripted play session. What a game asks of a sound engine: effects with variations, a looping theme, a boss theme made with time stretch and pitch shift, and a real time mixer with music and effects buses. A scripted session is rendered here.
bx-audio render game-audio --out=game-audio.mp3
| Setting | Range | Default | |
|---|---|---|---|
--seed | Seed (changes the variations) | 1 to 20 | 1 |
The BxAudio theme
Grid anthem. A neon grid runner: a pulsing saw bass, gated pads, an opening filter, then an original adventure fanfare of rising fourths with a harp run.
bx-audio render theme --out=theme.mp3
| Setting | Range | Default | |
|---|---|---|---|
--bars | Bars | 8 to 32 | 16 |
--bpm | Tempo | 120 to 145 | 132 |