Skip to main content

Text-to-Music Prompt Structurer

PyPI CI MPL-2.0

Turn a musical idea into separate Suno Custom/Advanced inputs: Style of Music, Lyrics, Exclude, title and optional vocal controls. Works offline, has no mandatory dependencies and requires Python 3.10+.

Install

pip install --upgrade text-to-music-prompt-structurer

Verify:

text-to-music-prompt --help

Quick start

text-to-music-prompt --title "Luz de madrugada" \
  "neo soul and jazz, warm female vocals in Spanish, piano, 92 bpm, no autotune"

The result includes separate headings such as:

TITLE
Luz de madrugada

STYLE OF MUSIC
Genre blend: Neo Soul + Jazz; 92 BPM; ...

EXCLUDE
Autotune

VOCAL GENDER
Female

Copy each value to the matching Suno field. Do not paste the whole report into the Lyrics field. --format json produces equivalent separate properties, useful for apps and automation.

Lyrics and song sections

Supply your own lyrics (preserved without rewriting):

text-to-music-prompt --lyrics-file lyrics.txt \
  "nostalgic soul, female vocals in Spanish, 90 bpm"

Or create a song structure with instructions for individual sections:

text-to-music-prompt \
  --section "Intro" --cue "Intro=solo piano, no drums" \
  --section "Verse 1" \
  --section "Chorus" --cue "Chorus=restrained harmonies" \
  --section "Chorus" --cue "Chorus#2=full band, huge final chorus" \
  --section "Outro" --cue "Outro=piano only" \
  "melancholic indie pop and jazz, intimate female voice, 105 bpm"

Repeated sections can have different cues. Use --cue "Chorus#2=..." to target the second occurrence; repeated unnumbered Chorus=... cues are assigned in order. The generated section skeleton does not invent lyrics.

Python API

from text_to_music_prompt_structurer import (
    MusicPromptEngine, SunoSection, validate_suno_prompt,
)

engine = MusicPromptEngine()
fields = engine.process_suno(
    "cinematic neo soul and jazz, 92 bpm, piano, female vocals in Spanish, no autotune",
    title="Luz de madrugada",
    sections=[
        SunoSection("Verse 1", lyrics="Aún espero la luz.", cue="breathy solo lead"),
        SunoSection("Chorus", lyrics="Volverá la luz.", cue="layered harmonies"),
    ],
)
print(fields.style_of_music)  # Suno -> Style of Music
print(fields.lyrics)          # Suno -> Lyrics
print(fields.exclude)         # Suno -> Exclude
print(fields.to_dict())       # Structured Python dictionary
print(validate_suno_prompt(fields))

Useful CLI flags

Flag Purpose
--format json Machine-readable Suno fields
--format legacy Previous STYLE/MOOD/BPM analysis
--lyrics-file FILE Use your own UTF-8 lyrics
--section NAME Append a song section; repeatable
--cue "NAME[#N]=TEXT" Direct a named section or the Nth occurrence
--exclude "TEXT" Add an explicit Exclude field item
--instrumental Enable instrumental-only mode
--style-notes "TEXT" Append production details
--no-original Omit the free-form description from the style summary
--no-auto-exclude Disable extraction of global no X directives
--check Print quality warnings to stderr
--max-style-chars N Optional user-defined style budget, with --check
--max-lyrics-chars N Optional user-defined lyrics budget, with --check
text-to-music-prompt --format json --check --max-style-chars 1000 \
  "indie pop and jazz, piano, 105 bpm, without autotune"

Constraints: global no drums is mapped to Exclude, but no drums in the intro, drums in the chorus is kept as a section-local musical direction, not a global exclusion. The parser supports common Spanish phrasing such as sin batería, voz femenina, voz rasgada, susurrado and coros. Detected multi-genre blends retain their source order. Numeric BPM values must be complete, in the supported 30–300 BPM range.

Project vision

Led by Eduardo J. Barrios, whose background includes advanced knowledge of AI, NLP and LLMs, this project aims to design an extensible, rigorous music-prompting system suited to Suno. The current implementation is a deterministic local parser, not an LLM or a Suno API client. Section tags and arrangement instructions are guidance rather than guaranteed generation controls.

Development and releases

git clone https://github.com/edujbarrios/text-to-music-prompt-structurer.git
cd text-to-music-prompt-structurer
pip install -e ".[dev]"
pytest
ruff check .

Merging an updated package version in pyproject.toml into main automatically triggers GitHub Actions to test, build, publish to PyPI (OIDC Trusted Publishing) and attach distributions to the corresponding GitHub Release. The PyPI project must have a Trusted Publisher for edujbarrios/text-to-music-prompt-structurer, workflow release.yml, environment pypi.

See CHANGELOG, CONTRIBUTING and the MPL-2.0 license.

Metadata

Release files for text-to-music-prompt-structurer 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text-to-music-prompt-structurer 0.4.0
File Size Uploaded
text_to_music_prompt_structurer-0.4.0.tar.gz 45.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for text-to-music-prompt-structurer 0.4.0
File Interpreter ABI Platform
text_to_music_prompt_structurer-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 90.7 kB

Release files / text_to_music_prompt_structurer-0.4.0.tar.gz

Download URL text_to_music_prompt_structurer-0.4.0.tar.gz
Size 45.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1428026f74201334f5c9807cf7c80a4721837ee24d5833180f777e07b01903c1
BLAKE2b-256 checksum
How to use checksums
29664d9af9845e51123751e98d302dc304042fa636b00410fabd2b382d13389a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / text_to_music_prompt_structurer-0.4.0-py3-none-any.whl

Download URL text_to_music_prompt_structurer-0.4.0-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d6f737cd9dc4939bc3de4c0549bc8c1dc492f3d648e5916f4122ea9fa00ae1d
BLAKE2b-256 checksum
How to use checksums
f8d03acab5ae934911f4e2ed5f8a9c3ac467fa5aaab8348610cdb9542a60dd73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page