Tuesday, July 20, 2010

More Durations and Better Beaming

I finally got most of the duration and beaming support worked out last weekend, and I gotta say that the generated scores by VexFlow (and VexTab) are starting to look pretty good.

In VexTab notation, you can now set the duration of the subsequent notes using the colon (:) character. By default, note durations are set to eighth notes.

Here's an example of a line that generates a half-note followed by two quarter-notes.

Basic Duration Support

Valid duration values (currently) are: w, h, q, 8, 16, and 32. Support for dots and tuplets/triplets is not yet implemented.

Durations can be specified inside slides, bends, and other types of ties by prefixing the fret with the duration value enclosed within colon characters.

Durations within Ties

Also, I spent time working on some of the tricker beam configurations, where notes with varying durations are beamed.

Crazy Beaming

In VexTab, you can create beams by enclosing your notes within brackets (separated by spaces).

Beaming in VexTab

Anyhow, I've pushed out the latest revision, with support for standard notation, durations, and beaming to the TabDiv website. Feel free to toy with it and report any issues you come across.

Here's a screenshot of a bluesy guitar lick written in VexTab.

A Blues Lick in VexTab

That's all for this week, folks! There are a lot more interesting things coming up. Check out the VexTab tutorial to play around in the sandboxes, and stay in touch.


  1. Absolutely Beautiful!!!!

  2. this is wonderful. I would like to use it on my site. I think it is time for me to replace Guitar Pro.

  3. Wow. Where is the code for this?

  4. I'll buy the cheap licence once you are all done :)
    keep up the good work.

  5. Thanks for the comments!

    @Tails: sounds like a fair deal :-)

  6. Hi Mohit.
    Nicely done. In my opinion the dots of the notes are a little bit to big, aren't they? Looks a little bit to overload.

    I also kept on working on my html5 notation renderer and finally I support an own language too. Check out the blog post: http://project.coderline.net/news/alphatab-one-step-closer-to-release-0-2/
    and the live demos: http://dev.alphatab.net/

    I'd be glad to hear some feedback of you.

  7. Danielku15 -- i think its bad form to plug your software on every single blog post that Mohit writes (just my opinion).

  8. @Anonymous: I don't mind really. But thanks for looking out for me. :-)

    @Danielku15: Keep up the good work!

  9. One thing I keep noticing with the mixed score/tab images is that the tablature number for each note seems to be a bit further to the left than it ought to be, compared to the note.

    For instance, in your topmost image above, the 5 and 7 are directly below the left-hand edges of their note heads, and the 6 seems to be directly below the sharp sign and not aligned with the note itself at all. Wouldn't it look considerably better to have the numbers centred below the notes?

    (I admit I'm not sure how that works with a chord complex enough to need note heads on both sides of its stem; probably the answer is to follow the same rule as you would if you had to align a single note on another stave below the complex chord.)

  10. @Simon

    That's a good point, and I've been experimenting with different ways to strike a balance here.

    The problem with the "number right below note" approach is that when there are some notes with accidentals (or other modifiers), the spacing between the lined up tablature looks off (i.e., some too close together, some too far apart).

    Right now what I do is allocate a certain amount of space for each "vertical context" and simply center the notes within the allocated space.

    This usually works out well, and has the advantage of not looking too mechanical.

    All this said, I need to think of a good approach to strike a balance between lining up the notes vertically, and evening out the horizontal spacing.

    Thanks for the comment. :-)