Re: Spreadsheet - Python – Ly

2020-11-22 Thread Gilles Thibault




Over last last couple of days I have been thinking about possible ways
to organize the engraving of a rather large piece (~45+ staves) in
Lilypond.
My problem is that the piece in question might undergo significant
changes in the future, so I need access to both instrument-wise and
measure-wise organisation simultaneously.


Well, this is more or less the goal of "arranger.ly".
This project was presented on this list a few weeks ago:

  https://lists.gnu.org/archive/html/lilypond-user/2020-10/msg00491.html

more infos here:

  http://gillesth.free.fr/Lilypond/arranger-docs/arrangerDoc-en.pdf


**

GitHub link of the whole project:

  https://github.com/gilles-th/arranger.ly

Direct link:

   http://gillesth.free.fr/Lilypond/arranger-GIT-copy/arranger.ly.zip


--
Gilles



Re: Spreadsheet - Python – Ly

2020-11-20 Thread Noeck
Dear Max,

what you describe sounds somewhat similar to gridly:
https://github.com/openlilylib/gridly

I have never been in need for such an approach. Which is why I don't
know enough about gridly to describe it properly. And it is not about
spreadsheets just the time/voice-segmentation sounds similar to me. But
perhaps you can have a look at it.

More links:
http://lilypond.1069038.n5.nabble.com/Gridly-simple-Segmented-Grid-td171558.html#a171704
http://web.archive.org/web/20191223132852/http://lilypondblog.org/2014/10/segment-grid/

But implementing a conversion from spreadsheet to a Python list of lists
is pretty straight forward, too. I would use pandas or openpyxl to read
the spreadsheet. Sth. like

import pandas as pd
pd.read_excel(filename).values.tolist()

I have doubts that I myself would like to edit it in a spreadsheet - I
just appreciate the text based approach and git too much to do that.

HTH
Joram



Re: Spreadsheet - Python – Ly

2020-11-20 Thread Martín Rincón Botero
sorry, group_by_measure()

