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

Safe HaskellNone




This has the basic data structures for the deriver level.

The events here are generated from UI Events, and will eventually be transformed into Perform Events, which are specific to the performance backend.




data Event Source #




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.

event_min :: Event -> RealTime.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.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 :: (ScoreTypes.Instrument -> BaseTypes.Environ) -> Event -> Event Source #

Apply event_control_offset and 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.





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 -> RealTime.RealTime) -> Event -> Event Source #

Change the start time of an event and move its controls along with it.

set_instrument :: ScoreTypes.Instrument -> BaseTypes.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_at :: RealTime.RealTime -> ScoreTypes.Control -> Event -> Maybe ScoreTypes.TypedVal 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.

set_dynamic :: Signal.Y -> Event -> Event Source #

Use this instead of set_control because it also sets EnvKey.dynamic_val.

modify_control :: ScoreTypes.Control -> (Signal.Control -> Signal.Control) -> Event -> Event Source #

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


transposed_at :: RealTime.RealTime -> Event -> Maybe BaseTypes.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.


warp :: Signal.Warp -> ScoreTypes.Warp Source #

Convert a Signal to a Warp.

warp_pos :: ScoreTypes.Warp -> ScoreTime -> RealTime.RealTime Source #

Warp a ScoreTime to a RealTime.

The warp signal is extended linearly in either direction infinitely, with its last slope, or 1:1 if there are no samples at all. Previously, the warp signal was flat before zero and after its end, which effectively made the tempo infinitely fast at those points. But that made the optimization for ScoreTypes.id_warp_signal produce inconsistent results with a warp that was linear but not not equal to id_warp_signal, which in turn led to inconsistent results from ornaments that placed notes before ScoreTime 0.

unwarp_pos :: ScoreTypes.Warp -> RealTime.RealTime -> ScoreTime Source #

The inverse of warp_pos. I originally would fail when the RealTime doesn't occur in the Warp, but now I extend it in the same way as warp_pos. Failing caused awkwardness with events at the end of the score.

compose_warps :: ScoreTypes.Warp -> ScoreTypes.Warp -> ScoreTypes.Warp Source #

Compose two warps. Warps with id signals are optimized. This is standard right to left composition



control :: Text -> Either Text ScoreTypes.Control Source #

Use this constructor when making a Control from user input. Literals can use the IsString instance.

pcontrol :: Text -> Either Text ScoreTypes.PControl Source #

Use this constructor when making a PControl from user input. Literals can use the IsString instance.

c_dynamic :: ScoreTypes.Control Source #

Converted into velocity or breath depending on the instrument.