lilypond-user
[Top][All Lists]
Advanced

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

Re: Feature Request: Chromatic note names


From: Paul Morris
Subject: Re: Feature Request: Chromatic note names
Date: Thu, 16 May 2013 18:12:21 -0700 (PDT)

With some help from these snippets:
  http://lsr.dsi.unimi.it/LSR/Item?id=784
  http://lsr.dsi.unimi.it/LSR/Item?id=619

I worked out how to redefine the note names, and make the default scale (the
scale that is represented by the staff) a chromatic scale. See the snippet
below.  This avoids the inconsistency with tritones in \relative mode.  That
is the benefit of this approach.  

The downside is that the default scale is set globally, so it affects all
staves.  This means you can't have a file that includes staves based on
different scales (say if you wanted to show a traditional staff alongside an
alternative one, for comparison).  Another possible downside is that
accidental signs are not shown, so you can't override them with alternative
signs (i.e. for using traditional nomenclature with an alternative/chromatic
staff[2]).

Using the staffLineLayoutFunction approach[1] on the other hand gives you
the opposite set of benefits and downsides.

(Rookie scheme tip: a single quote (') is not the same as a backtick (`). 
This tripped me up!)

Cheers,
-Paul

[1] http://musicnotation.org/wiki/software-wiki/lilypond/
[2] http://twinnote.org/learn/accidental-signs/


% BEGIN SNIPPET
% Using ly:set-default-scale to get a chromatic staff with custom note names

\version "2.16.1"

% set the default scale to chromatic scale
#(ly:set-default-scale
  (ly:make-scale '#(0 1/2 1 3/2 2 5/2 3 7/2 4 9/2 5 11/2)))

% Note names are redefined to represent 12 chromatic 
% pitches in LilyPond input.
mutoPitchNames =  #`(
       (do   . ,(ly:make-pitch -1 0 NATURAL))
       (di   . ,(ly:make-pitch -1 1 NATURAL))
       (re   . ,(ly:make-pitch -1 2 NATURAL))
       (me   . ,(ly:make-pitch -1 3 NATURAL))
       (mi   . ,(ly:make-pitch -1 4 NATURAL))
       (fa   . ,(ly:make-pitch -1 5 NATURAL))
       (fi   . ,(ly:make-pitch -1 6 NATURAL))
       (so   . ,(ly:make-pitch -1 7 NATURAL))
       (lu   . ,(ly:make-pitch -1 8 NATURAL))       
       (la   . ,(ly:make-pitch -1 9 NATURAL))
       (se   . ,(ly:make-pitch -1 10 NATURAL))
       (si   . ,(ly:make-pitch -1 11 NATURAL))
       )
pitchnames = \mutoPitchNames
#(ly:parser-set-note-names parser pitchnames)

\new Staff \with {
  \override StaffSymbol #'line-positions = #'(-6 0 6)
  } {
  \relative do' {
    do di re me mi fa fi so lu la se si 
    do di re me mi fa fi so lu la se si \break
    do,, re mi fa so la si do
    do re mi fa so la si do \break
    do, fi do' fi do fi do' fi'
  }
}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Feature-Request-Chromatic-note-names-tp145984p146014.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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