Safe Haskell | Safe-Inferred |
---|
This has Score.Event, which is the main output of the deriver.
The events here are generated from UI Events, and will eventually be transformed into Perform Events, which are specific to the performance backend.
Synopsis
- data Event = Event {
- event_start :: !RealTime
- event_duration :: !RealTime
- event_text :: !Text
- event_integrate :: !Text
- event_pitch :: !DeriveT.PSignal
- event_stack :: !Stack.Stack
- event_highlight :: !Color.Highlight
- event_instrument :: !ScoreT.Instrument
- event_environ :: !DeriveT.Environ
- event_flags :: !Flags.Flags
- event_delayed_args :: !(Map Text Dynamic.Dynamic)
- event_logs :: ![Log.Msg]
- short_event :: Event -> Text
- short_events :: [Event] -> Text
- empty_event :: Event
- event_end :: Event -> RealTime
- event_min :: Event -> RealTime
- event_max :: Event -> RealTime
- events_overlap :: Event -> Event -> Bool
- event_scale_id :: Event -> Pitch.ScaleId
- copy :: Event -> Event
- normalize :: Event -> Event
- has_flags :: Flags.Flags -> Event -> Bool
- add_flags :: Flags.Flags -> Event -> Event
- remove_flags :: Flags.Flags -> Event -> Event
- add_log :: CallStack.Stack => Text -> Event -> Event
- add_log_msg :: Log.Msg -> Event -> Event
- modify_environ :: (DeriveT.Environ -> DeriveT.Environ) -> Event -> Event
- modify_val :: EnvKey.Key -> (Maybe DeriveT.Val -> DeriveT.Val) -> Event -> Event
- event_attributes :: Event -> Attrs.Attributes
- has_attribute :: Attrs.Attributes -> Event -> Bool
- intersecting_attributes :: Attrs.Attributes -> Event -> Bool
- modify_attributes :: (Attrs.Attributes -> Attrs.Attributes) -> Event -> Event
- add_attributes :: Attrs.Attributes -> Event -> Event
- remove_attributes :: Attrs.Attributes -> Event -> Event
- put_arg :: Typeable.Typeable a => Text -> a -> Event -> Event
- take_arg :: Typeable.Typeable a => Text -> Event -> Either Text (Event, Maybe a)
- move :: (RealTime -> RealTime) -> Event -> Event
- place :: RealTime -> RealTime -> Event -> Event
- move_start :: RealTime -> RealTime -> Event -> Event
- duration :: (RealTime -> RealTime) -> Event -> Event
- set_duration :: RealTime -> Event -> Event
- set_instrument :: ScoreT.Instrument -> DeriveT.Environ -> Event -> Event
- event_controls :: Event -> ScoreT.ControlMap
- control_at :: RealTime -> ScoreT.Control -> Event -> Maybe (ScoreT.Typed Signal.Y)
- event_control :: ScoreT.Control -> Event -> Maybe (ScoreT.Typed Signal.Control)
- initial_dynamic :: Event -> Signal.Y
- modify_dynamic :: (Signal.Y -> Signal.Y) -> Event -> Event
- set_dynamic :: Signal.Y -> Event -> Event
- modify_control_vals :: ScoreT.Control -> (Signal.Y -> Signal.Y) -> Event -> Event
- modify_control :: ScoreT.Control -> (Maybe ScoreT.TypedSignal -> ScoreT.TypedSignal) -> Event -> Event
- modify_signal :: ScoreT.Control -> (Signal.Control -> Signal.Control) -> Event -> Event
- set_control :: ScoreT.Control -> ScoreT.Typed Signal.Control -> Event -> Event
- event_controls_at :: RealTime -> Event -> ScoreT.ControlValMap
- set_pitch :: DeriveT.PSignal -> Event -> Event
- set_named_pitch :: ScoreT.PControl -> DeriveT.PSignal -> Event -> Event
- event_named_pitch :: ScoreT.PControl -> Event -> Maybe DeriveT.PSignal
- transposed_at :: RealTime -> Event -> Maybe DeriveT.Transposed
- pitch_at :: RealTime -> Event -> Maybe DeriveT.Pitch
- apply_controls :: Event -> RealTime -> DeriveT.Pitch -> DeriveT.Transposed
- initial_pitch :: Event -> Maybe DeriveT.Transposed
- nn_at :: RealTime -> Event -> Maybe Pitch.NoteNumber
- initial_nn :: Event -> Maybe Pitch.NoteNumber
- note_at :: RealTime -> Event -> Maybe Pitch.Note
- initial_note :: Event -> Maybe Pitch.Note
- nn_signal :: Event -> (Signal.NoteNumber, [(RealTime, Text)])
Event
Event | |
|
Instances
short_event :: Event -> Text Source #
Format an event in a way suitable for including inline in log messages. It's short, but hopefully enough information to identify the event in question.
This is the derive equivalent to log_event
.
short_events :: [Event] -> Text Source #
empty_event :: Event Source #
event_min :: Event -> RealTime Source #
Get minimum and maximum edges of the event. event_start
isn't
necessarily the minimum because of negative durations.
event_max :: Event -> RealTime Source #
Get minimum and maximum edges of the event. event_start
isn't
necessarily the minimum because of negative durations.
event_scale_id :: Event -> Pitch.ScaleId Source #
copy :: Event -> Event Source #
If you use an event to create another event, call this to clear out data that shouldn't go with the copy.
normalize :: Event -> Event Source #
Apply environ and controls to pitches.
Normally this is done by Convert, but if you want to see an event for debugging it can be nicer to see the normalized version.
Unlike Perform.Midi.Convert, this doesn't trim the controls, so it applies out-of-range transpositions.
flags
remove_flags :: Flags.Flags -> Event -> Event Source #
logs
environ
modify_environ :: (DeriveT.Environ -> DeriveT.Environ) -> Event -> Event Source #
modify_val :: EnvKey.Key -> (Maybe DeriveT.Val -> DeriveT.Val) -> Event -> Event Source #
Modify the value at the given key.
attributes
has_attribute :: Attrs.Attributes -> Event -> Bool Source #
intersecting_attributes :: Attrs.Attributes -> Event -> Bool Source #
modify_attributes :: (Attrs.Attributes -> Attrs.Attributes) -> Event -> Event Source #
add_attributes :: Attrs.Attributes -> Event -> Event Source #
remove_attributes :: Attrs.Attributes -> Event -> Event Source #
delayed args
take_arg :: Typeable.Typeable a => Text -> Event -> Either Text (Event, Maybe a) Source #
Find an arg in event_delayed_args
, and remove it from the event if it
existed. Throw an error if it existed but had an unexpected type.
modify events
move :: (RealTime -> RealTime) -> Event -> Event Source #
Change the start time of an event and move its controls along with it.
set_instrument :: ScoreT.Instrument -> DeriveT.Environ -> Event -> Event Source #
Set the instrument on an event, and also update its environ from the instrument. You should really rederive with the new instrument, but this way can be more convenient, if somewhat sketchy.
control
control_at :: RealTime -> ScoreT.Control -> Event -> Maybe (ScoreT.Typed Signal.Y) Source #
Get a control value from the event, or Nothing if that control isn't present.
event_control :: ScoreT.Control -> Event -> Maybe (ScoreT.Typed Signal.Control) Source #
initial_dynamic :: Event -> Signal.Y Source #
modify_dynamic :: (Signal.Y -> Signal.Y) -> Event -> Event Source #
Use this instead of modify_control_vals
because it also sets
EnvKey.dynamic_val
. This is only valid for linear functions like (+) or
(*).
set_dynamic :: Signal.Y -> Event -> Event Source #
Use this instead of set_control
because it also sets
EnvKey.dynamic_val
.
modify_control_vals :: ScoreT.Control -> (Signal.Y -> Signal.Y) -> Event -> Event Source #
modify_control :: ScoreT.Control -> (Maybe ScoreT.TypedSignal -> ScoreT.TypedSignal) -> Event -> Event Source #
modify_signal :: ScoreT.Control -> (Signal.Control -> Signal.Control) -> Event -> Event Source #
Like modify_control
, but default to an empty control and retain any
type the original had.
set_control :: ScoreT.Control -> ScoreT.Typed Signal.Control -> Event -> Event Source #
pitch
set_named_pitch :: ScoreT.PControl -> DeriveT.PSignal -> Event -> Event Source #
transposed_at :: RealTime -> Event -> Maybe DeriveT.Transposed Source #
Unlike pitch_at
, the transposition has already been
applied. This is because callers expect to get the actual pitch, not the
pitch plus some homework to do on the pitch. If you use this pitch to emit
another pitch you proabbly need the raw pitch, but so far everyone doing
that is at the Derive level, not postproc, so they use Derive.pitch_at.
apply_controls :: Event -> RealTime -> DeriveT.Pitch -> DeriveT.Transposed Source #
initial_nn :: Event -> Maybe Pitch.NoteNumber Source #
initial_note :: Event -> Maybe Pitch.Note Source #