total newbie with music21 here.
I'm trying to use chordify(): http://web.mit.edu/music21/doc/usersGuide/usersGuide_09_chordify.html
How do you obtain a stream object (on which you can call chordify()) from a midi file?
I tried two approaches:
s = converter.parse(fn)
for el in s.recurse():
print '\n'
if 'Stream' in el.classes:
el.chordify() # NOT WORKING! throws error.
if 'Score' in el.classes:
el.chordify() # NOT WORKING EITHER! also throws error.
stream = c.parseFile(fn, format='.mid')
print stream # NOTHING! stream is None
Thanks in advance for telling me how I can get that stream object on which to call chordify(), from my midi file.
Your first answer was on the right track. After running
s = converter.parse(fn)
do
s2 = s.chordify()
Then you can call s2.show() or whatever you want.