xnano-audio
Synthesize, play and capture sound in Python without audio files or extra dependencies.
Install
pip install xnano-audio
Or install it as an extra of the top-level xnano package, which exposes it as xnano.audio and adds xnano.note, xnano.play, xnano.from_audio, canvas.audio, canvas.play and canvas.bpm:
pip install "xnano[audio]"
On Linux, playing on an audio device requires ALSA. Synthesis and rendering work without a device everywhere.
Example
from xnano_audio import render_note, TerminalAudioEffect
# Synthesize a bell with reverb, no device needed
ding = render_note('bell', 'C6', effects=[TerminalAudioEffect.reverb()])
assert ding.peak <= 0.98
# Build a melody on a beat timeline
from xnano_audio import TerminalMelody, TerminalTempoMap
melody = (
TerminalMelody(tempo_map=TerminalTempoMap(100))
.appended_note('C4')
.appended_chord(['E4', 'G4'], duration_beats=2)
.appended_rest(1)
)
sound = melody.render('piano')
What it provides
- Synthesis: 20+ built-in instruments (piano, organ, guitar, synth, kick, snare, bells, etc.) rendered deterministically to raw samples
- Effects: reverb, delay, distortion, filters, tremolo and bit-crushing, composable and reusable
- Melodies: notes arranged on a beat timeline with tempo maps and time signatures
- Playback: play sounds and instruments on the default output device with sample-accurate timing
- Mixing:
TerminalSound.mixcombines sounds, each with an offset and a gain, into one - Capture: read the level of the default input device (microphone)
- No audio files: every sound is computed on the fly
Links
- Repository: https://github.com/hsaeed3/xnano
- Documentation: https://xnano.hammad.app
- API reference: https://xnano.hammad.app/api-reference/
- License: MIT
Metadata
Release files for xnano-audio 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xnano_audio-0.3.0.tar.gz | 91.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| xnano_audio-0.3.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| xnano_audio-0.3.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| xnano_audio-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 7.4 MB
Release files / xnano_audio-0.3.0.tar.gz
| Download URL | xnano_audio-0.3.0.tar.gz |
|---|---|
| Size | 91.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d512b1ea08c9549a1c77d772638c4e49c22078f27535646c97de2ee7a1341a53
|
|
BLAKE2b-256 checksum How to use checksums |
8d6d594cdcf11fe2a7f1c3294ce1ed43644969396bc5151a4635f333927913ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-win_amd64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
600e6beffda8a055ebcb6d100d95dbf23e146cf1329b541b2512c41c79dd679d
|
|
BLAKE2b-256 checksum How to use checksums |
bd1e79368d03c86a59c969651374ca101a376bb287d0bee9bdafebf7d788d1df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2c736b9929a8bfcc55e6d6c15ce1bea24f9d21ae22108be67686e6e6f047e7b3
|
|
BLAKE2b-256 checksum How to use checksums |
d4dfe884d52ec7fa1ad21f7138a2070cdd1761e1bc9b103e4367940fb7dc1fda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5286d270a1ad0adb7a765f11cdcedc20cc968772f5d703256b11206eb19a266e
|
|
BLAKE2b-256 checksum How to use checksums |
37efc2be3b9e6e3829874e764cb0ebd258089e8f13c862a6606edfc755615f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4be4f453a395627c3ec979244efd108a598e3a9d8da5d877c1fe5b69bc5c2269
|
|
BLAKE2b-256 checksum How to use checksums |
a78038e63f03c967bceb10501f64fa6c6059feea73a853460d0dfd7639410689
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f0502c99f0a5c290e51e9985cd94eaacef8662fd31132850474d431005a72883
|
|
BLAKE2b-256 checksum How to use checksums |
aea67892604019e2b5aad2f7970efd9f278ad92609871ac08f6688f1626d5883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2a54cce3133e7da783b721b39ae967ea3c8ee6e2317ae54ec322114f6b10749d
|
|
BLAKE2b-256 checksum How to use checksums |
8997b9ee56ff2483114e593be4da793cf4076bb2276a312426a7ed6e2e57b6dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xnano_audio-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | xnano_audio-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
8056bf5af6e676214e5fa86911d2146a32b55236430c4d1cd7ac5f96038cfeda
|
|
BLAKE2b-256 checksum How to use checksums |
65ddc63561279761ff7fe5b79f39ddd7b158f2241851ae9498fef706d631a02c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|