Re: using python snippets in Lilypond
Am 21. Juni 2015 16:28:49 MESZ, schrieb David Kastrup d...@gnu.org: Avner avnerdor...@gmail.com writes: Dear All, I understand that there is a way to use python snippets within a lilypond score. Not that I know of, so it would seem that any such possibility would not be advertised widely and definitely not be a core feature of LilyPond. The LilyPond editor Frescobaldi may be extended in Python if I am not mistaken. Yes, and this is called Snippets. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
So I create the python snippet - how do I then call it in the score? I apologize if this is too basic of a question... Thanks! Avner On Sun, Jun 21, 2015 at 10:36 AM, Peter Bjuhr peterbj...@gmail.com wrote: On 2015-06-21 16:28, David Kastrup wrote: Dear All, I understand that there is a way to use python snippets within a lilypond score. Not that I know of, so it would seem that any such possibility would not be advertised widely and definitely not be a core feature of LilyPond. The LilyPond editor Frescobaldi may be extended in Python if I am not mistaken. Yes, you can use Python snippets in Frescobaldi, but not in the LilyPond code/score directly - instead they are created in a special Snippets editor. Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On 2015-06-21 16:28, David Kastrup wrote: Dear All, I understand that there is a way to use python snippets within a lilypond score. Not that I know of, so it would seem that any such possibility would not be advertised widely and definitely not be a core feature of LilyPond. The LilyPond editor Frescobaldi may be extended in Python if I am not mistaken. Yes, you can use Python snippets in Frescobaldi, but not in the LilyPond code/score directly - instead they are created in a special Snippets editor. Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On 2015-06-21 16:47, Urs Liska wrote: Just a question: would it be possible to call a Python script from Scheme (this should be possible) and use its output in LilyPond? Maybe you'll find some answers here: http://www.zak.co.il/a/itches/pyguile Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Yes, you can use Python snippets in Frescobaldi, but not in the LilyPond code/score directly - instead they are created in a special Snippets editor. So I create the python snippet - how do I then call it in the score? I apologize if this is too basic of a question... No I don't think it is too basic! I guess it interesting to compare it with a Scheme snippet, if you like, inside the LilyPond code. A scheme snippet is basically compiled together with the rest of the LilyPond code and can extend that code. With a Python snippet in Frescobaldi you can instead manipulate the LilyPond code to get the result you want. You don't call it from the score; you call it from the editor to change the score before it is compiled. If it's changes you perform regularly on the score, a Snippet could conveniently be applied to a keyboard shortcut or to the Snippets menu - otherways you run it from the Snippets manager. Hope that explains the basics! If you tell us more about what kind of snippet you want to run we could discuss this in more detail. Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On Jun 21, 2015, at 10:41 AM, Avner Dorman avnerdor...@gmail.com wrote: So I create the python snippet - how do I then call it in the score? In Frescobaldi go to the Tools menu and select “Snippets”. (or Snippets menu Manage Snippets…) The snippets panel appears. Find a snippet in the list and double click it. The result of the snippet is inserted into your .ly file, wherever your cursor is. HTH, -Paul ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On Jun 21, 2015, at 11:02 AM, Peter Bjuhr peterbj...@gmail.com wrote: If it's changes you perform regularly on the score, a Snippet could conveniently be applied to a keyboard shortcut or to the Snippets menu - otherways you run it from the Snippets manager. Does anyone know if there is a way to add these snippets to the snippets menu in Frescobaldi? If there is I haven’t been able to find it. It would be much more convenient to access them there (rather than via the snippets manager panel). Thanks, -Paul ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Am 21.06.2015 um 16:41 schrieb Avner Dorman: So I create the python snippet - how do I then call it in the score? You don’t call it in the score, but on the source file: Python may be used to aid in writing a source file, which is then processed by Lilypond. HTH, Simon ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Avner avnerdor...@gmail.com writes: Dear All, I understand that there is a way to use python snippets within a lilypond score. Not that I know of, so it would seem that any such possibility would not be advertised widely and definitely not be a core feature of LilyPond. The LilyPond editor Frescobaldi may be extended in Python if I am not mistaken. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Am 21. Juni 2015 16:36:06 MESZ, schrieb Peter Bjuhr peterbj...@gmail.com: On 2015-06-21 16:28, David Kastrup wrote: Dear All, I understand that there is a way to use python snippets within a lilypond score. Not that I know of, so it would seem that any such possibility would not be advertised widely and definitely not be a core feature of LilyPond. The LilyPond editor Frescobaldi may be extended in Python if I am not mistaken. Yes, you can use Python snippets in Frescobaldi, but not in the LilyPond code/score directly - instead they are created in a special Snippets editor. Best Peter Just a question: would it be possible to call a Python script from Scheme (this should be possible) and use its output in LilyPond? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: using python snippets in Lilypond
do you mean like this? http://www.python-course.eu/python_scores.php Stephen ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On 2015-06-21 18:37, Paul Morris wrote: If it's changes you perform regularly on the score, a Snippet could conveniently be applied to a keyboard shortcut or to the Snippets menu - otherways you run it from the Snippets manager. Does anyone know if there is a way to add these snippets to the snippets menu in Frescobaldi? If there is I haven’t been able to find it. It would be much more convenient to access them there (rather than via the snippets manager panel). Yes, this is controlled by the top line in the Snippet (you have to open the Snippet in the Snippets editor to see that). If you put in menu: followed by the name of the section in the Snippets menu, they will appear there. I think you'll understand what I'm talking about if you look at some of the examples. Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On 22 June 2015 at 04:51, Urs Liska u...@openlilylib.org wrote: Am 21.06.2015 um 18:25 schrieb Peter Bjuhr: On 2015-06-21 16:47, Urs Liska wrote: Just a question: would it be possible to call a Python script from Scheme (this should be possible) and use its output in LilyPond? Maybe you'll find some answers here: http://www.zak.co.il/a/itches/pyguile I think I'm thinking of something more simple: Invoke a Python script (or actually any other shell-like script) and use its output (i.e. what the Python script prints) as a string evaluation of the call. I think this should be feasible, but I'm not so sure if it is really interesting. Urs Given that I’m about 1000 times as proficient in Lua as I am in Scheme, it would be great (for my personal use) to be able to export, modify import a Scheme music expression for example. Vaughan ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Am 21.06.2015 um 18:25 schrieb Peter Bjuhr: On 2015-06-21 16:47, Urs Liska wrote: Just a question: would it be possible to call a Python script from Scheme (this should be possible) and use its output in LilyPond? Maybe you'll find some answers here: http://www.zak.co.il/a/itches/pyguile I think I'm thinking of something more simple: Invoke a Python script (or actually any other shell-like script) and use its output (i.e. what the Python script prints) as a string evaluation of the call. I think this should be feasible, but I'm not so sure if it is really interesting. Urs Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
Thank you so much everyone! It works perfectly and I've learned a whole lot! All the best, Avner On Sun, Jun 21, 2015 at 3:47 PM, Paul Morris p...@paulwmorris.com wrote: On Jun 21, 2015, at 1:00 PM, Peter Bjuhr peterbj...@gmail.com wrote: Does anyone know if there is a way to add these snippets to the snippets menu in Frescobaldi? If there is I haven’t been able to find it. It would be much more convenient to access them there (rather than via the snippets manager panel). Yes, this is controlled by the top line in the Snippet (you have to open the Snippet in the Snippets editor to see that). If you put in menu: followed by the name of the section in the Snippets menu, they will appear there. I think you'll understand what I'm talking about if you look at some of the examples. Got it, thanks Peter! -Paul ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
On Jun 21, 2015, at 1:00 PM, Peter Bjuhr peterbj...@gmail.com wrote: Does anyone know if there is a way to add these snippets to the snippets menu in Frescobaldi? If there is I haven’t been able to find it. It would be much more convenient to access them there (rather than via the snippets manager panel). Yes, this is controlled by the top line in the Snippet (you have to open the Snippet in the Snippets editor to see that). If you put in menu: followed by the name of the section in the Snippets menu, they will appear there. I think you'll understand what I'm talking about if you look at some of the examples. Got it, thanks Peter! -Paul ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: using python snippets in Lilypond
I think this is a very interesting idea (would be useful for me). On Sun, Jun 21, 2015 at 2:51 PM, Urs Liska u...@openlilylib.org wrote: Am 21.06.2015 um 18:25 schrieb Peter Bjuhr: On 2015-06-21 16:47, Urs Liska wrote: Just a question: would it be possible to call a Python script from Scheme (this should be possible) and use its output in LilyPond? Maybe you'll find some answers here: http://www.zak.co.il/a/itches/pyguile I think I'm thinking of something more simple: Invoke a Python script (or actually any other shell-like script) and use its output (i.e. what the Python script prints) as a string evaluation of the call. I think this should be feasible, but I'm not so sure if it is really interesting. Urs Best Peter ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user