lilypond-devel
[Top][All Lists]
Advanced

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

Re: Kievan square notation in LilyPond


From: Reinhold Kainhofer
Subject: Re: Kievan square notation in LilyPond
Date: Thu, 8 Sep 2011 22:59:05 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; i686; ; )

Am Donnerstag, 8. September 2011, 22:11:45 schrieb Aleksandr Andreev:
> > I think it should be done similarly to ancient music support: add a
> > new kind of context, for example KievanVoice.
> 
> > See how mensural notation works now - an example:
> OK, so IIUC, I have to add code to engraver-init.ly, and I can use the
> MensuralVoice context as an example. That seems to be fairly
> straightforward. Could you point me to which C++ files would need to
> be modified?

I wouldn't jump into modifying engraver-init.ly directly yet. I'd start with 
my own .ly file, where you have only Kievean-relevant stuff, and where you 
can't really break the internals. You'll go step-by-step, always adding one 
little piece until you are there...

You definitely want to look at how lilypond selects the notehead glyphs (note-
head:;calc-glyph-name in scm/output-lib.scm and internal_print in note-head.cc 
for the default style), because most of the logic will probably fit your 
Kievan notes, too. The only problem I see is that your noteheads include the 
stem... But up/down heads are correctly selected by lilypond already (see the 
shape note styles). They simply select the namedglyph from the font:
  "style.u0" 
where "style" is the value of \override NoteHead #'style = #'kievan, 
"u" or "d" or "s" gives the direction (up/down/same for both), and "0", "1", 
"2" gives the note duration (logarithm). That looks pretty much how Kievan 
works, too.

Unfortunately, the note-head::calc-glyph-name grob in scm/output-lib.scm hard-
codes a maximum of 2 for the suffix (i.e. a quarter note), so you can't have 
different noteheads for quarter and eighth notes, unless you write your own 
stencil function (i.e. copy note-head::calc-glyph-name and select-head-glyph 
to your own file and adjust them).


However, looking at the notation, I wonder if it's not simpler to separate the 
noteheads from the stem (the quarter and half notes have the same head, just a 
different stem, and the eigth note up has a normal stem and a flag, while the 
eighth note down has a more complicated stem/flag...)


Adding the Tse-Fa-Ut clef needs a look at the clef handling, because adding a 
clef cannot be done from a .ly file, but it's not too complicated, either 
(just add an entry to supported-clefs in scm/parser-clef.scm).

The more problematic things are the final notes (whole note with fermata), the 
symbol after the score, etc. But I'd start with getting normal notes right, 
and then adding more stuff.

A simple file to start from is:

\version "2.15.10"

\layout {
\context {\Score
  \accepts "KievanStaff"
}
\context {
  \Staff
  \name "KievanStaff"
  \alias "Staff"
  \denies "Voice"
  \defaultchild "KievanVoice"
  \accepts "KievanVoice"
  \description "Same as @code{Staff} context, except that it is
accommodated for typesetting a piece in Kievan square notation."
  % Here come all the context modifications (different font, whatever)
  % for your Kievan staff...
}
\context {
  \Voice
  \name "KievanVoice"
  \alias "Voice"
  \description "Same as @code{Voice} context, except that it is
accommodated for typesetting a piece in Kievan square notation."

  %%\override NoteHead #'stencil = #ly:text-interface::print
  %%\override NoteHead #'text = #(markup #:musicglyph "kievan.d2")
  %% OR better (this will select the musicglyphs kieven.[ud][012..]):
  \override NoteHead #'style = #'kievan
  \override NoteHead #'glyph-name = #'your-own-function-to-be written
  %% \override Rest #'style = #'kieven %% RESTS??

  %% There are no beams in mensural notation.
  autoBeaming = ##f

  %% Here come some more context modifications, you'll find them
  %% out as you are playing with this file
}
}

\score {
  \new KievanStaff {
    \new KievanVoice \relative c' {
      % Some notes to test...
    }
  }
}

Cheers,
Reinhold
  
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

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