How to use the musictheory.chord3.fromScale function in musictheory

To help you get started, we’ve selected a few musictheory examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joaoperfig / mikezart / source / mikezario.py View on Github external
def chordMenu(scale, path): # Request chord3 generation, return None if failed
    while True:
        print(path)
        print("Defining chord in scale: "+str(scale))
        print("Input list of 3 notes, separated by spaces")
        print("Input first note in chord")
        print("Rr - Generate")
        print("Tt - Generate With Restraints")
        print("Ii - Scale Info")
        print("Qq - Quit")
        inp = usrinp()
        if inp in "Rr":
            chord = musictheory.chord3.fromScale(scale)
            pianoprinter.octoPrint(chord._types)
            while True:
                print(str(chord)+", accept? Yy Nn")
                inp2 = usrinp()
                if inp2 in "Yy":
                    return chord
                elif inp2 in "Nn":
                    break
        elif inp in "Tt":
            print("Input restraint 1 (leave empty for NONE)")
            res1 = usrinp(True)
            if res1 == "":
                res1 = None
            print("Input restraint 2 (leave empty for NONE)")
            res2 = usrinp(True)
            if res2 == "":