lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Working on scheme engravers


From: Eric Knapp
Subject: Working on scheme engravers
Date: Wed, 20 Jan 2010 20:36:15 -0600

Hello,

I was asked to start posting here with my questions about scheme
engravers. I'm also learning scheme so my questions will be naive, and
my code is probably not up to scheme conventions. I have started with
the scheme-engraver.ly sample. I'm using Lilypond 2.13.11 on OS X and
Linux. I attached the full file with my current code. Here is the part
I have added to the sample. My goal is to determine the fingering
number and the string number and draw the notehead and the string
indicator with custom code and add a fret number that is calculated.

My code:

      (cons 'note-event (lambda (engraver event)
        (let*
          (
            (artics (ly:event-property event 'articulations))
            (fingers (car artics))
            (strings (car (cdr artics)))
            (digitNum (ly:event-property fingers 'digit))
            (stringNum (ly:event-property strings 'string-number))
          )
          (display (list "\n\nArticulations: \n\n"  artics "\n\n"))
          (display (list "\nfinger: \n" fingers "\n\n"))
          (display (list "\nstrings: \n" strings "\n\n"))
          (display (list "\ndigit: " digitNum "\n\n"))
          (display (list "\nstring: " stringNum "\n\n"))
        )

This will work with this music code:

<c-1\4 e-3\5>

Here are my questions. Is this the best way to determine the digit and
string-number? The first flaw I see with this code is if the music is
entered like this:

<c\4-1 e\5-3>

In that case my code won't work. Is there a way to determine the digit
and string-number directly by name? It looks like the articulations
are a list. Would it be possible to loop through the list and
determine what each one is?

Thanks for the scheme engraver capability. This will let me finally
crack the notation system of the Chapman Stick. I have started a
project with a few other programmers/Chapman Stick players. We are
determine to bring Lilypond to the Stick world.

Thanks for your help.

-Eric

-- 
Eric Knapp
IT Instructor
Information Technology
Madison College
http://matcmadison.edu
3550 Anderson Street
Madison, Wisconsin 53704
Telephone: 608.246.6641
Fax: 608.243.4754
Email: address@hidden

Attachment: firstSuccessEngraver.ly
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]