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: address@hidden
Subject: Re: Feature Request: Chromatic note names
Date: Thu, 16 May 2013 19:19:01 -0700 (PDT)

Hi, earlier today i just copied/pasted this to my file, and it worked fine.
All tritones go down.
I didnt really understand what the hell that code is doing, but worked the
way i want.

-------------------------------------------------------

/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)
/
---------------------------------------------------

The addition to define-note-names.scm

/;; Language: Chromatic -----------------------------------------------;
    ;; Erico Miranda Schmitt <address@hidden>
    ;;
    ;;  There are no accidentals.
    ;;  Names according to Muto Music Method.
    ;;  english:     c  c# d  d# e  f  f# g  g# a  a# b
    ;;  chromatic:   do di re me mi fa fi so lu la se si
    ;;  Does not support quarter tones as it kills the purpose of no
accidentals at all.
    ;;  To be used with MNP-scripts.ly, it supports chromatic staff
notation.

    (chromatic . (
                (do . ,(ly:make-pitch -1 0 NATURAL))            
                (di . ,(ly:make-pitch -1 0 SHARP))
                (re . ,(ly:make-pitch -1 1 NATURAL))
                (me . ,(ly:make-pitch -1 2 FLAT))
                (mi . ,(ly:make-pitch -1 2 NATURAL))
                (fa . ,(ly:make-pitch -1 3 NATURAL))
                (fi . ,(ly:make-pitch -1 3 SHARP))
                (so . ,(ly:make-pitch -1 4 NATURAL))
                (sol . ,(ly:make-pitch -1 4 NATURAL))
                (lu . ,(ly:make-pitch -1 5 FLAT))
                (la . ,(ly:make-pitch -1 5 NATURAL))
                (se . ,(ly:make-pitch -1 6 FLAT))
                (si . ,(ly:make-pitch -1 6 NATURAL))
                (ti . ,(ly:make-pitch -1 6 NATURAL))
                ))
/

and the chromatic.ly file

/\version "2.16.0"

\language "chromatic"/


So, i could possibily add a ra or ro to mean db, ri to mean d#, su to mean
gb, sa to mean g#, li to mean a#... or just keep the english names if anyone
prefers that kind of input.

I can still get the same notes in traditional notation if i cut out
/ 
\include "MNP-scripts.ly"
and that part i copied from
http://lsr.dsi.unimi.it/LSR/Item?id=619
So you just add
\new Staff { \theMusic }/

and i will get it.

*BUT!!!* now the manual dashed ledger lines become a problem, because i have
to manually take all of them out or they will mess the traditional staff.
Also those manual changes make the double chromatic staff incompatible to
the single one, as you can see in my file


so, here is my test file, with chromatic notation, and next is another file
with the same notes and traditional notation:

Ill still take a better look in your last message.

------------------------------------------


/\version "2.16.1"

\include "MNP-scripts.ly"
\language chromatic

% 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)

theMusic = { \relative do' { 
  \time 4/4
   % C clef for middle do. if nothing is done, treble clef is shown, but
works the same
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefPosition = #-6
  \set Staff.middleCPosition = #-6
  so'' di so fi |
  mi fa fi so |
  lu la se si |
  do re mi fa |
  so la si do |
  \time 2/4
  <do,, mi so>4
  
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefPosition = #6
  %12semitones (octave) clef. pitches sound 12 semitones lower
  \set Staff.clefOctavation = #-11
  \set Staff.middleCPosition = #18
   %add top dashed line
 \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 18 24 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t #f #t )
  <do mi so>4
  
  % returns to normal staff
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 18 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t #f )
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefOctavation = #0
  \set Staff.clefPosition = #6
  \set Staff.middleCPosition = #6
  <do mi so>4
  }
  }
  \new StaffThumlineTwo { \theMusic }
  
  % Not using \theMusic again because staff lines are modified in the middle
of \theMusic %
  
  \new StaffThumlineOne { \relative do' { 
  \time 4/4
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t )
  so'' 
  \stopStaff \startStaff
   \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f )
  di so fi |
  mi fa fi so |
  lu la se si |
  do re mi 
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t )
  fa |
  so la
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 18 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t #f )
  si do |
  
  \time 2/4
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefPosition = #-6
  \set Staff.middleCPosition = #-6
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f )  
  <do,, mi so>4
 
 \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12 18 24 )
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t #f #t )
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefPosition = #6
  \set Staff.clefOctavation = #-11
  %clef number 12 is far away downwards, should be with the clef
  \set Staff.middleCPosition = #18
  <do mi so>4
  
  \stopStaff \startStaff
  \override Staff.StaffSymbol #'line-positions = #'( -6 0 6 12)
  \dashedStaffSymbolLines #'(0.5 . 0.7) #'( #f #t #f #t )
  \set Staff.clefGlyph = #"clefs.C"
  \set Staff.clefOctavation = #0
  \set Staff.clefPosition = #6
  \set Staff.middleCPosition = #6
  <do mi so>4
  } }/
 

 ----------------------second file, traditional
notation------------------------


/\version "2.16.1"
\language chromatic


theMusic = { \relative do' { 
  \time 4/4
   so'' di so fi |
  mi fa fi so |
  lu la se si |
  do re mi fa |
  so la si do |
  \time 2/4
  <do,, mi so>4
 
  <do mi so>4
  
 
  <do mi so>4
  }
  }
  \new StaffThumlineTwo { \theMusic }/



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



reply via email to

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