inheritance tree
TimeMixin
class definition
[abstract class] The TimeMixin adds several timing attributes and methods to its subclasses.
The attributes startTime and endTime are absolute TimePoints. The attribute offsetTime is a relative TimeInterval to the startTime of the TemporalAspect an Item is contained in. The attribute duration is the TimeInterval difference of startTime and endTime.
The TimeUnit specifies what the numeric values for the TimeMixin attributes actually mean. The TimeUnit either specifies an absolute value (e.g. seconds) or a relative value (e.g. beats). The meaning of beat depends on the output definition, for instance, for the Lilypond output a beat is a quarter note. Currently, possible values are 'seconds' (or 'secs'), 'milliseconds' (or 'msecs'), 'beats', or beats(N), where N means number of ticks (i.e. the integer range) within a beat. For example, if the TimeUnit = beats(4) and a beat corresponds to a quarter note, then a note of duration 1 corresponds to a sixteenth note. beats is equivalent with beats(1). The meaning of a beat for sound output can be specified by the tempo (see Init.setBeatDuration, Init.setTempo etc.)
NB: to avoid confusion, the time units of all temporal items in the score are unified when a Strasheela score is initialised.
NB: A negative offsetTime value is not possible if the offsetTime is a FD integer (which presently is the only option). For the other temporal parameters, a negative value does not make sense anyway.
class TimeMixin (Inheritance-free)
feat label
attr duration endTime offsetTime startTime
- constrainTiming()
After full creation of score hierarchy, method must be called with every TimeMixin subclass instance in score to init the timing attributes/features
- findSimultaneousItem(X cTest:CTest test:Test toplevel:Top)
[Deterministic method] Returns the first score object found which is simultaneous to self and fulfilling the optional boolean function or method test.
If a toplevel Top (a temporal container) is given, then only within that container is searched for simultaneous items to self. Otherwise the temporal top-level of self is searched (i.e. usually the whole score).
The implementation uses LUtils.cFind and the reified constraints method isSimultaneousItemR. X is return as soon as the score contains enough information to tell for any score object that it is simultaneous to self (i.e. rhythmic structure of the whole score must not necessarily be fully determined).
NB: Test must be a deterministic function/method which does not block (e.g., checks on score object types or their position in the score topology are OK) and which is used for pre-filtering score objects. The argument cTest has the same format (optional Boolean function or method), but it is applied within the concurrent filtering of LUtils.cFilter, together with isSimultaneousItemR. Computationally very expensive tests and in particular tests which can block are better handed to cTest.
- getDuration(X)
- getDurationInBeats(X)
- getDurationInSeconds($)
- getDurationParameter(X)
- getEndTime(X)
- getEndTimeInBeats(X)
- getEndTimeInSeconds(X)
- getEndTimeParameter(X)
- getOffsetTime(X)
- getOffsetTimeInBeats(X)
- getOffsetTimeInSeconds(X)
- getOffsetTimeParameter(X)
- getSimultaneousItems(?Xs cTest:CTest test:Test toplevel:Top)
[Deterministic method] Returns list of score items simultaneous to self and fulfilling the optional Boolean function or method test.
If a toplevel Top (a temporal container) is given, then only within that container is searched for simultaneous items to self. Otherwise the temporal top-level of self is searched (i.e. usually the whole score).
See the documentation of GetItemsInTimeframe for further details (e.g., on the argument cTest).
- getSimultaneousItemsOffset(Xs Offset cTest:CTest test:Test toplevel:Top)
[Deterministic method] Generalised version of getSimultaneousItems where the offset time Offset (FD int) is taken into account. See the doc of InTimeframeOffsetR for the meaning of the Offset.
- getStartTime(X)
- getStartTimeInBeats(X)
- getStartTimeInSeconds(X)
- getStartTimeParameter(X)
- getTimeUnit(X)
- hasAbsoluteTimeUnit(B)
Returns true if the timeUnit is either seconds or milliseconds, and false otherwise.
- initTiming(duration:Duration endTime:EndTime offsetTime:OffsetTime startTime:StartTime timeUnit:TimeUnit)
[aux method] Method must not be called by user.
- isExactlySimultaneousItemR(?B X)
[0/1 Constraint] Returns 0/1-integer whether self and X are exactly simultaneous in time (i.e. start and end at the same time).
This relation defines the Allen's Interval Algebra relation equal.
- isSimultaneousItem(?B X)
[Deterministic method] Returns boolean whether self and X are simultaneous in time.
This relation defines a conjunction of the following Allen's Interval Algebra relations: overlaps, starts, during, finishes and equal; only meets and before/after are excluded.
- isSimultaneousItemOffset(B X Offset)
[Deterministic method] Generalised version of isSimultaneousItem where the offset time Offset is taken into account (see InTimeframeOffset).
- isSimultaneousItemOffsetR(B X Offset)
[0/1 Constraint] Generalised version of isSimultaneousItemR where the offset time Offset is taken into account.
- isSimultaneousItemR(?B X)
[0/1 Constraint] Returns 0/1-integer whether self and X are simultaneous in time (i.e. somehow overlap in time).
This relation defines a conjunction of the following Allen's Interval Algebra relations: overlaps, starts, during, finishes and equal; only meets and before/after are excluded.
end