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

Derive.Score

Description

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

Event

data Event Source #

Constructors

Event 

Fields

Instances

Instances details
Monoid NoteDeriver Source # 
Instance details

Defined in Derive.Deriver.Monad

Semigroup NoteDeriver Source # 
Instance details

Defined in Derive.Deriver.Monad

Show Builtins Source # 
Instance details

Defined in Derive.Deriver.Monad

Show InstrumentCalls Source # 
Instance details

Defined in Derive.Deriver.Monad

Show Library Source # 
Instance details

Defined in Derive.Library

Show Event Source # 
Instance details

Defined in Derive.Score

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

DeepSeq.NFData Event Source # 
Instance details

Defined in Derive.Score

Methods

rnf :: Event -> () #

Cacheable Event Source # 
Instance details

Defined in Derive.Cache

Taggable Note Source # 
Instance details

Defined in Derive.Deriver.Monad

ShowVal NoteDeriver Source #

This is an invalid instance, because a deriver has no literal syntax. But this lets me put a deriver in a defaulted argument, and get documentation for it.

Instance details

Defined in Derive.Deriver.Monad

Typecheck NoteDeriver Source # 
Instance details

Defined in Derive.Sig

Pretty.Pretty Event Source # 
Instance details

Defined in Derive.Score

Monoid (Stream Event) Source # 
Instance details

Defined in Derive.Stream

Semigroup (Stream Event) Source # 
Instance details

Defined in Derive.Stream

Callable (Generator Note) Source # 
Instance details

Defined in Derive.Deriver.Monad

Callable (TrackCall Note) Source # 
Instance details

Defined in Derive.Deriver.Monad

Callable (Transformer Note) Source # 
Instance details

Defined in Derive.Deriver.Monad

ToLibrary (Generator Note) Source # 
Instance details

Defined in Derive.Library

ToLibrary (TrackCall Note) Source # 
Instance details

Defined in Derive.Library

ToLibrary (Transformer Note) Source # 
Instance details

Defined in Derive.Library

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.

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.

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

logs

environ

modify_environ_key :: EnvKey.Key -> (Maybe DeriveT.Val -> DeriveT.Val) -> Event -> Event Source #

Modify the value at the given key.

attributes

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.

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 :: ScoreT.Control -> (Signal.Control -> Signal.Control) -> Event -> Event Source #

Modify a control. If there is no existing control, the modify function gets an empty signal.

pitch

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.