Beaming Problems in Vexflow (Vextab)

393 views
Skip to first unread message

Richard Gonski

unread,
May 20, 2013, 6:44:15 AM5/20/13
to vex...@googlegroups.com
Hi,

My colleague and I have been building a (browser based)  editor using Vexflow which is already at quite an advanced stage - however, we have repeatedly come up against one problem which is a bit of a showstopper, which is to do with how Vexflow handles automatic beaming (i.e. beaming using applyAndGetBeams).  In order to make sure that it is not our code that is the problem, I have tested all these issues in the Vextab sandbox with exactly the same results.

It appears that automatic beaming does not take into account factors such as time signatures and beat boundaries.

So, for example, in 6/8 time, Vexflow (Vextab) beams 6 eighth notes in 3 groups of 2, instead of 2 groups of 3.

Eg:

tabstave notation=true tablature=false time=6/8
notes :8 5/4 7/4 8/5 :8 6/3 5/4 5/5

Another example is how beaming is handled following a dotted note:

Eg:

tabstave notation=true time=4/4 key=Ab tuning=eb
notes :qd 5/2 :8 5/4 5/4 5/4 5/4 5/4


You would expect the 1st 8th note after the dotted quarter note to be separate, followed by 4 beamed 8th notes 

There are other examples of beaming anomalies of a similar kind. Here is one:

Inserting a 16th note(s) after a quarter note triplet - the beaming starts on the second 16th note, leaving the first one an orphan and upsetting the relationship with the (quarter note) beat.

tabstave notation=true tablature=false time=4/4 key=Ab tuning=eb
notes :q 5/5 5/4 5/3 ^3^ :16 5/5 5/5 6/5 7/5 6/5


We are not sure how to proceed - one option would be to turn off automatic beaming altogether or for some specific cases where it is problematic, but this means adding another layer of complexity to the code which we want to avoid if possible - I am also assuming that these issues are going to be problematic for other users too.

It may be that we have missed something here and that there is a fix or solution for these issues that we haven't spotted - if so apologies in advance, and we would appreciate any help/feedback.

Regards,

Richard Gonski


Mohit Muthanna

unread,
May 20, 2013, 10:14:14 AM5/20/13
to vex...@googlegroups.com
Yes, the automatic beaming is a bit naive and does not account for time signatures. That said, most of the heavy lifting is done, and I suspect with a little bit of work it would be straightforward to hand the beaming code some timing/grouping hints.

Feel free to file a feature request so I can track it. (I'm happy to review and merge your code too, if you decide to tackle this.)

Thanks,
Mohit.
 

Regards,

Richard Gonski


--
--
You received this message because you are subscribed to the Google
Groups "vexflow" group.
To post to this group, send email to vex...@googlegroups.com
To unsubscribe from this group, send email to
vexflow+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/vexflow?hl=en
 
---
You received this message because you are subscribed to the Google Groups "vexflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vexflow+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Mohit Muthanna [mohit (at) muthanna (uhuh) com]

Cyril

unread,
Jun 4, 2013, 2:34:24 AM6/4/13
to vex...@googlegroups.com
Currently the beaming code is a bit naive (I supplied a great deal of it).

If you go into the applyAndGetBeams function, you'll notice the ticksPerGroup variable. For 6/8 you can modify it to 6144 (the equivalent of 1.5 quarter notes). Basically, the algorithm tries to fit the max consecutive beam-able notes together without exceeding the ticksPerGroup. Currently, ticksPerGroup is hard-coded to be the equivalent of 1 quarter note (4096 ticks), so a modification would be necessary to make it a configurable aspect of applyAndGetBeams()
Message has been deleted

thomas boulenger

unread,
May 4, 2021, 2:43:33 PM5/4/21
to vexflow
Since 2013 no solution has been found?

For test, I try to change Vextab-div.js code. In beam class I found a defaut tab depending on time signature, i change '4/4' : [1/4] to '4/4' : [2/4] and i have a best rendering 

2021-05-04_20h35_53.png

instead of

2021-05-04_20h37_56.png

but i got other problem : in M1 tick 3, the F is not beamed with the E

i can get also problem like this :

2021-05-04_18h34_51.png

I will study this problem ;-)

thomas boulenger

unread,
May 9, 2021, 2:49:24 AM5/9/21
to vexflow
i find a solution to solve this problem : https://github.com/0xfe/vextab/pull/124 (in the discussion)
you can use bracket to open_beam and close_beam
This vextab code was implemented but not treated
i change the code of vextab-div.js this treat this command
Reply all
Reply to author
Forward
0 new messages