Skip to content

Having trouble muspy.metrics  #72

@hyeshinchu

Description

@hyeshinchu

Hi,

I have a question about using muspy.metrics.
I'm trying to check pitch_range using the metrics, but having an AttirbuteError.

I defined the music I want to check,

music1 = ('./unconditional_4.mid')

and typed the line as below,

muspy.pitch_range(music1)

but I got an error message.

AttributeError: 'str' object has no attribute 'tracks'

AttributeError Traceback (most recent call last)
/tmp/ipykernel_3330136/2725394534.py in
----> 1 muspy.pitch_range(music1)

~/.conda/envs/muspy/lib/python3.8/site-packages/muspy/metrics/metrics.py in pitch_range(music)
91
92 """
---> 93 if not music.tracks:
94 return 0
95 if not any(len(track.notes) > 0 for track in music.tracks):

AttributeError: 'str' object has no attribute 'tracks'

Any advice would be appreciated!
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions