Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred



Cmds to deal with Cmd.Performance, derivation, and performance.



data Source Source #

Whether the events come from the selected block as toplevel, or from the root block's derivation, assuming the local block is called from the root.




Instances details
Show Source Source # 
Instance details

Defined in Cmd.Repl.LPerf


controls :: Cmd.M m => Source -> m DeriveT.ControlMap Source #

Controls in scope at the insert point.

control_vals :: Cmd.M m => Source -> m ScoreT.ControlValMap Source #

The control vals at the insertion point, taking the control functions into account.

raw_control_vals :: Cmd.M m => Source -> m ScoreT.TypedControlValMap Source #

Like control_vals, but without control functions.


inst_controls :: Cmd.M m => Id.BlockId -> m (Map ScoreT.Instrument ControlVals) Source #

Get the first and last values for each instrument. This can be used to show which controls the each instrument uses, which in turn can be used to set its config_controls, to make sure it is always initialized consistently.


rederive :: Cmd.CmdT IO () Source #

Clear out all caches and rederive from scratch.


block_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event] Source #

Get this block's performance from the cache.

block_events_unnormalized :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event] Source #

normalize_events is important for display, but I can't do it if I'm going to pass to convert, because convert should do the normalization itself.

normalize_events :: [LEvent.LEvent Score.Event] -> [LEvent.LEvent Score.Event] Source #

Apply Score.normalize to the events, so that they have their final control positions and pitches. Normally convert does this, but if you display it before convert it's nice to see the "cooked" versions.

block_midi_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Types.Event] Source #

Get block_events from the cache and convert to MIDI performer events.

block_midi :: Cmd.M m => Id.BlockId -> m Perform.MidiEvents Source #

Derive all the way to MIDI. This uses the cache.


sel_events :: Cmd.M m => m [Score.Event] Source #

Derive the current block from the cache and return events that fall within the current selection.

sel_sampler_events :: Source -> Cmd.CmdT IO Text Source #

Show the low level events as seen by the sampler backend.

root_sel_events :: Cmd.M m => m [Score.Event] Source #

Like sel_events but take the root derivation.


extract_insts :: Cmd.M m => Id.BlockId -> Text -> [Text] -> m [(Text, [Score.Event])] Source #

Get logged events with the given tag and instruments.

extract_debug Source #


:: Cmd.M m 
=> Id.BlockId 
-> Text 
-> m [(Text, [Score.Event])]

logged events by the stack where they were logged

Extract events logged via the debug call.

e :: [Fmt] -> [Score.Event] -> Text Source #

Pretty-print events, presumably from sel_events. Extract the given fields, and format them in columns.

There are a set of e_* functions designed for this. E.g.

LPerf.sel_events $> LPerf.e [LPerf.e_sp, LPerf.e_attr]

play from


get_sel_events :: Cmd.M m => Source -> (Id.BlockId -> m [LEvent.LEvent Score.Event]) -> m [Score.Event] Source #

Like get_sel_events_logs, but filter out the LEvent.Logs.

get_sel_events_logs Source #


:: Cmd.M m 
=> Source 
-> (Id.BlockId -> m [LEvent.LEvent Score.Event])

derive events in the given block, e.g. via block_events or block_events_unnormalized

-> m [LEvent.LEvent Score.Event] 

Get events derived in the selected range.

get_sel :: Cmd.M m => (d -> RealTime) -> (d -> Stack.Stack) -> Source -> (Id.BlockId -> m [LEvent.LEvent d]) -> m [LEvent.LEvent d] Source #

in_score_range :: (a -> Stack.Stack) -> [Id.BlockId] -> [Id.TrackId] -> ScoreTime -> ScoreTime -> [LEvent.LEvent a] -> [LEvent.LEvent a] Source #

Like in_range, but use the stack to check for ScoreTime range.


midi_event_inst :: Types.Event -> Text Source #

Filter on events with a certain instrument.


sel_midi :: Cmd.M m => m Perform.MidiEvents Source #

This is the local block's performance, and the events are filtered to the selection range, and the filtering is done post-derivation, so they reflect what would actually be played. I can't filter by selected track because MIDI events don't retain the stack.

logs_like :: Cmd.M m => Id.BlockId -> String -> m [Log.Msg] Source #

Get all logs whose Log.msg_text matches a regex.

logs_matching :: Cmd.M m => Id.BlockId -> Id.BlockId -> [Id.TrackId] -> TrackTime -> TrackTime -> m [Log.Msg] Source #

Get logs that include a stack frame that matches the given block, tracks, and range.


simple_midi :: [Midi.WriteMessage] -> [(RealTime, Midi.Message)] Source #

Reduce MIDI to an easier to read form.

cache contents


chord :: Cmd.M m => m Text Source #

Show chord ratios at current selection.

chord_at :: Cmd.M m => Id.BlockId -> Maybe Id.TrackId -> ScoreTime -> m [(Pitch.NoteNumber, Pitch.Note, Ratio)] Source #

Show the ratios of the frequencies of the notes at the time of the current selection. They are sorted by their track-order, and the track with the selection is considered unity.

sort_by_track :: Ui.M m => Id.BlockId -> [Score.Event] -> m [Score.Event] Source #

Sort events by the tracknum of the tracks they fall on. Filter out events that don't directly originate from a track on the given block.

TODO I should look for the block anywhere in the stack, and sort it by the corresponding track.