Re: [frogs] bend implementation

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]



>----Original Message----
>From: c_sorensen@xxxxxxx
>Date: 11/01/2010 14:55 
>To: "Marc Hohl"<marc@xxxxxxxxxx>, "frogs@xxxxxxxxxxx"<frogs@lilynet.
net>
>Subj: Re: [frogs] bend implementation

>
>If I were doing it, I'd do it in c++, because I want to have some 
static
>variables in the engraver, and I don't know if I can do that in 
scheme.
>

It could be time-saving to at least prototype in Scheme and see if 
anything crops up that really needs C++.

By static, do you mean having a variable maintain its state between 
calls? If so it could be done as below:

\version "2.13.11"

#(define Engraver_with_static (list
  (cons 'process-music
    (let ((a 5))
      (lambda (x)
      (set! a (+ a 5))
      (display a)
      (newline)
  )))))

\layout {
  \context {
    \Voice
    \consists \Engraver_with_static
  }
}

\relative c' {
  c4 d e f
}

- David



2009: A year in review - http://www.tiscali.co.uk/2009


---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/