Safe Haskell | Safe-Inferred |
---|
Repl cmds to deal with events.
Synopsis
- get :: Ui.M m => TrackId -> m Events.Events
- events :: Ui.M m => TrackId -> m [Event.Event]
- stretch :: ScoreTime -> Cmd.CmdL ()
- stretch_event :: ScoreTime -> ScoreTime -> Event.Event -> Event.Event
- stretch_to :: TrackTime -> Cmd.CmdL ()
- sel_dur :: Cmd.M m => m TrackTime
- modify_dur :: Cmd.M m => (ScoreTime -> ScoreTime) -> m ()
- find :: Text -> Cmd.CmdL [(Ui.Range, Text)]
- find_f :: (Text -> Bool) -> Cmd.CmdL [(Ui.Range, Text)]
- replace :: Monad m => Text -> Text -> ModifyEvents.Track m
- replace_exact :: Monad m => Text -> Text -> ModifyEvents.Track m
- replace_many :: Monad m => [(Text, Text)] -> ModifyEvents.Track m
- replace_many_exact :: Monad m => [(Text, Text)] -> ModifyEvents.Track m
- upgrade_mridangam :: Cmd.M m => m ()
- replace_pattern :: Cmd.M m => ModifyEvents.Parser -> [ModifyEvents.Replacement] -> ModifyEvents.Track m
- replace_regex :: Monad m => String -> ([Text] -> Text) -> ModifyEvents.Track m
- data Mode
- quantize_sel :: Cmd.M m => Text -> m ()
- quantize_timestep :: Ui.M m => Mode -> Text -> ModifyEvents.Track m
- resolve_conflicts :: [TrackTime] -> [Event.Event] -> [Event.Event]
- quantize_event :: Mode -> [TrackTime] -> Event.Event -> ([TrackTime], Event.Event)
- quantize :: [TrackTime] -> TrackTime -> TrackTime
- insert :: Cmd.M m => [(ScoreTime, ScoreTime, Text)] -> m ()
Documentation
stretch_event :: ScoreTime -> ScoreTime -> Event.Event -> Event.Event Source #
stretch_to :: TrackTime -> Cmd.CmdL () Source #
Stretch events to fit in the given duration.
sel_dur :: Cmd.M m => m TrackTime Source #
Duration of the current selection, e.g. stretch_to =<< sel_dur
.
find :: Text -> Cmd.CmdL [(Ui.Range, Text)] Source #
Find all events containing the given substring. Call with pp
to get
copy-pastable s
codes.
replace :: Monad m => Text -> Text -> ModifyEvents.Track m Source #
Replace text on events. Call with ModifyEvents.all_blocks
to replace it
everywhere, or ModifyEvents.note_tracks
for just note tracks.
replace_exact :: Monad m => Text -> Text -> ModifyEvents.Track m Source #
replace_many :: Monad m => [(Text, Text)] -> ModifyEvents.Track m Source #
Multiple replacements. This is simultaneous replacement, so
[(a, b), (b, a)] will swap a
and b
as expected.
replace_many_exact :: Monad m => [(Text, Text)] -> ModifyEvents.Track m Source #
upgrade_mridangam :: Cmd.M m => m () Source #
Upgrade thoppi on the right to thoppi on the left. Delete when I don't have any more scores like that.
replace_pattern :: Cmd.M m => ModifyEvents.Parser -> [ModifyEvents.Replacement] -> ModifyEvents.Track m Source #
Modify event text with ModifyEvents.substitute
.
For example, to turn "si .5 .3" into ".3 | i .5":
ModifyEvents.control_tracks $ LEvent.replace_pattern ("si"<>w<>w) [F 1, "| i", F 0]
w
is a word, ws
is >=0 words, ws1
is >=1 words, and a string matches
literal text.
replace_regex :: Monad m => String -> ([Text] -> Text) -> ModifyEvents.Track m Source #
Modify event text with Regex.substituteGroups
.
For example, to turn "si .5 .3" into ".3 | i .5":
ModifyEvents.control_tracks $ LEvent.replace_regex "si (\\W+) (\\W+)" (\[f0 f1] -> f1 <> " | i " <> f0)
quantize
quantize_sel :: Cmd.M m => Text -> m () Source #
quantize_timestep :: Ui.M m => Mode -> Text -> ModifyEvents.Track m Source #
Quantize to a TimeStep's duration. What this does is snap the edges of the event to the nearest timestep.
resolve_conflicts :: [TrackTime] -> [Event.Event] -> [Event.Event] Source #
Quantize can put two events in the same spot. Resolve the conflicts by bumping events back until they don't conflict. If I run out of timesteps, bump by 1.
quantize_event :: Mode -> [TrackTime] -> Event.Event -> ([TrackTime], Event.Event) Source #
Zero-duration events will remain zero duration, and not be affected by End quantization. Non-zero-duration events will never be quantized to zero duration.