lilypond-user
[Top][All Lists]
Advanced

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

Re: merging different voices


From: Urs Liska
Subject: Re: merging different voices
Date: Wed, 1 Mar 2017 12:23:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0



Am 01.03.2017 um 11:45 schrieb Federico Camara Halac:

Hi Jeffery, thanks for you response!


it is unclear what exactly you want. Can
you provide a small snippet of code
(http://lilypond.org/tiny-examples.html) or a (small size) image or
anything else to maybe illustrate what you want?


I attached the first 4 bars of one instrument “flute_one”. I don’t want something very musically orthodox here... I need to generate musical material for composition by combining/merging different scores.






I am guessing that would
require quite a hefty procedure, though it certainly is possible (also
already said by Urs).

This hefty procedure is what I am after, and that’s why I asked the list if there is already a similar one out there. 

I remember doing something akin to ‘adding' in a -commercial- software: copying and pasting into different voices of a staff and then combining everything to one single voice and cleaning after…. Having this in mind, I included “flute_one_part_zero” and “flute_one_part_one” into one staff (separate voices) and tried \partcombine on them… the result, however, is still hard to clean because the merging happens within lily and I cannot access it directly. This is why I think what I want is to merge the actual text file of the score with another into a 3rd one before compiling.

On Mar 1, 2017, at 7:09 AM, Jeffery Shivers <address@hidden> wrote:

Just to echo what Urs wrote, 

Btw, I cant see Urs’ response.



Thanks again!

fede

Thanks for the example. This makes it clearer, but I think in order to judge what you *really* need you will have to be pretty concrete. Of course it's difficult to provide because you are currently investigating on a rather general level. But from this you can only get rather general replies.

I think there are two different fundamental ways to achieve what you need:

1)
a "Scheme music function". This is a programming construct that can process arbitrary arguments or input and returns a new music _expression_.
In your case it would be written to consume a given number of music expressions (i.e. voices), iterate over them in terms of musical moments and consider what's happening at the given moment in the different voices. From there it could process the new element/rest/etc. for the resulting voice.

This is actually pretty similar to what \partcombine does, and this is a good thing and a bad thing. The good part is that one could take \partcombine as a starting point, the bad thing is that this indicates how complex the problem is.

[It may also be possible to take another approach, called "Engravers", which would in a way be attached to the voices, but the complexity would probably be pretty much the same]

2)
I would also consider using a programming language outside of LilyPond to actually process the input files *before* passing them to LilyPond.
It's possible that python-ly (http://python-ly.readthedocs.io/en/latest/) can be of significant help if one would use Python for that job.

I can't make further recommendations at the moment, but it might give you a better idea already.

Best
Urs

reply via email to

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