Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bitComposer

CI Release License

Procedural 16-bit game music. Pure Python, no dependencies, writes Impulse Tracker .it modules you can play in any tracker player, and a KDE Plasma player that generates while you listen.

Every run composes a new song: a motif-based melody with call-and-response phrasing, voice-led harmony, bass, arpeggio and drums, arranged into a form (verse–chorus, AABA, rondo, through-composed) with a drawn intro, an energy curve and a real ending, titled after what it drew, between 1:15 and 3:30 long. Seven sounds, picked with --sound:

  • snes — sampled-style voices built the way the SNES made sound, through a BRR codec model and the SNES echo.
  • ffvi, mana, evermore, megamanx — style packs: an instrument set rebuilt from each game's own sound chip (every sample profiled, nothing copied) plus the arrangement habits of its score. Details under Sounds.
  • genesis — FM bells, brass, organ and bass.
  • chip — square, pulse and triangle waves. Closest to NES and Game Boy.

Listen in your browser — the actual modules, played live by libopenmpt in WebAssembly: one song per sound, straight from the generator, regenerated with each release.

Reproducible, not frozen. The same seed on the same version gives the same song, byte for byte. A new version may change what a seed draws, and the song message records the version that wrote the file.

Install

From PyPI, with pipx so it lands on your PATH without touching the system Python (Debian and Fedora refuse a plain pip install there):

pipx install bitcomposer
bitcomposer -d out            # writes out/<Title>.it
bitcomposer -d out -s 42 -v   # reproducible, with details

On Windows, the release zip needs no Python at all; see Windows. From a clone, for development:

git clone https://github.com/CatDogBark/bitComposer.git
cd bitComposer
python3 -m bitcomposer -d out

Play the result with OpenMPT (Windows), Schism Tracker, VLC, Audacious, xmp, or anything built on libopenmpt.

Python 3.10 or newer, no dependencies. The window (bitcomposer-gui) uses tkinter, which Debian and Ubuntu ship separately as python3-tk.

Sounds

A style pack pairs an instrument set with the arrangement habits of the score it imitates. Each is built from the game's SPC snapshots: every sample decoded and profiled, matched to the community's instrument tables where they exist, and re-synthesised; nothing from the games is in the repository.

  • ffvi: every voice modelled on the game's own sample bank and named by its instrument table: the chorused string section, flutes in chords, the dark synth lead of Locke and the Returners, trumpet, trombone, oboe, Terra's and Cyan's pan flutes, cello, choir, pipe organ and rock organ, the Aria's soprano, the Battle theme's distortion guitar, piano, harp, picked string, acoustic guitar, tubular bell, xylophone, a bass guitar and a kit of its own (kick, snare, hats, cymbal, timpani, wood block), with ostinato strings, a brass counter-line in the chorus, timpani rolls into sections and the game's short, wet echo.
  • mana: every voice modelled on the game's own sample bank: a soft slow-breathed flute, bright chorused strings, an 'ah' choir, a high whistle, soft and synth brass, marimba, vibraphone, electric piano, tubular bell, reed, accordion, glass and sine pads, fingered, electric and slap basses and a kit of its own (kick, snare, hats, crash, tom, castanet), with major and pentatonic keys, syncopated harmony, bouncy arps, light swing, the kick and snare set back and the game's one-row echo.
  • evermore: every voice modelled on the game's own sample bank: a slow bright string swell, a warm pad, a dark pad, a glass bell, a breathy flute, a reed, an "oo" choir, harp, tinker music box, piano, pluck and kalimba, a textured drone and a wind loop, a bass, and a quiet kit (soft kick, frame drum, brushes, hat, cymbal, wood ping), with slow tempos, sustained harmony, a drone bass, sparse or no drums, long linear forms and the game's sparing 80 ms echo.
  • megamanx: every voice modelled on the game's own sample bank and named by it: a driven, chorused lead guitar, a chugging rhythm guitar on power chords, the overdrive guitar for arps and counter-lines, synth brass, strings, a guitar swell pad, a saw pad, organ, the boomer synth lead, square and bright leads, a hollow wave, a bell synth, an acoustic pluck, the orchestra hit for stabs, slap and synth basses on a riff, and a tight kit, at fast tempos in minor keys with the game's 48 ms slapback echo.

--sound picks a palette or a pack in one word; left to chance, the four packs together weigh as much as plain snes.

  • snes — sampled-style voices rendered the way the SNES actually made sound: strings, brass, a formant choir, flute, organ, e-piano, bells, plucks and a gated drum kit at 16 kHz with loop points, passed through a BRR codec model for the grain, with the lead, harmony and arp through an echo modelled on the SNES unit's result: fading, darkening repeats on a beat fraction, drawn per song.
  • genesis — FM bells, brass, organ and bass.
  • chip — square, pulse and triangle waves.

What you can steer

Everything defaults to random.

--sound   chip|snes|genesis|ffvi|mana|evermore|megamanx  the sound in one word: a palette or a style pack (overrides the two below)
--style   chip|snes|genesis          sound palette
--pack    ffvi|mana|evermore|megamanx|none|random  style pack: an instrument set with the habits of the scores it imitates (a pack implies snes)
--echo    on|off|random              echo (random: 70% of snes songs, never chip or genesis)
--echo-wet    light|normal|wet|random  how much of the lead, harmony and arp the echo carries
--echo-delay  eighth|dotted|quarter|slap|row|random  beat fraction between repeats, a 48 ms slap, or one row (random: weighted by tempo)
--echo-stereo bounce|centre|random     repeats alternate sides, or sit under their source
--keys    moving|home                moving: choruses/bridges may change key; home: stay put
--tempo   slow|medium|fast           80–110 / 110–140 / 140–180 BPM
--energy  chill|normal|intense       density and arrangement weight
--scale   minor|major|pentatonic
--form    standard|aaba|rondo|short|linear
--drum-density sparse|normal|busy    --no-fills    --swing off|light|heavy
--melody  simple|phrased             phrased = motif-based, has a hook
--harmony-voicing thin|full          two real voices, or three
--harmony-mode stabs|sustain|rhythmic
--bass-weight heavy|medium|light
--name    title|timestamp            file naming; --suffix adds a marker
-s SEED   -n COUNT   -o FILE   -d DIR   -v

