> ## Documentation Index
> Fetch the complete documentation index at: https://chart-spec.enchor.us/llms.txt
> Use this file to discover all available pages before exploring further.

# How notes resolve

> How a .chart file's notes become the notes a player plays.

A scanner turns the notes written in a guitar section into the notes a player plays in five steps, in this order:

1. [Cut off short sustains](#cut-off-short-sustains).
2. [Decide strums and HOPOs](#decide-strums-and-hopos), then apply the modifiers.
3. [Snap close notes into chords](#snap-close-notes-into-chords), if `song.ini` asks for it.
4. [Remove duplicate notes](#remove-duplicate-notes).
5. [Trim overlapping sustains](#trim-overlapping-sustains).

Steps 1, 3, 4 and 5 apply to drums too, pad by pad. Drum notes are never HOPOs.

## Cut off short sustains

A note whose sustain is no longer than the cutoff is read with no sustain. The cutoff is `sustain_cutoff_threshold` in `song.ini`, in ticks. Without it, or with a negative value, a `.chart` file has no cutoff.

With `sustain_cutoff_threshold = 65`, a note of length 65 has no sustain, and a note of length 66 keeps it.

**Recommended:** leave `sustain_cutoff_threshold` out of a new chart, and write each sustain at the length it should play. Charts that set it stay valid.

## Decide strums and HOPOs

The player plays each guitar note one of two ways. A **strum** must be strummed. A **HOPO**, a hammer-on or pull-off, can be played by pressing the fret alone, without strumming. The chart doesn't say which a note is: a scanner decides from where the note is, as below, and then the note's [modifiers](/chart/modifiers) can change the result.

### Natural HOPOs

A note is a HOPO, called a natural HOPO, when all of these are true:

* It isn't the track's first note.
* The distance (in ticks) between the note and the closest previous note is no more than the [HOPO threshold](#the-hopo-threshold).
* It's a single note, not a chord. Notes of one fret at one tick count as one note.
* If the note before it is a single note, the two are on different frets. An open note is a fret of its own for this rule.

Every other note is a strum. So a chord is always a strum, and a single note after a chord can be a HOPO, even on a fret of that chord. In this example the resolution is 192, so the threshold is 65 ticks:

| Notes | Result | Why |
| - | - | - |
| Green at 0 | Strum | The first note |
| Red at 65 | HOPO | 65 ticks after green, on another fret |
| Yellow at 131 | Strum | 66 ticks after red: more than the threshold |
| Green and red at 192 | Strum | A chord |
| Green at 250 | HOPO | 58 ticks after the chord |

Then the forced modifier flips a note between strum and HOPO, and the tap modifier makes it a tap. See [Note modifiers](/chart/modifiers).

### The HOPO threshold

The threshold is `65 × resolution ÷ 192` ticks, rounded down: about a third of a beat.

| Resolution | Threshold |
| - | - |
| 192 | 65 |
| 480 | 162 |
| 960 | 325 |

Two deprecated `song.ini` keys change the threshold in older charts. See [Deprecated](#deprecated).

## Snap close notes into chords

`chord_snap_threshold` in `song.ini` merges notes that are very close together into chords. It's in ticks, and it's off when it's 0 or missing.

* A note less than the threshold after an earlier note moves to that note's tick and joins its chord. It takes the strum, HOPO or tap of the notes already at that tick, and keeps its own length. The forced and tap modifiers on its written tick have no effect.
* The earlier note is the first one not yet moved. Moving a note doesn't move the next one along: with a threshold of 10, notes at 100, 105 and 109 all move to 100, and a note at 112 stays.

So every note of a chord has one type, in every scanner that snaps.

**Recommended:** leave `chord_snap_threshold` out of a new chart, and write the notes of each chord at one tick. Charts that set it stay valid.

**Edge case: what still comes from the ticks as written.** Snapping decides no strum, HOPO or tap again. The notes that don't move keep the type they have at their written ticks, so a chord that snapping makes is a HOPO or tap chord when the note it joins is a single HOPO or tap note. A chord written at one tick is a strum unless a modifier changes it. The next note's natural HOPO is still measured from the tick where the moved note was written.

## Remove duplicate notes

After snapping, a track holds at most one note of each fret at a tick. When snapping makes two notes of one fret meet, a scanner keeps the longer one.

## Trim overlapping sustains

When a note starts before the sustain of an earlier note on the same fret has ended:

* the earlier note's sustain ends where the later note starts;
* the later note's sustain ends where the later of the two sustains ended.

For example, blue at 400 with length 300, then blue at 500 with length 0, becomes blue at 400 with length 100 and blue at 500 with length 200. The sustain cutoff isn't applied again afterward.

A sustain that ends on the tick where the next note of its fret starts doesn't overlap it, and doesn't change.

**Recommended:** end each sustain at or before the next note on its fret.

**Edge case:** in a `.chart` file, YARG doesn't trim overlapping sustains: it keeps each note's length as written.

## Deprecated

Two `song.ini` keys change the HOPO threshold. Older charts used them before the forced modifier was common. To make a note a strum or a HOPO, force it instead.

* **`hopo_frequency`**, when it's more than 0: the threshold is that many ticks. It isn't scaled by the resolution: `hopo_frequency = 30` is 30 ticks at any resolution.
* **`eighthnote_hopo = True`**: the threshold is half the resolution, rounded down, plus 1. It applies only when `hopo_frequency` doesn't.

| Resolution | With `eighthnote_hopo` |
| - | - |
| 192 | 97 |
| 480 | 241 |
| 960 | 481 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.