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

Fixes index error for staffs and removes invalid last note #8

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

Conversation

lars-erik
Copy link

I just had a play with this. Sadly the sheet I attempted to read probably have too low resolution, including three-note chords, so the result was a total catastrophe. 🤣 (Happy to provide outputs, but won't post IP here)

In any case, I thought I'd just PR these two changes I had to make for it to go through the whole process.

I'll be moving on to other libraries to see if I can use my crappy source material, but good luck with this one! Will be looking for updates for sure! 👍

@@ -189,7 +189,7 @@ def open_file(path):
note_group = []
i = 0; j = 0;
while(i < len(staff_notes)):
if (staff_notes[i].rec.x > staffs[j].x and j < len(staffs)):
if (j < len(staffs) and staff_notes[i].rec.x > staffs[j].x):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got index out of range, so moved the index check first.

@@ -240,7 +240,7 @@ def open_file(path):
midi.addNote(track,channel,pitch,time,duration,volume)
time += duration

midi.addNote(track,channel,pitch,time,4,0)
# midi.addNote(track,channel,pitch,time,4,0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got pitch undefined here

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