Hi,

I still have a little question :

In my code, I use a define-music-function to exctract the nots of chords
from a chordmode , and i compare each pitch of the notes events with a list
to find x/y position of a colored dot making a custom diagram.

My problem is that I can't get the name of the pitch, and when I compare the
pitch and my list, the values didn't match.

#(define-markup-command (complete layout props the-chord)
  (ly:music?)
  (ly:stencil-scale
   (
     
     (make-dot-list 
      (map
        (lambda (m) (ly:music-property m 'pitch))
        (extract-named-music the-chord 'NoteEvent)))) 
    1 1))


diag=
#(define-music-function (parser location music)
  (ly:music?)
  (music-map
    (lambda (m)
     (if (music-is-of-type? m 'event-chord)
      #{ <>^\markup \complete #m $m #}
      m))
    music))


Here is the code which compare the list and the pitch from music event
function :

#(define (make-dot-list l1)
   (if (null? l1) 
       empty-stencil
       (ly:stencil-add 
          (make-dot (ly:pitch-notename(car l1)))
          (make-dot-list (cdr l1)))))

I get this error in lilypond.

keyboard diagram error - unkown note '0' 

If I drop the ly:pitch-notename, I get this error instead : fatal error:
keyboard diagram error - unkown note '#<Pitch c' >'

I would like to extact from the varioable only c' in this case.
Why the function ly:pitch-notename fails ?

I join the ly file.

Thanks By advance.

Ewen







--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Apply-a-music-function-script-to-all-elements-of-a-list-tp200313p202900.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

Reply via email to