Skip to content
Back to developer hub
Rap-craft intelligence

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.

Auto-routed. Rap subgenre detection runs automatically on every forge + refine call. Operator overrides (manual subgenre / BPM / bar count / rhyme scheme) are available via the backend API today; UI for them ships in a future build.

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.

SubgenreBPMSyl/barWhat it is
boom-bap
Boom Bap
85-9510-12Tight meter, multisyllabic chains expected, sample-based production. Nas / MF DOOM / Mos Def lineage.
trap
Trap
130-15014-18Hook-driven, 808 sub-bass + hi-hat triplets, half-time feel. Future / Migos / 21 Savage lineage.
drill
Drill
140-1608-12Sparse + minimal by design, sliding 808s, aggressive vocal. Pop Smoke / UK Drill / Chicago Drill lineage.
conscious-rap
Conscious Rap
85-10012-16Narrative architecture, jazz-influenced production, multisyllabic chains pay off semantically. Kendrick / Common / Black Thought lineage.
rap
Generic Rap (catch-all)
Routes here when the operator hasn't named a subgenre. Inherits MODE_RAP rubric weights but no subgenre-specific calibration.
The 9 critic dimensions

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.

FailureWhat it names
Forced RhymeBars that bend meaning to reach a rhyme.
Dead BarFiller that exists only to advance the rhyme scheme.
Slant At PeakSlant rhyme at a climactic spot where perfect was available.
Internal Rhyme FatigueOverloaded internal rhymes; unsingable.
Wordplay Over StoryClever rhyme that derails the narrative.
Hook ObscurationVerse so dense the hook gets ignored.
Borrowed Slang Without EarningRegional vernacular without contextual coherence (SA#15 applied to rap).
Cartoon BravadoBoasting without specific anchors.
Run-On BarSyllable count violates the subgenre band.
Empty Inner ClimaxMultisyllabic chain that doesn't pay off semantically.
Cultural authenticity rule

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.

Honest posture

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