def test_reduce_to_tetrads(self): true_red_wo_bass = chords(['N', 'A:min', 'A:min7', 'F:dim', 'F:maj', 'C:maj', 'G:maj7', 'G:aug']) reduced_wo_bass = reduce_to_tetrads(self.det['chord'], keep_bass=False) self.assertTrue((reduced_wo_bass == true_red_wo_bass).all()) reduced_w_bass = reduce_to_tetrads(self.det['chord'], keep_bass=True) self.assertTrue((reduced_w_bass == self.det['chord']).all()) # test some further mappings src = chords(['A:maj9', 'Cb:9', 'E:min9/9', 'E:min9/b7']) trg = chords(['A:maj7', 'Cb:7', 'E:min7', 'E:min7/b7']) self.assertTrue((reduce_to_tetrads(src, keep_bass=True) == trg).all())
def test_reduce_to_tetrads(self): true_red_wo_bass = chords([ 'N', 'A:min', 'A:min7', 'F:dim', 'F:maj', 'C:maj', 'G:maj7', 'G:aug' ]) reduced_wo_bass = reduce_to_tetrads(self.det['chord'], keep_bass=False) self.assertTrue((reduced_wo_bass == true_red_wo_bass).all()) reduced_w_bass = reduce_to_tetrads(self.det['chord'], keep_bass=True) self.assertTrue((reduced_w_bass == self.det['chord']).all()) # test some further mappings src = chords(['A:maj9', 'Cb:9', 'E:min9/9', 'E:min9/b7']) trg = chords(['A:maj7', 'Cb:7', 'E:min7', 'E:min7/b7']) self.assertTrue((reduce_to_tetrads(src, keep_bass=True) == trg).all())
def test_reduce_to_triads(self): true_red_wo_bass = chords(['N', 'A:min', 'A:min', 'F:dim', 'F:maj', 'C:maj', 'G:maj', 'G:aug']) reduced_wo_bass = reduce_to_triads(self.det['chord'], keep_bass=False) self.assertTrue((reduced_wo_bass == true_red_wo_bass).all()) true_red_w_bass = chords(['N', 'A:min', 'A:min', 'F:dim', 'F:maj', 'C:maj/3', 'G:maj', 'G:aug']) reduced_w_bass = reduce_to_triads(self.det['chord'], keep_bass=True) self.assertTrue((reduced_w_bass == true_red_w_bass).all()) # test some further mappings src = chords(['A:hdim7', 'B:min6/5', 'C:sus4/4', 'G:(1,5,b7)']) trg = chords(['A:dim', 'B:min/5', 'C:sus4/4', 'G:(1,5)']) self.assertTrue((reduce_to_triads(src, keep_bass=True) == trg).all())
def test_reduce_to_triads(self): true_red_wo_bass = chords([ 'N', 'A:min', 'A:min', 'F:dim', 'F:maj', 'C:maj', 'G:maj', 'G:aug' ]) reduced_wo_bass = reduce_to_triads(self.det['chord'], keep_bass=False) self.assertTrue((reduced_wo_bass == true_red_wo_bass).all()) true_red_w_bass = chords([ 'N', 'A:min', 'A:min', 'F:dim', 'F:maj', 'C:maj/3', 'G:maj', 'G:aug' ]) reduced_w_bass = reduce_to_triads(self.det['chord'], keep_bass=True) self.assertTrue((reduced_w_bass == true_red_w_bass).all()) # test some further mappings src = chords(['A:hdim7', 'B:min6/5', 'C:sus4/4', 'G:(1,5,b7)']) trg = chords(['A:dim', 'B:min/5', 'C:sus4/4', 'G:(1,5)']) self.assertTrue((reduce_to_triads(src, keep_bass=True) == trg).all())
def test_chords(self): # test whether the chords() function creates a proper array of # chords labels = ['F', 'C:maj', 'D:(1,b3,5)', 'Bb:maj7'] for lbl, crd in zip(labels, chords(labels)): self.assertChordEqual(chord(lbl), crd)