Back to all guides

Background Vocals in TTML

Use the x-bg role to add ad libs, harmonies, and backing vocals as secondary lines in a TTML file.

Background vocals, ad libs, and harmonies are what TTML calls "x-bg" spans. They appear as a secondary lyric line on Apple Music, smaller and slightly offset from the main line. This guide covers how to structure them and when to use them.

What x-bg means

The ttm:role="x-bg" attribute marks a span as background content. Apple Music and other players that support the feature render x-bg content visually distinct from the main line, usually at a smaller size.

The "x" prefix is XML convention for an experimental or platform-specific extension. "x-bg" became the de facto standard and most platforms render it.

The structure

A background vocal lives inside the paragraph of the line it accompanies. The outer x-bg span carries no timing. Inner spans carry the timing.

<p begin="00:00:12.000" end="00:00:16.000" ttm:agent="v1">
  <span begin="00:00:12.000" end="00:00:13.500">Main lyric word one</span>
  <span begin="00:00:13.500" end="00:00:16.000">two</span>
  <span ttm:role="x-bg">
    <span begin="00:00:13.000" end="00:00:14.500">oh yeah</span>
    <span begin="00:00:14.500" end="00:00:16.000">ooh</span>
  </span>
</p>

The outer <span ttm:role="x-bg"> has no begin or end attribute. The inner spans do. The inner timing can overlap the main-line timing; both render together.

When to use x-bg

Use x-bg for:

  • Ad libs, interjections, and non-lead vocal phrases
  • Harmony lines that echo the main lyric
  • Background "oh"s, "ah"s, or spoken lines that are part of the song
  • Featured vocalist phrases that overlap the lead line

When not to use x-bg

Do not use x-bg for:

  • The main lead vocal line (that is the primary <p> content)
  • A featured verse by a different artist (use ttm:agent on a new paragraph instead)
  • Any lyric line that stands on its own (put it in a new <p>)

Line-level background vocals

If the background part has no word-level timing, you can use a single timed span inside the x-bg wrapper:

<span ttm:role="x-bg">
  <span begin="00:00:13.000" end="00:00:14.500">background phrase</span>
</span>

This still follows the rule that the outer x-bg span has no timing and inner spans do.

Authoring x-bg in CallEditor

Open the edit view. Every line has a background text field. Type the background lyric there and the export will wrap it in an x-bg span automatically. For word-level background timing, switch to the sync view and sync the background words the same way you sync the main line.

CallEditor preserves the exact space handling in background vocals. Trailing spaces in the source are preserved in the export, and the outer x-bg wrapper never gets stray timing attributes.

Related reading

The TTML file format reference covers the x-bg element alongside the rest of the format. The multi-agent duets guide covers how x-bg and agent attribution interact on the same line.

Ready to try it?

Better Lyrics

A browser extension that adds time-synced, animated lyrics to YouTube Music. Free, open source, and the reason CallEditor exists.

Visit better-lyrics.boidu.dev