Skip to main content

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) or pyenv 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 expressive first.
  • 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.md
  • docs/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

latentscore-0.1.1.tar.gz (91.9 kB view details)

Uploaded Source

Built Distribution

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

latentscore-0.1.1-py3-none-any.whl (88.1 kB view details)

Uploaded Python 3

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

Hashes for latentscore-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6dc0780287617c353be9dc49d4ca463fde655847bd02930c9f50bbbd6eefe95b
MD5 1b400521f4283aecfda872926702150d
BLAKE2b-256 cc39cba4fb363878b76cb90bfd23afc2ef7c175725aef10af8d3aec01623fbc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for latentscore-0.1.1.tar.gz:

Publisher: workflow.yml on prabal-rje/latentscore

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

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

Hashes for latentscore-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa93866518b9db98def2b617ea6420aee8bdd6aec344049ebb9edcf6988da27
MD5 11d488dd8b962077486651eddc9a3028
BLAKE2b-256 f73ca56826325ec59a6b6293f1d73b9c1b61f88ecbac4b9c663f7fffc859faae

See more details on using hashes here.

Provenance

The following attestation bundles were made for latentscore-0.1.1-py3-none-any.whl:

Publisher: workflow.yml on prabal-rje/latentscore

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