Menu

#37 Updated drum notation support (patch)

Unstable (example)
open
nobody
5
2019-12-06
2019-05-18
Theo Other
No

This is an updated version of patch #11 (https://sourceforge.net/p/tuxguitar/patches/11/) against the latest commit in the trunk.

Compared with the original patch, mine has the following improvements:
Works with the current codebase (I made it part of tuxguitar-lib)
Includes more noteheads, such as a slanted diamond, a triangle, and an "effect cymbal" cross that looks somewhat different
Includes more modifiers, such as a circle around the notehead (for use with the china cymbal, cross stick, etc.)
Includes more drums and percussion mapped - I mapped everything that I could find a consensus for, which includes all six toms, both crash cymbals, the splash cymbal, china cymbal, both rides and the ride bell, tambourine, cowbell, stick clicks, wood blocks, triangles, both bass drums, hi-hats, etc.
Size, shape, and positioning of noteheads has been improved
+ over closed hi-hat only occurs on the first closed hi-hat rather than every one of them

As such, I would definitely consider this an improvement over TuxGuitar's current handling of drum notation and so would urge Julian to include this in the trunk.

1 Attachments

Related

Patches: #37

Discussion

  • Anonymous

    Anonymous - 2019-05-19

    I have also been working on this, and I made some dialogs to go with it. See the attached screenshots for some pictures. However my fork has diverged somewhat from upstream and so the patches would require some work to be ported back. If this patch (#37) gets merged then I can look more into what that would take.

     
  • Julian Casadesus

    Hi Guys

    Sorry for my late answer, i often don't have enougth free time to analize the code people send me (please understand i wouldn't upload patches without analize and test them before).

    So now i'm having some time and i'm testing this patch however it's not working as i would expect.
    Please take a look to the attached screenshot

    The "Green Circle" is just a question.. I'm not familiarized with drum scores, taking a quick look in google i don't see drum scores with both clef images together (2 small bars and a rectangle).
    Is it really needed to have both icons?

    Thanks for your help.
    Regards

     
  • Theo Other

    Theo Other - 2019-05-31

    Thanks for looking at this Julian.

    As for the clef (green circles), the two small bars appears to be the more common notation, while the rectangle was a holdover from Simon's patch. I would probably suggest removing the rectangle if any.

    As for the note stems (red circles), I intended for the drums and cymbals to be written in separate voices, which would lead to note stem separation. For an example of what I mean, see this image:
    Also, see my attached image of what it would look like in TuxGuitar with the "feet" drums in Voice 2 and the "hands" drums in Voice 1.

    I intended for it to be up to the user to decide if they wanted to write the drums in separate voices and have a more presentable track or have the convenience of writing it in a single voice. However, I can see why you would see this as an issue with the patch. To address it, there are two solutions I can think of off of the top of my head:

    • Hardcode note stems for each drum type to point a certain direction (and group in a certain way) or have some other method of overriding the regular stem direction behaviour
    • Create a plugin or something that splits the two drum types in a single voice into two voices for better presentability upon user demand

    The advantages of the first approach would be that drums would always look presentable and perfect, and without special effort from the user to do so. However, this could potentially be difficult to program and may require more modification to how TuxGuitar treats note stems. For example, from what I can see, the stem direction is set per beat (or rather beat group), i.e. there is only one for any given beat. Either the code would have to "fake" the stems somehow (e.g. set all stems for all beats to none and draw them in separately) or the code would have to change to allow multiple stems per beat.

    The advantages of the second approach would be that it is probably easier to program (though it may not be) and would definitely require less modification to TuxGuitar's internals. However, it would be complicated by user-configured drum positioning like Cycloptic's (as it would have to move drums around between voices and whatever) and would obviously look bad unless the user specifically changed it.

    So yeah, I don't really know what the best course of action would be on this. I would probably lean more towards the hardcoded stem implementation, but then it may make the stem code more difficult for you to maintain.

    Thanks again for replying,
    Theo

     

    Last edit: Theo Other 2019-05-31
  • Julian Casadesus

    Well, I do not want to cover the problems but to solve them

    User may use 2 voices is he want, however tuxguitar should render without problems is he don't.

    Here the problem is how the patch is calculating positions.
    TuxGuitar looks for minumum and maximun notes, because asumes position Y is relative to note value. But in drum notation it's different

    In TGBeatGroup.getY1(TGLayout layout,TGNoteImpl note, int key, int clef) you are transposing the value to solve the problem:

    -> noteValue = TGDrumMap.getCurrentDrumMap().transposeDrum(noteValue);

    but you are not transposing anything in all other places where tuxguitar computes what is the mininimun/maximun note. This computed value is used later to determine size or directions (if are auto) of steams.

    The change must be deeper, let me to fix the root of the problem when find some free time

    What i really need is a graphic representing all notes (MIDI Key) in a drum notation to get expected positions.

     
  • Julian Casadesus

    So i have allmost fixed, however i still need the notation positions of each percussion note to rebuild TGDrumMap since it should returns a position now instead of a transpoded note. ¿Could you provide me this info?

     
  • Theo Other

    Theo Other - 2019-06-01

    I think I misinterpreted what you were referring to - I thought it was only stem direction. I have attached the positions for all drums and most percussion in image and table form.

    Some of the other percussion instruments don't seem to have a commonly used position, so I didn't include it in my mapping.

    And again, thanks for taking interest in this patch.

     

    Last edit: Theo Other 2019-06-01
  • Julian Casadesus

    Thanks,
    Rendering position is not using note value anymore, this is why i needed the notation graphic to map new position "in score" values.
    I uploaded all changes now, except one commented block that needs more work to fix a bug.

     
  • Cameron Sinclair

    Hi There,

    Excuse me but how do I implement this please? Hopefully someone can explain.

    I have 1.5.2 installed.

    Should I be able to configure the software "as is" or do I need to install something else?

    Many thanks

     
    • Theo Other

      Theo Other - 2019-12-06

      You would have to apply the patch to the source code of the software and build it yourself (i.e. you can't just apply it to your current executable).

      However, I believe Julian has applied his own modified version of the patch to the current main trunk of TuxGuitar (i.e. in the svn repo under the 'Code' tab), so you should be able to simply build the executable from the main trunk without having to apply a separate patch.

      Building the repo is not particularly easy and took me a while to figure out properly - I managed to do so by importing the repo via Eclipse's subversion plugin, and then imported the TuxGuitar projects as maven projects inside Eclipse. I had to edit some of the Maven settings to do so, but managed to build TG through the bash command of mvn clean package -P platform-macosx-x86_64 -Dnative-modules (for OS X - on Linux your platform would be different).

       
      • Cameron Sinclair

        Thanks for getting back Theo.

        I needed something to work straight away and found Musescore.

        It’s free and does the lot.

        Cheers,
        Cammy

        On 6 Dec 2019, at 08:47, Theo Other simplytheother@users.sourceforge.net<mailto:simplytheother@users.sourceforge.net> wrote:

        You would have to apply the patch to the source code of the software and build it yourself (i.e. you can't just apply it to your current executable).

        However, I believe Julian has applied his own modified version of the patch to the current main trunk of TuxGuitar (i.e. in the svn repo under the 'Code' tab), so you should be able to simply build the executable from the main trunk without having to apply a separate patch.

        Building the repo is not particularly easy and took me a while to figure out properly - I managed to do so by importing the repo via Eclipse's subversion plugin, and then imported the TuxGuitar projects as maven projects inside Eclipse. I had to edit some of the Maven settings to do so, but managed to build TG through the bash command of mvn clean package -P platform-macosx-x86_64 -Dnative-modules (for OS X - on Linux your platform would be different).


        [patches:#37]https://sourceforge.net/p/tuxguitar/patches/37/ Updated drum notation support (patch)

        Status: open
        Group: Unstable (example)
        Labels: drum notation enhancement patch latest
        Created: Sat May 18, 2019 01:40 PM UTC by Theo Other
        Last Updated: Thu Dec 05, 2019 03:08 PM UTC
        Owner: nobody
        Attachments:

        This is an updated version of patch #11 (https://sourceforge.net/p/tuxguitar/patches/11/) against the latest commit in the trunk.

        Compared with the original patch, mine has the following improvements:
        Works with the current codebase (I made it part of tuxguitar-lib)
        Includes more noteheads, such as a slanted diamond, a triangle, and an "effect cymbal" cross that looks somewhat different
        Includes more modifiers, such as a circle around the notehead (for use with the china cymbal, cross stick, etc.)
        Includes more drums and percussion mapped - I mapped everything that I could find a consensus for, which includes all six toms, both crash cymbals, the splash cymbal, china cymbal, both rides and the ride bell, tambourine, cowbell, stick clicks, wood blocks, triangles, both bass drums, hi-hats, etc.
        Size, shape, and positioning of noteheads has been improved
        + over closed hi-hat only occurs on the first closed hi-hat rather than every one of them

        As such, I would definitely consider this an improvement over TuxGuitar's current handling of drum notation and so would urge Julian to include this in the trunk.


        Sent from sourceforge.nethttp://sourceforge.net because you indicated interest in https://sourceforge.net/p/tuxguitar/patches/37/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

        Related

        Patches: #37


        Last edit: Cameron Sinclair 2020-07-21

Log in to post a comment.