lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using SVG backend to implement point-and-click to braille location


From: Mario Lang
Subject: Using SVG backend to implement point-and-click to braille location
Date: Wed, 01 Apr 2015 00:59:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi.

This is basically a big thank you to the LilyPond community.

I am writing software to deal with braille music code.
Recently, I have started to implement a GUI for the functionality
already implemented, based on Qt.  My program uses LilyPond to render
visual music notation based on the braille music code provided by the
user.

I am using the LilyPond SVG backend in combination with Qt's SVG
support.  While Qt's SVG module does not implement any support for <a>
elements, it has a way to click on svg elements with an id attribute.
What I did was to parse the SVG to XML, and walk the tree for all <a>
elements, setting an id attribute on the inner path element.  While
LilyPond's point-and-click does only refer to the location in the
*LilyPond* file, I added comments after every emitted lilypond
expression to be able to point back to the braille music code location
which was actually responsible for the generation of that LilyPond
code.  A long story short, I have point-and-click now, which repositions
the editing cursor in my braille editing window if you click a note in
the LilyPond based SVG display below.

This is, rather amazing.  Becuase it will ultimately allow blind and
sighted musicians to work together.  A sighted user can just use the
mouse to "point" at a specific note, and the blind user will be able to
see the same note, but in a totally different represnetation.

I don't have a screenshot ready, since I am a blind developer, and
screenshots are not my thing :-).  However, I might be able to convince
someone to help me produce one, if there is interest.  The code is
on GitHub, if you want to see this yourself interactively, see below for
short build instructions.

Anyway, again, a big THANK YOU to everyone working on LilyPond.
BMC would be very much less impressive without your work.


How to build and test this
--------------------------

$ git clone http://github.com/mlang/bmc
$ cd bmc
$ git checkout qt
$ cmake .
$ make bmc-ui
$ ./ui/Qt/bmc-ui

An example file is loaded automatically.  Press F8 (or invoke File ->
Compile) to compile the braille to LilyPond output.  Click a note or
rest, to see the text cursor jump to the relevant position.

-- 
CYa,
  ⡍⠁⠗⠊⠕



reply via email to

[Prev in Thread] Current Thread [Next in Thread]