# Loudness meter

> Integrated loudness in LUFS against the target the project chose, with momentary and short-term bars, loudness range, true peak, the time measured and a history graph with the target band.

Source: https://kwark.space/designSystem/components/loudness-meter

## Usage

### What it is
Delivery specs are written in loudness, not peaks. The meter reads the programme the way the broadcaster's or platform's check will: **integrated** loudness over the measured span, with **short-term** (3 s) and **momentary** (400 ms) for what is happening now, **loudness range** for how much it moves, and **true peak** for the ceiling.

### The target is the project's choice
Kwark never presents one number as *the* standard. The presets are the common ones, each named with its source: *−23 · EBU R128*, *−24 · ATSC A/85*, *−16 · Online*. The project chooses per deliverable, and the meter shows which target it is checking against and that the project chose it.

### When to use
- In a sound session while mixing; in a delivery check; as a read-only summary on a phone.

### When not to
- For cinema mixes: those are mixed to a calibrated monitoring level in a calibrated room. Show the reading, never call a cinema mix *too quiet*.

### States
| State | How it shows |
|---|---|
| Within target | Check and *Within target · −23 ± 0.5*, `--k-ok` |
| Outside target | *1.8 LU over target*, `--k-warn`, with the number |
| True peak over limit | *True peak −0.4 dBTP · over the −1.0 limit*, `--k-danger` |
| Measuring | *Measured 00:02:41:12*; Reset starts again |

**Do:** *Integrated −23.1 LUFS · Within target · −23 ± 0.5*, target named and chosen by the project.

**Don't:** *Your mix is too quiet* with no target, or a red bar for a reading that blocks nothing.

## Style

### Anatomy

