Case of 'c' in partcombine

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

Case of 'c' in partcombine

Charles Winston
Hey developers,

I am working on my first patch—it is resolving a very simple issue from the tracker. The case of the ‘c’ in partcombine is inconsistent and can result in some confusion. For example: \partcombine, \partcombineApart, and others like this use the lower-case ‘c' … but \partCombineTextsOnNote, \partCombineListener use the camelCase ‘C’. The suggestion is to change all instances of partcombine to the camelCase partCombine—not the other way around because the engraver treats “part” and “combine” as separate words: ‘Part_combine_engraver’.

I would love some guidance as to where to find all the instances of partcombine. I know it is a command that takes two different as arguments, and combines them on the same staff, duplicating events that are different and keeping only one copy of events that are the same in both voices. I see the Scheme file which performs this function, but I believe that I need to make changes in the parsing process where the parser reads the string “partcombine” input by the user as the command. However I’m not completely clear on where to find this in the source code. Would love some preliminary help!

Thanks,
Charles Winston
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Phil Holmes
----- Original Message -----
From: "Charles Winston" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, May 25, 2017 3:40 PM
Subject: Case of 'c' in partcombine


> Hey developers,
>
> I am working on my first patch—it is resolving a very simple issue from
> the tracker. The case of the ‘c’ in partcombine is inconsistent and can
> result in some confusion. For example: \partcombine, \partcombineApart,
> and others like this use the lower-case ‘c' … but \partCombineTextsOnNote,
> \partCombineListener use the camelCase ‘C’. The suggestion is to change
> all instances of partcombine to the camelCase partCombine—not the other
> way around because the engraver treats “part” and “combine” as separate
> words: ‘Part_combine_engraver’.
>
> I would love some guidance as to where to find all the instances of
> partcombine. I know it is a command that takes two different as arguments,
> and combines them on the same staff, duplicating events that are different
> and keeping only one copy of events that are the same in both voices. I
> see the Scheme file which performs this function, but I believe that I
> need to make changes in the parsing process where the parser reads the
> string “partcombine” input by the user as the command. However I’m not
> completely clear on where to find this in the source code. Would love some
> preliminary help!
>
> Thanks,
> Charles Winston

git grep would allow you to find every instance of 'partcombine'.  Would
that help?

--
Phil Holmes


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston

> On May 25, 2017, at 11:29 AM, Phil Holmes <[hidden email]> wrote:
>
> ----- Original Message ----- From: "Charles Winston" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, May 25, 2017 3:40 PM
> Subject: Case of 'c' in partcombine
>
>
>> Hey developers,
>>
>> I am working on my first patch—it is resolving a very simple issue from the tracker. The case of the ‘c’ in partcombine is inconsistent and can result in some confusion. For example: \partcombine, \partcombineApart, and others like this use the lower-case ‘c' … but \partCombineTextsOnNote, \partCombineListener use the camelCase ‘C’. The suggestion is to change all instances of partcombine to the camelCase partCombine—not the other way around because the engraver treats “part” and “combine” as separate words: ‘Part_combine_engraver’.
>>
>> I would love some guidance as to where to find all the instances of partcombine. I know it is a command that takes two different as arguments, and combines them on the same staff, duplicating events that are different and keeping only one copy of events that are the same in both voices. I see the Scheme file which performs this function, but I believe that I need to make changes in the parsing process where the parser reads the string “partcombine” input by the user as the command. However I’m not completely clear on where to find this in the source code. Would love some preliminary help!
>>
>> Thanks,
>> Charles Winston
>
> git grep would allow you to find every instance of 'partcombine'.  Would that help?

Yes that would definitely help!

Charles
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Carl Sorensen-3
In reply to this post by Charles Winston
On 5/25/17 8:40 AM, "lilypond-devel on behalf of Charles Winston"
<lilypond-devel-bounces+c_sorensen=[hidden email] on behalf of
[hidden email]> wrote:

>Hey developers,
>
>I am working on my first patch‹it is resolving a very simple issue from
>the tracker. The case of the Œc¹ in partcombine is inconsistent and can
>result in some confusion. For example: \partcombine, \partcombineApart,
>and others like this use the lower-case Œc' Š but
>\partCombineTextsOnNote, \partCombineListener use the camelCase ŒC¹. The
>suggestion is to change all instances of partcombine to the camelCase
>partCombine‹not the other way around because the engraver treats ³part²
>and ³combine² as separate words: ŒPart_combine_engraver¹.

This is an easy patch in terms of functionality, but it will need a
convert-ly rule because it will break existing scores.  That's not a
reason to avoid doing it; you just need to be aware that the rule will
need to be made and tested.

>
>I would love some guidance as to where to find all the instances of
>partcombine.

