[EMAIL PROTECTED] writes: > I've been studying and thinking about architectures for Fret Diagrams in > lilypond. > > It seems to me that there should be a FretDiagrams context which would > process exactly the same music expression as the ChordNames context. > Then, a lead sheet with fret diagrams could look like: > > \score { > << > \new ChordNames \chords { chords } > \new FretDiagrams \chords { chords } > \notes the melody > \lyricsto "" \new Lyrics \lyrics { the text } > >> > } > > > As far as the Fret_diagrams_engraver goes, I'm thinking that it could > work as follows: If there are no string events, then it could just do > an alist lookup for the fret diagram, based on the chord name, which is > available using the code from the Chord_name_engraver. If there are > string events, then it could create the fret diagram using the string > (and possibly finger) events. > > First, does this architecture seem reasonable?
I think that it is a good idea to make sure that you can feed everything accepted by ChordNames to FretDiagrams as well. I would not base anything on the chord name itself (ie. the output string). Systems for chord names are highly non-standard, so they're not a good basis to interpret. I suppose that you would have to devise some kind of lookup structure, and given a chord in standard format, it looks up the standard fingerings for guitar. It would even be cooler if there could be an automated system that generates a suitable fingering for a chord, given the pitches of the chord and the tuning of the strings. I suspect that that might not be easy to keep track of limitations of the human hand, though. > Second, where do I look to find out how a context is created? See ly/engraver-init.ly > Third, can I just call make-item, setting the "text" property to be a > fret-diagram markup, much like the Chord_name_engraver does now? If Yes. You could copy Chord_name_engraver, but plug-in a different Scheme function to go from chords to frets. In any case, it would probably be a good idea if you would send the first tries to the mailing list as patches. -- Han-Wen Nienhuys | [EMAIL PROTECTED] | http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/lilypond-devel