Using Frescobaldi compile functionality from another program

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Frescobaldi compile functionality from another program

pablocordal
Hi everyone,

May be this is not the right forum to expose this question but I'm sure that some of you guys are not lilypond expert users but expert programmers too and may be you can give me a hand, so here goes my problem:

I'm writing a small visual basic program where I enter some notes in lilypond language and then I press the button "save". Then the program creates a .ly file. Then I go to Frescobaldi, open the file and compile it --> a pdf and midi files are created, then I can listen to the midi file.

What I need is to generate the pdf and midi file from visual basic directly. Is there any way I can use the compile functionality of Frescobaldi from visual basic? if so, I could listen to the midi file and watch the pdf directly in visual basic saving a lot of time.

Thank you very much in advance,
Best regards
Pablo

Reply | Threaded
Open this post in threaded view
|

Re: Using Frescobaldi compile functionality from another program

Davide Liessi-2
Dear Pablo,

Il giorno gio 19 mar 2020 alle ore 17:25 Pablo Cordal
<[hidden email]> ha scritto:
> What I need is to generate the pdf and midi file from visual basic directly.
> Is there any way I can use the compile functionality of Frescobaldi from visual basic?

"compile functionality of Frescobaldi" = LilyPond!
I don't know Visual Basic, but I am sure there is a way to run
external programs (see, e.g., [1] where Process.Start is mentioned),
so you should be able to run LilyPond on your (possibly temporary)
file from within your program.

Best wishes.
Davide

[1] https://stackoverflow.com/questions/16152531/how-to-run-a-command-prompt-command-with-visual-basic-code

Reply | Threaded
Open this post in threaded view
|

Re: Using Frescobaldi compile functionality from another program

m.tarenskeen
In reply to this post by pablocordal


On Thu, 19 Mar 2020, Pablo Cordal wrote:

> Hi everyone,
> May be this is not the right forum to expose this question but I'm sure that some of you guys are not lilypond expert users but expert programmers too and may be you
> can give me a hand, so here goes my problem:
>
> I'm writing a small visual basic program where I enter some notes in lilypond language and then I press the button "save". Then the program creates a .ly file. Then
> I go to Frescobaldi, open the file and compile it --> a pdf and midi files are created, then I can listen to the midi file.
>
> What I need is to generate the pdf and midi file from visual basic directly. Is there any way I can use the compile functionality of Frescobaldi from visual basic?
> if so, I could listen to the midi file and watch the pdf directly in visual basic saving a lot of time.

Hi Pablo,

Don't know anything about Visual Basic, but it's the lilypond.exe
binary that you need to call to do the work for you directly. I am sure
Visual Basic can call external commands?

MT


Reply | Threaded
Open this post in threaded view
|

Re: Using Frescobaldi compile functionality from another program

m.tarenskeen


On Thu, 19 Mar 2020, Martin Tarenskeen wrote:

> Hi Pablo,
>
> Don't know anything about Visual Basic, but it's the lilypond.exe binary that
> you need to call to do the work for you directly. I am sure Visual Basic can
> call external commands?

https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-function

https://lilypond.org/doc/v2.18/Documentation/usage/command_002dline-usage.en.html

Hope that helps?

MT