Exemplo n.º 1
0
 def __init__(
     self,
     quality_string='major',
     extent='triad',
     inversion='root',
     ):
     if extent in ('triad', 5):
         intervals = self._initialize_triad(quality_string)
     elif extent in ('seventh', 7):
         intervals = self._initialize_seventh(quality_string)
     elif extent in ('ninth', 9):
         intervals = self._initialize_ninth(quality_string)
     elif extent in ('augmented sixth', 6):
         intervals = self._initialize_augmented_sixth(quality_string)
     else:
         message = 'unknown chord quality arguments.'
         raise ValueError(message)
     intervals, rotation = self._invert_chord_quality(
         intervals, inversion)
     IntervalSegment.__init__(
         self,
         items=intervals,
         item_class=pitchtools.NamedInterval,
         )
     self._quality_string = quality_string
     self._rotation = rotation
Exemplo n.º 2
0
 def __init__(self, quality_string, extent='triad', inversion='root'):
     if extent in ('triad', 5):
         intervals = self._init_triad(quality_string)
     elif extent in ('seventh', 7):
         intervals = self._init_seventh(quality_string)
     elif extent in ('ninth', 9):
         intervals = self._init_ninth(quality_string)
     elif extent in ('augmented sixth', 6):
         intervals = self._init_augmented_sixth(quality_string)
     else:
         raise ValueError('unknown chord quality indicator arguments.')
     intervals, rotation = self._invert_quality_indicator(
         intervals, inversion)
     IntervalSegment.__init__(
         self,
         tokens=intervals,
         item_class=pitchtools.NamedInterval,
         )
     self._quality_string = quality_string
     self._rotation = rotation
Exemplo n.º 3
0
def test_pitchtools_IntervalSegment_spread_01():
    mcis = IntervalSegment([1, 2, -3, 1, -2, 1])
    assert mcis.spread == NumberedInterval(4)