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

Check Chord duration creation #1382

Closed
mscuthbert opened this issue Aug 15, 2022 · 1 comment · Fixed by #1691
Closed

Check Chord duration creation #1382

mscuthbert opened this issue Aug 15, 2022 · 1 comment · Fixed by #1691

Comments

@mscuthbert
Copy link
Member

music21 version

8alpha

Problem summary

Check whether the duration code in ChordBase can be simplified:

        super().__init__(**keywords)

        # inherit Duration object from GeneralNote
        # keep it here in case we have no notes
        durationKeyword = None
        if 'duration' in keywords:
            durationKeyword = keywords['duration']

        durationKeyword = self._add_core_or_init(notes, useDuration=durationKeyword)

        if durationKeyword is not None:
            self.duration = durationKeyword
        elif 'type' in keywords or 'quarterLength' in keywords:  # dots dont cut it
            self.duration = Duration(**keywords)

it seems like all this information already is handled in Music21Object

@mscuthbert
Copy link
Member Author

except the self._add_core_or_init line

mscuthbert added a commit that referenced this issue Apr 25, 2024
Fix #1382: Simplify ChordBase duration creation
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

Successfully merging a pull request may close this issue.

1 participant