|
From: | Simon Albrecht |
Subject: | Re: Roman Numeral placement |
Date: | Wed, 22 Apr 2015 02:20:02 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
Hi Harm,very impressive, but don’t you also think that it’s a little overkill to launch such big efforts on this small task? If it were on a larger scale, the automation would be more efficient, but with myself I observe that I tend to invest far more time into using as much automation as possible than I’d have needed with simpler code.
One comment I added below… Yours, Simon Am 22.04.2015 um 01:47 schrieb Thomas Morley:
2015-04-22 1:32 GMT+02:00 Thomas Morley <address@hidden>:2015-04-21 19:34 GMT+02:00 SonusProj . <address@hidden>:Attached (for ease of reading this post, code not embedded) is a simple project that has a staff for C Major and all Major flat keys. Above each 7th chord is the chord name. I want to add below the chord, treble clef, the associated Roman numeral description of each chord. I.E. on the C Major I would have I, the Dm7 would have ii7 with the 7 in superscript, the Em7 would have iii7 with the 7 in superscript, etc. I see several avenues for this but I don't see an avenue where I can write the code once and use many times. I want the Roman numerals to appear for all keys and don't want an overly clutter code. Can someone point me in the correct direction? Best regards, Lance _______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-userHi, how about: \version "2.18.2" \header { title = "Root Position 7th Chords" composer = "Lance James" } diatonicScale = { c d e f g a b } chrd = { <c' e' g' b'>1 } multipleModalTransposes = #(define-music-function (parser location m music)(ly:music? ly:music?) (music-clone m 'elements (map (lambda (pitch) (ly:music-property #{ \modalTranspose c $pitch $diatonicScale \context Bottom $music #} 'element)) (event-chord-pitches m)))) multipleTransposes = #(define-music-function (parser location m music)(ly:music? ly:music?) (music-clone m 'elements (map (lambda (pitch) (ly:music-property #{ \transpose c $pitch $music #} 'element)) (event-chord-pitches m)))) #(define (note-name->roman-number-markup pitch lowercase?) "Return roman-number-markup for @var{pitch}." (make-simple-markup (vector-ref #("i" "ii" "iii" "iv" "v" "vi" "vii") (ly:pitch-notename pitch))))%% more concise: #(define (note-name->roman-number-markup pitch lowercase?) "Return roman-number-string for @var{pitch}." (vector-ref #("i" "ii" "iii" "iv" "v" "vi" "vii")
or #("I" "ii" "iii" "IV" "V" "vi" "vii") in order to differentiate between major and minor.
(ly:pitch-notename pitch)))\score { \new PianoStaff << \new ChordNames \multipleTransposes { c f bes ees aes des ges ces } \multipleModalTransposes \diatonicScale \chordmode { \chrd } \new Staff \multipleTransposes { c f bes, ees aes, des, ges, ces } { \key c \major \multipleModalTransposes \diatonicScale \chrd \break \bar "||" } \new ChordNames \with { minorChordModifier = "" %chordNameLowercaseMinor = ##t majorSevenSymbol = "7+" %#whiteTriangleMarkup chordRootNamer = #note-name->roman-number-markup \remove "Staff_performer" } \repeat unfold 8 \multipleModalTransposes \diatonicScale \chordmode { \chrd } \new Staff { \clef bass \multipleTransposes { c f bes ees aes des ges ces' } { \key c \major \multipleModalTransposes \diatonicScale \transpose c c,, \chrd } \bar "|." } >> \layout { \context { \Staff explicitKeySignatureVisibility = #end-of-line-invisible printKeyCancellation = ##f } } \midi { } } Cheers, Harm_______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user
[Prev in Thread] | Current Thread | [Next in Thread] |