clipasm 0.3.2

A strict, typed language for compiling and rendering Video and Audio graphs
Documentation
<!-- Generated by clipasm-reference-docs. Do not edit directly. -->

# during

Replace a selected timeline range with the result of a body.

## Call shape

```text
during<T: Video | Audio>(timeline: T, range: TimeRange) { ... } -> T
```

This is call-shape notation for lookup, not ClipAsm declaration syntax.

## Graph inputs

| Name | Type | Cardinality |
| --- | --- | --- |
| `timeline` | `T` | exactly one |

## Parameters and defaults

| Name | Type | Requirement | Default or omission behavior |
| --- | --- | --- | --- |
| `range` | `TimeRange` | required | — |

## Result and stack behavior

Outputs: `T`.

All `T` inputs and outputs use one homogeneous type: Video or Audio. Use an explicit `<Video>` or `<Audio>` argument when the accessible stack makes inference ambiguous.

Default stack access is **visible**. See [stack binding](../language/stack-binding.md) for ownership and visibility rules.

## Body

The body begins with:

- `T` from the range selected from `timeline` by `range`

The body must leave exactly `T`.

## Timeline and markers

Replaces the selected range in `timeline`, shifts later markers, and names the inserted result `replacement`.

## Example

```clipasm
clipasm 1

config {
    video {
        fps = 30
    }
}

image("assets/card.png", 3s)
during(1s..2s) {
    zoom_in(4%)
}
```

Expected validation result: `Video` with exactly 90 project frames at the example's explicit `fps = 30`.

This exact example is parsed and compiled by the reference checks; compilation does not inspect the named media files.

## Behavior

- The body starts with the selected range and exposes the complete bound input as lexical $timeline.
- The body must return exactly one matching value, which is spliced into the original timeline.
- Placements before and after the range are preserved or shifted; intersecting or uncertain placements are omitted, and the inserted body is available as replacement.
- A Video selection supplies its requested extent to an image call whose duration is omitted.

## Requirements

- The range must be native-grid aligned, within the bound timeline, and owned by that timeline.
- Use `during<Video>` or `during<Audio>` when a mixed stack makes the generic type ambiguous.

## Common diagnostics

These are the diagnostics most specific to this program.

- [`E_BODY_OUTPUT_COUNT`]https://nikitamgrimm.github.io/clipasm/diagnostics/#e_body_output_count — Wrong body output count

## See also

- [`trim`]trim.md
- [`join`]join.md
- [`image`]image.md
- [Statements and calls]../language/statements-and-calls.md
- [Stack binding]../language/stack-binding.md