PastaSource / Musinator

Generates random lyrics from a given TXT file, and a chord progression in a randomly chosen key.
0 stars 0 forks source link

Rare error when running Generator.py #20

Open PastaSource opened 2 years ago

PastaSource commented 2 years ago

Out of all the times I've tried this, it only occurred once. PS C:\Users\aaron\Documents\GitHUb\Musinator> python .\Generator.py -u 1 -l 20 Traceback (most recent call last): File "C:\Users\aaron\Documents\GitHUb\Musinator\Generator.py", line 250, in <module> main(sys.argv) File "C:\Users\aaron\Documents\GitHUb\Musinator\Generator.py", line 217, in main generations += formatting("input.txt", int(lyric_upperrange), int(chord_upperrange), int(uncommon_chords), File "C:\Users\aaron\Documents\GitHUb\Musinator\Generator.py", line 151, in formatting items = chordgenerator(chordupperrange, frequency, complexity) File "C:\Users\aaron\Documents\GitHUb\Musinator\Generator.py", line 115, in chordgenerator chord = chords[random.randrange(0, len(chords))] UnboundLocalError: local variable 'chords' referenced before assignment I doubt the option I used for the code contributed to the error.