braidio 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- braidio-0.0.2/.gitattributes +1 -0
- braidio-0.0.2/.github/workflows/ci.yml +48 -0
- braidio-0.0.2/.gitignore +120 -0
- braidio-0.0.2/LICENSE +21 -0
- braidio-0.0.2/PKG-INFO +168 -0
- braidio-0.0.2/README.md +139 -0
- braidio-0.0.2/braidio/__init__.py +242 -0
- braidio-0.0.2/braidio/bodies/__init__.py +42 -0
- braidio-0.0.2/braidio/bodies/_domain.py +120 -0
- braidio-0.0.2/braidio/bodies/_render_nodes.py +107 -0
- braidio-0.0.2/braidio/bodies/_tiers.py +43 -0
- braidio-0.0.2/braidio/compose.py +67 -0
- braidio-0.0.2/braidio/conversation.py +181 -0
- braidio-0.0.2/braidio/delivery.py +132 -0
- braidio-0.0.2/braidio/formats.py +332 -0
- braidio-0.0.2/braidio/kinds.py +12 -0
- braidio-0.0.2/braidio/multivoice.py +244 -0
- braidio-0.0.2/braidio/music.py +111 -0
- braidio-0.0.2/braidio/project.py +26 -0
- braidio-0.0.2/braidio/provenance.py +152 -0
- braidio-0.0.2/braidio/render.py +228 -0
- braidio-0.0.2/braidio/rights.py +197 -0
- braidio-0.0.2/braidio/script.py +117 -0
- braidio-0.0.2/braidio/sources.py +249 -0
- braidio-0.0.2/braidio/tts.py +163 -0
- braidio-0.0.2/braidio/weave.py +260 -0
- braidio-0.0.2/braidio/weave_config.py +121 -0
- braidio-0.0.2/misc/docs/Extraction and nw-App Design.md +129 -0
- braidio-0.0.2/misc/docs/research/commentary-formats-and-styles.md +384 -0
- braidio-0.0.2/misc/docs/research/conversational-vs-narration-tts.md +337 -0
- braidio-0.0.2/misc/docs/research/notebooklm-and-conversational-pacing.md +262 -0
- braidio-0.0.2/pyproject.toml +171 -0
- braidio-0.0.2/tests/test_conversation.py +80 -0
- braidio-0.0.2/tests/test_delivery.py +18 -0
- braidio-0.0.2/tests/test_formats.py +92 -0
- braidio-0.0.2/tests/test_multivoice.py +54 -0
- braidio-0.0.2/tests/test_music.py +33 -0
- braidio-0.0.2/tests/test_nw_app.py +81 -0
- braidio-0.0.2/tests/test_script.py +21 -0
- braidio-0.0.2/tests/test_sources.py +56 -0
- braidio-0.0.2/tests/test_tts_api_key.py +170 -0
- braidio-0.0.2/tests/test_weave.py +61 -0
- braidio-0.0.2/tests/test_weave_config.py +53 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.ipynb linguist-documentation
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# wads CI — calls the reusable workflow hosted in i2mint/wads.
|
|
2
|
+
#
|
|
3
|
+
# All configuration comes from this repo's pyproject.toml [tool.wads.ci.*].
|
|
4
|
+
# To customize the workflow itself (rare), replace this file with the
|
|
5
|
+
# full inline template `wads/data/github_ci_uv.yml` from i2mint/wads.
|
|
6
|
+
#
|
|
7
|
+
# Pinning: `@master` floats with wads. If you need version stability for
|
|
8
|
+
# a release-sensitive repo, change `@master` to a wads tag (e.g. `@v0.1.81`).
|
|
9
|
+
# CI failure does not block a published release — it blocks the publish
|
|
10
|
+
# step itself — so floating master is generally safe.
|
|
11
|
+
#
|
|
12
|
+
# Permissions: GitHub validates that the caller grants AT LEAST the
|
|
13
|
+
# permissions any job in the called workflow requests — at workflow-parse
|
|
14
|
+
# time, not at run-time, even if the job would be skipped via `if:`.
|
|
15
|
+
# The reusable workflow needs:
|
|
16
|
+
# contents: write for the publish job's version-bump push-back
|
|
17
|
+
# and for the github-pages job's gh-pages branch push
|
|
18
|
+
# pages: write for the github-pages job's REST API Pages config
|
|
19
|
+
# Both default to `write` on org-account GITHUB_TOKEN and need to be
|
|
20
|
+
# granted explicitly on personal-account callers (where the default is
|
|
21
|
+
# read-only). No `id-token: write` needed — the publish-github-pages
|
|
22
|
+
# action uses peaceiris/actions-gh-pages (branch-based) + REST API,
|
|
23
|
+
# not the OIDC `actions/deploy-pages` flow.
|
|
24
|
+
name: Continuous Integration
|
|
25
|
+
on: [push, pull_request]
|
|
26
|
+
jobs:
|
|
27
|
+
ci:
|
|
28
|
+
uses: i2mint/wads/.github/workflows/uv-ci.yml@master
|
|
29
|
+
permissions:
|
|
30
|
+
contents: write
|
|
31
|
+
pages: write
|
|
32
|
+
# Explicit pass-through (not `secrets: inherit`) because `inherit` does
|
|
33
|
+
# not reliably propagate caller-repo secrets to a reusable workflow owned
|
|
34
|
+
# by a different account (verified empirically: personal-account caller +
|
|
35
|
+
# i2mint-org workflow → `${{ secrets.PYPI_PASSWORD }}` resolved to empty).
|
|
36
|
+
#
|
|
37
|
+
# This list is the per-repo *transport*: it should contain PYPI_PASSWORD
|
|
38
|
+
# (for publishing) plus every secret your tests/CI need. It is generated
|
|
39
|
+
# from [tool.wads.ci.env] in pyproject.toml. To add one, run
|
|
40
|
+
# wads-secrets add VAR_NAME # updates pyproject + this block
|
|
41
|
+
# or just append a line below. *Which* of these become job env vars (and
|
|
42
|
+
# which are required) is controlled by [tool.wads.ci.env] — passing a
|
|
43
|
+
# secret here does not by itself put it in the environment.
|
|
44
|
+
#
|
|
45
|
+
# A secret name must also be declared in the reusable workflow's superset
|
|
46
|
+
# (wads/ci_secrets.py). `wads-secrets add` warns if it is not.
|
|
47
|
+
secrets:
|
|
48
|
+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
braidio-0.0.2/.gitignore
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.claude/handoffs/
|
|
2
|
+
.claude/scratch/
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.DS_Store
|
|
11
|
+
# C extensions
|
|
12
|
+
*.so
|
|
13
|
+
|
|
14
|
+
# TLS certificates
|
|
15
|
+
## Ignore all PEM files anywhere
|
|
16
|
+
*.pem
|
|
17
|
+
## Also ignore any certs directory
|
|
18
|
+
certs/
|
|
19
|
+
|
|
20
|
+
# Distribution / packaging
|
|
21
|
+
.Python
|
|
22
|
+
build/
|
|
23
|
+
develop-eggs/
|
|
24
|
+
dist/
|
|
25
|
+
downloads/
|
|
26
|
+
eggs/
|
|
27
|
+
.eggs/
|
|
28
|
+
lib/
|
|
29
|
+
lib64/
|
|
30
|
+
parts/
|
|
31
|
+
sdist/
|
|
32
|
+
var/
|
|
33
|
+
wheels/
|
|
34
|
+
*.egg-info/
|
|
35
|
+
.installed.cfg
|
|
36
|
+
*.egg
|
|
37
|
+
MANIFEST
|
|
38
|
+
_build
|
|
39
|
+
|
|
40
|
+
# PyInstaller
|
|
41
|
+
# Usually these files are written by a python script from a template
|
|
42
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
43
|
+
*.manifest
|
|
44
|
+
*.spec
|
|
45
|
+
|
|
46
|
+
# Installer logs
|
|
47
|
+
pip-log.txt
|
|
48
|
+
pip-delete-this-directory.txt
|
|
49
|
+
|
|
50
|
+
# Unit test / coverage reports
|
|
51
|
+
htmlcov/
|
|
52
|
+
.tox/
|
|
53
|
+
.coverage
|
|
54
|
+
.coverage.*
|
|
55
|
+
.cache
|
|
56
|
+
nosetests.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
*.cover
|
|
59
|
+
.hypothesis/
|
|
60
|
+
.pytest_cache/
|
|
61
|
+
|
|
62
|
+
# Translations
|
|
63
|
+
*.mo
|
|
64
|
+
*.pot
|
|
65
|
+
|
|
66
|
+
# Django stuff:
|
|
67
|
+
*.log
|
|
68
|
+
local_settings.py
|
|
69
|
+
db.sqlite3
|
|
70
|
+
|
|
71
|
+
# Flask stuff:
|
|
72
|
+
instance/
|
|
73
|
+
.webassets-cache
|
|
74
|
+
|
|
75
|
+
# Scrapy stuff:
|
|
76
|
+
.scrapy
|
|
77
|
+
|
|
78
|
+
# Sphinx documentation
|
|
79
|
+
docs/_build/
|
|
80
|
+
docs/*
|
|
81
|
+
|
|
82
|
+
# PyBuilder
|
|
83
|
+
target/
|
|
84
|
+
|
|
85
|
+
# Jupyter Notebook
|
|
86
|
+
.ipynb_checkpoints
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
.python-version
|
|
90
|
+
|
|
91
|
+
# celery beat schedule file
|
|
92
|
+
celerybeat-schedule
|
|
93
|
+
|
|
94
|
+
# SageMath parsed files
|
|
95
|
+
*.sage.py
|
|
96
|
+
|
|
97
|
+
# Environments
|
|
98
|
+
.env
|
|
99
|
+
.venv
|
|
100
|
+
env/
|
|
101
|
+
venv/
|
|
102
|
+
ENV/
|
|
103
|
+
env.bak/
|
|
104
|
+
venv.bak/
|
|
105
|
+
|
|
106
|
+
# Spyder project settings
|
|
107
|
+
.spyderproject
|
|
108
|
+
.spyproject
|
|
109
|
+
|
|
110
|
+
# Rope project settings
|
|
111
|
+
.ropeproject
|
|
112
|
+
|
|
113
|
+
# mkdocs documentation
|
|
114
|
+
/site
|
|
115
|
+
|
|
116
|
+
# mypy
|
|
117
|
+
.mypy_cache/
|
|
118
|
+
|
|
119
|
+
# PyCharm
|
|
120
|
+
.idea
|
braidio-0.0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thor Whalen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
braidio-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: braidio
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Weave narration with extracted media segments into audiovisual productions
|
|
5
|
+
Project-URL: Homepage, https://github.com/thorwhalen/braidio
|
|
6
|
+
Project-URL: Repository, https://github.com/thorwhalen/braidio
|
|
7
|
+
Project-URL: Documentation, https://thorwhalen.github.io/braidio
|
|
8
|
+
Author: Thor Whalen
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: audio,elevenlabs,ffmpeg,narration,podcast,tts
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Requires-Dist: elevenlabs
|
|
14
|
+
Requires-Dist: mixing
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
17
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
18
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
19
|
+
Provides-Extra: docs
|
|
20
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == 'docs'
|
|
21
|
+
Requires-Dist: sphinx>=6.0; extra == 'docs'
|
|
22
|
+
Provides-Extra: graph
|
|
23
|
+
Requires-Dist: lacing; extra == 'graph'
|
|
24
|
+
Provides-Extra: nw-app
|
|
25
|
+
Requires-Dist: falaw; extra == 'nw-app'
|
|
26
|
+
Requires-Dist: lacing; extra == 'nw-app'
|
|
27
|
+
Requires-Dist: nw; extra == 'nw-app'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# braidio
|
|
31
|
+
|
|
32
|
+
**Weave *commentary* — solo, duo, panel, debate, interview, documentary — with
|
|
33
|
+
source clips into a production.**
|
|
34
|
+
|
|
35
|
+
`braidio` braids the strands of a piece that talks *about* something (a song, a
|
|
36
|
+
book, a film, an event) into one rendered production. The **talk is the spine** —
|
|
37
|
+
a single presenter, two hosts, a panel, a narrator — and **source clips and
|
|
38
|
+
narration bridges are the "illustration" layers** woven onto it. Audio today,
|
|
39
|
+
with visual support to follow (it braids A/V — *braid-io*, and it sounds like
|
|
40
|
+
*radio*).
|
|
41
|
+
|
|
42
|
+
Two things braidio gives you:
|
|
43
|
+
|
|
44
|
+
1. **Ready-made format templates** under the standard, industry names people
|
|
45
|
+
already recognize — *Deep Dive*, *Song Exploder-style*, *Panel*, *Debate*,
|
|
46
|
+
*Documentary VO* — each a high-quality bundle of defaults you can render in one
|
|
47
|
+
call.
|
|
48
|
+
2. **Full parametrization** underneath, so any style is expressible: a `Script`
|
|
49
|
+
of beats, cast via a `ConversationCast`, tuned by `WeaveConfig` + `Delivery`,
|
|
50
|
+
with per-beat voice/delivery overrides.
|
|
51
|
+
|
|
52
|
+
> Status: early. `braidio` is extracted from the
|
|
53
|
+
> [Hamilton lyrics-podcast](https://github.com/thorwhalen/Hamilton) (its first
|
|
54
|
+
> application) into a reusable engine. APIs will move quickly.
|
|
55
|
+
|
|
56
|
+
## The model
|
|
57
|
+
|
|
58
|
+
A production is a **`Script`** — an ordered list of **beats**:
|
|
59
|
+
|
|
60
|
+
| Beat | What it is |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `Narration(text, voice?, voice_settings?, …)` | one voice reading — a narrator **or** a solo presenter. `voice` / `voice_settings` override per beat, so one timeline can carry a lively **presenter** *and* a graver **book-narrator**. |
|
|
63
|
+
| `Dialogue(turns=[(role, text)])` | a multi-speaker exchange, synthesized in **one pass** (so it sounds like people *talking to each other*, not alternating monologues). A `ConversationCast` maps roles → voices. |
|
|
64
|
+
| `SegmentBeat(reference)` | a span of source media to cut and weave in (resolved by a pluggable `SegmentSource` — quote → `[start, end]`). |
|
|
65
|
+
|
|
66
|
+
`WeaveConfig` holds every editing knob (casting, turns, pacing, clip pre/post-roll,
|
|
67
|
+
duck, crossfades, loudness). `Delivery` presets bundle the TTS model + voice
|
|
68
|
+
settings (e.g. `V2_PRESENTER` lively vs `V2_NARRATOR` grave). The renderer
|
|
69
|
+
loudness-normalizes every part, tucks clips under the speech (speech stays
|
|
70
|
+
dominant), and masters the result.
|
|
71
|
+
|
|
72
|
+
## Ready-made formats
|
|
73
|
+
|
|
74
|
+
Pick a standard format and render it — the template supplies the cast, voices,
|
|
75
|
+
delivery and mix defaults:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
from braidio import DEEP_DIVE, render_format
|
|
79
|
+
|
|
80
|
+
render_format(DEEP_DIVE, script, source=my_source, out_path="episode.mp3")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Preset id | Standard name | Shape |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `solo_explainer` | Solo-Presenter Explainer (video/audio essay, close reading) | one presenter + exhibits |
|
|
86
|
+
| `deep_dive` | Two-Host Conversation (*"Deep Dive"*, Switched on Pop, NotebookLM) | two hosts; one teaches, one probes |
|
|
87
|
+
| `interview` | Interview (host + guest) | Q→A, guest is the center |
|
|
88
|
+
| `interview_host_removed` | *Song Exploder*-style (host removed) | guest monologue; each claim illustrated by its isolated stem; full artifact at the tail |
|
|
89
|
+
| `panel` | Panel / Roundtable (Pop Culture Happy Hour) | moderator routes distinct voices |
|
|
90
|
+
| `debate` | Debate (Oxford-style) | proposition / opposition / moderator, phased |
|
|
91
|
+
| `documentary_vo` | Documentary Voice-Over (*"Voice of God"*, This American Life) | narrator on top; interviews + clips + actuality beneath |
|
|
92
|
+
|
|
93
|
+
**Narration bridges** and **source clips** are optional *illustration layers*
|
|
94
|
+
usable with any format. The taxonomy, weaving grammar, exemplar recipes and the
|
|
95
|
+
full template specs are in
|
|
96
|
+
[`misc/docs/research/commentary-formats-and-styles.md`](misc/docs/research/commentary-formats-and-styles.md).
|
|
97
|
+
|
|
98
|
+
*Render support note:* the cast, per-role voices, narration deliveries, loudness
|
|
99
|
+
master, **per-clip placement** — `SegmentBeat(placement="before" | "under" |
|
|
100
|
+
"after")`, where `under` lays the clip concurrently beneath the talk, ducked —
|
|
101
|
+
and a **music bed** (`MusicBed`, an app-supplied instrumental laid under the whole
|
|
102
|
+
production) are applied today. Scene stings and fade-to-spotlight (dropping the
|
|
103
|
+
bed before a key exhibit) remain on the render-side roadmap (braidio#1).
|
|
104
|
+
|
|
105
|
+
## Parametrize anything
|
|
106
|
+
|
|
107
|
+
The templates are just good defaults over the primitives — compose directly for
|
|
108
|
+
full control:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from braidio import Script, Dialogue, Narration, SegmentBeat, WeaveConfig
|
|
112
|
+
from braidio.conversation import ConversationCast, JESSICA, CHRIS
|
|
113
|
+
from braidio import V2_NARRATOR, render_production
|
|
114
|
+
|
|
115
|
+
script = Script(
|
|
116
|
+
title="…",
|
|
117
|
+
id_slug="01",
|
|
118
|
+
beats=[
|
|
119
|
+
Dialogue(
|
|
120
|
+
(("A", "First thing that gets me…"), ("B", "right — but isn't that…"))
|
|
121
|
+
),
|
|
122
|
+
SegmentBeat("the lyric being discussed", label="hook"),
|
|
123
|
+
Narration(
|
|
124
|
+
"Here's how the book tells it —", voice_settings=V2_NARRATOR.voice_settings
|
|
125
|
+
), # graver, per-beat
|
|
126
|
+
],
|
|
127
|
+
)
|
|
128
|
+
render_production(
|
|
129
|
+
script,
|
|
130
|
+
source=my_source,
|
|
131
|
+
cast=ConversationCast(roles={"A": JESSICA, "B": CHRIS}),
|
|
132
|
+
config=WeaveConfig(),
|
|
133
|
+
out_path="out.mp3",
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## What it deliberately does *not* do
|
|
138
|
+
|
|
139
|
+
braidio is a thin orchestration layer. It **delegates**:
|
|
140
|
+
|
|
141
|
+
| Concern | Owner |
|
|
142
|
+
|---|---|
|
|
143
|
+
| Content acquisition (Genius, audiobooks, news…) | the consuming app, via `SegmentSource` adapters |
|
|
144
|
+
| Linked-artifact graph / content-addressed media | [`lacing`](https://github.com/thorwhalen/lacing) |
|
|
145
|
+
| Project workflow, provenance, plan/execute, partial re-render | [`nw`](https://github.com/thorwhalen/nw) |
|
|
146
|
+
| Video render + visual support | [`reelee`](https://github.com/thorwhalen/reelee) |
|
|
147
|
+
| Raw audio DSP + TTS (crop, concat, duck, loudnorm, synth) | [`mixing`](https://github.com/thorwhalen/mixing) / `falaw` |
|
|
148
|
+
|
|
149
|
+
braidio orchestrates these; it never reimplements the DSP or the graph.
|
|
150
|
+
|
|
151
|
+
## Ecosystem
|
|
152
|
+
|
|
153
|
+
`braidio` is a **production kind** on top of `nw` — a reusable definition of
|
|
154
|
+
"commentary that weaves talk with extracted media" — the way a music video is
|
|
155
|
+
another production kind. It sits on `lacing` (graph) + `nw` (workflow /
|
|
156
|
+
provenance) + `mixing`/`falaw` (audio/TTS), and will use `reelee` for video. The
|
|
157
|
+
optional nw-app layer (`braidio.HAS_GRAPH` / `HAS_NW`) records render choices as
|
|
158
|
+
provenance so a change re-renders only the affected parts.
|
|
159
|
+
|
|
160
|
+
## Install
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
pip install braidio # (once published)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT
|
braidio-0.0.2/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# braidio
|
|
2
|
+
|
|
3
|
+
**Weave *commentary* — solo, duo, panel, debate, interview, documentary — with
|
|
4
|
+
source clips into a production.**
|
|
5
|
+
|
|
6
|
+
`braidio` braids the strands of a piece that talks *about* something (a song, a
|
|
7
|
+
book, a film, an event) into one rendered production. The **talk is the spine** —
|
|
8
|
+
a single presenter, two hosts, a panel, a narrator — and **source clips and
|
|
9
|
+
narration bridges are the "illustration" layers** woven onto it. Audio today,
|
|
10
|
+
with visual support to follow (it braids A/V — *braid-io*, and it sounds like
|
|
11
|
+
*radio*).
|
|
12
|
+
|
|
13
|
+
Two things braidio gives you:
|
|
14
|
+
|
|
15
|
+
1. **Ready-made format templates** under the standard, industry names people
|
|
16
|
+
already recognize — *Deep Dive*, *Song Exploder-style*, *Panel*, *Debate*,
|
|
17
|
+
*Documentary VO* — each a high-quality bundle of defaults you can render in one
|
|
18
|
+
call.
|
|
19
|
+
2. **Full parametrization** underneath, so any style is expressible: a `Script`
|
|
20
|
+
of beats, cast via a `ConversationCast`, tuned by `WeaveConfig` + `Delivery`,
|
|
21
|
+
with per-beat voice/delivery overrides.
|
|
22
|
+
|
|
23
|
+
> Status: early. `braidio` is extracted from the
|
|
24
|
+
> [Hamilton lyrics-podcast](https://github.com/thorwhalen/Hamilton) (its first
|
|
25
|
+
> application) into a reusable engine. APIs will move quickly.
|
|
26
|
+
|
|
27
|
+
## The model
|
|
28
|
+
|
|
29
|
+
A production is a **`Script`** — an ordered list of **beats**:
|
|
30
|
+
|
|
31
|
+
| Beat | What it is |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `Narration(text, voice?, voice_settings?, …)` | one voice reading — a narrator **or** a solo presenter. `voice` / `voice_settings` override per beat, so one timeline can carry a lively **presenter** *and* a graver **book-narrator**. |
|
|
34
|
+
| `Dialogue(turns=[(role, text)])` | a multi-speaker exchange, synthesized in **one pass** (so it sounds like people *talking to each other*, not alternating monologues). A `ConversationCast` maps roles → voices. |
|
|
35
|
+
| `SegmentBeat(reference)` | a span of source media to cut and weave in (resolved by a pluggable `SegmentSource` — quote → `[start, end]`). |
|
|
36
|
+
|
|
37
|
+
`WeaveConfig` holds every editing knob (casting, turns, pacing, clip pre/post-roll,
|
|
38
|
+
duck, crossfades, loudness). `Delivery` presets bundle the TTS model + voice
|
|
39
|
+
settings (e.g. `V2_PRESENTER` lively vs `V2_NARRATOR` grave). The renderer
|
|
40
|
+
loudness-normalizes every part, tucks clips under the speech (speech stays
|
|
41
|
+
dominant), and masters the result.
|
|
42
|
+
|
|
43
|
+
## Ready-made formats
|
|
44
|
+
|
|
45
|
+
Pick a standard format and render it — the template supplies the cast, voices,
|
|
46
|
+
delivery and mix defaults:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from braidio import DEEP_DIVE, render_format
|
|
50
|
+
|
|
51
|
+
render_format(DEEP_DIVE, script, source=my_source, out_path="episode.mp3")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
| Preset id | Standard name | Shape |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `solo_explainer` | Solo-Presenter Explainer (video/audio essay, close reading) | one presenter + exhibits |
|
|
57
|
+
| `deep_dive` | Two-Host Conversation (*"Deep Dive"*, Switched on Pop, NotebookLM) | two hosts; one teaches, one probes |
|
|
58
|
+
| `interview` | Interview (host + guest) | Q→A, guest is the center |
|
|
59
|
+
| `interview_host_removed` | *Song Exploder*-style (host removed) | guest monologue; each claim illustrated by its isolated stem; full artifact at the tail |
|
|
60
|
+
| `panel` | Panel / Roundtable (Pop Culture Happy Hour) | moderator routes distinct voices |
|
|
61
|
+
| `debate` | Debate (Oxford-style) | proposition / opposition / moderator, phased |
|
|
62
|
+
| `documentary_vo` | Documentary Voice-Over (*"Voice of God"*, This American Life) | narrator on top; interviews + clips + actuality beneath |
|
|
63
|
+
|
|
64
|
+
**Narration bridges** and **source clips** are optional *illustration layers*
|
|
65
|
+
usable with any format. The taxonomy, weaving grammar, exemplar recipes and the
|
|
66
|
+
full template specs are in
|
|
67
|
+
[`misc/docs/research/commentary-formats-and-styles.md`](misc/docs/research/commentary-formats-and-styles.md).
|
|
68
|
+
|
|
69
|
+
*Render support note:* the cast, per-role voices, narration deliveries, loudness
|
|
70
|
+
master, **per-clip placement** — `SegmentBeat(placement="before" | "under" |
|
|
71
|
+
"after")`, where `under` lays the clip concurrently beneath the talk, ducked —
|
|
72
|
+
and a **music bed** (`MusicBed`, an app-supplied instrumental laid under the whole
|
|
73
|
+
production) are applied today. Scene stings and fade-to-spotlight (dropping the
|
|
74
|
+
bed before a key exhibit) remain on the render-side roadmap (braidio#1).
|
|
75
|
+
|
|
76
|
+
## Parametrize anything
|
|
77
|
+
|
|
78
|
+
The templates are just good defaults over the primitives — compose directly for
|
|
79
|
+
full control:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from braidio import Script, Dialogue, Narration, SegmentBeat, WeaveConfig
|
|
83
|
+
from braidio.conversation import ConversationCast, JESSICA, CHRIS
|
|
84
|
+
from braidio import V2_NARRATOR, render_production
|
|
85
|
+
|
|
86
|
+
script = Script(
|
|
87
|
+
title="…",
|
|
88
|
+
id_slug="01",
|
|
89
|
+
beats=[
|
|
90
|
+
Dialogue(
|
|
91
|
+
(("A", "First thing that gets me…"), ("B", "right — but isn't that…"))
|
|
92
|
+
),
|
|
93
|
+
SegmentBeat("the lyric being discussed", label="hook"),
|
|
94
|
+
Narration(
|
|
95
|
+
"Here's how the book tells it —", voice_settings=V2_NARRATOR.voice_settings
|
|
96
|
+
), # graver, per-beat
|
|
97
|
+
],
|
|
98
|
+
)
|
|
99
|
+
render_production(
|
|
100
|
+
script,
|
|
101
|
+
source=my_source,
|
|
102
|
+
cast=ConversationCast(roles={"A": JESSICA, "B": CHRIS}),
|
|
103
|
+
config=WeaveConfig(),
|
|
104
|
+
out_path="out.mp3",
|
|
105
|
+
)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## What it deliberately does *not* do
|
|
109
|
+
|
|
110
|
+
braidio is a thin orchestration layer. It **delegates**:
|
|
111
|
+
|
|
112
|
+
| Concern | Owner |
|
|
113
|
+
|---|---|
|
|
114
|
+
| Content acquisition (Genius, audiobooks, news…) | the consuming app, via `SegmentSource` adapters |
|
|
115
|
+
| Linked-artifact graph / content-addressed media | [`lacing`](https://github.com/thorwhalen/lacing) |
|
|
116
|
+
| Project workflow, provenance, plan/execute, partial re-render | [`nw`](https://github.com/thorwhalen/nw) |
|
|
117
|
+
| Video render + visual support | [`reelee`](https://github.com/thorwhalen/reelee) |
|
|
118
|
+
| Raw audio DSP + TTS (crop, concat, duck, loudnorm, synth) | [`mixing`](https://github.com/thorwhalen/mixing) / `falaw` |
|
|
119
|
+
|
|
120
|
+
braidio orchestrates these; it never reimplements the DSP or the graph.
|
|
121
|
+
|
|
122
|
+
## Ecosystem
|
|
123
|
+
|
|
124
|
+
`braidio` is a **production kind** on top of `nw` — a reusable definition of
|
|
125
|
+
"commentary that weaves talk with extracted media" — the way a music video is
|
|
126
|
+
another production kind. It sits on `lacing` (graph) + `nw` (workflow /
|
|
127
|
+
provenance) + `mixing`/`falaw` (audio/TTS), and will use `reelee` for video. The
|
|
128
|
+
optional nw-app layer (`braidio.HAS_GRAPH` / `HAS_NW`) records render choices as
|
|
129
|
+
provenance so a change re-renders only the affected parts.
|
|
130
|
+
|
|
131
|
+
## Install
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pip install braidio # (once published)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|