I would do

git grep -i combine

which should find every occurrence of combine, ignoring case.  It should
catch all of the things you've identified in your first paragraph.

HTH,

Carl


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston
In reply to this post by Charles Winston

> On May 25, 2017, at 11:42 AM, Charles Winston <[hidden email]> wrote:
>
>>
>> On May 25, 2017, at 11:29 AM, Phil Holmes <[hidden email]> wrote:
>>
>> ----- Original Message ----- From: "Charles Winston" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Thursday, May 25, 2017 3:40 PM
>> Subject: Case of 'c' in partcombine
>>
>>
>>> Hey developers,
>>>
>>> I am working on my first patch—it is resolving a very simple issue from the tracker. The case of the ‘c’ in partcombine is inconsistent and can result in some confusion. For example: \partcombine, \partcombineApart, and others like this use the lower-case ‘c' … but \partCombineTextsOnNote, \partCombineListener use the camelCase ‘C’. The suggestion is to change all instances of partcombine to the camelCase partCombine—not the other way around because the engraver treats “part” and “combine” as separate words: ‘Part_combine_engraver’.
>>>
>>> I would love some guidance as to where to find all the instances of partcombine. I know it is a command that takes two different as arguments, and combines them on the same staff, duplicating events that are different and keeping only one copy of events that are the same in both voices. I see the Scheme file which performs this function, but I believe that I need to make changes in the parsing process where the parser reads the string “partcombine” input by the user as the command. However I’m not completely clear on where to find this in the source code. Would love some preliminary help!
>>>
>>> Thanks,
>>> Charles Winston
>>
>> git grep would allow you to find every instance of 'partcombine'.  Would that help?
>

Is there any way to use git grep to search for instances of a string, but leave out all instances from some specified directory? I ask because there are an insane amount of instances of the string in Documentation, and it’s clouding my ability to find all instances in the source code.

Thanks,
Charles


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

David Kastrup
Charles Winston <[hidden email]> writes:

> Is there any way to use git grep to search for instances of a string,
> but leave out all instances from some specified directory? I ask
> because there are an insane amount of instances of the string in
> Documentation, and it’s clouding my ability to find all instances in
> the source code.

git grep partcombine lily scm ly

I mean, it's not like we have dozens of toplevel source code
directories.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston
In reply to this post by Carl Sorensen-3

> On May 25, 2017, at 11:48 AM, Carl Sorensen <[hidden email]> wrote:
>
> On 5/25/17 8:40 AM, "lilypond-devel on behalf of Charles Winston"
> <lilypond-devel-bounces+c_sorensen=[hidden email] on behalf of
> [hidden email]> wrote:
>
>> Hey developers,
>>
>> I am working on my first patch‹it is resolving a very simple issue from
>> the tracker. The case of the Œc¹ in partcombine is inconsistent and can
>> result in some confusion. For example: \partcombine, \partcombineApart,
>> and others like this use the lower-case Œc' Š but
>> \partCombineTextsOnNote, \partCombineListener use the camelCase ŒC¹. The
>> suggestion is to change all instances of partcombine to the camelCase
>> partCombine‹not the other way around because the engraver treats ³part²
>> and ³combine² as separate words: ŒPart_combine_engraver¹.
>
> This is an easy patch in terms of functionality, but it will need a
> convert-ly rule because it will break existing scores.  That's not a
> reason to avoid doing it; you just need to be aware that the rule will
> need to be made and tested.
>
>>
>> I would love some guidance as to where to find all the instances of
>> partcombine.
>
> I would do
>
> git grep -i combine
>
> which should find every occurrence of combine, ignoring case.  It should
> catch all of the things you've identified in your first paragraph.

Is there a reason to ignore case? The goal is to change the lowercase ‘c’s to uppercase in every instance of “partcombine”. It seems to me that ignoring case will give me instances that I do not need to change.

Charles
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Federico Bruni-2
In reply to this post by Charles Winston
Il giorno gio 25 mag 2017 alle 17:48, Charles Winston
<[hidden email]> ha scritto:
> Is there any way to use git grep to search for instances of a string,
> but leave out all instances from some specified directory? I ask
> because there are an insane amount of instances of the string in
> Documentation, and it’s clouding my ability to find all instances
> in the source code.

git grep -i combine -- './*'  ':!./Documentation/*'

you need git >= 1.9.0




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Carl Sorensen-3
In reply to this post by Charles Winston
On 5/25/17 9:54 AM, "Charles Winston" <[hidden email]> wrote:

>
>Is there a reason to ignore case? The goal is to change the lowercase
>Œc¹s to uppercase in every instance of ³partcombine². It seems to me that
>ignoring case will give me instances that I do not need to change.

