Exemplo n.º 1
0
    def testHarmonyC(self):
        from music21 import harmony

        h = harmony.ChordSymbol()
        h.root('E-')
        h.bass('B-')
        h.inversion(2, transposeOnSet=False)
        #h.romanNumeral = 'I64'
        h.chordKind = 'major'
        h.chordKindStr = 'M'

        hd = harmony.ChordStepModification()
        hd.modType = 'alter'
        hd.interval = -1
        hd.degree = 3
        h.addChordStepModification(hd)

        s = stream.Stream()
        s.append(h)
        #s.show()
        raw = fromMusic21Object(s)
        self.assertEqual(raw.find('<root-alter>-1</root-alter>') > 0, True)
        self.assertEqual(raw.find('<degree-value>3</degree-value>') > 0, True)
        self.assertEqual(
            raw.find('<degree-type>alter</degree-type>') > 0, True)
Exemplo n.º 2
0
def writeSharpEleven(MyMeasure, RootNote, Duration, Kind):
    MySymbol = harmony.ChordSymbol(root=RootNote, bass=RootNote, kind=Kind)
    MySymbol.duration = Duration
    hd = harmony.ChordStepModification()
    hd.type = 'add'
    hd.interval = 1
    hd.degree = 11
    MySymbol.addChordStepModification(hd)
    MyMeasure.append(MySymbol)
    return (MySymbol)