Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

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
Show Event # 
Instance details

Defined in Derive.Score

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Show InstrumentCalls # 
Instance details

Defined in Derive.Deriver.Monad

Show Builtins # 
Instance details

Defined in Derive.Deriver.Monad

Show Library # 
Instance details

Defined in Derive.Library

Semigroup NoteDeriver # 
Instance details

Defined in Derive.Deriver.Monad

Monoid NoteDeriver # 
Instance details

Defined in Derive.Deriver.Monad

DeepSeq.NFData Event # 
Instance details

Defined in Derive.Score

Methods

rnf :: Event -> () #

Pretty.Pretty Event # 
Instance details

Defined in Derive.Score

ShowVal NoteDeriver #

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

Taggable Note # 
Instance details

Defined in Derive.Deriver.Monad

Typecheck NoteDeriver # 
Instance details

Defined in Derive.Sig

Cacheable Event # 
Instance details

Defined in Derive.Cache

Semigroup (Stream Event) # 
Instance details

Defined in Derive.Stream

Monoid (Stream Event) # 
Instance details

Defined in Derive.Stream

Callable (Transformer Note) # 
Instance details

Defined in Derive.Deriver.Monad

Callable (Generator Note) # 
Instance details

Defined in Derive.Deriver.Monad

Callable (TrackCall Note) # 
Instance details

Defined in Derive.Deriver.Monad

ToLibrary (Transformer Note) # 
Instance details

Defined in Derive.Library

ToLibrary (Generator Note) # 
Instance details

Defined in Derive.Library

ToLibrary (TrackCall Note) # 
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

put_arg :: Typeable a => Text -> a -> Event -> Event Source #

take_arg :: 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.