Some starting points:

# Overworld — bright, sampled palette with echo
bitcomposer -d out --style snes --scale major --tempo medium --form standard

# FM boss fight
bitcomposer -d out --style genesis --tempo fast --energy intense --scale minor --drum-density busy --form short

# Game Boy flavour — square waves, thin harmony, no echo
bitcomposer -d out --style chip --echo off --harmony-voicing thin --bass-weight light --form short

# Credits roll
bitcomposer -d out --style snes --tempo slow --energy chill --scale major --drum-density sparse --no-fills --form linear

How it works

  1. Pick a key and a scale weighted toward game music (minor pentatonic, dorian, harmonic minor, mixolydian…), then a progression for it. The tables include borrowed chords and secondary dominants — ♭VII, ♭VI, V/V — not just the diatonic set.
  2. Choose a form and its energy curve; decide which sections repeat. Repeated sections draw the same music from the same seed, so the hook comes back.
  3. Generate a motif (rhythm template plus contour) and vary it per bar in statement/answer pairs. Fourteen rhythm templates, six of them with 16th-note pushes and pickups.
  4. Each four-bar pattern holds a chord timeline; about half the time the back two bars move to a related chord. Melody resolves onto chord tones at each change. Harmony is two or three real voices placed near fixed anchors, so it steps rather than leaps and keeps the chord's third; the anchors are set per voice family (pads low and wide, brass and guitars mid and close), the top voice stays under the lead's line, and a stab holds for as long as the voice needs to speak. Bass and arp follow and rest with the section's energy.
  5. Drums come from one-bar templates by section and density, with fills, retriggered snare rolls and tick-level swing.
  6. Instruments are synthesized per song from the chosen palette and written as samples. SNES voices get attack-then-loop sustain and the BRR treatment.
  7. The echo: held lead notes and phrase endings come back as three fading, darkening repeats, the harmony and arp as lighter ones, each on return channels of their own, drums and bass dry. Everything is written as a 19-channel .it with the title and a song message (key, BPM, palette, form, seed, and a layout: line naming every channel's role) that trackers display.

Each song gets a seed-derived two-word title that leans with its scale: Haunted Orchard, Neon Causeway, Rusted Foundry.

Measuring instead of guessing

tools/analyze.py parses .it files back from disk (stdlib only, independent of the generator) and scores a batch on the things that correlate with "sounds like a song": section reuse, motif repetition, rhythmic grid, chord voicing variety, voice motion, effect vocabulary, drum density.

python3 tools/analyze.py 'out/*.it'          # metric table
python3 tools/analyze.py --grid out/song.it  # tracker-style pattern dump

docs/ANALYSIS.md is the story of this project: the output was once limited by three silent arrangement bugs that nine commits of ear-checking never caught, and every improvement since has been measured before and after. Read it before changing the generator.

Tests:

python3 -m unittest discover -s tests -v

Windows

Every release carries bitComposer-windows.zip with two executables built by GitHub Actions on every push and attached on the tag: bitComposer.exe, a small window (sound, echo, energy, tempo, how many, save folder, Generate), and bitcomposer-cli.exe, the command line. Songs are .it files; OpenMPT plays them and will play a whole folder as a playlist. The executables are not code-signed, so SmartScreen asks once. With Python installed instead, pipx install bitcomposer gives the same two commands as bitcomposer and bitcomposer-gui. A Windows player with the Plasma widget's features is a 1.x item (see the roadmap).

Companion player (optional, Linux + KDE Plasma 6)

The Plasma widget: now playing, transport, gain, generate and settings, playlist

companion/ holds a desktop player stack: a libopenmpt D-Bus daemon with MPRIS2, a Plasma 6 panel widget with transport, gain, generator settings, presets and a per-channel mixer, and an auto-generate "radio" mode that composes the next track as the current one ends.

./companion/install.sh --check   # see what it would do
./companion/install.sh           # install, enable the daemon

See docs/INSTALL.md. The generator does not depend on any of this.

License

MIT. Every instrument is synthesized; no samples were taken from any game.

Metadata

Release files for bitcomposer 1.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitcomposer 1.0.0rc1
File Size Uploaded Provenance
bitcomposer-1.0.0rc1.tar.gz 134.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bitcomposer 1.0.0rc1
File Interpreter ABI Platform
bitcomposer-1.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 271.2 kB

Release files / bitcomposer-1.0.0rc1.tar.gz

Download URL bitcomposer-1.0.0rc1.tar.gz
Size 134.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7829863e8341f9076bb2f15fba6f1f0ef444a71d10abf5b6fcb63c146f4930be
BLAKE2b-256 checksum
How to use checksums
0715bd081d9a5af1518e45fada1547e5f26882ee422849fc631145a684c32181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / bitcomposer-1.0.0rc1-py3-none-any.whl

Download URL bitcomposer-1.0.0rc1-py3-none-any.whl
Size 136.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0ab3c9fa02de83b93ee3b889a071d24188c0833d094f0ff544e04ae65d337c9
BLAKE2b-256 checksum
How to use checksums
9d3a7a1497033c3ed05d361ac8fc4d20b258dd2036d6ad1f10431ad3b493728e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for bitcomposer 1.0.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bitcomposer-1.0.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page