Rap subgenre system
A phonology-aware audit + 5 subgenre profiles + 9-dimension critic + bar planner that runs on every rap song SongForgeAI forges. The system measures rap craft against subgenre-calibrated targets (Boom Bap demands multisyllabic chains; Drill explicitly doesn't) and flags failure modes by canonical names so eval + critic surfaces share vocabulary.
The 5 subgenre profiles
Each subgenre carries quantitative targets (BPM band, syllables-per-bar band, internal-rhyme rate band, multisyllabic chain minimum) + a banned-failure-modes list specific to that form. The forge prompt, the audit, and the critic all read from the same definitions.
| Subgenre | BPM | Syl/bar | What it is |
|---|---|---|---|
boom-bapBoom Bap | 85-95 | 10-12 | Tight meter, multisyllabic chains expected, sample-based production. Nas / MF DOOM / Mos Def lineage. |
trapTrap | 130-150 | 14-18 | Hook-driven, 808 sub-bass + hi-hat triplets, half-time feel. Future / Migos / 21 Savage lineage. |
drillDrill | 140-160 | 8-12 | Sparse + minimal by design, sliding 808s, aggressive vocal. Pop Smoke / UK Drill / Chicago Drill lineage. |
conscious-rapConscious Rap | 85-100 | 12-16 | Narrative architecture, jazz-influenced production, multisyllabic chains pay off semantically. Kendrick / Common / Black Thought lineage. |
rapGeneric Rap (catch-all) | — | — | Routes here when the operator hasn't named a subgenre. Inherits MODE_RAP rubric weights but no subgenre-specific calibration. |
Every rap song is scored 1-5 on nine craft axes. Composite = (mean − 1) × 25 → 0-100. Tiers: weak <40 · mixed 40-69 · strong 70-89 · elite ≥90.
- · flow — stress placement × rhyme placement × syntax-bar alignment
- · rhymeDensity — phoneme rhyme spans per word in window
- · multisyllabicChains — consecutive multi-phoneme tails
- · internalRhyme — non-line-final rhymes within bars
- · cadence — syl/bar + subdivision + syncopation match the subgenre band
- · breath — phrase lengths feasible for human delivery
- · storytelling — scene continuity, entity tracking, payoff
- · personaConsistency — stable rhetorical signature
- · culturalAuthenticity — contextually coherent language + stance + references (NOT vocabulary mimicry)
The Rap Forbidden Archive — 10 canonical failures
When the critic flags a bar, it uses one of the 10 canonical failure names so eval output + critic output share vocabulary. Full definitions in docs/RAP-FORBIDDEN-ARCHIVE.md.
| Failure | What it names |
|---|---|
| Forced Rhyme | Bars that bend meaning to reach a rhyme. |
| Dead Bar | Filler that exists only to advance the rhyme scheme. |
| Slant At Peak | Slant rhyme at a climactic spot where perfect was available. |
| Internal Rhyme Fatigue | Overloaded internal rhymes; unsingable. |
| Wordplay Over Story | Clever rhyme that derails the narrative. |
| Hook Obscuration | Verse so dense the hook gets ignored. |
| Borrowed Slang Without Earning | Regional vernacular without contextual coherence (SA#15 applied to rap). |
| Cartoon Bravado | Boasting without specific anchors. |
| Run-On Bar | Syllable count violates the subgenre band. |
| Empty Inner Climax | Multisyllabic chain that doesn't pay off semantically. |
Authenticity is contextual coherence, not vocabulary mimicry. If a brief gives SongForgeAI a scene + persona + place + stakes, the forge leans into the specifics of that world. If the brief is thin, the forge writes a deliberately neutral verse that does NOT compensate by inventing borrowed slang. A song that performs vocabulary without coherence reads as appropriation; a song with strong specifics is authentic regardless of register.
This rule is load-bearing (Group E unanimous in the WAR Room §5). It surfaces in every rap subgenre forge prompt + every eval-context block.
Forge a rap song
The standard forge endpoint accepts a genre string + prompt. When the detector resolves to a rap subgenre, the forge prompt automatically embeds:
- The subgenre's cadence + diction profile
- BPM band + syl/bar band + multisyllabic chain minimum
- Subgenre-specific banned failure modes
- The cultural authenticity rule
- A 16-bar BAR MAP with per-bar job + rhyme letter + syllable target
- Plan-then-draft-then-self-critique output discipline
curl -X POST https://songforgeai.com/api/songs/forge \
-H "Authorization: Bearer <YOUR_SESSION>" \
-H "Content-Type: application/json" \
-d '{
"prompt": "boom bap song about leaving the old block",
"genre": "boom bap",
"vocalGender": "male"
}'Subgenre keywords that route automatically: boom bap · boom-bap · trap · atlanta trap · drill · uk drill · conscious rap · jazz rap · storytelling rap · political rap. Generic rap / hip hop falls through to MODE_RAP catch-all.
Programmatic critique (server-side)
For server-side integrations, the rap critic is callable directly via the internal library. Returns the 9-dimension scorecard + per-bar failure flags + rewrite priority list.
import { critiqueRapVerse } from '@songforgeai/server';
const result = await critiqueRapVerse({
lyrics: verse,
brief: { premise: 'a song about leaving the old block', anchors: ['water tower'] },
subgenreId: 'boom-bap',
});
console.log(`${result.verdict} (composite ${result.composite})`);
for (const flag of result.flags) {
console.log(` bar ${flag.bar}: ${flag.failure}`);
}One Haiku call per critique. ~$0.0005 + ~2-4s wall-clock. LRU-cached (500 entries, 15-min TTL) keyed on lyric + subgenre + premise.
Calibration + drift detection
Score thresholds live in one home — src/lib/claude/rap-calibration.ts — so the critic, the corpus analyzer, the dashboard, and this doc page all read the same numbers. Methodology:
- Probe — runs the audit on a curated baseline of synthetic + commissioned verses. Calibration reference.
- Corpus analyzer — runs the audit on production exports (JSONL); surfaces per-subgenre distributions + cross-subgenre fairness flags.
- Re-run cycle — every rap audit / plugin change triggers a probe + analyzer re-run; report diffs detect drift across builds.
Full methodology in docs/RAP-CALIBRATION.md. Corpus probe runbook: RAP-CORPUS-PROBE-RUNBOOK.md. Subgenre analysis runbook: RAP-CORPUS-ANALYSIS-RUNBOOK.md.
This is a craft-intelligence layer, not a model fine-tune. SongForgeAI uses the Anthropic API — we cannot retrain Claude. What we DO is wrap the API call in a phonology-aware audit + subgenre-calibrated forge prompt + rap-aware critic + per-bar validator. The output is measurably better than naked prompt engineering on rap (B2861 follow-up judgment pending), but the model itself is still general-purpose Claude.
What this stack does not do: claim to replace human rap craft, generate verses about real artists by name, or imitate a specific living rapper. It writes originals against subgenre conventions, scores them, and tells the operator which bars to fix.
Next
All developer surfaces: Lyric Scoring API, Fidelity API, OpenAPI reference, SDK.
Orthogonal axis: did the lyric answer the brief? CC BY 4.0 Fidelity Standard.
12-metric quality rubric. The rap-craft audit is the rap-specific complement.
The 100-expert × 100-round design doc behind every build in the rap stack.