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
Blank staff in wizard (fix #1139) #1605
base: master
Are you sure you want to change the base?
Conversation
frescobaldi_app/scorewiz/build.py
Outdated
num = self.scoreProperties.blankStaff.value() | ||
if num: | ||
ly.dom.Text(r"\repeat unfold {num} {{ s1 \break }}".format(num=num), s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not proud of this part... If there is a better way to do it, please enlighten me !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't python-ly have dom elements for repeats and such? (I didn't look into this yet.)
The s1
needs to depend on the time signature...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the time signature and \partial
into account. I did not find anything in the dom code about repeats. Nothing about rests either.
Is the purpose to get a blank staff as final score (e.g., to print staves to handwrite on), or to start with a score that already has some staves to get a first idea of the layout? If the latter, perhaps spelling out |
To be honest I just picked an issue with a If it's the second one, I think the biggest problem is the |
I just noticed that it doesn't work well with the |
|
||
# Partial makes its own line | ||
if self.scoreProperties.pickup.currentIndex() > 0: | ||
partial_dur, partial_dots = scoreproperties.partialDurations[self.scoreProperties.pickup.currentIndex() - 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a cleaner way to get this value, or is it fine like this ?
|
||
if num_blank: | ||
# Compute duration for whole measure | ||
sig = self.scoreProperties.timeSignature.currentText().strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, is there a cleaner way to get this value, or is it fine like this ?
partial_dur, partial_dots = scoreproperties.partialDurations[self.scoreProperties.pickup.currentIndex() - 1] | ||
num_blank -= 1 | ||
duration_ly = ly.duration.tostring(partial_dur, partial_dots) | ||
ly.dom.Text("s{duration}".format(duration=duration_ly), s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found nothing about rests in ly.dom
factor = duration_frac.numerator | ||
duration_ly = ly.duration.tostring(int(math.log2(duration)), dots, factor) | ||
|
||
ly.dom.Text(r"\repeat unfold {num} {{ s{duration} \break }}".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found nothing about rests nor repeat in ly.dom
I skimmed this patch and found no obvious issues, although I don't feel very competent on this. Maybe @PeterBjuhr or @dliessi wants to comment? |
preview.examplify(doc) | ||
if not builder.scoreProperties.blankStaff.value(): | ||
# Add some music when blank staff are not configured | ||
preview.examplify(doc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: isn't it possible to exemplify a blank staff?
@@ -290,6 +293,26 @@ def lySimpleMidiTempo(self, node): | |||
val = self.metronomeValue.currentText() or '60' | |||
return ly.dom.Tempo(dur, val, node) | |||
|
|||
# Blank staff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Since blank staff is included in the function names the comment is unneeded
Hi,
This PR adds a new option in the score wizard to create blank staff with the given configuration.
Fixes #1139
It generates this kind of code :