1. **Head**: source (*Master · stereo*), from-time, Reset.
2. **Target switch**: presets named with their source.
3. **Bars**: Momentary and Short-term, 18px wide, −50 to −10 LUFS, the target as a 2px line.
4. **Numbers**: Integrated at 28px with unit; status line; a list of short-term, momentary, LRA, true peak and time measured.
5. **History**: short-term over time, 1px line, target band ±1 LU in `--k-pro-mark` at 14%, time labels.
6. **Note**: one sentence saying who chose the target and for which deliverable.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-pro-panel` | #f6f7f9 | #19191b |
| `--k-pro-control` | #ffffff | #2a2a2e |
| `--k-pro-line` | #d3d9e0 | rgba(255, 255, 255, .09) |
| `--k-ok` | #2c6e49 | #6cc08a |
| `--k-warn` | #8a5a00 | #d8a44a |
| `--k-danger` | #b4382c | #e0685c |
| `--k-pro-mark` | #23767d | #83cfd3 |
| `--k-text` | #0f172a | #e3e3e3 |
| `--k-text-2` | #5b6779 | #9ca3af |

### Numbers
| Part | Value |
|---|---|
| Integrated | 28px, weight 500, tabular |
| Bars | 18 × 180px |
| History | 72px tall |
| Units | LUFS (LKFS in North American specs), LU for range, dBTP for true peak; true minus sign |

## Code

### React

Use the HTML below with `kwark.css`. The example shows the markup and styling. Supply any application behavior described on this page.

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<section class="kw-pro kw-pro-panel kw-pro-loud" aria-label="Loudness, master stereo">
  <div class="kw-pro-bar"><strong>Loudness</strong><span class="kw-pro-dim kw-pro-ellip">Master · stereo · from 01:04:00:00</span><span class="kw-pro-sp"></span><button class="kw-pro-btn kw-pro-btn--text" type="button">Reset</button></div>
  <div class="kw-pro-loud__targets"><span class="kw-pro-dim">Target</span><div class="kw-pro-seg kw-pro-seg--text" role="group" aria-label="Loudness target"><button type="button" aria-pressed="true">−23 · EBU R128</button><button type="button" aria-pressed="false">−24 · ATSC A/85</button><button type="button" aria-pressed="false">−16 · Online</button></div></div>
  <div class="kw-pro-loud__body">
    <div class="kw-pro-loud__bars"><span class="kw-pro-loud__scale" aria-hidden="true"><i style="bottom:100.0%">−10</i><i style="bottom:67.5%" data-t>−23</i><i style="bottom:50.0%">−30</i><i style="bottom:25.0%">−40</i><i style="bottom:0.0%">−50</i></span><div class="kw-pro-lbar" role="meter" aria-label="Momentary loudness" aria-valuemin="-50" aria-valuemax="-10" aria-valuenow="-19.8" aria-valuetext="−19.8 LUFS"><span class="kw-pro-lbar__well"><span class="kw-pro-lbar__fill" style="height:75.5%"></span><span class="kw-pro-lbar__target" style="bottom:67.5%"></span></span><b>M</b></div><div class="kw-pro-lbar" role="meter" aria-label="Short-term loudness" aria-valuemin="-50" aria-valuemax="-10" aria-valuenow="-21.4" aria-valuetext="−21.4 LUFS"><span class="kw-pro-lbar__well"><span class="kw-pro-lbar__fill" style="height:71.5%"></span><span class="kw-pro-lbar__target" style="bottom:67.5%"></span></span><b>S</b></div></div>
    <div class="kw-pro-loud__nums">
      <div class="kw-pro-loud__int"><span class="kw-pro-dim">Integrated</span><output class="kw-pro-tc"><b>−23.1</b> LUFS</output><span class="kw-pro-loud__ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Within target · −23 ± 0.5</span></div>
      <dl class="kw-pro-loud__dl"><div><dt>Short-term</dt><dd>−21.4 LUFS</dd></div><div><dt>Momentary</dt><dd>−19.8 LUFS</dd></div><div><dt>Loudness range</dt><dd>8.2 LU</dd></div><div><dt>True peak max</dt><dd>−1.6 dBTP <span class="kw-pro-dim">limit −1.0</span></dd></div><div><dt>Measured</dt><dd>00:02:41:12</dd></div></dl>
    </div>
  </div>
  <div class="kw-pro-loud__hist"><svg viewBox="0 0 300 100" preserveAspectRatio="none" aria-hidden="true"><rect class="kw-pro-loud__band" x="0" y="40.0" width="300" height="6.7"/><path class="kw-pro-g" d="M0 33.3H300M0 66.7H300" vector-effect="non-scaling-stroke"/><path class="kw-pro-loud__line" d="M0.0 45.5L2.5 43.5L5.0 42.2L7.5 44.7L10.0 45.0L12.5 45.7L15.0 47.8L17.5 45.1L20.0 43.3L22.5 42.4L25.0 43.5L27.5 42.2L30.0 41.9L32.5 42.5L35.0 41.4L37.5 43.9L40.0 42.7L42.5 41.4L45.0 39.7L47.5 41.2L50.0 39.3L52.5 37.9L55.0 36.8L57.5 35.7L60.0 33.9L62.5 33.8L65.0 33.9L67.5 37.1L70.0 39.4L72.5 41.4L75.0 40.5L77.5 41.9L80.0 43.2L82.5 42.3L85.0 41.5L87.5 39.1L90.0 37.8L92.5 36.4L95.0 34.9L97.5 36.5L100.0 37.7L102.5 38.8L105.0 41.5L107.5 39.8L110.0 42.7L112.5 43.3L115.0 45.7L117.5 45.8L120.0 43.5L122.5 41.0L125.0 40.3L127.5 38.9L130.0 39.0L132.5 40.0L135.0 42.1L137.5 39.8L140.0 38.9L142.5 36.8L145.0 35.6L147.5 37.4L150.0 36.3L152.5 37.4L155.0 35.9L157.5 34.9L160.0 33.3L162.5 34.3L165.0 35.7L167.5 34.4L170.0 36.5L172.5 35.6L175.0 36.9L177.5 34.1L180.0 35.2L182.5 31.9L185.0 33.0L187.5 30.3L190.0 29.5L192.5 26.7L195.0 26.4L197.5 26.3L200.0 26.1L202.5 26.7L205.0 30.1L207.5 30.6L210.0 31.8L212.5 32.6L215.0 33.5L217.5 33.9L220.0 36.4L222.5 36.7L225.0 35.3L227.5 36.1L230.0 36.9L232.5 35.8L235.0 36.0L237.5 38.6L240.0 39.9L242.5 41.9L245.0 39.8L247.5 40.8L250.0 43.5L252.5 44.4L255.0 43.7L257.5 44.0L260.0 44.5L262.5 46.5L265.0 48.5L267.5 47.0L270.0 46.8L272.5 46.1L275.0 46.1L277.5 46.5L280.0 43.9L282.5 43.2L285.0 43.4L287.5 44.2L290.0 41.8L292.5 41.0L295.0 43.8L297.5 42.8L300.0 44.4" vector-effect="non-scaling-stroke"/></svg><span class="kw-pro-loud__hl" style="top:43.3%">−23</span><span class="kw-pro-loud__ht" aria-hidden="true"><i>01:04:00:00</i><i>01:05:20:00</i><i>01:06:41:12</i></span></div>
  <p class="kw-pro-loud__note">Target chosen by the project for the broadcast deliverable. The festival copy is measured against its own spec.</p>
</section>
```

## Accessibility

### Keyboard
| Key | Does |
|---|---|
| Tab | Target presets, then Reset |
| ⌥ R | Reset measurement |

### ARIA
- Bars are `role="meter"` with value text in LUFS.
- The status line is a polite live region that speaks only when the status changes (*Now 1.8 LU over target*).
- Status is in words and an icon, never only a colour.

## For agents

### Rules

- **Must** show the target beside every reading and name who chose it and its source.
- **Never** present one loudness number as the standard.
- **Must** use LUFS for loudness, LU for range and dBTP for true peak, with a true minus sign.
- **Always** write the status in words with the difference in LU.
- **Never** use red for anything but a true-peak or clipping problem.

### AI readiness test

**Task:** Build the delivery check for two masters: broadcast and online.

**Give the agent:** Loudness meter, Audio meter, Sound kit.

**Constraint:** Broadcast is −23 LUFS / −1 dBTP; online is −16 LUFS / −1 dBTP; the project entered both.

**A reliable answer:**
- One meter per deliverable with its own target
- Integrated, short-term, momentary, LRA, true peak
- Status in words with LU difference
- Target source named
- Red only for true peak over limit
