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: Wed, 29 May 2013 09:11:35 -0700 (PDT)

address@hidden wrote
> Sorry for the delay, here's the file i had been doing some testing.

Thanks for posting your file.  I now see that re-setting the language like
this
  \language english

overwrites the changes that were made by 
  #(ly:parser-set-note-names parser dodecaPitchNames)

and that lets you combine different types of staff, as shown in the snippet
below.  That's good to know!


I haven't been able to look closely at your message about the problem of
converting the chromatic note names back to traditional names.  But I wonder
if a simple find/replace operation on the .ly text file would work as well
or better than converting to MIDI and back?  

It just seems like you could lose a lot of info through the MIDI conversion
(since MIDI is meant for audio and not notation).  You could just do a
find/replace for each of your 12 chromatic note names, converting them to
the traditional names.  Maybe you could script this somehow.  I wonder if
there are scripts for converting .ly files from one note-name language to
another that could help?

If your target is a sharp key you would use the sharp names for the
"black-key" enharmonic notes, or flat names for a flat key.  That would
result in the correct notes for any notes in the key, and then you could
manually change any accidental notes that fall outside the key (choosing a
sharp or flat enharmonic) if needed.  (If the target key had more than 5
sharps or flats, you'd need to adjust for that, for example F --> E#.)

Hmmm... then the tritones and relative entry problem would only occur if
there were a tritone that included an accidental note, and you would have a
50/50 chance of it coming out correctly.  You could manually check the
accidentals I guess.  (Maybe a helper function that would highlight any note
that was a tritone away from the previous one, and maybe it could even check
that one note was not in the current key? Might be tricky.)

Just checked the LSR and this looks promising:
http://lsr.dsi.unimi.it/LSR/Item?id=638

Nice definitions for "gambiarra"!  

-Paul


% BEGIN SNIPPET
\version "2.16"

% set the nominals to be 12-equal
#(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)))

% Set the pitches to 12-equal with enharmonic equivalences
% keep the original pitch names.
% all tritones go downwards on \relative, unless specified otherwise.
% Preserves quartertones as half-sharps.
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  \with {
    \override StaffSymbol #'line-positions = #'( -6 0 6 )
  } {
    \relative f { a ais b c cis d dis e f fis g gis a ais b c cis d dis e f
fis g gis a ais b c fis c fis }
  }
  \language english
  \new Staff {
    \relative f { a as b c cs d ds e f fs g gs a as b c cs d ds e f fs g gs
a as b c fs c fs }
  }
>>




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



reply via email to

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