# Practice and rhythm tools

Practice can change how you hear a phrase without changing what is written.
Score editing changes the source itself. This chapter separates the two and
shows what the native engine can do with rhythm, tempo and repeated music.

**Availability:** the examples can be edited and engraved on this website.
The practice projections and structured rhythm edits described below are
native engine capabilities for applications to expose. The browser editor
does not yet provide controls for all of them. Building an integration
requires [source access](integration.md).

## Practise at a different tempo

A phrase may carry tempo changes, a range or a metric modulation. Keep that
musical information when practising slowly:

- **Scale the tempo:** apply a rational multiplier to the whole reading.
  A scale of 3/4 turns quarter = 120 into 90 and quarter = 80 into 60.
  Their relationship remains intact.
- **Set the opening rate:** choose a starting beat and rate while retaining
  the relationships to later tempo changes.
- **Use one uniform rate:** rehearse the whole passage at a chosen beat and
  rate. This overrides changes for that reading; it does not erase them
  from the source.

```scorescript-input
meter 4/4
tempo {q=120, m2 q=80}
4G4 A B C | 2D C
```

A rate always names its beat value. Dotted quarter = 60 in 6/8 is not the
same speed as quarter = 60. Written tempo ranges play from their first
number unless a practice setting changes the reading. See
[tempo and metric modulation](context.md).

A host opens one native position-clock reading and uses its returned
performance, beat grid and occurrence table together. At a fermata or
caesura, arrival and release can differ; estimating a rest or beat from the
nearest sounding note loses that information.

## Hear the beat inside a subdivision

Two native practice options answer different musical questions:

| Option | What you hear | What stays written |
| --- | --- | --- |
| Mute authored accents | The attacks without their accent emphasis | The original accent marks |
| Hear beat heads | Attacks at the native beat-group heads rather than every subdivision | The original notes, rests and subdivisions |
| Add a pulse overlay | Derived beat and subdivision strikes alongside the phrase | The original phrase, without extra authored notes |

A pulse can follow each selected part's native grouping or use an explicit
valid grouping. Its subdivision has a count and a named sound template.
The engine owns their timing, including silent beats; the application plays
the returned strikes. These are separate from the authored notes.

For 6/8, begin by hearing the two dotted-quarter groups, then add the three
subdivisions within each group:

```scorescript-input
meter 6/8
tempo q.=60
8G4 A B C D E | D C B A G F
```

A hearing projection and a pulse overlay cannot be combined in one reading.
A missing or ambiguous sound template, a grouping that does not fit the
meter, and unsupported meters receive a refusal. They do not silently turn
into another practice pattern.

## Follow repeats and returns

A straight-through reading visits the written bars once. A
`written-navigation` reading follows supported repeats, numbered endings,
D.C., D.S., Fine and Coda instructions. Applications choose that traversal
explicitly; ordinary performance output does not imply repeat-aware playback.

```scorescript-input
|: 4C5 D E F | [1..] 1G :| [2..] C, |||
```

Each performed visit retains its original written bar and event addresses.
The second visit to a bar is another occurrence of that bar, not a newly
written measure. A cursor or selection can therefore distinguish “m1,
second visit” from “m1, first visit”. A uniform practice rate retains these
source addresses as well.

An application must ask which occurrence it means when a position repeats.
Ambiguous temporal spans across jumps and enabled expressive-navigation
combinations are refused. See [repeats and navigation](repeats.md) for the
written instructions.

## Build a rhythm from beat figures

The native rhythm builder accepts a meter, tempo, beat lengths and figures.
It writes a ScoreScript document with independently addressable bars, so the
same document can then be edited by beat, event or bar. A figure can contain:

- an ordinary or accented attack;
- a rest;
- a hold continuing the preceding event;
- equal subdivisions, unequal weights or a tuplet;
- explicit R/L sticking, or a hit with no hand assigned.

An unassigned hand stays unassigned. The engine does not invent alternating
R/L strokes. A second voice may add an evenly spaced counter-rhythm while
preserving the main line.

Here is ordinary authored source for a two-against-three rhythm. The voices
occupy the same bar; they are not successive passages:

```scorescript-input
meter 3/4
parts { snare-drum }
snare-drum {
  staff-lines 1
  m1 {
    v1[4B4 B B]
    v2[4.B4 B]
  }
}
```

The builder is `scorescript_entry::bar_ops::rhythm::build`, a Rust API, not a
new source keyword or a browser menu. Beat lengths must fill their meter
exactly. Empty requests, figures that do not fit, and requests over its
128-bar or 8,192-event bounds are refused before a document is returned.

## Change the grouping, figure or beat length

These are three different musical edits:

| Change | Musical result |
| --- | --- |
| Grouping | Change how the existing attacks beam together; keep the printed meter and attack times |
| Beat figure | Replace the selected beat with a subdivision, rest/attack/hold pattern or other supported figure; keep other beats and voices |
| Beat length | Rescale that beat's existing figure and preserve its pitches and marks; write a new additive meter for this bar |

For example, a beat containing two eighths can become a dotted-quarter
beat containing two dotted eighths. In an otherwise four-quarter bar the
new lengths are 2+3+2+2 eighths. The following bar restores its own meter.

```scorescript-input
meter {4/4, m2 2+3+2+2/8, m3 4/4}
m1 { 4B4 8B(>) B(.) 4B r }
m2 { 4B4 8.B(>) B(.) 4B r }
m3 { 1r }
```

Grouping alone does not change 4/4 into 9/8. Changing a beat's length does.
See [Beaming](beaming.md) for automatic groups, recursive trees,
beam connections, cross-staff membership and feathering.

The same native bar operations can add, replace or remove a counter-rhythm;
change a meter or tempo for one bar or until the next stated change; insert,
duplicate or remove a bar; and adjust a pickup. A pickup adjustment must
respect the music already occupying each voice. Unsupported figures and
changes that would damage unselected music are refused.

## Keep edits bound to the music you selected

Structured edits use the source revision and exact snapshot they were read
from. If the score changes before the edit is applied, the caller must
refresh the selection and request again. A stale request cannot overwrite
newer music, even when the replacement text would otherwise be a no-op.

Native applications use `scorescript_entry::step_grid`, `bar_ops` and
`part_pan` with the document session. Hosts should expose their native
refusals and revision checks. These are not extra methods on the browser's
`CompiledDocument` class. See [integration](integration.md) for the actual
WASM methods and [projects](projects.md) for linked-source boundaries.

## Different meters at once

Polymeter gives parts separate meters and exact alignment rules. It is more
than a counter-rhythm inside one shared meter. The primary part owns the
section's bar range and tempo; each follower states either a bar ratio or
an equality between beat values. The engine derives each part's clock.

See [Polymeter](context.md#polymeter) for complete examples, local bar
numbering and section limits. It currently refuses practice pulse overlays,
hearing/expression projections, uniform tempo and written-navigation
playback. Independent barline engraving remains reserved. Those boundaries
are separate from the accepted source and timing model.
