Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Cmd.Integrate.Convert

Contents

Synopsis

Documentation

data Track Source #

A simplified description of a UI track, as collected by Derive.Call.Integrate.

Constructors

Track 

type Tracks = [(Track, [Track])] Source #

(note track, control tracks)

integrate Source #

Arguments

:: Config 
-> Map TrackId TrackNum 
-> [Score.Event] 
-> (Tracks, [Text])

(tracks, errs)

Convert derived score events back into UI events.

TODO optionally quantize the ui events

allocate_tracks :: Map TrackId TrackNum -> [Score.Event] -> [(TrackKey, [Score.Event])] Source #

Allocate the events to separate tracks.

split_overlapping :: [Score.Event] -> [[Score.Event]] Source #

Split events into separate lists of non-overlapping events.

type TrackKey = (Maybe TrackNum, Instrument, Pitch.ScaleId, Voice) Source #

This determines how tracks are split when integration recreates track structure.

type Voice = Int Source #

note

pitch

pitch_events :: Pitch.ScaleId -> Pitch.ScaleId -> [Score.Event] -> (Track, [Text]) Source #

Unlike control_events, this only drops dups that occur within the same event. This is because it's more normal to think of each note as establishing a new pitch, even if it's the same as the last one.

pitch_signal_events :: Score.Event -> ([Event.Event], [Text]) Source #

Convert an event's pitch signal to symbolic note names. This uses pitch_note, which handles a constant transposition, but not continuous pitch changes (it's not even clear how to spell those). I could try to convert back from NoteNumbers, but I still have the problem of how to convert the curve back to high level pitches.

control

util

align_signal :: X -> Signal.Signal y -> [(X, Signal.Y)] Source #

Make sure the first sample of the signal lines up with the start. This is called after Signal.drop_before, which may still emit a sample before the start time.

clip_concat :: [[Event.Event]] -> [Event.Event] Source #

Concatenate the events, dropping ones that are out of order. The durations are not modified, so they still might overlap in duration, but the start times will be increasing.

drop_dups :: [Event.Event] -> [Event.Event] Source #

Drop subsequent events with the same text, since those are redundant for controls.

clip_to_zero :: [Event.Event] -> [Event.Event] Source #

Drop events before 0, keeping at least one at 0. Controls can wind up with samples before 0 (e.g. after using move), but events can't start before 0.