-
Notifications
You must be signed in to change notification settings - Fork 261
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
Drum notation? #33
Comments
I'm afraid Audiveris does not recognize drum sheets. |
Hi Hervé, Wikipedia has an article, but there isn't a universal standard for drum notation (noteheads, voices, etc), so I would suggest the ability to define a drumset (i.e. MuseScore). I've attached two examples of full scores from different books (same typesetting software and transcribing company, I believe) to give an idea: They use a double sharp sign for some note heads, but Elaine Gould ('Behind Bars', page 11) discourages this. |
Wow! It's a whole bunch of notations! On top of that, we'd have to check how MusicXML export format can support all these drum notations. Please have a look at MusicXML 3.1 My guts feeling, based on Audiveris architecture, is that this is technically feasible. However it would be a significant task, and we lack time and human resources right now. Perhaps some external contribution could focus on this development. When you say "there isn't a universal standard for drum notation (noteheads, voices, etc), so I would suggest the ability to define a drumset", I hear a small voice saying "beware, this sounds like a niche requirement". Before investing large efforts into this, make sure the need is crucial and the "standard" widely shared. |
I couldn't take the time to point out those problems, but I'm aware there is no standard notation for it and that it could take a large amount of work to implement it. |
I was originally inspired by certain sophisticated published transcriptions (hidden empty staves, tablature, drums, etc), so I feel this is an area I could assist (though I am not a coder). Such material has helped improve the scoring tool I use - MuseScore. @stephanepjeannin: Regardless of the scale of challenge, I still think it's a valid issue and we should leave it open. @hbitteur: It might be a matter of perspective, but defining drumsets may not be as niche as you think.🙂 May I email you with some private examples? I will also post some public ones so they can be discussed, etc. |
Well, I closed the issue because I got my answer... |
@chenlung You can use my private mail (herve dot bitteur at audiveris dot org) for any private example |
Well, actually I already have some MusicXML with drum notation around.. |
@hallvors I couldn't open your file in MuseScore 3.6.2 (crashes). I've got a mscz with several drumsets if you want to experiment with it? |
Ops.. Probably my mistake, it is extracted from a bigger MusicXML score, but it does render fine with OSMD (Opensheetmusicdisplay JS library). I can't really speak for any Audiveris developers here since I'm just a random user :) But if Musescore exports that drum set file nicely to MusicXML I think it might be useful to them as an example of percussion notation in MusicXML. |
MuseScore crashes on that xml file, in a Debug build with a failed assertion somewhere deep in Qt: |
FYI, Audiveris template matching was recently extended to support cross heads (x-shaped heads). I'm putting this here to help contributors (Brian...) on drum notation. The image above shows how we can interactively apply a head-template for a given shape (here shape NOTEHEAD_CROSS, with a stem located on the right head side) on a given score location. This was meant for Audiveris developer to visually check how the template worked (or not). To play with this, you will need: to
In the Templates tab, use mouse right button to position the template at a desired location. Then read the matching result in the template board on the right column (where you can also select which template to use). Mouse left button is used to read the distance from mouse location to the nearest template foreground point. OK, that's a bit complex, but this feature was never meant for the end-user :-) Then browse Audiveris code, beginning with classes:
They should be good starting points. |
@hbitteur thanks for the welcome and the tips for getting started! As Hervé implied, I want to get involved with improving Audiveris' recognition of drum notation: specifically, 5-line unpitched percussion scores. I am brand new to GitHub, so please forgive and correct any mistakes like posting under the wrong heading of the forum. Let me first address the issue of MusicXML. It seems that MusicXML 4.0 already supports all the needed elements of unpitched percussion for Audiveris export; see https://www.w3.org/2021/06/musicxml40/tutorial/percussion/ for a good introduction. In particular, it supports encoding of:
Admittedly there are some choices to make with that last point: in the example posted near the top of this thread by chenlung on Jan 17 2018, an x on the space above the score is depicted as an open hi-hat, but many programs that create drum score notation (and many drummers) would use that symbol for a closed hi-hat. Ultimately Audiveris should probably provide a choice to the user among several common schemes for assigning MIDI sounds to each (notehead, score position) pair. But initially for development purposes, it makes sense to choose one of them; I would propose the one used by MuseScore. Maybe that's enough for now. After I've had a chance to try Hervé's suggestions from the previous post, I'll probably have some questions. And at some point I'll post an overview of what I think will need to be done, in terms of new or improved code development, shape recognition, training, etc., for Audiveris to support unpitched 5-line percussion scores. [GitHub newbie question: should all that be posted here in Issue #33, or somewhere else?] |
Hi Brian, I have a score which you may use for testing (specially designed for this). Can I email it to you? |
@chenlung, thanks for the offer. I have dozens if not hundreds of PDF drum scores already, from MuseScore and various other sources. Is there something special about yours? I’m not sure how email works with GitHub—I got an email copy of your posting, does that mean if you post your score I’ll get it by email? |
Yes you can use this location for questions, suggestions, etc... Since you are a GitHub "newbie", to get up and running on Audiveris code, do the following from the command line level in a local folder of your choice:
Before that, you'll need to install Git and Gradle tools, plus Java JDK 17 and your favorite IDE. What's your OS? |
@brian-math You might be covered overall, but I think the score will still serve you in some form, even beyond five-line drumsets (should you get to those). And I think that's just a notification, so feel free to drop me a line. |
Hervé, I want to say that the existing instructions on the site for installing Audiveris were very clear, and I had almost no problems getting it up and running a week ago. The only problems arose regarding the tesseract language files. It seemed that the default was to download version 4.1.0 of those files, whereas it was (exceedingly!) clear from the instructions that only v. 3.0.4 would work. When I first ran Audiveris, I got an error "Could not initialize Tesseract with language deu" [or eng or fra or ita] and suggesting that the environment variable TESSDATA_PREFIX needed to be set. Eventually I discovered that the language files (on a Mac) are saved in /opt/local/share/tessdata/xxx.traindata (where xxx is deu, eng, fra, ita, etc), and after adding that environment variable definition to my .login file, the error message went away. But I still had to figure out how to find and download the tesseract 3.0.4 language files and substitute them for the 4.1.0 files in the aforementioned directory. Some better explanation of this process might have helped. But otherwise it was no problem! Mac OS Mojave 10.14.6. |
I suppose you are using Audiveris development branch. During this switch, I discovered by chance that TESSDATA_PREFIX environment variable that was supposed (in 3.x) to point to the parent folder of tessdata folder is now supposed in (4.x) to point directly to tessdata folder. This might explain your problem. This needs to be documented before the next release is published... |
Template generation In Audiveris 5.x, heads are recognized by template matching while most of the other fixed-shape symbols are handled by a trained neural network. For this, the key class is org.audiveris.omr.image.TemplateFactory. It works with a specific free true-type font named "MusicalSymbols" which does not need to be installed on the user machine, since it is provided in Audiveris With this font, in TemplateFactory we simply specify the code to use for every specific head shape. For example:
Drum notation will require a few additional codes. A quick search gave:
But I could not find any circled fat cross head (crash cymbal) in this font. What can we do?
Any other idea? |
You can play with this small tool integrated in Audiveris. |
@hbitter Thanks for this detailed information about the music font used for note heads; it is very interesting. I would suggest not to worry too much right now about the circled x. It seems to me that ~95% of drum notation uses only standard oval and x note heads. The next most common head seems to be a diamond. I have never encountered a circle-x used for a crash cymbal; rather, the main crash is normally an x on the first ledger line above the staff (or perhaps the space above that, for a 2nd crash cymbal). I have seen a circle-x used for an open hi-hat cymbal, but there are at least two other common notations in use for the open hi-hat, and we can probably reasonably translate to one of them if we can recognize an x-in-a-circle glyph. This should be good enough until we get to version 6.x. But if not, I like your idea of combining two existing symbols from the font. By the way, as mentioned at the bottom of @chenlung 's Jan 17 2018 post, the double sharp symbol should not be used for drum cymbal notation, even though it certainly appears in some scores (probably because it was an existing music notation symbol to which the transcriber had easy access). So I think we should stick to the Code 192 x and not use the Code 220 double sharp. I've spent a good deal of today preparing 1) a detailed analysis of how Audiveris performs, step by step, when given a drum score as input, and 2) an outline of a proposed set of tasks to get Audiveris able to recognize 5-line drum scores. I'll post those later this evening (US time). |
I think MuseScore has the circle-x? Barnes Music Engraving used Amadeus Music Software for these transcriptions, by the way. |
MuseScore 4 is still in development, but already available as 'nightly builds' |
|
I will try it. Purpose is to make sure that MusicXML as produced by Audiveris is OK, and a practical test is to feed a few music sequencers like Finale, MuseScore, Primus, ... with it. |
I was about to post a screenshot of the B B King song. But I guess I won't bother if it's unusable in Audiveris. What happens if you go to this link? https://www.drumeo.com/beat/20-easy-songs-beginner-drummers/ Does it load without you having to create a [free] account with them? Do the links "Click for the sheet music" function? |
Yes I can download the file, and a double-click on it opens a PDF viewer with no banner. Fine. |
I can confirm identical results between MuseScore 3 and MuseScore 4: no repeat sign appears, measure content is displayed as for a "standard" measure. |
Guess that'd be something for @lvinken to look at (MusicXML im-/export of (multi-)measure-repeats). |
Actually, a watermark is indeed displayed across the page by a PDF viewer (and by the web browser as well I suppose), but it is very faint, so we don't really notice it. You can check this on your own. |
With commit ee68a8c simile marks are now handled for 2 and 4 measure marks. Finale works correctly with the provided MusicXML data for REPEAT_TWO_BARS symbol but displays two measures, each with a REPEAT_ONE_BAR symbol. Why not? [Slurs in Finale come from circles not yet handled by Audiveris and mistaken with slurs. But this is another story...] |
Not the same thing, repeat last 2 measures is not that same as repeat last measure twice |
Good point! |
Listening to Finale playback though, I think it plays the correct content (the 2 measures to be replicated are slightly different). |
Just checked. MuseScore 3.6.2 supports "repeat last bar" symbol, but does not export this to or import from MusicXML. MuseScore 4.0 supports "repeat last bar", "repeat last two bars" and "repeat last four bar" symbols, including MusicXML import and export (did not actually test the "four bar" variety). MusicXML produced by MuseScore 4.0 seems to match https://www.w3.org/2021/06/musicxml40/musicxml-reference/examples/tutorial-percussion/. In case something does not work, please provide details. |
Thank you for confirming that my observations with MuseScore 3.6.2 are as expected. |
@hbitteur What is your advice about the number of different circle-x noteheads to include in the code? The SMuFL font includes noteheadCircleX, noteheadCircleXHalf, and noteheadCircleXWhole (E0B3, E0B2, E0B1), but they look very similar, and I doubt the OMR engine is going to be able to detect the difference between the three different heads in an input score. OTOH maybe we require at least two separate heads for logical reasons--one with and one without a stem? Would including all three help in correctly assigning time durations? |
@hbitteur I have made a commit 01a8dad to the development branch on my brian-math GitHub account of my progress so far on recognizing circle-x note heads. I'd appreciate your suggestions about what should be done next to make this work. I have been testing using the score "Come As You Are," page 2, which you used for testing two-measure repeats on June 10. Prior to adding the two new mapShape lines to Symbols.java, I received a few dozen "Error: no symbol to paint HeadInter NOTEHEAD_CIRCLE_X." So I believe Audiveris was recognizing several such note heads on this page. However, after adding those lines to Symbols (lines 324 and 419), there seem to be no circle-x note heads being recognized. (Or am I just not seeing those inters?) Dragging the NOTEHEAD_CIRCLE_X template (in the Templates tab of running Audiveris) onto the actual circle-x note heads in the score image, the template is evidently much smaller than the printed note heads, producing very poor match scores of around 0.1. Another clue is the following line from the log file during HEADS step:
I suppose this means that the circle-x note heads have radius 2.3, compared to 1.5 for the oval note heads? Is there a way to force Audiveris automatically or manually to scale up the circle-x template to match the oversize circle-x note heads in this score? |
@brian-math My understanding is that noteheadCircleX, noteheadCircleXHalf, and noteheadCircleXWhole (E0B3, E0B2, E0B1) represent notes with different durations (1/4, 1/2 and 1), please correct me if I'm wrong. Now, I can't see all these 3 shapes in the modifications you made, noteheadCircleXHalf seems to have disappeared. Was this done on purpose? My advice would be to address either none or all three of them for the sake of completeness from an end-user point of view, notably regarding note duration. Head size is given by the chosen musical font (Bravura as of this writing), meaning that for the same font size, a black oval head and a circle-X head have the bounds defined by Bravura font for each of these shapes. And what you get when dragging out of shape board to some target staff shows you the actual head size for the target staff. It's true that in your score example ("Come as you are"), the circle-X appear somewhat larger than their oval shape counterparts, still referring to what Bravura provides. The question is to decide on "which is right" regarding oval/circle size ratio: Bravura or "Score as you are"? If needed (see my question above) we can "cheat", still using Bravura font, and impose a ratio specific for circle-x heads. To do so, we will have to define a specific
This output line gives you the mean observed abscissa offset from head center to stem connection point. The offset is expressed in interline fraction. 'R' stands for Right and 'L' for Left side of the head. And that dx is provided per head shape. |
@hbitteur Yes I intentionally left out noteheadCircleXHalf from the initial code on the premise that it might not be needed, since it looks almost identical to noteheadCircleX and both should have a stem attached. But it will be easy to add the half-note version for completeness and consistency. I noticed that in the score "Come as you are" under consideration, the "x" portion of the circle-x heads occupies almost exactly the space between two score lines. Since the arms of the x appear to create a right angle but at a 45 degree angle to vertical, the circle diameter should be sqrt{2} times the interline distance L. And the horizontal distance from the head center to the stem attachment point should be the radius of the circle, (sqrt{2}/2 ~ .707) L. So I'm not sure why the abscissa offset is reported as 2.3 L... In fact, I'm a bit confused about why any NOTEHEAD_CIRCLE_X abscissa offsets are being reported in the log at all, since I could not see any such circle-x head inters in the Audiveris display after the HEADS step. Does this mean that the matching to the circle-x template was actually successful in many cases, and either I missed them, or for some reason they are still not being "painted" with the font character? I agree that we should be cautious about hard-coding in some specific ratio to handle the sizing of the circle-x glyph in the scores coming from drumeo, without first testing several other sources. I believe MuseScore can be coerced into creating circle-x heads, so I'll create a sample MuseScore file to see how big they are. Could you perhaps do the same with Finale? |
I think we can close this issue. At last!:-) |
@brian-math The first mesure of the second system is as follows: At the end of the REDUCTION step, the measure appears as: The result looks OK (except for the very first note head above staff, but let's forget this). Let's look at the space just above the middle line. It contains 4 heads with a circle-x.
We need very good eyes to detect this visually. Looking very carefully, we can observe that the two circled heads are indeed not identical. But the template-matching mechanism currently used by our OMR engine suffers similar problems. Many"black" circle-x heads are mistaken for "half" circle-x heads. So, what can we do? My personal thinking would be to, at least, prevent the template-matching tool to assign these "half" heads that are too similar to their "filled" counterpart. Manually assigning them would still remain possible though. What do you think? |
@brian-math
This may be a bit too strict, but it works nicely now. Another question: I noticed a few "triangle up " motifs, with some "Cowbell" text, in RedEye Percussion scores. Should we add support for this motif? |
@hbitteur Regarding triangle-up heads, it's true that these do occur occasionally in percussion scores, and it would probably be very little additional work to include them. The question is whether the growing palette of heads is likely to result in increasing head mis-identification by the engine... |
OK, beside the
|
Agreed.
Sure. |
While working on discussion #672, I had to reconsider how Audiveris processes 1-line staves. There were many locations, here and there in the source code, where the engine implicitly assumed a 5-line staff. My question is about drum notation on such 1-line staves. I found only two examples on Redeye site (BangBang and HoldItNowHitIt). Based on this limited data, I extended the <staff line-count="1">
<!-- -1 -->
<entry pitch-position="-1" motif="oval" sound="Hi_Bongo"/>
<entry pitch-position="-1" motif="cross" sound="Maracas"/> <!-- Surely wrong... -->
<!-- 0 -->
<entry pitch-position="0" motif="oval" sound="Hand_Clap"/>
<!-- 1 -->
<entry pitch-position="1" motif="oval" sound="Low_Bongo"/>
<entry pitch-position="1" motif="cross" sound="Cowbell"/>
</staff> Since this is a 1-line staff, I think we have to handle pitch positions -1, 0 and +1. You are the expert! :-) |
We already have in drum-set.xml mappings (for the downward-pointing triangle): On the RedEyePercussion site, the score OldTimeRock&Roll has an upward-pointing triangle on sheet 2, system 1, pitch-position -5, which I believe is (also) played as a Cowbell in the recording. So after creating a "triangle-up" head shape, you could add
On the same site, the score for WhoLetTheDogsOut actually has two 5-line percussion staves per system, one for a standard Drumset and the other labeled as "TIMS" (Timbales?). This latter has some triangle-up heads at pitch-position 3 labeled "Triangle" (MIDI percussion instrument #81), and some others at pitch-position 1 (in the 2nd-last system) that are unlabeled (and I don't know what instrument they represent). Based on this, you could add
although I think this is probably rather non-standard usage. That same score also uses the triangle-down head for both "Cowbell" and "Small Cowbell" at pitch-position -1, but I think you can leave it to the user to add this to the local drum-set.xml file; in any case, there does not seem to be a MIDI percussion instrument Small Cowbell defined. |
I haven't encountered many 1-line percussion staves. Poking around the internet, they seem to be used typically for one single instrument, or sometimes two related instruments (above and below the line), such as hi and low bongos. A typical score might have many 1-line percussion staves for different instruments. It would be impossible to try to anticipate them all. I think your definitions are fine. They provide an example of how to define multiple instruments on all three possible pitch-positions of a 1-line staff, which the end user can easily modify for a given score. |
Hello, wonderful developers of Audiveris!
I try to scan my drums sheets from my music school but after a processing, the hi-hat notes (noted with crosses), do not appear on the resulting file; am I missing some configuration? I tried to search for "drums" in your wiki and documentation, is it an expected behavior, a limitation or an error I did?
Thanks for your help :)
~SPJ
The text was updated successfully, but these errors were encountered: