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

Migrate VexTab to VexFlow 4.0.0. #137

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

Migrate VexTab to VexFlow 4.0.0. #137

wants to merge 1 commit into from

Conversation

ronyeh
Copy link

@ronyeh ronyeh commented Nov 6, 2021

This patch makes VexTab compatible with the VexFlow 4.0.0-alpha at:

https://github.com/ronyeh/vexflow/tree/4.0.0-alpha

@@ -625,7 +625,7 @@ class Artist
fingerings = @makeFingering(annotations[i])
if fingerings?
try
(note.addModifier(fingering.num, fingering.modifier) for fingering in fingerings)
(note.addModifier(fingering.modifier, fingering.num) for fingering in fingerings)
Copy link
Author

Choose a reason for hiding this comment

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

Possible bug fix? Or did an old version of VexFlow have the arguments reversed? Anyways, it was throwing an exception so I switched the two arguments.

@@ -44,7 +44,7 @@ class VexTab
notation_option = option
throw error("'#{option.key}' must be 'true' or 'false'") if option.value not in ["true", "false"]
when "key"
throw error("Invalid key signature '#{option.value}'") unless _.has(Vex.Flow.keySignature.keySpecs, option.value)
throw error("Invalid key signature '#{option.value}'") unless Vex.Flow.hasKeySignature(option.value)
Copy link
Author

Choose a reason for hiding this comment

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

It seemed cleaner to have a method called hasKeySignature(), so I added it to VexFlow.

@@ -197,7 +197,7 @@ class VexTabTests

# KEY SIGNATURE TESTS

for key of Vex.Flow.keySignature.keySpecs
for key of Vex.Flow.getKeySignatures()
Copy link
Author

Choose a reason for hiding this comment

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

Similarly, I added a getter here instead of allowing client code to reach into the internals of VexFlow.

@ronyeh
Copy link
Author

ronyeh commented Nov 6, 2021

This is the commit that added some backwards compatibility and some new methods to VexFlow, to support this migration.

ronyeh/vexflow@e5747ba

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.

1 participant