Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() got an unexpected keyword argument 'mode' #2

Open
ekt1701 opened this issue Mar 12, 2017 · 3 comments
Open

TypeError: __init__() got an unexpected keyword argument 'mode' #2

ekt1701 opened this issue Mar 12, 2017 · 3 comments

Comments

@ekt1701
Copy link

ekt1701 commented Mar 12, 2017

Hello, when generator.py is run I get the following error:

Traceback (most recent call last): File "generator.py", line 193, in <module> main(sys.argv) File "generator.py", line 188, in main generate(data_fn, out_fn, N_epochs) File "generator.py", line 107, in generate chords, abstract_grammars = get_musical_data(data_fn) File "/Users/EKT2014/dlmusic/preprocess.py", line 130, in get_musical_data measures, chords = __parse_midi(data_fn) File "/Users/EKT2014/dlmusic/preprocess.py", line 37, in __parse_midi melody_voice.insert(0, key.KeySignature(sharps=1, mode='major')) TypeError: __init__() got an unexpected keyword argument 'mode'

I am on Mac OSX 10.11.6 Python 2.7

@F-Serra
Copy link

F-Serra commented Mar 12, 2017

Same here.
Deleting the mode='major' part fixed it.
The doc doesn't mention a second argument:
http://web.mit.edu/music21/doc/moduleReference/moduleKey.html#music21.key.KeySignature

@ekt1701
Copy link
Author

ekt1701 commented Mar 12, 2017

@F-Serra Thanks for the fix

@benwiz
Copy link

benwiz commented Apr 30, 2017

Alternative fix is to use key.Key() (http://web.mit.edu/music21/doc/moduleReference/moduleKey.html#music21.key.Key)

With optional second argument of mode.

melody_voice.insert(0, key.Key('G', 'major'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants