Thanks Harm,
I do think it would be cool -- i must say i only played a bit with it and
yes in little examples :)

>Apart from the most simple cases and only in c-major. ;)

actually I got it to go in all keys :) a hack i do admit .. but it does the
job.

anyway that as I said would be a great feature!

In other keys -- other then c-major --- you just have to find the I

%%%%%%%%% cut

\version "2.18.2"


 diatonicScale = { cis d e fis gis a b }


 chrd = \relative c'' { <a cis e> <gis b d> <fis a cis>2

}


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

%% 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") (ly:pitch-notename
pitch)))

\score {

\new PianoStaff

<<

\new ChordNames

\multipleTransposes

{ c }

\multipleModalTransposes

\diatonicScale \chordmode { \chrd }


 \new Staff

\multipleTransposes

{ c }

{

\key a \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 1

\multipleModalTransposes \diatonicScale \chordmode { \transpose c e {\chrd}
}


 \new Staff {

\clef bass

\multipleTransposes

{ c }

{

\key a \major

\multipleModalTransposes \diatonicScale \transpose c c,, \chrd

}

\bar "|."

}

>>


 \layout {

\context {

\Staff

explicitKeySignatureVisibility = #end-of-line-invisible

printKeyCancellation = ##f

}

}

\midi { }

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


 \version "2.18.2"


 diatonicScale = { cis d e fis g a b }


 chrd = \relative c' { <d fis a>4 d'8 cis <g b d>4 <a cis e>

}


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

%% 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") (ly:pitch-notename
pitch)))

\score {

\new PianoStaff

<<

\new ChordNames

\multipleTransposes

{ c }

\multipleModalTransposes

\diatonicScale \chordmode { \chrd }


 \new Staff

\multipleTransposes

{ c }

{

\key d \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 1

\multipleModalTransposes \diatonicScale \chordmode { \transpose c b {\chrd}
}


 \new Staff {

\clef bass

\multipleTransposes

{ c }

{

\key d \major

\multipleModalTransposes \diatonicScale \transpose c c,, \chrd

}

\bar "|."

}

>>


 \layout {

\context {

\Staff

explicitKeySignatureVisibility = #end-of-line-invisible

printKeyCancellation = ##f

}

}

\midi { }

}


%%%%%%%%%%%%%%%%%%


good luck with the patch


Thanks

Stephen


On Wed, Apr 22, 2015 at 5:59 PM, Thomas Morley <thomasmorle...@gmail.com>
wrote:

> 2015-04-22 19:24 GMT+02:00 Stephen MacNeil <classicalja...@gmail.com>:
> > Harm , Thomas Morley and others
> > I like to follow the discussions even if I don't understand/need
> something
> > because I usually learn a lot and sometimes even adapt some ideas or code
> > into something I can use later.
> >
> > In this thread I was amazed that the scheme created could interpret the
> > chords!!!
>
> Well, it does not!
> Apart from the most simple cases and only in c-major. ;)
>
> It may be doable to extend the ChordRootNamer to cover more keys and
> let our chord-naming-engine do some additional work.
> But it will likely be restricted to the simpelst use cases (as others
> mentioned already)
>
> > I tend to analyze music (almost daily). Usually I print it out and
> > go over it and mark in what I need. When I saw this i instantly tried it
> on
> > some of my scores and was amazed.
> >
> > Now where I was lost was -
> > 1. is it possible to make it read polyphony? <<\top \\ \bottom>> without
> re
> > writing it as a chord?
> > 2. the ability to add it to any score as needed for analysis
> > 3. to only transpose when needed to specific keys?
> > 4. use not only pianoStaff but whatever the score uses
>
> A summarizing answer:
> For most questioned I'd answer: I don't know or I doubt
> At least I don't have the time to work on it.
>
> There's a patch of mine needing some rework and I didn't add a single
> line of code to it for about 2 weeks ...
>
> >
> > Thanks
> >
> > Stephen
> >
> > And I really was impressed
> > and liked how it listed the chord and numeral
>
>
> Cheers,
>   Harm
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to