escaping backslashes

The method that you are using works well for a piece that I am doing for generative music, but I wanted to note that because of the way the Ruby notate def, it errors on any \ that are in the lilypond syntax. For example:

\relative c' {
c d e f
g a b c
}

Doesn't compile correctly. if you add another backslash:

\\relative c' {
c d e f
g a b c
}

it then works. I don't know Ruby well at all, so I don't know the proper way to Regex the string for the slashes, or I would provide code to fix the bug.

As a side note, it would seem like you could do this with simple scripting executing terminal commands to lilypond, but I won't argue with something that works.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
You must answer the following question to post. This prevents automated spam submissions. If you answer incorrectly, a different question will be provided so you can try again.
_oltage: