David,

Yes!!! Yes! Yes! Yes! Yes! Yes!

Seriously, that totally made my day. You are my hero. Scheme is not my native 
language ;-), but I am learning slowly. I did determine the need for that 
check, but was unsure how to do it. I think I have everything I need to make 
this sweet font work beautifully! Can't wait to show everyone!

Best regards,
Abraham

Sent from my iPhone

> On Mar 21, 2015, at 9:35 PM, David Nalesnik-2 [via Lilypond] 
> <ml-node+s1069038n17346...@n5.nabble.com> wrote:
> 
> 
> 
>> On Sat, Mar 21, 2015 at 10:06 PM, David Nalesnik <[hidden email]> wrote:
>> Hi Abraham,
>> 
>>> On Sat, Mar 21, 2015 at 9:13 PM, tisimst <[hidden email]> wrote:
>>> David,
> 
> [...]
>  
>>> This works perfectly when there are NO rests, but I get this error when 
>>> there is a rest in the NoteColumn:
>>> 
>>>> In procedure ly:grob-array->list in expression (ly:grob-array->list 
>>>> (ly:grob-object grob #)): Wrong type argument in position 1 (expecting 
>>>> Grob_array): ()
>> 
>> Glad I could help!
>> 
>> If there's a rest, then the note-heads array will be empty.  To make this 
>> work, just add a check that the note-heads list isn't the empty list '().
> 
>  Oh, shoot!  It's past my bedtime...
> 
> The error happens because you're applying ly:grob-array->list to that 
> grob-array which is empty when there's a rest.  So the check has to be before 
> the conversion to a list:
> 
> #(define (flipnotes grob)
>    (let ((notes (ly:grob-object grob 'note-heads)))
>      (if (ly:grob-array? notes)
>          (for-each
>           (lambda (note)
>             (let* (;(pitch (ly:event-property (event-cause note) 'pitch)) ;; 
> don't need this
>                    (stem (ly:grob-object note 'stem))
>                    (dir (ly:grob-property stem 'direction))
>                    (offset (ly:grob-relative-coordinate note grob X)))
>               (if (eq? dir DOWN)
>                   (if (and (< offset 0.1) (> offset -0.1))
>                       (ly:grob-set-property! note 'rotation '(180 0 0))
>                       (ly:grob-set-property! note 'rotation '(0 0 0)))
>                   (if (and (< offset 0.1) (> offset -0.1))
>                       (ly:grob-set-property! note 'rotation '(0 0 0))
>                       (ly:grob-set-property! note 'rotation '(180 0 0)))
>                   )
>               ))
>           (ly:grob-array->list notes))
>          ; alternate return?
>          
>          )))
> 
> 
> --David
> 
> 
> _______________________________________________ 
> lilypond-user mailing list 
> [hidden email] 
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173461.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com 
> To unsubscribe from Lilypond, click here.
> NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173462.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