How to use the musictheory.chChWeights 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
inp = usrinp()
        if inp in "Dd":
            print("Requesting id in range [0-"+str(progsize-1)+"]")
            cid = idMenu()
            if cid in range(progsize):
                print("Defining chord "+str(cid))
                chord = chordMenu(pal._scale, path + " > Chord"+str(cid))
                if chord != None:
                    print("Chord defined!")
                    prog[cid] = chord
            else:
                print("Invalid id: " + str(cid))
        elif inp in "Vv":
            prog = list(pal._scale.makeProg(progsize, musictheory.n1ChWeights()[0], musictheory.n1ChWeights()[1]))
        elif inp in "Cc":
            prog = list(pal._scale.makeProg(progsize, musictheory.chChWeights()[0], musictheory.chChWeights()[1])) 
        elif inp in "Gg":
            w0 = customWeightMenu(("short", "normal", "large"))
            if w0 != None:
                w1 = customWeightMenu(("minor", "weird", "major"))
                if w1 != None:
                    prog = list(pal._scale.makeProg(progsize, w0, w1))
        elif inp in "Ss":
            for c in prog:
                if c == "":
                    pianoprinter.octoPrint([])
                else:
                    pianoprinter.octoPrint(c._types)
        elif inp in "Pp":
            previewProg(prog)
        elif inp in "Ii":
            scaleInfo(pal._scale)