lilypond-user
[Top][All Lists]
Advanced

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

polychords proof of concept


From: Jean-Alexis Montignies
Subject: polychords proof of concept
Date: Mon, 30 Jan 2012 00:25:24 +0100

Hi,

Here is a report on my attempts to display polychords in lilypond. Feedback and 
comments are welcome! As it's my beginnings in scheme, programming style may 
not be very good :).

I was able to print the chord root name transposed in the markup. 
Now I can't print the transposed root name above the normal root name, so I 
might need to find another way. May be write my own chord namer.

Greetings,

Jean-Alexis



#(define myChordRootNamer #f)

#(define-markup-command (transposedRootName layout props a b) (number? number?)
  #:properties ((cause #f))
  "Print the root of the chord transposed."
  (display (ly:event-property cause 'pitch))
  (display myChordRootNamer)
  (interpret-markup layout props
    (markup (myChordRootNamer 
             (ly:pitch-transpose (ly:event-property cause 'pitch) 
(ly:make-pitch 0 a b))
                                #f))))
chExceptionMusic = {
  <c e g des'' f'' aes''>1-\markup { & 
                         \transposedRootName #1 #-1/2 }
}
chExceptions = #( append
  ( sequential-music-to-chord-exceptions chExceptionMusic #t)
 ignatzekExceptions)
theMusic = \chordmode {
\set chordNameExceptions = #chExceptions
     \applyContext #(lambda (x)
      (set! myChordRootNamer (ly:context-property x 'chordRootNamer) ))
       c1:5.16-.18.20-
}
\layout {
  ragged-right = ##t
}
<< \context ChordNames \theMusic
   \context Voice \theMusic
>>



reply via email to

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