I would do it because I would want to be aware of all of the possible
issues.  I realize that you aren't interested in changing the upper case
Cs, but I like to have a big picture before I jump in.

Carl

P.S. It sounded in your email like this was already an issue in the
tracker.  If it is, it would normally be a good idea to reference the
issue number in your emails.  So the subject would typically be something
like "Issue 12345: Case of 'c' in part combine"


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston
In reply to this post by Charles Winston

> On May 25, 2017, at 11:54 AM, Charles Winston <[hidden email]> wrote:
>
>
>> On May 25, 2017, at 11:48 AM, Carl Sorensen <[hidden email]> wrote:
>>
>> On 5/25/17 8:40 AM, "lilypond-devel on behalf of Charles Winston"
>> <lilypond-devel-bounces+c_sorensen=[hidden email] on behalf of
>> [hidden email]> wrote:
>>
>>> Hey developers,
>>>
>>> I am working on my first patch‹it is resolving a very simple issue from
>>> the tracker. The case of the Œc¹ in partcombine is inconsistent and can
>>> result in some confusion. For example: \partcombine, \partcombineApart,
>>> and others like this use the lower-case Œc' Š but
>>> \partCombineTextsOnNote, \partCombineListener use the camelCase ŒC¹. The
>>> suggestion is to change all instances of partcombine to the camelCase
>>> partCombine‹not the other way around because the engraver treats ³part²
>>> and ³combine² as separate words: ŒPart_combine_engraver¹.
>>
>> This is an easy patch in terms of functionality, but it will need a
>> convert-ly rule because it will break existing scores.  That's not a
>> reason to avoid doing it; you just need to be aware that the rule will
>> need to be made and tested.
>>

Am I correct in understanding that the convert-ly rules are defined in python/convertrules.py? So I would have to write rules in this file that convert any “\partcombineSomething” to “partCombineSomething”? And what should I do about existing rules that involve partcombine? For example, there is one rule with the following description: “\\partcombine syntax change to \\newpartcombine”—should I leave this alone? Because the following rule seems to change it back… “\\newpartcombine -> partcombine”

Would love some clarification on this.

Thanks,
Charles
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston
Hi all,

This is a pretty simple question but for some reason I can’t find a definitive answer. I’m adding a rule to convertrules.py, but I need to know the version for the rule. Where can I find what the latest version of LilyPond is?

Charles

> On May 25, 2017, at 2:33 PM, Carl Sorensen <[hidden email]> wrote:
>
> On 5/25/17 11:22 AM, "Charles Winston" <[hidden email]> wrote:
>
>>
>>>>
>>
>> Am I correct in understanding that the convert-ly rules are defined in
>> python/convertrules.py? So I would have to write rules in this file that
>> convert any ³\partcombineSomething² to ³partCombineSomething²? And what
>> should I do about existing rules that involve partcombine? For example,
>> there is one rule with the following description: ³\\partcombine syntax
>> change to \\newpartcombine²‹should I leave this alone? Because the
>> following rule seems to change it backŠ ³\\newpartcombine -> partcombine²
>
> The convert-ly rules are defined in python/convertrules.py, as shown in
> the CG 10.9.3.
>
> There is one convert-ly rule for each release of LilyPond that involves a
> change in syntax. (see the comments at the end of convertrules.py).  Your
> rule should ignore any of the previous rules; it should only deal with
> changing a file from the syntax that would be used before your patch to
> the syntax that would be used after your patch.
>
> As you work your way through this, it would be great to have you keep
> notes that can be added to section 10.9.3 of the CG.
>
> Hope this helps,
>
> Carl
>


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

David Kastrup
Charles Winston <[hidden email]> writes:

> Hi all,
>
> This is a pretty simple question but for some reason I can’t find a
> definitive answer. I’m adding a rule to convertrules.py, but I need to
> know the version for the rule. Where can I find what the latest
> version of LilyPond is?

The one you are going to end up with is in the file VERSION in the
repository's top directory as $MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
.  Don't use $VERSION_DEVEL : that's the last version that already has a
web page up.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston
Could you explain the following line which appears all over convert rules.py:

str = re.sub (r“str1”, r“str2”, str)

I want to change all instances of “partcombine...” to “partCombine…". If I were to do this:

str = re.sub (r“partcombine”, r“partCombine”, str)

Would that work?


Charles

> On May 29, 2017, at 12:28 PM, David Kastrup <[hidden email]> wrote:
>
> Charles Winston <[hidden email]> writes:
>
>> Hi all,
>>
>> This is a pretty simple question but for some reason I can’t find a
>> definitive answer. I’m adding a rule to convertrules.py, but I need to
>> know the version for the rule. Where can I find what the latest
>> version of LilyPond is?
>
> The one you are going to end up with is in the file VERSION in the
> repository's top directory as $MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
> .  Don't use $VERSION_DEVEL : that's the last version that already has a
> web page up.
>
> --
> David Kastrup
>
> _______________________________________________
> lilypond-devel mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-devel


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

