[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Programming question
From:       David Nalesnik <david.nalesnik () gmail ! com>
Date:       2014-11-26 14:44:39
Message-ID: CANn-nXnj0EfidNtdSb7pj_voAPS3JQ-hBoeJRdaneZmXf46gQQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Jay,

On Wed, Nov 26, 2014 at 4:10 AM, Jay Vara <jay@diljun.com> wrote:

> Yay! That works. Not sure why the other way did not work.
>
> I tried various ways of getting it to output to a string instead of to a
> file, something like:
>
> #(set! (jv (with-output-to-string
>
> (lambda () #{ \displayMusic \music #}))))
>
>
> so that we could add the # to the string jv. No luck here as I could not
> get past the syntax / non-music expression issues.
>

You could add the "#" like this (in the file "out.ly"):

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

{
  #(with-output-to-file "display.txt"
      (lambda () (display "#")
                  #{ \displayMusic \music #}))
}

Now, as for doing everything within a single file, I'm at a loss.
Hopefully, somebody could help here.

--David

[Attachment #5 (text/html)]

<div dir="ltr">Jay,<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, \
Nov 26, 2014 at 4:10 AM, Jay Vara <span dir="ltr">&lt;<a href="mailto:jay@diljun.com" \
target="_blank">jay@diljun.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr">Yay! That works. Not sure why the other way did not \
work.<div><br></div><div>I tried various ways of getting it to output to a string \
instead of to a file, something like:</div><div><br></div><div><p \
style="margin:0px">#(set! (jv (with-output-to-string</p> <p style="margin:0px">      \
(lambda () #{ \displayMusic \music #}))))</p><p style="margin:0px"><br></p><p \
style="margin:0px">so that we could add the # to the string jv. No luck here as I \
could not get past the syntax / non-music expression \
issues.</p></div></div></blockquote><div><br></div><div>You could add the \
&quot;#&quot; like this (in the file &quot;<a \
href="http://out.ly">out.ly</a>&quot;):</div><div><br></div><div><div>music   = \
\relative c&#39; { c4 d e f g a b c d e f g a b c \
}</div><div><br></div><div>{</div><div>   #(with-output-to-file \
&quot;display.txt&quot;</div><div>         (lambda () (display \
&quot;#&quot;)</div><div>                           #{ \displayMusic \music \
#}))</div><div>}</div></div><div><br></div><div>Now, as for doing everything within a \
single file, I&#39;m at a loss.   Hopefully, somebody could help \
here.</div><div><br></div><div>--David</div></div></div></div>



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic