denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Sibelius 7 to LilyPond Conversion!


From: Richard Shann
Subject: Re: [Denemo-devel] Sibelius 7 to LilyPond Conversion!
Date: Fri, 30 Oct 2015 11:54:29 +0000

On Fri, 2015-10-30 at 08:09 -0300, Thomas Wilmot wrote:
> The other issue is that the single-part export has no line breaks in it so
> it's very hard to work with!
> Might version 2.0 be better with this?

no, but 2.0.2 may well be if you continue to show an interest :)

Right clicking on Quick LilyPond Part and choosing "Get Script into
Scheme Window" you see this is the script:

(d-PushPosition)
(d-GoToBeginning)
(let ((name  (d-Open "query=filename")))
    (if name
        (let* ((filename  (string-append (substring name 0 (- (string-length 
name) 7)) "-denemo-" (number->string (d-GetStaff)) ".ly"))   
                (port (open-file filename "w")))
            (let loop ()
                (if port
                    (begin 
                        (format port "~A " (d-GetLilyPond))
                        (if (d-MoveCursorRight)
                            (loop)
                            (close-port port))))))
        (d-WarningDialog (_ "The score does not have a file name, so no file 
name for the output LilyPond file can be constructed. Save the score first."))))
(d-PopPosition) 


In order to put in breaks at each measure you could set up a measure
number variable to the value (d-GetMeasure) and then where it emits the
LilyPond syntax you could emit a comment with the measure number and a
line break

(format port "%Measure ~A\n" measure-number)

below is a revised script that does this:

8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 

(d-PushPosition)
(d-GoToBeginning)
(let ((current "-1")(name  (d-Open "query=filename")))
    (if name
        (let* ((filename  (string-append (substring name 0 (- (string-length 
name) 7)) "-denemo-" (number->string (d-GetStaff)) ".ly"))   
                (port (open-file filename "w")))
            (let loop ()
                (define measure-number (d-GetMeasure))
                (if port
                    (begin
                        (if (not (equal? measure-number current))
                                (begin
                                        (set! current measure-number)
                                        (format port "%Measure ~A\n" 
measure-number)))
                        (format port "~A " (d-GetLilyPond))
                        (if (d-MoveCursorRight)
                            (loop)
                            (close-port port))))))
        (d-WarningDialog (_ "The score does not have a file name, so no file 
name for the output LilyPond file can be constructed. Save the score first."))))
(d-PopPosition)  


8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 8>< 
I've attached it as a file, which is safer...

I've put this in Denemo now, so it will show in version 2.0.1
Meanwhile you can run it from the scheme window.

Richard


Attachment: QuickLilyPondPart.scm
Description: Text Data


reply via email to

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