www.martinrinconbotero.com
On 20. Nov 2020, 19:22 +0100, Maximilian Marcoll , wrote:
>
> > > Wouldn’t you just put each measure in a separate cell, so that a cell in 
> > > column 227 corresponds to measure 227? Deleting the corresponding column 
> > > would delete the measure, wouldn’t it?. Or do you have a different 
> > > structure for the Excel spreadsheet in mind?
>
> That’s exactly what I had in mind.
>
> (Sorry, I thought you meant the “make”-approach as an alternative rather than 
> an extension to this idea.)
>
> I’m experimenting with the spreadsheet-python-appoach atm and it looks quite 
> promising.
>
> M
>
> __
> http://www.marcoll.de
>
> subscribe to newsletter
>
> > On 20 Nov 2020, at 19:15, Martín Rincón Botero 
> >  wrote:
> >
> > Hi Maximilian,
> >
> > after having failed at the beginning with abjad (it’s looking better now) I 
> > programmed some functions in Python to also be able to access instruments 
> > and measures. For measures, I made a function that simply looks for | and 
> > gives you back whatever is between | as a list. The Excel approach didn’t 
> > occur to me. Wouldn’t you just put each measure in a separate cell, so that 
> > a cell in column 227 corresponds to measure 227? Deleting the corresponding 
> > column would delete the measure, wouldn’t it?. Or do you have a different 
> > structure for the Excel spreadsheet in mind?
> >
> > Best regards,
> > Martín.
> >
> > www.martinrinconbotero.com
> > On 20. Nov 2020, 17:51 +0100, Maximilian Marcoll , 
> > wrote:
> > > Hi!
> > >
> > > thank you!
> > > That looks awesome. But what do you do if you want to delete measure 227 
> > > entirely?
> > >
> > > Cheers
> > > M
> > >
> > >
> > >
> > >
> > > __
> > > http://www.marcoll.de
> > >
> > > subscribe to newsletter
> > >
> > > > On 20 Nov 2020, at 17:39, J Martin Rushton 
> > > >  wrote:
> > > >
> > > > Hi Max,
> > > >
> > > > Caveat: I've not used this personally, my scores are not complex enough.
> > > >
> > > > One of the standard ways of handling this is to use make 
> > > > (https://www.gnu.org/software/make).  Basically you write a makefile 
> > > > which tells make which files to compile and use that as the input to 
> > > > Lilypond.  Make is clever though, and can select files on the basis of 
> > > > the last time they were changed, or if given parameters (for instance 
> > > > to generate part scores).
> > > >
> > > > See 
> > > > http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles 
> > > > for Lily's take on this.
> > > >
> > > > Regards,
> > > > Martin
> > > >
> > > > On 20/11/2020 16:03, Maximilian Marcoll wrote:
> > > > > Hi Everyone,
> > > > > Over last last couple of days I have been thinking about possible 
> > > > > ways to organize the engraving of a rather large piece (~45+ staves) 
> > > > > in Lilypond.
> > > > > My problem is that the piece in question might undergo significant 
> > > > > changes in the future, so I need access to both instrument-wise and 
> > > > > measure-wise organisation simultaneously.
> > > > > I am considering to enter the entire music in a huge excel 
> > > > > spreadsheet and to write a (python)-script to create one .ly file per 
> > > > > voice,
> > > > > storing all the music in variables that can be used both in the full 
> > > > > score and the individual parts.
> > > > > I’m having difficulties imagining that I am the first one to have 
> > > > > this idea, but couldn’t find anything online.
> > > > > Any hints?
> > > > > Thanks a lot!
> > > > > Cheers,
> > > > > Max
> > > > > __
> > > > > http://www.marcoll.de 
> > > > > subscribe to newsletter 
> > > >
> > > > --
> > > > J Martin Rushton MBCS
> > > >
> > >
>


Re: Spreadsheet - Python – Ly

2020-11-20 Thread Martín Rincón Botero
I see. Abjad has group_by_measures() as well if you’d like to go down that road.

www.martinrinconbotero.com
On 20. Nov 2020, 19:22 +0100, Maximilian Marcoll , wrote:
>
> > > Wouldn’t you just put each measure in a separate cell, so that a cell in 
> > > column 227 corresponds to measure 227? Deleting the corresponding column 
> > > would delete the measure, wouldn’t it?. Or do you have a different 
> > > structure for the Excel spreadsheet in mind?
>
> That’s exactly what I had in mind.
>
> (Sorry, I thought you meant the “make”-approach as an alternative rather than 
> an extension to this idea.)
>
> I’m experimenting with the spreadsheet-python-appoach atm and it looks quite 
> promising.
>
> M
>
> __
> http://www.marcoll.de
>
> subscribe to newsletter
>
> > On 20 Nov 2020, at 19:15, Martín Rincón Botero 
> >  wrote:
> >
> > Hi Maximilian,
> >
> > after having failed at the beginning with abjad (it’s looking better now) I 
> > programmed some functions in Python to also be able to access instruments 
> > and measures. For measures, I made a function that simply looks for | and 
> > gives you back whatever is between | as a list. The Excel approach didn’t 
> > occur to me. Wouldn’t you just put each measure in a separate cell, so that 
> > a cell in column 227 corresponds to measure 227? Deleting the corresponding 
> > column would delete the measure, wouldn’t it?. Or do you have a different 
> > structure for the Excel spreadsheet in mind?
> >
> > Best regards,
> > Martín.
> >
> > www.martinrinconbotero.com
> > On 20. Nov 2020, 17:51 +0100, Maximilian Marcoll , 
> > wrote:
> > > Hi!
> > >
> > > thank you!
> > > That looks awesome. But what do you do if you want to delete measure 227 
> > > entirely?
> > >
> > > Cheers
> > > M
> > >
> > >
> > >
> > >
> > > __
> > > http://www.marcoll.de
> > >
> > > subscribe to newsletter
> > >
> > > > On 20 Nov 2020, at 17:39, J Martin Rushton 
> > > >  wrote:
> > > >
> > > > Hi Max,
> > > >
> > > > Caveat: I've not used this personally, my scores are not complex enough.
> > > >
> > > > One of the standard ways of handling this is to use make 
> > > > (https://www.gnu.org/software/make).  Basically you write a makefile 
> > > > which tells make which files to compile and use that as the input to 
> > > > Lilypond.  Make is clever though, and can select files on the basis of 
> > > > the last time they were changed, or if given parameters (for instance 
> > > > to generate part scores).
> > > >
> > > > See 
> > > > http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles 
> > > > for Lily's take on this.
> > > >
> > > > Regards,
> > > > Martin
> > > >
> > > > On 20/11/2020 16:03, Maximilian Marcoll wrote:
> > > > > Hi Everyone,
> > > > > Over last last couple of days I have been thinking about possible 
> > > > > ways to organize the engraving of a rather large piece (~45+ staves) 
> > > > > in Lilypond.
> > > > > My problem is that the piece in question might undergo significant 
> > > > > changes in the future, so I need access to both instrument-wise and 
> > > > > measure-wise organisation simultaneously.
> > > > > I am considering to enter the entire music in a huge excel 
> > > > > spreadsheet and to write a (python)-script to create one .ly file per 
> > > > > voice,
> > > > > storing all the music in variables that can be used both in the full 
> > > > > score and the individual parts.
> > > > > I’m having difficulties imagining that I am the first one to have 
> > > > > this idea, but couldn’t find anything online.
> > > > > Any hints?
> > > > > Thanks a lot!
> > > > > Cheers,
> > > > > Max
> > > > > __
> > > > > http://www.marcoll.de 
> > > > > subscribe to newsletter 
> > > >
> > > > --
> > > > J Martin Rushton MBCS
> > > >
> > >
>


Re: Spreadsheet - Python – Ly

2020-11-20 Thread Maximilian Marcoll

>> Wouldn’t you just put each measure in a separate cell, so that a cell in 
>> column 227 corresponds to measure 227? Deleting the corresponding column 
>> would delete the measure, wouldn’t it?. Or do you have a different structure 
>> for the Excel spreadsheet in mind?

That’s exactly what I had in mind.

(Sorry, I thought you meant the “make”-approach as an alternative rather than 
an extension to this idea.)

I’m experimenting with the spreadsheet-python-appoach atm and it looks quite 
promising.

M

__
http://www.marcoll.de

subscribe to newsletter 
> On 20 Nov 2020, at 19:15, Martín Rincón Botero  
> wrote:
> 
> Hi Maximilian,
> 
> after having failed at the beginning with abjad (it’s looking better now) I 
> programmed some functions in Python to also be able to access instruments and 
> measures. For measures, I made a function that simply looks for | and gives 
> you back whatever is between | as a list. The Excel approach didn’t occur to 
> me. Wouldn’t you just put each measure in a separate cell, so that a cell in 
> column 227 corresponds to measure 227? Deleting the corresponding column 
> would delete the measure, wouldn’t it?. Or do you have a different structure 
> for the Excel spreadsheet in mind?
> 
> Best regards,
> Martín.
> 
> www.martinrinconbotero.com
> On 20. Nov 2020, 17:51 +0100, Maximilian Marcoll , 
> wrote:
>> Hi!
>> 
>> thank you!
>> That looks awesome. But what do you do if you want to delete measure 227 
>> entirely?
>> 
>> Cheers
>> M
>> 
>> 
>> 
>> 
>> __
>> http://www.marcoll.de 
>> 
>> subscribe to newsletter 
>>> On 20 Nov 2020, at 17:39, J Martin Rushton >> > wrote:
>>> 
>>> Hi Max,
>>> 
>>> Caveat: I've not used this personally, my scores are not complex enough.
>>> 
>>> One of the standard ways of handling this is to use make 
>>> (https://www.gnu.org/software/make ).  
>>> Basically you write a makefile which tells make which files to compile and 
>>> use that as the input to Lilypond.  Make is clever though, and can select 
>>> files on the basis of the last time they were changed, or if given 
>>> parameters (for instance to generate part scores).
>>> 
>>> See http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles 
>>>  for 
>>> Lily's take on this.
>>> 
>>> Regards,
>>> Martin
>>> 
>>> On 20/11/2020 16:03, Maximilian Marcoll wrote:
 Hi Everyone,
 Over last last couple of days I have been thinking about possible ways to 
 organize the engraving of a rather large piece (~45+ staves) in Lilypond.
 My problem is that the piece in question might undergo significant changes 
 in the future, so I need access to both instrument-wise and measure-wise 
 organisation simultaneously.
 I am considering to enter the entire music in a huge excel spreadsheet and 
 to write a (python)-script to create one .ly file per voice,
 storing all the music in variables that can be used both in the full score 
 and the individual parts.
 I’m having difficulties imagining that I am the first one to have this 
 idea, but couldn’t find anything online.
 Any hints?
 Thanks a lot!
 Cheers,
 Max
 __
 http://www.marcoll.de  >
 subscribe to newsletter >
>>> 
>>> --
>>> J Martin Rushton MBCS
>>> 
>> 



Re: Spreadsheet - Python – Ly

2020-11-20 Thread Martín Rincón Botero
Hi Maximilian,

after having failed at the beginning with abjad (it’s looking better now) I 
programmed some functions in Python to also be able to access instruments and 
measures. For measures, I made a function that simply looks for | and gives you 
back whatever is between | as a list. The Excel approach didn’t occur to me. 
Wouldn’t you just put each measure in a separate cell, so that a cell in column 
227 corresponds to measure 227? Deleting the corresponding column would delete 
the measure, wouldn’t it?. Or do you have a different structure for the Excel 
spreadsheet in mind?

Best regards,
Martín.

www.martinrinconbotero.com
On 20. Nov 2020, 17:51 +0100, Maximilian Marcoll , wrote:
> Hi!
>
> thank you!
> That looks awesome. But what do you do if you want to delete measure 227 
> entirely?
>
> Cheers
> M
>
>
>
>
> __
> http://www.marcoll.de
>
> subscribe to newsletter
>
> > On 20 Nov 2020, at 17:39, J Martin Rushton  
> > wrote:
> >
> > Hi Max,
> >
> > Caveat: I've not used this personally, my scores are not complex enough.
> >
> > One of the standard ways of handling this is to use make 
> > (https://www.gnu.org/software/make).  Basically you write a makefile which 
> > tells make which files to compile and use that as the input to Lilypond.  
> > Make is clever though, and can select files on the basis of the last time 
> > they were changed, or if given parameters (for instance to generate part 
> > scores).
> >
> > See http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles 
> > for Lily's take on this.
> >
> > Regards,
> > Martin
> >
> > On 20/11/2020 16:03, Maximilian Marcoll wrote:
> > > Hi Everyone,
> > > Over last last couple of days I have been thinking about possible ways to 
> > > organize the engraving of a rather large piece (~45+ staves) in Lilypond.
> > > My problem is that the piece in question might undergo significant 
> > > changes in the future, so I need access to both instrument-wise and 
> > > measure-wise organisation simultaneously.
> > > I am considering to enter the entire music in a huge excel spreadsheet 
> > > and to write a (python)-script to create one .ly file per voice,
> > > storing all the music in variables that can be used both in the full 
> > > score and the individual parts.
> > > I’m having difficulties imagining that I am the first one to have this 
> > > idea, but couldn’t find anything online.
> > > Any hints?
> > > Thanks a lot!
> > > Cheers,
> > > Max
> > > __
> > > http://www.marcoll.de 
> > > subscribe to newsletter 
> >
> > --
> > J Martin Rushton MBCS
> >
>


Re: Spreadsheet - Python – Ly

2020-11-20 Thread Maximilian Marcoll
Hi!

thank you!
That looks awesome. But what do you do if you want to delete measure 227 
entirely?

Cheers
M




__
http://www.marcoll.de

subscribe to newsletter 
> On 20 Nov 2020, at 17:39, J Martin Rushton  
> wrote:
> 
> Hi Max,
> 
> Caveat: I've not used this personally, my scores are not complex enough.
> 
> One of the standard ways of handling this is to use make 
> (https://www.gnu.org/software/make).  Basically you write a makefile which 
> tells make which files to compile and use that as the input to Lilypond.  
> Make is clever though, and can select files on the basis of the last time 
> they were changed, or if given parameters (for instance to generate part 
> scores).
> 
> See http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles for 
> Lily's take on this.
> 
> Regards,
> Martin
> 
> On 20/11/2020 16:03, Maximilian Marcoll wrote:
>> Hi Everyone,
>> Over last last couple of days I have been thinking about possible ways to 
>> organize the engraving of a rather large piece (~45+ staves) in Lilypond.
>> My problem is that the piece in question might undergo significant changes 
>> in the future, so I need access to both instrument-wise and measure-wise 
>> organisation simultaneously.
>> I am considering to enter the entire music in a huge excel spreadsheet and 
>> to write a (python)-script to create one .ly file per voice,
>> storing all the music in variables that can be used both in the full score 
>> and the individual parts.
>> I’m having difficulties imagining that I am the first one to have this idea, 
>> but couldn’t find anything online.
>> Any hints?
>> Thanks a lot!
>> Cheers,
>> Max
>> __
>> http://www.marcoll.de 
>> subscribe to newsletter 
> 
> -- 
> J Martin Rushton MBCS
> 



Re: Spreadsheet - Python – Ly

2020-11-20 Thread J Martin Rushton

Hi Max,

Caveat: I've not used this personally, my scores are not complex enough.

One of the standard ways of handling this is to use make 
(https://www.gnu.org/software/make).  Basically you write a makefile 
which tells make which files to compile and use that as the input to 
Lilypond.  Make is clever though, and can select files on the basis of 
the last time they were changed, or if given parameters (for instance to 
generate part scores).


See http://lilypond.org/doc/v2.21/Documentation/usage/make-and-makefiles 
for Lily's take on this.


Regards,
Martin

On 20/11/2020 16:03, Maximilian Marcoll wrote:

Hi Everyone,

Over last last couple of days I have been thinking about possible ways 
to organize the engraving of a rather large piece (~45+ staves) in Lilypond.
My problem is that the piece in question might undergo significant 
changes in the future, so I need access to both instrument-wise and 
measure-wise organisation simultaneously.
I am considering to enter the entire music in a huge excel spreadsheet 
and to write a (python)-script to create one .ly file per voice,
storing all the music in variables that can be used both in the full 
score and the individual parts.


I’m having difficulties imagining that I am the first one to have this 
idea, but couldn’t find anything online.


Any hints?

Thanks a lot!

Cheers,

Max

__
http://www.marcoll.de 

subscribe to newsletter 



--
J Martin Rushton MBCS



Spreadsheet - Python – Ly

2020-11-20 Thread Maximilian Marcoll
Hi Everyone,

Over last last couple of days I have been thinking about possible ways to 
organize the engraving of a rather large piece (~45+ staves) in Lilypond.
My problem is that the piece in question might undergo significant changes in 
the future, so I need access to both instrument-wise and measure-wise 
organisation simultaneously.
I am considering to enter the entire music in a huge excel spreadsheet and to 
write a (python)-script to create one .ly file per voice, 
storing all the music in variables that can be used both in the full score and 
the individual parts.

I’m having difficulties imagining that I am the first one to have this idea, 
but couldn’t find anything online.

Any hints?

Thanks a lot!

Cheers,

Max



__
http://www.marcoll.de

subscribe to newsletter