def test_setenharmonic(self): F = FretBoardGtr() self.assertEqual( FretBoardGtr.setenharmonic(['A#', 'C', 'D', 'D#', 'F', 'G', 'A']), ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'A']) self.assertEqual( FretBoardGtr.setenharmonic([ "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#" ]), ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#']) self.assertEqual( FretBoardGtr.setenharmonic( ['F#', 'G#', 'A#', 'B', 'C#', 'D#', 'F']), ['Gb', 'Ab', 'Bb', 'Cb', 'Db', 'Eb', 'F'])
def __init__(self, *args, scale=['C', 'E', 'G'], root='C', enharmonic=False): FretBoardGtr.__init__(self) self.enharmonic = enharmonic try: if isinstance(args[0], ScaleFromName) or isinstance( args[0], ChordFromName): self.scale = args[0].results['scale'] self.root = args[0].results['root'] except: self.scale = scale self.root = root if enharmonic: self.enharmonic_scale = FretBoardGtr.setenharmonic(self.scale)