-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add worex tool to add melismatic word extenders #67
base: master
Are you sure you want to change the base?
Add worex tool to add melismatic word extenders #67
Conversation
Would this tool do anything other than add/remove the underline? What to call the tool and what it does would influence how the options are named as well. Perhaps a better name that "underline" could be used. More precise would be "word extender" since it is a line that follows the ending syllable of a word. Perhaps it is better to not call it an "underline" since that typically means to underline words in standard text. And in addition, the word extension line is sometimes centered like dashes rather than on the more typical baseline position (which is itself higher than standard prose "underlines" which would be placed below the baseline). In that case the tool could be called For example There are a couple of corner cases to consider, the main one being: should the extension line extend across rests. In general I think so. There is a difficult corner case to consider: Suppose that you have multiple sections to the music, such as three verse lines at the start of the music, two in the middle and three again at the end of the music. If the end of the third verse in the first section ends in a melisma, you would want the word extender to stop at the last note of the first section, and not continue throughout the entire middle section. In such cases, there could be a maximum size rest (such as a full measure rest) that would prevent the word extender from continuing. This last case is what annoys me. There is a semi-official character that I use to stop word extenders explicitly for such cases (@jacekiwaszko1 can remind me what that character is, as he suggested it). Maybe the Another related interpretation that could be implemented is |
My idea was that something like the
Does it really happen in music that after a rest there are no new syllables? What text should the singer sing in this case? So I thinks it's not wrong to simply extend the word until the next syllables occurs in the lyrics. One question would be if the extender line should stop under a rest and start again after it but I don't think this is necessary.
Okay this would be good to know. So currently this character is encoded in some scores so far but not implemented intro humdrum/verovio? The only solution I could come up with is using
What do you mean by section,
Okay. But the
This would be implemented directly into verovio and there is no need for an additional tool, isn't it? |
Here is more of what I was thinking of: test data**kern **text
4g Word
4g ex-
4g -ten-
4g -der_
4g .
4g .
4r .
4g new
4g word
=|| =||
4g Word
4g ex-
4g -ten-
4g -der_
4g .
4g .
4r .
4r .
4r .
4r .
4g new
4g word
=|| =||
4g Word
4g ex-
4g -ten-
4g -der_
4g .
4g .
8r .
4g new
4g word
=|| =||
4g Word
4g ex-
4g -ten-
4g -der_
4g .
4g .
8r .
8r .
8r .
8r .
4g new
4g word
=|| =||
4g Word
4g ex-
4g -ten-
4g -der_
4g .
4g .
2r .
4g new
4g word
=|| =||
*- *- Which is not really a problem. When the rest comes after the melisma and before the next note, then it is good to stop the word extender before the rest. Breaking the extender for rests in the middle would never be done, so that is not a problem as well. There is some complicated case, which I will have to think more about. |
Boolean options are false by default, and true if they are specified. So there is no other state of If you need a three-state option, then yes, the option would have to be defined as an integer.
What is the behavior you are thinking "default" or "null" would do in this case? |
But verovio is already rendering the word extender like this. So there is no need to change something for this? Or would you prefer to stop the word extender manually with the mentioned semi-official character?
If we keep |
I implemented It should be fairly easy to implement |
In this case I think it's best to migrate this functionality into verovio There are some cases that we should consider more carefully:
Should I revert it back to Currently there is a bug where |
It is subjective as to what should be a tool (or a HumdrumFileContent function) and what should be incorporated directly into verovio. Mostly it would depend on if you need text formatting as an independent tool outside of verovio. If it is anticipated that a CLI tool would be useful, then implementing as a tool is good. If it is some notational aspect that you don't care about doing outside of verovio, then implementing in iohumdrum.cpp is better. But there is also the consideration of the size of the code. If it takes a lot of code to implement, it is probably better to implement as a tool even if it is primarily focused on notation rather than analysis of data processing. One example of this is the beaming and tuplet analysis. That is currently done in verovio since the code started out small and simple, but it is quite complex, and I will want the same code for reuse when converting to other formats such as MusicXML. Otherwise, there is the consideration of computational efficiency. The filter system is not very optimized in terms of computational speed: At the moment it seems that embedding in verovio requires text output from the filter (the reason for this I do not remember, and it is annoying to have this limitation). I also allow manipulating the Humdrum data directly by a tool in order to pass to another tool without reparsing the data. When passing Humdrum data as a string between tools, each tool has to reparse the data. Eventually I will be (re)writing a Humdrum-to-MusicXML tool, and when I do so, I will want to pull out a lot of functionality that is currently in iohumdrum.cpp into shared code (this will mostly be done by moving code to the HumdrumFileContent class). Implementing tools as functions in that class will allow them to be applied directly to a HumdrumFile object without needing to use the code as a tool. Tools can be primarily implemented in HumdrumFileContent, and then utilized in a tool as well by calling those functions from within the tool. The scope of what should be a tool verses what should be implemented in HumdrumFileContent (or in verovio) depends on the complexity of the code: tools should be used for complicated code with many member functions needed to do what is needed (such as When the action is something related to rendering music notation, that is preferably something that goes into iohumdrum.cpp. This is somewhat related to The lyricsformatter (worex) tool is pushing against the general aesthetic in that it focuses on the visual aspects rather than an analytic or data processing aspect. This is not necessarily a problem, but I have not had time to think of all of the implications of doing it one way or the other (see next posting for next questions related to this). |
This one would be fairly easy to solve: use To force all word extensions to be removed when using the
This is one thing I have been thinking about. I would have the It could also be done with `shed:
|
I would say that dealing with For word extenders the choice is more subjective (so I will try implementing in verovio first before deciding). One argument for this is that the I have done that already for TiMP https://www.tassomusic.org/analysis/melisma which is far more complicated than just looking for So don't do anything yet (unless there is particular urgency). Also, I did not mention another path to generating tools. If only a CLI interface is needed and a tool is not needed to run inside of verovio, the code can be placed in the CLI source code file rather than in a https://github.com/craigsapp/humlib/blob/master/cli/npvi.cpp |
For the first part, remind me too look into it later. For the last question the answer can be found in the function which I will be adding to iohumdrum.cpp if word extender styling will end up being processed inside of verovio: //////////////////////////////
//
// HumdrumInput::hasParallelNote -- Go backwards on the line and count
// any note attack (or tied note) on the first staff-like spine (track)
// found to the left. If there is a spine split in the text and or
// **kern data, then this algorithm needs to be refined further.
//
int HumdrumInput::hasParallelNote(hum::HTp token) {
hum::HTp current = token;
int track = -1;
while (current) {
current = current->getPreviousField();
if (!current) {
break;
}
if (current->isStaffLike()) {
int ctrack = current->getTrack();
if (track < 0) {
track = ctrack;
}
if (track != ctrack) {
return 0;
}
if (current->isNull()) {
continue;
}
if (current->isNote()) {
return 1;
}
}
}
return 0;
} To summarize: in order to identify the note that a text syllable is attached to, you look to the left of the There is a complication related to spine splitting (which I will deal with whenever there is an example). When there are two voices in the Note that the above code has not been debugged yet, so there may be some off-by-one errors that I will check on later. |
I would not deprecate the Hyphens to indicate if a syllable is attached to other syllables before it or after it are important, and not removing them would cause serious problems since they cannot be automatically generated. Word extenders do not have that sort of criticality. There is no ambiguity when adding them automatically. So in that sense they are more disposable, and easier to turn them on/off with an interpretation. So the general aesthetic is to not include them in the data and instead control though use of interpretations. However, there are cases when |
when there were slices between a syllable token and the next syllable caused by the rhythm of other voices
Good point. But this is the big advantage of Humdrum to have a dynamic way to interact with the score and this is the reason why I started using humdrum in the first place. To stay as flexibel as possible within the browser context (JS) it's good to have such tool available in verovio. E.g. I'm planning (a student of mine already started) to implement humdrum-tools/verovio-humdrum-viewer#778 which is crucial for one of my next project ideas. So if it is a feature that people can benefit of using in within the browser directly I will keep making the available within verovio. Particularly the But just tell me if you want me to implement this into |
Thank you this helped. I thought there is a convenient method to use that I did not find so far. But I added your code to I fixed this bug now and it will only print |
This is a nice view for displaying melisma. Thank you for sharing.
Not urgent at all. I was just going through open issues and saw that the word extender tool is still open an thought it's a small tool that can be implemented relatively quick. I can continue on this when you clarify how you want it implemented. |
Commit rism-digital/verovio@9363775 implements Thinking more about the
But adding them is the complicated part. There is still consideration as to what to call the tool. If the tool only manages word extensions, then the best name would be For
|
This PR adds the functionality discussed in humdrum-tools/verovio-humdrum-viewer#657 (comment) to enable melismatic underlines at ending syllables of words with a dedicated filter for this. I used a generic name
lyricsformatter
so we can potentially add more features into this tool.The name
lyricsformatter
is a bit verbose. Do you have a better suggestion? Maybelf
,fmtlyrics
or something else?Current usage do add melismatic underlines is
And to remove them:
Do we need a pluralized alias for these options?
You mentioned a possible new
*ul
interpretation. I have not implemented this.Tool_lyricsformatter::addUnderlines
andTool_lyricsformatter::removeUnderlines
only need to get passed a list with start tokens. So I hope this makes it usable in verovioiohumdrum.cpp
, if needed. Should I make these methods static?