Skip to main content

A code-first audio studio: write -> render -> listen -> adjust.

Project description

shipwright-audio

A code-first audio studio: describe a sound or a few bars of music in a small Python function, run one command, get a .wav.

Requires Python 3.10 through 3.12.

The shape

Four layers, cleanly separated:

Layer File Job
Composition (above) shipwright/compose.py chord symbols / pitch lists → Notes
Sound sources (below) shipwright/instruments.py Faust synths the engine plays
SFX synthesis shipwright/dsp.py numpy oscillators / noise / envelopes / filters
The spine shipwright/engine.py DawDreamer: graph → mix → bus FX → offline render

You author in a sounds/ directory in your project (create it yourself — the tool reads ./sounds from wherever you run it). Each file is one sound. A build-function returns either a Buffer (raw numpy samples → SFX) or a RenderSpec (tracks of MIDI played by instruments → music). The harness routes by type. Copy-paste starting points live in examples/.

Install

As a tool (gets you the shipwright command anywhere):

uv tool install shipwright-audio      # or: pipx install shipwright-audio

Or from a checkout for development:

uv sync                               # create .venv + install deps

Use

shipwright loads sounds from ./sounds and writes to ./output relative to the directory you run it in (override with SHIPWRIGHT_SOUNDS / SHIPWRIGHT_OUTPUT).

shipwright                       # list sounds
shipwright sea_bed               # render one  -> output/sea_bed.wav
shipwright all --ogg             # render all, also write .ogg
shipwright --watch sea_bed       # re-render on every save (tight loop)

From a checkout without installing, uv run shipwright ... or python render.py ... both work.

Develop

uv run --extra dev pytest
env SHIPWRIGHT_SOUNDS=examples uv run shipwright ui_blip
env SHIPWRIGHT_SOUNDS=examples uv run shipwright sea_bed

Add a sound

Create sounds/my_thing.py:

from shipwright import sound, Buffer, dsp

@sound("zap")
def zap():
    s = dsp.ad_env(dsp.saw(220, 0.25), attack=0.001, release=0.2)
    s = dsp.lowpass(s, 1200)
    return Buffer(dsp.to_stereo(dsp.normalize(s, 0.9)))

…then shipwright zap. Music works the same way but returns a RenderSpec of Tracks — see examples/music_sea_bed.py.

Why DawDreamer is the spine but not the whole thing

DawDreamer mixes, automates (sample-accurate, via numpy arrays), hosts plugins, and renders deterministically offline. It does not compose and ships no instruments — so composition lives above it (compose.py) and sound sources below it (instruments.py, here as Faust). That's the whole architecture.

Nicer instruments (upgrade path)

The built-in Faust synths need zero files. When you want more "produced" sound, swap a Track's instrument for either:

  • SoundFont: drop an .sf2 in soundfonts/, render its MIDI with pyfluidsynth, feed the audio into the DawDreamer graph as a track.
  • VST/AU: engine.make_plugin_processor("name", "/path/to/plugin.vst3"), then add_midi_note(...) exactly like the Faust instruments.

License

shipwright-audio is MIT licensed. Its DawDreamer dependency is GPLv3; review that license before redistributing bundled applications or generated tooling.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shipwright_audio-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shipwright_audio-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file shipwright_audio-0.1.0.tar.gz.

File metadata

  • Download URL: shipwright_audio-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shipwright_audio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d18443bc0816860eec7bfbc063124f23c3d799d0fe9b380159a5c801c4ed4e9
MD5 461beb24fde8de1705824094c4b06ad6
BLAKE2b-256 0402049022a774462aa71814ba6bc4949d143ec669a7cdaf21b083375e038c53

See more details on using hashes here.

Provenance

The following attestation bundles were made for shipwright_audio-0.1.0.tar.gz:

Publisher: publish.yml on dinger086/shipwright-audio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shipwright_audio-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shipwright_audio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e82cff239ad75792b8e9267a0242cd0138149198dac886492d255e8627736c8
MD5 b60cbf9ad8e58cc37cf6217839863707
BLAKE2b-256 bf79ec50956790d5699862a3aef59b7e43d5206ddcbcb2f2abcd1cf4d4009aa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for shipwright_audio-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dinger086/shipwright-audio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page