Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if inp2 in "Yy":
return chord
elif inp2 in "Nn":
break
elif inp2 in "Pp":
previewChord(chord)
elif inp in "Ii":
scaleInfo(scale)
elif inp in "Qq":
return None
else:
notenames = str.split(inp, " ")
notes = ()
for i in range(len(notenames)):
if len(notenames[i]) != 0:
notes = notes + (musictheory.mnote.fromName(notenames[i] + "0"),)
if len(notes) == 1:
for i in scale.getChords():
if i._types[0]._type == notes[0]._type:
chord = i
break
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 len(notes) == 3:
chord = musictheory.chord3(notes[0], notes[1], notes[2])