LatentScore audio synthesis library.
Project description
LatentScore
⚠️ Alpha: This library is under active development. API may change between versions.
Generate ambient music from text descriptions. Locally. No GPU required.
Read more about how it works here.
import latentscore as ls
ls.render("warm sunset over water").play()
Install
Conda
conda create -n latentscore python=3.10
conda activate latentscore
conda install pip
pip install latentscore
Pip
python -m venv .venv
source .venv/bin/activate
pip install latentscore
Requires Python 3.10. If you don't have it:
brew install python@3.10(macOS) orpyenv install 3.10
Usage
import latentscore as ls
# Render and play
audio = ls.render("warm sunrise over water")
audio.play()
audio.save("output.wav")
Streaming
import latentscore as ls
# Stream a single vibe
ls.stream("warm sunset over water", duration=120).play()
# Stream multiple vibes with crossfade
ls.stream(
"morning coffee",
"afternoon focus",
"evening wind-down",
duration=60,
transition=5.0,
).play()
Async Streaming
import latentscore as ls
import asyncio
async def main():
items = [
ls.Streamable(content="morning coffee", duration=30),
ls.Streamable(content="afternoon focus", duration=30),
]
async for chunk in ls.astream(items):
# Process chunks as they arrive
print(f"Got {len(chunk)} samples")
asyncio.run(main())
Playlists
import latentscore as ls
playlist = ls.Playlist(tracks=(
ls.Track(content="morning energy", duration=60),
ls.Track(content="deep focus", duration=120),
ls.Track(content="evening calm", duration=60),
))
playlist.play()
Modes
- fast (default): Embedding lookup. Instant.
- expressive: Local LLM. Slower, more creative. Run
latentscore download expressivefirst. - external: Route through Claude, Gemini, etc. Best quality, needs API key.
# Use expressive mode
ls.render("jazz cafe at midnight", model="expressive").play()
# Use external LLM
ls.render(
"cyberpunk rain",
model="external:gemini/gemini-3-flash-preview",
api_key="..."
).play()
CLI
latentscore demo # Generate and play a sample
latentscore download expressive # Fetch local LLM weights
latentscore doctor # Check setup
Architecture
See docs/architecture.md for the data_work pipeline map and environment notes.
Research & Training Pipeline (data_work/)
The data_work/ folder hosts the full research + training pipeline (data prep, SFT/GRPO on Modal, CLAP benchmarking, eval suites, exports).
If you want anything beyond the core library, start here:
data_work/README.mddocs/architecture.md
Contributing
See CONTRIBUTE.md for environment setup and contribution guidelines.
See docs/coding-guidelines.md for code style requirements.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file latentscore-0.1.1.tar.gz.
File metadata
- Download URL: latentscore-0.1.1.tar.gz
- Upload date:
- Size: 91.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dc0780287617c353be9dc49d4ca463fde655847bd02930c9f50bbbd6eefe95b
|
|
| MD5 |
1b400521f4283aecfda872926702150d
|
|
| BLAKE2b-256 |
cc39cba4fb363878b76cb90bfd23afc2ef7c175725aef10af8d3aec01623fbc3
|
Provenance
The following attestation bundles were made for latentscore-0.1.1.tar.gz:
Publisher:
workflow.yml on prabal-rje/latentscore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
latentscore-0.1.1.tar.gz -
Subject digest:
6dc0780287617c353be9dc49d4ca463fde655847bd02930c9f50bbbd6eefe95b - Sigstore transparency entry: 868822757
- Sigstore integration time:
-
Permalink:
prabal-rje/latentscore@e9cb79763acec8729e6911bcec523ac70a2ec7ea -
Branch / Tag:
refs/tags/v0.1.1-alpha - Owner: https://github.com/prabal-rje
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@e9cb79763acec8729e6911bcec523ac70a2ec7ea -
Trigger Event:
release
-
Statement type:
File details
Details for the file latentscore-0.1.1-py3-none-any.whl.
File metadata
- Download URL: latentscore-0.1.1-py3-none-any.whl
- Upload date:
- Size: 88.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fa93866518b9db98def2b617ea6420aee8bdd6aec344049ebb9edcf6988da27
|
|
| MD5 |
11d488dd8b962077486651eddc9a3028
|
|
| BLAKE2b-256 |
f73ca56826325ec59a6b6293f1d73b9c1b61f88ecbac4b9c663f7fffc859faae
|
Provenance
The following attestation bundles were made for latentscore-0.1.1-py3-none-any.whl:
Publisher:
workflow.yml on prabal-rje/latentscore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
latentscore-0.1.1-py3-none-any.whl -
Subject digest:
5fa93866518b9db98def2b617ea6420aee8bdd6aec344049ebb9edcf6988da27 - Sigstore transparency entry: 868822764
- Sigstore integration time:
-
Permalink:
prabal-rje/latentscore@e9cb79763acec8729e6911bcec523ac70a2ec7ea -
Branch / Tag:
refs/tags/v0.1.1-alpha - Owner: https://github.com/prabal-rje
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@e9cb79763acec8729e6911bcec523ac70a2ec7ea -
Trigger Event:
release
-
Statement type: