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 RangeDefault
--barsBars8 to 5628
--bpmTempo90 to 150128
--styleStylepop, drivepop

Script and notes

Lofi

Lofi hip hop. Swing, humanised timing, tape wobble and vinyl crackle over jazzy seventh chords.

bx-audio render lofi --out=lofi.mp3
Setting RangeDefault
--barsBars8 to 3216
--bpmTempo60 to 9578
--swingSwing0.5 to 0.70.58
--seedSeed1 to 997

Script and notes

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 RangeDefault
--barsBars16 to 4832
--bpmTempo118 to 130124

Script and notes

Ambient

Drone and pads. Slow envelopes, inharmonic bells, noise swells and a very large reverb.

bx-audio render ambient --out=ambient.mp3
Setting RangeDefault
--barsBars4 to 2412
--bpmTempo36 to 7048
--seedSeed1 to 995

Script and notes

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 RangeDefault
--barsBars16 to 4832
--bpmTempo124 to 145132

Script and notes

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 RangeDefault
--barsBars16 to 4832
--bpmTempo85 to 120100

Script and notes

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 RangeDefault
--barsBars16 to 4024
--bpmTempo70 to 12090

Script and notes

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 RangeDefault
--trackTrackoverworld, cave, boss, title, victoryoverworld
--loopsLoops (0 is the track's own)0 to 40

Script and notes

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 RangeDefault
--soundSoundsampler, jump, coin, laser, explosion, powerup, hit, blip, alarm, gameover, footstepsampler
--seedSeed (the noise in the explosion, hit and footstep)1 to 991

Script and notes

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 RangeDefault
--chorusesChoruses2 to 63
--bpmTempo100 to 180132
--swingSwing0.5 to 0.750.64
--seedSeed1 to 994

Script and notes

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 RangeDefault
--barsBars16 to 4832
--bpmTempo100 to 160128
--seedSeed1 to 993

Script and notes

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 RangeDefault
--voiceVoicetextjoe
--textLines, separated by text
--duckMusic ducking in dB-24 to 0-12
--bpmTempo80 to 130100

Script and notes

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 RangeDefault
--secondsLength in seconds8 to 4015
--voiceVoicetextjoe
--textWhat the voice saystextnone
--targetLoudness targetstreaming, podcast, game, broadcast, cinemastreaming

Script and notes

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 RangeDefault
--seedSeed (changes the variations)1 to 201

Script and notes

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 RangeDefault
--barsBars8 to 3216
--bpmTempo120 to 145132

Script and notes

Edit this page Download Markdown Last updated Oct 16, 2026, 11:59:46 AM Report an issue