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–3.12. If you don't have it: brew install python@3.10 (macOS) or pyenv install 3.12

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.2.tar.gz (103.3 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.2-py3-none-any.whl (101.8 kB view details)

Uploaded Python 3

File details

Details for the file latentscore-0.1.2.tar.gz.

File metadata

  • Download URL: latentscore-0.1.2.tar.gz
  • Upload date:
  • Size: 103.3 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.2.tar.gz
Algorithm Hash digest
SHA256 284b67df32631d53179c2a9707bf82c4f9a1818146b835976677cc2d169ebb60
MD5 19c21c7a69958219c70a831c47c3d245
BLAKE2b-256 f0c7116d183f7065c04cafae4559eeb7a9b157a0df99a5ed0725f3471bed810f

See more details on using hashes here.

Provenance

The following attestation bundles were made for latentscore-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: latentscore-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 101.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b1b95ca2836dbcb54fe026038e47baef53d1f4eefa4d0e5dca163ad8019f84d
MD5 9276c8e90439dfb5eb59430fb5cb85cc
BLAKE2b-256 b16c11fe28eba9d340679c5c16eb4011cdf996fe7b24b067dfbc72760906e513

See more details on using hashes here.

Provenance

The following attestation bundles were made for latentscore-0.1.2-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