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

Cmd.Repl.LPerf

Description

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

Synopsis

Documentation

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.

Constructors

Local 
Root 

Instances

Instances details
Show Source Source # 
Instance details

Defined in Cmd.Repl.LPerf

info

controls :: Cmd.M m => Source -> m ScoreT.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.

analysis

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.

derive

rederive :: Cmd.CmdT IO () Source #

Clear out all caches and rederive from scratch.

block

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.

selection

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

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 #

Arguments

:: 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]

en :: Functor f => f [Score.Event] -> f Text Source #

LPerf.en LPerf.sel_events

play from

implementation

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 #

Arguments

:: 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.Types.Event

midi_event_inst :: Types.Event -> Text Source #

Filter on events with a certain instrument.

midi

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.

analyze_midi :: [LEvent.LEvent Midi.WriteMessage] -> Text Source #

Analyze a section of MIDI for debugging.

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.

extract

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

Reduce MIDI to an easier to read form.

cache contents

pitches

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.