jevrecipes

Recipe catalog / lyric-mood-fit

Check lyrics against the mood of the music

lyric-mood-fit is a Jev recipe from the jev-recipes TypeScript package. Do lyrics fit the mood and pacing of the music described in music? Use it when you generate, suggest, or review lyrics for a described track and want to catch lines whose mood or pacing clashes with the music before showing them to a writer.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use lyric-mood-fit in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { lyricMoodFit } from 'jev-recipes/lyric-mood-fit';

const result = await lyricMoodFit({
  "lyrics": "Hands up, we don't stop till the sun comes up\nBass in the trunk and the whole crew showed up\nNo sleep tonight, turn the lights down low\nOne more round and then we go, go, go",
  "music": "Slow, sparse piano ballad in D minor at 62 bpm with long sustained chords and a single cello line, written to underscore a grieving scene in a short film.",
  "minConfidence": 0.8
});
console.log(result);

What input does lyric-mood-fit take?

FieldTypeNeeded
lyricsstringRequired
musicstringRequired
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "lyrics": {
        "type": "string"
      },
      "music": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "lyrics",
      "music"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "probability": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "verdict": {
        "type": "string",
        "enum": [
          "fits",
          "clashes"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "probability",
      "confidence",
      "verdict"
    ],
    "additionalProperties": false
  }
}

What does a lyric-mood-fit result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo lyric-mood-fit.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "probability": 0.04,
  "confidence": 0.96,
  "verdict": "clashes"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.

Result

verdict is fits when Jev's yes probability is at least 0.5 and clashes otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields clashes with 0.9 confidence.

A result is ready when confidence meets minConfidence. Otherwise it is review. Treat a review result as unknown and fall back to your safe default.

Reuse and calls

Uses the shared gate helper, a single yes/no question. This folder owns the question wording, the outcome descriptions, and the review policy. A live invocation makes one logical Jev request.

Limits

The verdict concerns mood and pacing only: it does not check rhyme scheme, syllable counts, meter, or whether the words sit on a melody, and it cannot hear the track, so it trusts the description of the music as written. Intentional contrast between words and music passes only when the description says the contrast is wanted; otherwise an upbeat lyric on a sombre track is a clash. Judging lyric quality, originality, explicitness, or suitability for an audience is outside this decision and belongs in other checks or with the writer.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo lyric-mood-fit shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe lyric-mood-fit to inspect the input and result schemas.

How accurate is lyric-mood-fit?

Fixture only

No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of lyric-mood-fit?