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

issue #1603 - key signature on non-treble stave, no glyph #1606

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

AaronDavidNewman
Copy link
Collaborator

Prior to this fix, there was no way to show a key signature correctly in a bass clef stave, without the clef glyph (and any other non-treble). I added a test case and created a stave.addClefLines(clefSpec: string) method that adds the logical clef (e.g. the lines match the clef) but without the glyph.

None of our test cases had clef with non-default clef (e.g. bass) and a key signature, without the clef symbol displayed.  I added a test case and created a 'addClefLines' that adds the logical clef (e.g. the lines match the clef) but without the glyph.
Copy link
Collaborator

@rvilarl rvilarl left a comment

Choose a reason for hiding this comment

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

I have done some minor comments. They are not must do.

src/stave.ts Outdated

/**
* treat the stave as if the clef is clefSpec, but don't display the clef
* @param clefSpec
Copy link
Collaborator

Choose a reason for hiding this comment

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

@param is no longer needed.

@@ -443,7 +443,14 @@ export class Stave extends Element {
}
return this;
}

/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please leave a space before and after the function.

function clefKeySignature(options: TestOptions): void {
const f = VexFlowTests.makeFactory(options, 900);

// The previous code was buggy: f.Stave(10, 10, 800), even though Factory.Stave() only accepts 1 argument.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove comment.

f.KeySigNote({ key: 'Bb' }),
f.StaveNote({ keys: ['c/4'], duration: '1', clef: 'bass' }),
f.BarNote(),
f.KeySigNote({ key: 'D', alterKey: ['b', 'n'] }), // TODO: alterKey needs to be a string[]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove comment.

f.draw();

options.assert.ok(true, 'all pass');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a line after the function.

@rvilarl
Copy link
Collaborator

rvilarl commented Jan 5, 2024

@AaronDavidNewman Thanks for the PR, let me know if you prefer to do the changes or just to let it and merge. Also, would you like to do the same PR in Vexflow 5 or should I do it?

@rvilarl rvilarl linked an issue Jan 5, 2024 that may be closed by this pull request
@ronyeh
Copy link
Collaborator

ronyeh commented Jan 6, 2024

After the merge, you can try to cherry pick the commit and apply it to the V5 repo (assuming the modified file isn't substantially different). That way the authorship is preserved, I believe. (Or Aaron can submit the V5 PR himself.)

@AaronDavidNewman
Copy link
Collaborator Author

I updated based on comments and I'll merge it in. I'll look at vex5 soon and submit a PR.

@AaronDavidNewman AaronDavidNewman merged commit 8ddc8fa into 0xfe:master Jan 6, 2024
2 checks passed
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.

stave.addKeySignature for bass clef without visible bass symbol
3 participants