inheritance tree
Score.abstractElement
|
|
|
Interval
class definition
The class Interval is a data structure for representing the interval, for example, between the pitches of two note objects. Various information on the interval is provided including the absolute pitch distance, its direction, its pitch class, and the fitting value of various additional features defined in the interval database (e.g., its dissonance degree). Like the other classes of Strasheela's harmony model, the interval class supports microtonal music based on freely defined equidistant subdivisions of the octave (e.g., 72 pitches per octave or pitches measured in cent, set in the DB as pitchesPerOctave).
The class Interval defines the following parameters. The distance is the absolute distance between two pitches (e.g. 13 is a minor ninth for PitchesPerOctave=12). The parameter direction denotes the direction of the interval: 'upwards' is represented by 2, unison by 1, and an interval 'downwards' by 0 (cf. Pattern.direction). The parameter pitchClass expresses the interval's pitch class, and the parameter octave the number of octaves added to the pitch class to reach the interval's distance (e.g. if the distance is 13, then the pitchClass is 1 and the octave is 1). Finally, the parameter index is the position of the interval's pitch class in the respective interval database (this parameter corresponds to the index parameter of the classes Chord and Scale).
The class Interval allows the user to access and constrain further interval-specific properties. Besides the compulsary interval database feature interval, the user can define arbitrary further attributes in each database entry (see DB.setDB). For example, the default interval database includes the feature dissonanceDegree.
The init argument dbFeatures allows to accociates self with further FD/FS variables. These variables are constrained to the values at the respective feature of an database entry at the position of self's index. The database features to be used are 'announced' by the init method argument dbFeatures, which expects a list of atoms denoting the database features to include.
Let us assume that the database defines the feature dissonanceDegree for each interval in the database. This feature is 'announced' to self with the init argument init(dbFeatures:[dissonanceDegree] ...). The dissonance degree of self is then accessible -- and further constrainable -- by {self getDBFeature($ dissonanceDegree)}.
Please note that only interval values defined in the interval database are permitted as pitch class values. For example, if you use an Interval object to express the interval between two specific notes and your interval DB does not specify an interval 7 (a fifth if PitchesPerOctave=12), then the interval between the two note pitches is implicitly constrained not to be a fifth.
NB: The class Interval inherits from Score.abstractElement -- in contrast to the classes Chord and Scale which inherit (indirectly) from Score.temporalElement. Consequently, an interval does _not_ have associated temporal information such as a start time and can thus not be output, for example, in a Lilypond score -- in contrast to instances of the classes Chord and Scale).
class Interval (Inheritance-free)
feat !IntervalType label
attr dbFeatures direction distance index octave pitchClass
- getDB(X)
The interval database is defined by DB.setDB. getDB returns the internal representation of this database (see the DB.setDB for more details).
- getDBFeature(X Feat)
Returns the value (FD int or FS) of the additional feature Feat.
- getDBFeatures(X)
Returns a record with the additional features defined in the database and 'announced' to self with the init argument dbFeatures.
- getDirection($)
- getDirectionParameter($)
- getDistance($)
- getDistanceParameter($)
- getIndex(X)
- getIndexParameter(X)
- getInitInfo($ ...)
- getOctave($)
- getOctaveParameter($)
- getPitchClass($)
- getPitchClassParameter($)
- init(dbFeatures:DBFeats direction:Dir distance:Dist index:Index octave:Oct pitchClass:PC ...)
end