[frogs] chord-name-engraver plus capo - schemeing away ...

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


 Okay. I (think I) know how to call scheme from C++. And I've been told
it's a lot easier to manipulate markup in scheme than C++. So I need to
write two functions in scheme, and call them from my engraver. Help! :-)

The chords are stored as markup as:

(#<procedure line-markup (layout props args)>
  ( 
    (#<procedure line-markup (layout props args)>
      ( (#<procedure simple-markup (layout props str)> C)
        (#<procedure line-markup (layout props args)>
      ( (#<procedure simple-markup (layout props str)> )))))
    (#<procedure simple-markup (layout props str)> )
    (#<procedure super-markup (layout props arg)>
      (#<procedure line-markup (layout props args)>
    ((#<procedure line-markup (layout props args)>
      ( (#<procedure line-markup (layout props args)>
          ((#<procedure simple-markup (layout props str)> )))
        (#<procedure simple-markup (layout props str)> 7))))))))

Digging into that, it seems fairly simple that I want to wrap a couple
more "procedure line-markup" or "procedure simple-markup"s around this
lot. So.

(define (parenthesize-markup markup)
  (make-line-markup (list (make-simple-markup "(") markup
(make-simple-markup ")"))

??? I can't believe it's that easy! there must be more to it than that!

So. First of all, what have I missed :-)
Secondly, where do I put this function if I have got it right.
Thirdly, how do I create "" or " " as my separator and do I need it ...
Fourthly, given that I know the name of the function, is that all I need
to pass from C++, or do I need to get a pointer to the function from
somewhere?

Phew! Get this done, then the code is all working and all I need do is
document it and submit it for inclusion!

Cheers,
Wol

---
----
Join the Frogs!


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