Re: Input for \chords: What data type?

2015-06-16 Thread Klaus Blum
Hi Harm, 

thanks a lot - that's what I needed.
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Input-for-chords-What-data-type-tp177895p177914.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Input for \chords: What data type?

2015-06-15 Thread Thomas Morley
2015-06-16 0:10 GMT+02:00 Klaus Blum benbigno...@gmx.de:
 Dear list fellows,

 I am trying to write a function which outputs chord symbols after
 transposing them.
 But what type of data do I need for the input of the \chordmode or
 \chords function, i.e stuff like
 { c1 d:m f g:7 }
 ?



 \chords { c1 d:m f g:7 }

 returns:
 C   Dm   F   G7
 as expected.



 mychords =
 #(define-music-function (parser location arg) (ly:music?)
#{
  \chords { $arg }
#})
 \mychords { c1 d:m f g:7 }

The above is equivalent to
\mychords \notemode { c1 d:m f g:7 }
Can't work.

You have to state \chordmode explicitly or work _inside_ chordmode.
Either of this work:

\mychords \chordmode { c1 d:m f g:7 }


\chordmode { \mychords { c1 d:m f g:7 } }

Ofcourse 'mychords' contains some redundancy then ;)

Below the same

HTH,
  Harm


 returns:
 C   DFG
 Additions like  :m  or  :7  are ignored and produce an error message
 because they are not part of a regular music expression.


 transchordsI =
 #(define-music-function (parser location arg) (ly:music?)
#{
  \chords { \transpose c d { $arg } }
#})
 \transchordsI { c1 d:m f g:7 }

 and

 transchordsII =
 #(define-music-function (parser location arg) (ly:music?)
#{
  \transpose c d { \chords { $arg } }
#})
 \transchordsII { c1 d:m f g:7 }

 obviously suffer the same problem.


 However,
 \trans { \chords { c1 d:m f g:7 } }
 works without problems.
 It seems that the OUTPUT of \chords is accepted as a music expression.

 Surprisingly, even
 \chords { \trans { c1 d:m f g:7 } }
 works, and I can't understand why...



 I've tried nearly each and every data type (predicate). If ly:music?
 isn't the right choice, what do I need?
 Am I missing something else?

 Thanks for any hint
 Klaus

 chord_function_fail.ly
 http://lilypond.1069038.n5.nabble.com/file/n177895/chord_function_fail.ly
 chord_function_fail.pdf
 http://lilypond.1069038.n5.nabble.com/file/n177895/chord_function_fail.pdf



 --
 View this message in context: 
 http://lilypond.1069038.n5.nabble.com/Input-for-chords-What-data-type-tp177895.html
 Sent from the User mailing list archive at Nabble.com.

 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user