trim
Keep a selected range of a Video or Audio timeline.
Call shape
trim<T: Video | Audio>(value: T, range: TimeRange) -> T
This is call-shape notation for lookup, not ClipAsm declaration syntax.
Graph inputs
| Name | Type | Cardinality |
|---|---|---|
value | 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 owned. See stack binding for ownership and visibility rules.
Timeline and markers
The program keeps the selected range from value. It preserves only markers that are fully inside the range.
Example
clipasm 1
config {
video {
fps = 30
}
}
video("assets/scene.mp4")
trim(1s..3s)
Expected validation result: Video with exactly 60 project frames at the example’s explicit fps = 30.
The reference checks parse and compile this exact example. Compilation does not inspect the named media files.
Behavior
- ClipAsm accepts absolute ranges and rooted timeline-marker ranges for both Video and Audio.
- ClipAsm preserves and rebases complete child placements inside the selected range.
- ClipAsm omits partial or uncertain placements.
- Media-dependent marker boundaries remain deferred until preflight resolves the source domain.
Requirements
- The range must be nonempty, native-grid aligned, within the bound timeline, and owned by that timeline.
Common diagnostics
These are the diagnostics most specific to this program.
E_INVALID_TIME_RANGE— Invalid time range