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: Fri, 17 May 2013 00:29:45 -0700 (PDT)

dak wrote
> So in case you are using 2.17.16 or newer, it would be nice if you
> checked that this "first pitch like absolute" rule works even when
> starting with an f sharp.

I gave this a try in 2.17.18 with the test code below, and "first pitch like
absolute" still works even with a default scale that has an even number of
notes.  In this case \relative {...} corresponds to \relative fis {...}
instead of \relative f {...}  

Cheers,
-Paul


% BEGIN TEST SNIPPET
\version "2.17.18"

% set the default scale to chromatic scale, and pitchnames to match
#(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)))

dodecaPitchNames = #(map (lambda (pitchname)                        
                           (let* (
                                  (pitch (cdr pitchname))
                                  (nominal-steps (vector-ref '#(0 2 4 5 7 9
11)
                                                   (ly:pitch-notename
pitch)))
                                  (fractional-steps
                                   (+ nominal-steps (* 2
(ly:pitch-alteration pitch))))
                                  (steps (inexact->exact (floor
fractional-steps)))
                                  )
                             (cons (car pitchname)
                               (ly:make-pitch
                                (ly:pitch-octave pitch)
                                steps
                                (/ (- fractional-steps steps) 2)))))
                      pitchnames)

#(ly:parser-set-note-names parser dodecaPitchNames) 

\new Staff {
  \mark "absolute" 
  fis' g' gis' a' ais' b' 
  c' cis' d' dis' e' f'
}

\new Staff { 
  \mark "relative {...}"
  \relative { fis' }
  \relative { g' }
  \relative { gis' }
  \relative { a' }
  \relative {ais' }
  \relative { b' }
  
  \relative { c' }
  \relative { cis' }
  \relative { d' }
  \relative { dis' }
  \relative { e' }
  \relative { f' }
}

\new Staff {
  \mark "relative f {...}"
  \relative f { fis' }
  \relative f { g' }
  \relative f { gis' }
  \relative f { a' }
  \relative f { ais' }
  
  \relative f { b' }
  \relative f { c' }
  \relative f { cis' }
  \relative f { d' }
  \relative f { dis' }
  \relative f { e' }
  \relative f { f' }
}

\new Staff {
  \mark "relative fis {...}"
  \relative fis { fis' }
  \relative fis { g' }
  \relative fis { gis' }
  \relative fis { a' }
  \relative fis { ais' }
  \relative fis { b' }
  
  \relative fis { c' }
  \relative fis { cis' }
  \relative fis { d' }
  \relative fis { dis' }
  \relative fis { e' }
  \relative fis { f' }
}



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



reply via email to

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