Safe Haskell | Safe-Inferred |
---|
Cmds to deal with Cmd.Performance, derivation, and performance.
Synopsis
- data Source
- get_root :: Cmd.M m => m Performance
- get :: Cmd.M m => Id.BlockId -> m Performance
- get_current :: Cmd.M m => Id.BlockId -> m Performance
- poll_threads :: Cmd.CmdT IO (Map Id.BlockId (Maybe (Either Exception.SomeException ())))
- environ :: Cmd.M m => m (Maybe Environ)
- controls :: Cmd.M m => Source -> m ScoreT.ControlMap
- control_vals :: Cmd.M m => Source -> m ScoreT.ControlValMap
- raw_control_vals :: Cmd.M m => Source -> m ScoreT.TypedControlValMap
- aliases :: Cmd.M m => m (Map ScoreT.Instrument ScoreT.Instrument)
- warp :: Cmd.M m => Source -> m Warp.Warp
- dynamic :: Cmd.M m => Source -> m Dynamic
- sel_to_real :: Cmd.M m => m [RealTime]
- get_realtime :: Cmd.M m => Source -> m RealTime
- type ControlVals = Map ScoreT.Control ((RealTime, Signal.Y), (RealTime, Signal.Y))
- inst_controls :: Cmd.M m => Id.BlockId -> m (Map ScoreT.Instrument ControlVals)
- rederive :: Cmd.CmdT IO ()
- compare_cached_events :: Cmd.M m => Id.BlockId -> m [Either Simple.ScoreEvent Simple.ScoreEvent]
- derive :: Cmd.M m => Id.BlockId -> m Result
- uncached_derive :: Cmd.M m => Id.BlockId -> m Result
- inverse_tempo_func :: Cmd.M m => RealTime -> m [(Id.BlockId, [(Id.TrackId, ScoreTime)])]
- block_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event]
- block_events_unnormalized :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event]
- block_uncached_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event]
- normalize_events :: [LEvent.LEvent Score.Event] -> [LEvent.LEvent Score.Event]
- block_midi_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Types.Event]
- block_midi :: Cmd.M m => Id.BlockId -> m Perform.MidiEvents
- sel_events :: Cmd.M m => m [Score.Event]
- sel_midi_events :: Cmd.M m => m [LEvent.LEvent Types.Event]
- sel_im_events :: Cmd.M m => m [LEvent.LEvent Shared.Note.Note]
- sel_sc_events :: Cmd.M m => m [LEvent.LEvent Sc.Note.Note]
- sel_sampler_events :: Source -> Cmd.CmdT IO Text
- root_sel_events :: Cmd.M m => m [Score.Event]
- root_sel_midi_events :: Cmd.M m => m [LEvent.LEvent Types.Event]
- root_sel_im_events :: Cmd.M m => m [LEvent.LEvent Shared.Note.Note]
- extract_insts :: Cmd.M m => Id.BlockId -> Text -> [Text] -> m [(Text, [Score.Event])]
- extract_debug :: Cmd.M m => Id.BlockId -> Text -> m [(Text, [Score.Event])]
- control :: ScoreT.Control -> Score.Event -> Maybe (ScoreT.Typed Signal.Y)
- event_controls :: Score.Event -> ScoreT.ControlValMap
- only_keys :: [Key] -> [LEvent.LEvent Score.Event] -> [Score.Event]
- with_insts :: [Text] -> [Score.Event] -> [Score.Event]
- strip_stack :: [Score.Event] -> [Score.Event]
- strip_env :: [Score.Event] -> [Score.Event]
- e :: [Fmt] -> [Score.Event] -> Text
- en :: Functor f => f [Score.Event] -> f Text
- type Fmt = [Score.Event -> Text]
- e_sdt :: Fmt
- e_sd :: Fmt
- e_sp :: Fmt
- e_s :: Fmt
- e_note :: Fmt
- e_pitch :: Fmt
- e_attr :: Fmt
- e_inst :: Fmt
- e_env :: Fmt
- e_env_like :: Text -> Fmt
- e_env_k :: Text -> Fmt
- events_from :: Cmd.M m => m (Vector.Vector Score.Event)
- perform_from :: Cmd.M m => m (Perform.MidiEvents, [LEvent.LEvent Sc.Note.Note])
- get_sel_events :: Cmd.M m => Source -> (Id.BlockId -> m [LEvent.LEvent Score.Event]) -> m [Score.Event]
- get_sel_events_logs :: Cmd.M m => Source -> (Id.BlockId -> m [LEvent.LEvent Score.Event]) -> m [LEvent.LEvent Score.Event]
- get_sel :: Cmd.M m => (d -> RealTime) -> (d -> Stack.Stack) -> Source -> (Id.BlockId -> m [LEvent.LEvent d]) -> m [LEvent.LEvent d]
- get_sel_ranges :: Cmd.M m => Source -> m (Id.BlockId, [Id.TrackId], RealTime, RealTime)
- score_in_selection :: [Id.TrackId] -> RealTime -> RealTime -> [LEvent.LEvent Score.Event] -> [LEvent.LEvent Score.Event]
- in_tracks :: (d -> Stack.Stack) -> [Id.TrackId] -> [LEvent.LEvent d] -> [LEvent.LEvent d]
- in_range :: (a -> RealTime) -> RealTime -> RealTime -> [LEvent.LEvent a] -> [LEvent.LEvent a]
- in_score_range :: (a -> Stack.Stack) -> [Id.BlockId] -> [Id.TrackId] -> ScoreTime -> ScoreTime -> [LEvent.LEvent a] -> [LEvent.LEvent a]
- stack_in_score_range :: [Id.BlockId] -> [Id.TrackId] -> ScoreTime -> ScoreTime -> Stack.Stack -> Bool
- midi_convert :: Cmd.M m => [Score.Event] -> m [LEvent.LEvent Types.Event]
- im_convert :: Cmd.M m => Id.BlockId -> [Score.Event] -> m [LEvent.LEvent Shared.Note.Note]
- sc_convert :: Cmd.M m => [Score.Event] -> m [LEvent.LEvent Sc.Note.Note]
- midi_event_inst :: Types.Event -> Text
- perform_events :: Cmd.M m => [LEvent.LEvent Score.Event] -> m Perform.MidiEvents
- perform_midi_events :: Ui.M m => [LEvent.LEvent Types.Event] -> m Perform.MidiEvents
- sel_midi :: Cmd.M m => m Perform.MidiEvents
- analyze_midi :: [LEvent.LEvent Midi.WriteMessage] -> Text
- root_sel_midi :: Cmd.M m => m Perform.MidiEvents
- get_sel_midi :: Cmd.M m => Source -> m Perform.MidiEvents
- logs_like :: Cmd.M m => Id.BlockId -> String -> m [Log.Msg]
- logs_matching :: Cmd.M m => Id.BlockId -> Id.BlockId -> [Id.TrackId] -> TrackTime -> TrackTime -> m [Log.Msg]
- play_midi :: Cmd.M m => Perform.MidiEvents -> m ()
- with_chans :: [Midi.Channel] -> [Midi.WriteMessage] -> [Midi.WriteMessage]
- simple_midi :: [Midi.WriteMessage] -> [(RealTime, Midi.Message)]
- get_cache :: Cmd.M m => Id.BlockId -> m (Map CacheKey Cached)
- get_cache_events :: (Cache.Cacheable d, Cmd.M m) => Id.BlockId -> m (Map CacheKey [LEvent.LEvent d])
- show_cache :: Cmd.M m => Id.BlockId -> m Text
- entry_events :: CacheEntry -> Int
- type Ratio = Rational
- chord_hook :: Cmd.M m => [(Id.ViewId, Maybe Cmd.TrackSelection)] -> m ()
- chord :: Cmd.M m => m Text
- show_chord :: [(Pitch.NoteNumber, Pitch.Note, Ratio)] -> Text
- show_ratio :: Ratio -> Text
- set_chord_status :: Cmd.M m => Id.ViewId -> Maybe Cmd.TrackSelection -> m ()
- chord_at :: Cmd.M m => Id.BlockId -> Maybe Id.TrackId -> ScoreTime -> m [(Pitch.NoteNumber, Pitch.Note, Ratio)]
- sort_by_track :: Ui.M m => Id.BlockId -> [Score.Event] -> m [Score.Event]
- nn_ratios :: Maybe Pitch.NoteNumber -> [Pitch.NoteNumber] -> [Ratio]
- overlapping_events :: Cmd.M m => Source -> m (RealTime, [Score.Event])
Documentation
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.
get_root :: Cmd.M m => m Performance Source #
get :: Cmd.M m => Id.BlockId -> m Performance Source #
get_current :: Cmd.M m => Id.BlockId -> m Performance Source #
poll_threads :: Cmd.CmdT IO (Map Id.BlockId (Maybe (Either Exception.SomeException ()))) Source #
info
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.
aliases :: Cmd.M m => m (Map ScoreT.Instrument ScoreT.Instrument) Source #
sel_to_real :: Cmd.M m => m [RealTime] Source #
analysis
type ControlVals = Map ScoreT.Control ((RealTime, Signal.Y), (RealTime, Signal.Y)) Source #
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
compare_cached_events :: Cmd.M m => Id.BlockId -> m [Either Simple.ScoreEvent Simple.ScoreEvent] Source #
uncached_derive :: Cmd.M m => Id.BlockId -> m Result Source #
inverse_tempo_func :: Cmd.M m => RealTime -> m [(Id.BlockId, [(Id.TrackId, ScoreTime)])] Source #
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.
block_uncached_events :: Cmd.M m => Id.BlockId -> m [LEvent.LEvent Score.Event] Source #
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_midi_events :: Cmd.M m => m [LEvent.LEvent Types.Event] Source #
sel_im_events :: Cmd.M m => m [LEvent.LEvent Shared.Note.Note] Source #
sel_sc_events :: Cmd.M m => m [LEvent.LEvent Sc.Note.Note] Source #
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.
root_sel_midi_events :: Cmd.M m => m [LEvent.LEvent Types.Event] Source #
root_sel_im_events :: Cmd.M m => m [LEvent.LEvent Shared.Note.Note] Source #
extract
extract_insts :: Cmd.M m => Id.BlockId -> Text -> [Text] -> m [(Text, [Score.Event])] Source #
Get logged events with the given tag and instruments.
:: 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.
control :: ScoreT.Control -> Score.Event -> Maybe (ScoreT.Typed Signal.Y) Source #
only_keys :: [Key] -> [LEvent.LEvent Score.Event] -> [Score.Event] Source #
with_insts :: [Text] -> [Score.Event] -> [Score.Event] Source #
strip_stack :: [Score.Event] -> [Score.Event] Source #
strip_env :: [Score.Event] -> [Score.Event] Source #
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]
type Fmt = [Score.Event -> Text] Source #
e_env_like :: Text -> Fmt Source #
play from
events_from :: Cmd.M m => m (Vector.Vector Score.Event) Source #
perform_from :: Cmd.M m => m (Perform.MidiEvents, [LEvent.LEvent Sc.Note.Note]) Source #
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.
:: Cmd.M m | |
=> Source | |
-> (Id.BlockId -> m [LEvent.LEvent Score.Event]) | derive events in the
given block, e.g. via |
-> 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 #
get_sel_ranges :: Cmd.M m => Source -> m (Id.BlockId, [Id.TrackId], RealTime, RealTime) Source #
score_in_selection :: [Id.TrackId] -> RealTime -> RealTime -> [LEvent.LEvent Score.Event] -> [LEvent.LEvent Score.Event] Source #
in_tracks :: (d -> Stack.Stack) -> [Id.TrackId] -> [LEvent.LEvent d] -> [LEvent.LEvent d] Source #
in_range :: (a -> RealTime) -> RealTime -> RealTime -> [LEvent.LEvent a] -> [LEvent.LEvent a] 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.
stack_in_score_range :: [Id.BlockId] -> [Id.TrackId] -> ScoreTime -> ScoreTime -> Stack.Stack -> Bool Source #
Midi.Types.Event
midi_convert :: Cmd.M m => [Score.Event] -> m [LEvent.LEvent Types.Event] Source #
im_convert :: Cmd.M m => Id.BlockId -> [Score.Event] -> m [LEvent.LEvent Shared.Note.Note] Source #
sc_convert :: Cmd.M m => [Score.Event] -> m [LEvent.LEvent Sc.Note.Note] Source #
midi_event_inst :: Types.Event -> Text Source #
Filter on events with a certain instrument.
midi
perform_events :: Cmd.M m => [LEvent.LEvent Score.Event] -> m Perform.MidiEvents Source #
perform_midi_events :: Ui.M m => [LEvent.LEvent Types.Event] -> m Perform.MidiEvents Source #
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.
root_sel_midi :: Cmd.M m => m Perform.MidiEvents Source #
get_sel_midi :: Cmd.M m => Source -> m Perform.MidiEvents Source #
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.
play_midi :: Cmd.M m => Perform.MidiEvents -> m () Source #
extract
with_chans :: [Midi.Channel] -> [Midi.WriteMessage] -> [Midi.WriteMessage] Source #
simple_midi :: [Midi.WriteMessage] -> [(RealTime, Midi.Message)] Source #
Reduce MIDI to an easier to read form.
cache contents
get_cache_events :: (Cache.Cacheable d, Cmd.M m) => Id.BlockId -> m (Map CacheKey [LEvent.LEvent d]) Source #
show_cache :: Cmd.M m => Id.BlockId -> m Text Source #
entry_events :: CacheEntry -> Int Source #
pitches
chord_hook :: Cmd.M m => [(Id.ViewId, Maybe Cmd.TrackSelection)] -> m () Source #
A hook for Cmd.hooks_selection
.
show_chord :: [(Pitch.NoteNumber, Pitch.Note, Ratio)] -> Text Source #
show_ratio :: Ratio -> Text Source #
set_chord_status :: Cmd.M m => Id.ViewId -> Maybe Cmd.TrackSelection -> m () Source #
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.
nn_ratios :: Maybe Pitch.NoteNumber -> [Pitch.NoteNumber] -> [Ratio] Source #
overlapping_events :: Cmd.M m => Source -> m (RealTime, [Score.Event]) Source #