Hi,
I’m trying to understand how ob-lilypond handles variables.
I have the following minimal example which compiles correctly:
#+begin_src lilypond :file test.png :cache no
 myVar = { e f g}
 \relative c' { a b c d \myVar }
#+end_src

Can I move the definition of myVar to a header argument of the source block? When I write this: #+begin_src lilypond :file test.png :cache no :var myVar="{ e f g }"
 \relative c' { a b c d \myVar }
#+end_src
The compiler complains: "unknown escaped string: `\myVar'".

This makes me think that myVar is not passed at all to the code block. What is the correct way to do this?

I know that I can do it with noweb syntax. However, I would prefer to use header args because I need those variables in all lilypond code blocks. Ultimately, I plan to pass them from org-babel-default-header-args:lilypond.

Victor

Reply via email to