Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)

Derive.Slice

Description

Slicing is chopping the block horizontally, so that the horizontal chunks can act like their own little blocks.

For the sake of convenient notation, this is done in several places.

1. A note with subtracks will slice out the subevents within its range. This allows a note to take another note (or notes) as arguments, e.g. a tuplet. This is what slice_notes is for.
2. A note with controls as subtracks can invert itself so it has control over the evaluation of the controls. Documented further in Derive.Call.Note.
3. #1 above is a convenient way to apply a transformation to multiple notes: group the tracks under another, and put the transformations in the parent. However, notes that have no transformation (aka orphans) must be extracted from underneath the empty parent, otherwise they will not be evaluated at all. This is done by derive_note_track.

This is a nasty tricky bit of work, but is depended on by all the high level notation, e.g. calls that can manipulate the results of other calls, aka parent calls. I'd still love to figure out a better way to do it though!

Synopsis

# Documentation

Ask slice to synthesize a note track and insert it at the leaves of the sliced tree.

Constructors

 InsertEvent Fieldsevent_duration :: !ScoreTime event_orientation :: !Types.OrientationA Negative orientation means that the controls at the Event.end time are not trimmed off.event_around :: !([Event.Event], [Event.Event]) event_track_id :: !(Maybe TrackId)The TrackId for the track created for this event. This is required so it can collect a TrackDynamic and when the Cmd level looks at at track with inverted note calls, it sees the environ established by the tracks that the calls are inverted beneath. E.g., if the pitch track sets a scale, the Cmd layer should see the note track as having that scale.

#### Instances

Instances details
 # Instance detailsDefined in Derive.Slice MethodsshowList :: [InsertEvent] -> ShowS #

data Track Source #

Constructors

 Track Fields_track_id :: Maybe TrackId _notes :: [Note]

#### Instances

Instances details
 # Instance detailsDefined in Derive.Slice MethodsshowsPrec :: Int -> Track -> ShowS #show :: Track -> String #showList :: [Track] -> ShowS #

Arguments

 :: Bool Omit events than begin at the start. slice_notes documents why this is necessary. -> ScoreTime -> ScoreTime -> Maybe InsertEvent If given, insert an event at the bottom with the given text and dur. The created track will have the given track_range, so it can create a Stack.Region entry. -> TrackTree.EventsNode -> TrackTree.EventsNode

Slice a track between start and end, and optionally put a note track with a single event of given string at the bottom. Sliced control tracks usually get events beyond the slice boundaries for context.

Arguments

 :: Bool TODO change this to Event.Orientation? -> ScoreTime -> ScoreTime -> TrackTree.EventsTree -> Either Text [Track]

This is slice_notes, but throw an error if find_overlapping complains.

TODO I think I don't want to allow sub-events larger than their slice, but currently I do. Actually I think overlap checking needs an overhaul in general.

This is a variant of slice used by note track evaluation to derive orphan events.