Safe Haskell | Safe-Inferred |
---|
Utilities that use Cmd.ModifyNotes to do higher-level transformations.
Synopsis
- notes :: Cmd.CmdL [(ModifyNotes.Note, TrackId)]
- note_controls :: Cmd.CmdL [(ModifyNotes.Note, (Maybe Transposed, ScoreT.ControlValMap))]
- merge :: Cmd.CmdL ()
- distribute_n :: Int -> Cmd.CmdL ()
- distribute :: Cmd.CmdL ()
- compact :: Cmd.CmdL ()
- find_index :: ScoreTime -> ScoreTime -> [ScoreTime] -> (Int, [ScoreTime])
- split_on_pitch :: ModifyNotes.Index -> Pitch.NoteNumber -> Cmd.CmdL ()
- sort_on_pitch :: Cmd.M m => Bool -> m ()
- insert_ordered :: ((ModifyNotes.Note, a) -> (ModifyNotes.Note, a) -> Bool) -> (ModifyNotes.Note, a) -> State a -> State a
- bump_index :: Int -> Map Int a -> Map Int a
- extract :: State a -> [ModifyNotes.Note]
- type State annot = Map ModifyNotes.Index [(ModifyNotes.Note, annot)]
- insert_cons :: Ord k => k -> a -> Map k [a] -> Map k [a]
query
modify
distribute_n :: Int -> Cmd.CmdL () Source #
Distribute the notes among the given number of tracks, round-robin. Since only each note only carries over the controls in its extent, if there are notes that rely on control values carried forward, the values will be different in the new tracks.
distribute :: Cmd.CmdL () Source #
Like distribute_n
, but use only the selected tracks.
compact :: Cmd.CmdL () Source #
Try to compact non-overlapping notes to use the least number of tracks possible.
find_index :: ScoreTime -> ScoreTime -> [ScoreTime] -> (Int, [ScoreTime]) Source #
Find the lowest index that a note will fit. Search the list of end times for one at or before the given start, and return that index and update the list with the new end.
split_on_pitch :: ModifyNotes.Index -> Pitch.NoteNumber -> Cmd.CmdL () Source #
If it's above the nn, compact starting at the high_index, otherwise compact starting at index 0.
For example, to split on middle C, assuming only dyads in the left hand:
LNote.split_on_pitch 2 NN.c4
sort_on_pitch :: Cmd.M m => Bool -> m () Source #
Sort by pitch and compact.
insert_ordered :: ((ModifyNotes.Note, a) -> (ModifyNotes.Note, a) -> Bool) -> (ModifyNotes.Note, a) -> State a -> State a Source #
Find the last index with an overlapping note that isn't place_before, and put the note on index+1. If it it overlaps, make a space by bumping tracks up by one.
extract :: State a -> [ModifyNotes.Note] Source #
type State annot = Map ModifyNotes.Index [(ModifyNotes.Note, annot)] Source #
From track index to notes in reverse order.