lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LilyPond processing mode


From: Han-Wen Nienhuys
Subject: Re: LilyPond processing mode
Date: Sun, 06 Nov 2005 02:11:39 +0100
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Graham Percivalwrote:

So, would it be possible to add a mode to lilypond, where you load
lilypond, and keep it sitting there on standby. Then, when you want a score typeset, you tell lilypond the file to use (or drag it into the window). Lilypond then processes the file as normal, but stays 'alive' after that. This might be a useful feature to have, especially when doing tweaks.

This is quite easy to add, since the LilyPond mainloop is also coded in Scheme, but why do you need it? It would only save 1 second or so on a run, typically much less than the time you spend dragging the file.


Seriously?!  Please please please!

see attached; the file will listne on port 2904 for a quoted string, and process that as .ly; of course, this is one of many options.

I had to apply a small fix, so use with CVS.

muurbloem:~/src/lilypond$ lilypond foo &
[1] 30388
muurbloem:~/src/lilypond$ GNU LilyPond 2.7.16
Processing `foo.ly'
Parsing...Listening for clients in pid: 30388

muurbloem:~/src/lilypond$
muurbloem:~/src/lilypond$  telnet localhost 2904
Trying 127.0.0.1...
Got new client connection: #(2 2130706433 57450)
Client address: #("localhost.localdomain" ("muurbloem" "localhost") 2 4 (2130706433))
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
hello LilyPond 2.7.16
" \\relative { f g a } "

Interpreting music... [1]
Preprocessing graphical objects...
Calculating line breaks... [2]
Calculating page breaks...
Layout output to `foo.ps'...
Converting to `foo.pdf'...Connection closed by foreign host.

Interpreting music... [1]
Preprocessing graphical objects...
Calculating line breaks... [2]
Calculating page breaks...
Layout output to `foo-1.ps'...muurbloem:~/src/lilypond$
Converting to `foo-1.pdf'...Finished. Time elapsed: 6.93

I think I can avoid the latency issues by creating the music one system in advance... but still, saving 1 second for each run would be great! Especially if I wanted to try having one computer displaying parts for two (or even four) people.

Cool project; I suspect it will be a lot of work to glue together all the parts.

--
 Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen

#(if #t
  (let ((s (socket PF_INET SOCK_STREAM 0)))
       (setsockopt s SOL_SOCKET SO_REUSEADDR 1)
       (bind s AF_INET INADDR_ANY 2904)
       (listen s 5)

       (simple-format #t "Listening for clients in pid: ~S" (getpid))
       (newline)

       (while #t
              (let* ((client-connection (accept s))
                     (start-time (get-internal-real-time))
                     (client-details (cdr client-connection))
                     (client (car client-connection)))
                (simple-format #t "Got new client connection: ~S"
                               client-details)
                (newline)
                (simple-format #t "Client address: ~S"
                               (gethostbyaddr
                                (sockaddr:addr client-details)))
                (newline)
                ;; Send back the greeting to the client port
                (display (format
                          "hello LilyPond ~a\n"
                          (lilypond-version))
                          client)

               (let* ((question (read client))
                      (result (ly:parse-string-result
                               (format " \\notemode {  ~a } " question)
                               (ly:clone-parser parser))))
                      
                (print-music-as-book parser result)
                (close client)

                (print-music-as-book parser result)
                (display (format "Finished. Time elapsed: ~a\n"
                          (/ (- (get-internal-real-time) start-time)
                           (* 1.0 internal-time-units-per-second))

                        ))
                (gc) ; do GC while app is refreshing the screen.
              )))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]