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

Delete 'channel' and 'velocity' attributes of 'Note' class. #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Delete 'channel' and 'velocity' attributes of 'Note' class. #55

wants to merge 1 commit into from

Conversation

ZimingYuan
Copy link

In the function "play_Note" of class "Sequencer" :

    def play_Note(self, note, channel=1, velocity=100):
        if hasattr(note, "velocity"):
            velocity = note.velocity
        if hasattr(note, "channel"):
            channel = note.channel

The code checks "velocity" and "channel" attributes. In original code the "Note" class has these two attributes in default, so above two condition clauses will pass any time, making you unable to control which channel to play through the function parameter. Deleting these two attributes makes them only exist after calling "Note.set_channel" method.

@edudobay
Copy link
Collaborator

edudobay commented May 9, 2020

Thank you for the contribution and sorry for the delay! This seems indeed wrong in the original code and your commit seems to fix it. However there are some other issues with channel and velocity that I think should be fixed along with this. I'll be investigating these on the next few days and will reply here when I have an answer.

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 this pull request may close these issues.

2 participants