Safe Haskell | Safe-Inferred |
---|
Extract things from the PassedArgs data structure.
Synopsis
- context :: PassedArgs a -> Context a
- event :: PassedArgs a -> Event.Event
- orientation :: PassedArgs a -> Types.Orientation
- negative :: PassedArgs a -> Bool
- prev_control :: ControlArgs -> Maybe (RealTime.RealTime, Signal.Y)
- prev_pitch :: PitchArgs -> Maybe (RealTime.RealTime, Pitch)
- prev_event :: NoteArgs -> Maybe Score.Event
- prev_event_pitch :: PassedArgs Score.Event -> Maybe Pitch
- prev_val_end :: Taggable a => PassedArgs a -> Maybe RealTime.RealTime
- prev_val :: PassedArgs a -> Maybe a
- prev_note_pitch :: RealTime.RealTime -> Deriver (Maybe Pitch)
- prev_note :: Deriver (Maybe Score.Event)
- lookup_next_pitch :: PassedArgs a -> Deriver (Maybe Pitch)
- lookup_prev_pitch :: PassedArgs a -> Deriver (Maybe Pitch)
- lookup_next_note_pitch :: ScoreTime -> Deriver (Maybe Pitch)
- lookup_prev_note_pitch :: ScoreTime -> Deriver (Maybe Pitch)
- note_before :: TrackTime -> Events.Events -> Maybe Event.Event
- note_after :: TrackTime -> Events.Events -> Maybe Event.Event
- get_note_events :: Deriver Events.Events
- lookup_pitch_at :: TrackTime -> Deriver (Maybe Pitch)
- lookup_parsed_pitch_at :: (Pitch.Note -> Maybe a) -> TrackTime -> Deriver (Maybe a)
- eval :: CallableExpr d => Context x -> Event.Event -> [Event.Event] -> Deriver (Stream.Stream d)
- eval_next_pitch :: PitchArgs -> Deriver (Maybe Pitch)
- eval_pitch :: Event.Event -> Deriver (Maybe Pitch)
- start :: PassedArgs a -> TrackTime
- duration :: PassedArgs a -> TrackTime
- real_duration :: PassedArgs a -> Deriver RealTime.RealTime
- real_start :: PassedArgs a -> Deriver RealTime.RealTime
- end :: PassedArgs a -> TrackTime
- real_end :: PassedArgs a -> Deriver RealTime.RealTime
- next :: PassedArgs a -> TrackTime
- next_end :: PassedArgs a -> TrackTime
- next_start :: PassedArgs a -> Maybe TrackTime
- prev_start :: PassedArgs a -> Maybe TrackTime
- prev_end :: PassedArgs a -> Maybe TrackTime
- prev_events :: PassedArgs a -> [Event.Event]
- next_events :: PassedArgs a -> [Event.Event]
- set_duration :: TrackTime -> PassedArgs a -> PassedArgs a
- range :: PassedArgs a -> (TrackTime, TrackTime)
- real_range :: PassedArgs a -> Deriver (RealTime.RealTime, RealTime.RealTime)
- range_or_next :: PassedArgs a -> (TrackTime, TrackTime)
- real_range_or_next :: PassedArgs a -> Deriver (RealTime.RealTime, RealTime.RealTime)
- range_or_note_end :: PassedArgs a -> Deriver (TrackTime, TrackTime)
- extent :: PassedArgs a -> (TrackTime, TrackTime)
- real_extent :: PassedArgs a -> Deriver (RealTime.RealTime, RealTime.RealTime)
- range_on_track :: PassedArgs a -> (TrackTime, TrackTime)
- normalized :: PassedArgs a -> Deriver b -> Deriver b
- normalized_start :: PassedArgs a -> Deriver b -> Deriver b
Documentation
context :: PassedArgs a -> Context a Source #
event :: PassedArgs a -> Event.Event Source #
orientation :: PassedArgs a -> Types.Orientation Source #
negative :: PassedArgs a -> Bool Source #
prev and next
from ctx_prev_val
prev_control :: ControlArgs -> Maybe (RealTime.RealTime, Signal.Y) Source #
prev_pitch :: PitchArgs -> Maybe (RealTime.RealTime, Pitch) Source #
prev_event :: NoteArgs -> Maybe Score.Event Source #
prev_val_end :: Taggable a => PassedArgs a -> Maybe RealTime.RealTime Source #
Polymorphic version of prev_control
or prev_pitch
.
prev_val :: PassedArgs a -> Maybe a Source #
Get the previous val. See NOTE [prev-val].
from state_prev_val
prev_note_pitch :: RealTime.RealTime -> Deriver (Maybe Pitch) Source #
prev_note :: Deriver (Maybe Score.Event) Source #
Get the previous note. Unlike prev_val
, this always gets the previous
Score.Event, even if you're evaluating a control track under the note track.
TODO it doesn't really belong here since it doesn't use PassedArgs, but this is where I would look for a function for the previous value.
state_pitch_map
lookup_next_pitch :: PassedArgs a -> Deriver (Maybe Pitch) Source #
Pitch at the time of the next event in this track.
lookup_prev_pitch :: PassedArgs a -> Deriver (Maybe Pitch) Source #
lookup_next_note_pitch :: ScoreTime -> Deriver (Maybe Pitch) Source #
Pitch at the time of the next note event of this track's
state_note_track
.
note_before :: TrackTime -> Events.Events -> Maybe Event.Event Source #
note_after :: TrackTime -> Events.Events -> Maybe Event.Event Source #
lookup_pitch_at :: TrackTime -> Deriver (Maybe Pitch) Source #
Get a logical pitch at the given time, via state_pitch_map
.
As documented by state_pitch_map
, the pitch map is unset while
evaluating the pitch map, so pitch calls that use this shouldn't be
surprised if it's Nothing.
lookup_parsed_pitch_at :: (Pitch.Note -> Maybe a) -> TrackTime -> Deriver (Maybe a) Source #
Like lookup_pitch_at
, except for parsed pitches. Normally you'd pass
get_pitch_functions
to make a Pitch.Pitch
.
eval
eval :: CallableExpr d => Context x -> Event.Event -> [Event.Event] -> Deriver (Stream.Stream d) Source #
Unused, but might be used again if I need to evaluate the next event.
eval_next_pitch :: PitchArgs -> Deriver (Maybe Pitch) Source #
Get the pitch at the time of the next event, when evaluating a pitch track. Since the pitch hasn't been evaluated yet, it has to be evaluated here. So if it depends on the previous pitch, you won't get a pitch back.
Actually, the pitch likely *has* been evaluated, I just can't get at it
here. If it's uninverted then I have the whole pitch track, and if it's
inverted then the event at or after the end of the event will be included.
But trim_signal
will clip that sample off to avoid
a spurious pitch change at the end of the note.
eval_pitch :: Event.Event -> Deriver (Maybe Pitch) Source #
event timing
start :: PassedArgs a -> TrackTime Source #
duration :: PassedArgs a -> TrackTime Source #
real_start :: PassedArgs a -> Deriver RealTime.RealTime Source #
end :: PassedArgs a -> TrackTime Source #
real_end :: PassedArgs a -> Deriver RealTime.RealTime Source #
next :: PassedArgs a -> TrackTime Source #
The start of the next event, or the end of the block if there is no next event.
Used by calls to determine their extent, especially control calls, which have no explicit duration.
next_end :: PassedArgs a -> TrackTime Source #
End of the next event, or the end of the block if there is no next event.
next_start :: PassedArgs a -> Maybe TrackTime Source #
Get the start of the next event, if there is one.
This is similar to next
, except that it will be Nothing at the end of
the block.
prev_start :: PassedArgs a -> Maybe TrackTime Source #
Start time of the previous event.
prev_events :: PassedArgs a -> [Event.Event] Source #
next_events :: PassedArgs a -> [Event.Event] Source #
modify
set_duration :: TrackTime -> PassedArgs a -> PassedArgs a Source #
Modify the duration of the ctx_event. This is a hack, because calls run in TrackTime, instead of using Derive.place.
range
range :: PassedArgs a -> (TrackTime, TrackTime) Source #
Range of the called event, i.e. (min, max). Note that range is the minimum to maximum, which is not the same as the start and end if the event has negative duration.
real_range :: PassedArgs a -> Deriver (RealTime.RealTime, RealTime.RealTime) Source #
range_or_next :: PassedArgs a -> (TrackTime, TrackTime) Source #
range_or_note_end :: PassedArgs a -> Deriver (TrackTime, TrackTime) Source #
The current event's start and end times.
If the event has a duration, then use that. Otherwise, if there is
a EnvKey.note_end
, return that. Otherwise, return next
. However, if
there's an EnvKey.note_start
and it's past the event start, then this
event isn't contained within the range of its parent note, which means that
its expected note end has also passed. In that case, it returns
(note_start, note_start), which should cause the call to just emit its final
sample at the note-start, which will both get the correct value for the
event and not destroy the earlier track signal fragment.
extent :: PassedArgs a -> (TrackTime, TrackTime) Source #
Start and duration of the event. This is probably the right thing for calls that generate a note since it will give a negative duration when appropriate.
range_on_track :: PassedArgs a -> (TrackTime, TrackTime) Source #
Event range as it appears on the track, regardless of slicing.
normalized :: PassedArgs a -> Deriver b -> Deriver b Source #
This normalizes a deriver to start at 0 and have a duration of 1, provided that the deriver is placed at the start and dur of the given args. This is the case if the deriver is a transformer arg, so this is useful for a transformer to manipulate its argument.
normalized_start :: PassedArgs a -> Deriver b -> Deriver b Source #
Like normalized
, but only shifts start to 0.