new GenericInterval(gi)
Represents an interval such as unison, second, etc.
Properties are demonstrated below.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
gi |
Int |
<optional> |
1 | generic interval (1 or higher, or -2 or lower) |
- Source:
Example
var gi = new music21.interval.GenericInterval(-14) gi.value // -14 gi.directed // -14 gi.undirected // 14 gi.direction == music21.interval.Direction.DESCENDING // true gi.isSkip // true gi.isStep // false gi.isDiatonicStep // false // augmented unisons are not diatonicSteps but can't tell yet.. gi.isUnison // false gi.simpledDirected // -7 gi.simpleUndirected // 7 gi.undirectedOctaves // 1 gi.semiSimpleUndirected // 7 -- semiSimple distinguishes between 8 and 1; that's all gi.semiSimpleDirected // 7 -- semiSimple distinguishes between 8 and 1; that's all gi.perfectable // false gi.niceName // "Fourteenth" gi.directedNiceName // "Descending Fourteenth" gi.simpleNiceName // "Seventh" gi.staffDistance // -13 gi.mod7inversion // 2 // sevenths invert to seconds
Methods
-
<static> GenericInterval#complement() → {music21.interval.GenericInterval}
-
Returns a new GenericInterval which is the mod7inversion; 3rds (and 10ths etc.) to 6ths, etc.
- Source:
Returns:
-
<static> GenericInterval#getDiatonic(specifier) → {music21.interval.DiatonicInterval}
-
Given a specifier, return a new DiatonicInterval with this generic.
Parameters:
Name Type Description specifierstring | Int a specifier such as "P","m","M","A","dd" etc.
- Source:
Returns:
-
<static> GenericInterval#reverse() → {music21.interval.GenericInterval}
-
Returns a new GenericInterval which has the opposite direction (descending becomes ascending, etc.)
- Source:
Returns:
-
<static> GenericInterval#transposePitch(p) → {music21.pitch.Pitch}
-
Transpose a pitch by this generic interval, maintaining accidentals
Parameters:
Name Type Description pmusic21.pitch.Pitch - Source:
Returns:
- Type
- music21.pitch.Pitch