Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.Repl.LNote

Contents

Description

Utilities that use Cmd.ModifyNotes to do higher-level transformations.

Synopsis

query

modify

merge :: Cmd.CmdL () Source #

Merge the selected note tracks into one.

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.

type State annot = Map ModifyNotes.Index [(ModifyNotes.Note, annot)] Source #

From track index to notes in reverse order.

insert_cons :: Ord k => k -> a -> Map k [a] -> Map k [a] Source #