David Kastrup
Charles Winston <[hidden email]> writes:

> Could you explain the following line which appears all over convert rules.py:
>
> str = re.sub (r“str1”, r“str2”, str)
>
> I want to change all instances of “partcombine...” to
> “partCombine…". If I were to do this:
>
> str = re.sub (r“partcombine”, r“partCombine”, str)
>
> Would that work?

Probably would change a couple too many occurences.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Charles Winston

> On May 29, 2017, at 1:40 PM, David Kastrup <[hidden email]> wrote:
>
> Charles Winston <[hidden email]> writes:
>
>> Could you explain the following line which appears all over convert rules.py:
>>
>> str = re.sub (r“str1”, r“str2”, str)
>>
>> I want to change all instances of “partcombine...” to
>> “partCombine…". If I were to do this:
>>
>> str = re.sub (r“partcombine”, r“partCombine”, str)
>>
>> Would that work?
>
> Probably would change a couple too many occurrences.

Could you elaborate?

Charles



_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

David Kastrup
Charles Winston <[hidden email]> writes:

>> On May 29, 2017, at 1:40 PM, David Kastrup <[hidden email]> wrote:
>>
>> Charles Winston <[hidden email]> writes:
>>
>>> Could you explain the following line which appears all over convert rules.py:
>>>
>>> str = re.sub (r“str1”, r“str2”, str)
>>>
>>> I want to change all instances of “partcombine...” to
>>> “partCombine…". If I were to do this:
>>>
>>> str = re.sub (r“partcombine”, r“partCombine”, str)
>>>
>>> Would that work?
>>
>> Probably would change a couple too many occurrences.
>
> Could you elaborate?

git grep partcombine ly Documentation

will list more or less all occurences bound to be changed by your
script.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Winston, Charles R.


> On May 29, 2017, at 4:27 PM, David Kastrup <[hidden email]> wrote:
>
> Charles Winston <[hidden email]> writes:
>
>>> On May 29, 2017, at 1:40 PM, David Kastrup <[hidden email]> wrote:
>>>
>>> Charles Winston <[hidden email]> writes:
>>>
>>>> Could you explain the following line which appears all over convert rules.py:
>>>>
>>>> str = re.sub (r“str1”, r“str2”, str)
>>>>
>>>> I want to change all instances of “partcombine...” to
>>>> “partCombine…". If I were to do this:
>>>>
>>>> str = re.sub (r“partcombine”, r“partCombine”, str)
>>>>
>>>> Would that work?
>>>
>>> Probably would change a couple too many occurrences.
>>
>> Could you elaborate?
>
> git grep partcombine ly Documentation
>
> will list more or less all occurences bound to be changed by your
> script.

Yes. I'm just confused when you say that the script will probably change too many occurrences. What do you mean by too many? I want to change all occurrences.

Charles
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Case of 'c' in partcombine

Carl Sorensen-3
On 5/29/17 2:49 PM, "lilypond-devel on behalf of Winston, Charles R."
<lilypond-devel-bounces+c_sorensen=[hidden email] on behalf of
[hidden email]> wrote:

>
>
>> On May 29, 2017, at 4:27 PM, David Kastrup <[hidden email]> wrote:
>>
>> Charles Winston <[hidden email]> writes:
>>
>>>> On May 29, 2017, at 1:40 PM, David Kastrup <[hidden email]> wrote:
>>>>
>>>> Charles Winston <[hidden email]> writes:
>>>>
>>>>> Could you explain the following line which appears all over convert
>>>>>rules.py:
>>>>>
>>>>> str = re.sub (r³str1², r³str2², str)
>>>>>
>>>>> I want to change all instances of ³partcombine...² to
>>>>> ³partCombineŠ". If I were to do this:
>>>>>
>>>>> str = re.sub (r³partcombine², r³partCombine², str)
>>>>>
>>>>> Would that work?
>>>>
>>>> Probably would change a couple too many occurrences.
>>>
>>> Could you elaborate?
>>
>> git grep partcombine ly Documentation
>>
>> will list more or less all occurences bound to be changed by your
>> script.
>
>Yes. I'm just confused when you say that the script will probably change
>too many occurrences. What do you mean by too many? I want to change all
>occurrences.

I can't speak for David, but you may wish to start on a word boundary.

somepartcombine  would change to somepartCombine with your given regex.  I
don't know if that's a problem or not; you'd want to look carefully to
make sure there's nothing that would be adversely affected by being in the
middle of a word.

HTH,

Carl


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel