inheritance tree
Score.temporalElement
|
|
|
UniformMeasures
class definition
UniformMeasures is a silent timed element representing a constant meter of a score for the duration of the UniformMeasures. The parameter 'n' represents the number of measures. The parameter 'beatNumber' and 'beatDuration' represent the meter as in Measure. The further measure parameters and features (e.g. 'beats' and 'accents') are accessible by the same methods as in Measure. However, there is a difference between getDuration and getMeasureDuration: the first returns the duration of the whole UniformMeasures while the second the duration of a single measure.
The similar class MeasureSeq allows to represent a sequence of measures which differ in beatNumber or beatDuration. However, this makes the constraints for MeasureSeq less efficient then the constraints for UniformMeasures.
NB: The constraints defined for UniformMeasures required both BeatNr and BeatDuration to be determined.
See the Measures doc for more info.
class UniformMeasures (Inheritance-free)
feat !UniformMeasuresType label
attr beatDuration beatNumber measure n
- accentSyncopationR(B Start End)
B=1 <-> an event lasting from Start to End is a syncope at accent level: Start is not on an accent, and Start and End fall between different accents.
Note: if both Start or End are outside self then B = 0 (even though the respective event might be a syncope in other uniform measures instances).
BUG: B=0 for an event that is a syncope at accent level, but its duration is some multiple of the measure duration.
- beatSyncopationR(B Start End)
B=1 <-> an event lasting from Start to End is a syncope at beat level: Start is not on a beat, and Start and End fall between different beats.
Note: if both Start or End are outside self then B = 0 (even though the respective event might be a syncope in other uniform measures instances).
- getAccentInMeasureAt(I Time)
I is the index of the accent at Time (one-based). Accents are only counted within individual measures (the first accent in the 2nd measure is again index 1). If Time is between accents then the index of the accent before Time is returned.
If Time is outside the boundaries of self, then I = 0.
Method delayed until measure duration is determined (i.e. both beatNumber and beatDuration are determined).
- getAccents(X)
- getAccentsFS(X)
- getBeatAt(I Time)
I is the index of the beat at Time (one-based). Beats are counted across all measures in self. If Time is between beats then the index of the last beat before is returned.
If Time is outside the boundaries of self, then I = 0.
- getBeatDuration(X)
- getBeatDurationParameter(X)
- getBeatInMeasureAt(I Time)
I is the index of the beat at Time (one-based). Beats are only counted within individual measures (the first beat in the 2nd measure is again index 1). If Time is between beats then the index of the beat before Time is returned.
Constraint blocks until beatNumber is determined.
If Time is outside the boundaries of self, then I = 0.
- getBeatNumber(X)
- getBeatNumberParameter(X)
- getBeats(X)
- getBeatsFS(X)
- getInitInfo($ ...)
- getMeasureAt(I Time)
I is the index of the measure at Time (one-based). A measure starts at its start time and ends before its end time. For instance, the index for the first measure is 1, starting at Time 0. Measure 2 starts at MeasureDuration. I and Time are FD integers.
If Time is outside the boundaries of self, then I = 0.
- getMeasureDuration(X)
Returns the duration of a single measure. The duration of the whole UniformMeasures is returned by getDuration.
- getMeasureDurationParameter(X)
- getN(X)
- getNParameter(X)
- init(beatDuration:BeatDuration beatNumber:BeatNr n:N ...)
... Further init arguments: accentIdxDB (see Measure) ...
If the args n, beatNumber, or beatDuration are left unset, you must set them later with their respective accessor methods.
- measureSyncopationR(B Start End)
Same as overlapsBarlineR
- onAccentR(B Time)
B=1 <-> Time equals some strong beat in some measure in UniformMeasures. Time is FD int, B is implicitly constrained to 0/1-int.
NB: Constraint blocks until both beatNumber and beatDuration are determined.
NB: method does not take n into account -- to limit truth value B to the actual time span within start and end time of UniformMeasures add necessary constraints outside of this method.
- onBeatDR(B Time)
Variant of onBeatR which does domain propagation (which can be very expensive). However, propagation of Time does only happen after B got determined.
- onBeatR(B Time)
Variant of onAccentR which does domain propagation (which can be very expensive). However, propagation of Time does only happen after B got determined.
!!?? constraint suspends and performs OK if it first calls {Browse Time}?
BUGGY -- see comments in alternative implementation in onAccentR
*/
meth onAccentDR(B Time)
AccentDur = {FD.decl}
RelTime = {FD.decl}
in
AccentDur = {FD.minusD {Nth {self getAccents($)} 2} {self getAccents($)}.1}
RelTime = {FD.modD Time AccentDur}
B = {FD.int 0#1}
B =: (RelTime =: 0)
end
/** %% B=1 <-> Time equals some beat of some measure in UniformMeasures. For instance, in case beat note value is halve note, that B=1 means that Time is on a halve-note onset or on a strong quarter-note onset.
Time is FD int, B is implicitly constrained to 0/1-int.
NB: method does not take n into account -- to limit truth value B to the actual time span within start and end time of UniformMeasures add necessary constraints outside of this method.
- onMeasureStartDR(B Time)
Variant of onMeasureStartR which does domain propagation (which can be very expensive). However, propagation of Time does only happen after B got determined.
!!?? constraint suspends and performs OK if it first calls {Browse Time}?
- onMeasureStartR(B Time)
B=1 <-> Time equals the start time of some measure in UniformMeasures. Time is FD int, B is implicitly constrained to 0/1-int.
NB: blocks until Time is known to be at least size of start time of self.
NB: Constraint blocks until both beatNumber and beatDuration are determined.
NB: method does not take n into account -- to limit truth value B to the actual time span within start and end time of UniformMeasures add necessary constraints outside of this method.
- overlapsBarlineR(B Start End)
B=1 <-> an event lasting from Start to End is a syncope at measure level: Start and End fall in different measures (either within self or beyond).
Note: if both Start and End are outside self then B = 0 (even though the respective event might be a syncope at measure level for other uniform measures instances).
end