Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Cmd.Repl.LPerf

Contents

Description

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

Synopsis

Documentation

info

controls :: Bool -> Cmd.CmdL ControlMap Source #

Controls in scope at the insert point.

control_vals :: Bool -> Cmd.CmdL ControlValMap Source #

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

raw_control_vals :: Bool -> Cmd.CmdL TypedControlValMap Source #

Like control_vals, but without control functions.

analysis

inst_controls :: BlockId -> Cmd.CmdL (Map 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.CmdL () Source #

Clear out all caches and rederive from scratch.

block

block_events :: BlockId -> Cmd.CmdL [LEvent.LEvent Score.Event] Source #

Get this block's performance from the cache.

block_events_unnormalized :: BlockId -> Cmd.CmdL [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 :: Cmd.M m => [LEvent.LEvent Score.Event] -> m [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 :: BlockId -> Cmd.CmdL [LEvent.LEvent Types.Event] Source #

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

block_midi :: BlockId -> Cmd.CmdL Perform.MidiEvents Source #

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

selection

sel_events :: Cmd.CmdL [Score.Event] Source #

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

root_sel_events :: Cmd.CmdL [Score.Event] Source #

Like sel_events but take the root derivation.

extract

extract_insts :: BlockId -> Text -> [Text] -> Cmd.CmdL [(Text, [Score.Event])] Source #

Get logged events with the given tag and instruments.

extract_debug Source #

Arguments

:: BlockId 
-> Text 
-> Cmd.CmdL [(Text, [Score.Event])]

logged events by the stack where they were logged

Extract events logged via the debug call.

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

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

play from

implementation

get_sel_events Source #

Arguments

:: Bool

from root

-> (BlockId -> Cmd.CmdL (Events Score.Event)) 
-> Cmd.CmdL [Score.Event] 

Like get_sel_events_logs, but filter out the LEvent.Logs.

get_sel_events_logs Source #

Arguments

:: Bool

from root

-> (BlockId -> Cmd.CmdL (Events Score.Event))

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

-> Cmd.CmdL (Events Score.Event) 

Get events derived in the selected range.

get_sel Source #

Arguments

:: (d -> RealTime) 
-> (d -> Stack.Stack) 
-> Bool

from root

-> (BlockId -> Cmd.CmdL (Events d)) 
-> Cmd.CmdL (Events d) 

in_tracks :: (d -> Stack.Stack) -> [TrackId] -> Events d -> Events d Source #

Midi.Types.Event

midi_event_inst :: Types.Event -> Text Source #

Filter on events with a certain instrument.

midi

sel_midi :: Cmd.CmdL 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 :: BlockId -> String -> Cmd.CmdL [Log.Msg] Source #

Get all logs whose Log.msg_text matches a regex.

logs_matching :: BlockId -> BlockId -> [TrackId] -> TrackTime -> TrackTime -> Cmd.CmdL [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.CmdL Text Source #

Show chord ratios at current selection.

chord_at :: Cmd.M m => BlockId -> Maybe 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 => 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.