cipher music
Dear All,
Cipher Music is a variety of notation systems that are used, particularly in Asia, by many millions of
people. The structure is relatively simple with each note having a letter or number identifier and
diacritics to indicate octave, length, etc.
But, just as with western notation, this stuff is hard to typeset and lilypond, being such a power tool
should be able to eat it up.
I enclose my first attempt at this. But I would value some help in making it look nicer and not requiring
raise/lower hackery to get the music lines not to clash. So all improvements are welcome.
The approach I have taken is to extend the note-names engraver slightly so that it can output duration, and
then to reparse the note name to convert it into the required output. I enclose the patch and sample
document. I propose the patch for addition to lilypond in a subsequent version. It's not very big and it
shouldn't break anything.
Particular questions on the .ly front:
1. How do I get the voices not to smash into each other?
2. How do I get the barlines of the right thickness and height?
Todo.
1. Add key normalisation to CMaj or Am and insert indicative text to that effect.
2. Fix Doulos SIL to add better diacritic rendering on numbers
3. Do some user testing
Scary thoughts.
1. People like the - (for time doubling) to spread into the spare space
2. Underlining should act like beaming just like, but completely different to, beaming in Western notation.
Yours,
Martin
diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc
index 1e1e01a..95ffd14 100644
--- a/lily/note-name-engraver.cc
+++ b/lily/note-name-engraver.cc
@@ -9,6 +9,7 @@
#include "engraver.hh"
#include "item.hh"
#include "pitch.hh"
+#include "duration.hh"
#include "stream-event.hh"
#include "translator.icc"
@@ -46,6 +47,11 @@ Note_name_engraver::process_music ()
p = Pitch (-1, p.get_notename (), p.get_alteration ());
s += p.to_string ();
+ if (to_boolean (get_property ("printDurations")))
+ {
+ Duration *d = unsmob_duration (events_[i]->get_property ("duration"));
+ s += d->to_string ();
+ }
}
if (s.length ())
{
@@ -74,6 +80,7 @@ ADD_TRANSLATOR (Note_name_engraver,
"NoteName ",
/* read */
+ "printDurations "
"printOctaveNames ",
/* write */
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 3b18e94..093b696 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -356,6 +356,7 @@ sustain pedals: @code{text}, @code{bracket} or @code{mixed} (both).")
(pedalUnaCordaStyle ,symbol? "See @code{pedalSustainStyle}.")
(predefinedDiagramTable ,hash-table? "The hash table of predefined
fret diagrams to use in FretBoards.")
+ (printDurations ,boolean? "Print durations for the @code{NoteNames} context.")
(printKeyCancellation ,boolean? "Print restoration alterations
before a key signature change.")
(printOctaveNames ,boolean? "Print octave marks for the
_______________________________________________
lilypond-user mailing list
lilypond-user <at> gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user