Re: exact inversion (issue4173065)

2011-02-19 Thread pkx166h

Just minor stuff for the NR.

James


http://codereview.appspot.com/4173065/diff/1/Documentation/notation/pitches.itely
File Documentation/notation/pitches.itely (right):

http://codereview.appspot.com/4173065/diff/1/Documentation/notation/pitches.itely#newcode823
Documentation/notation/pitches.itely:823: The syntax is
Remove the line 'The syntax is' as the @example makes it redundant.

http://codereview.appspot.com/4173065/diff/1/Documentation/notation/pitches.itely#newcode830
Documentation/notation/pitches.itely:830: This means that
@code{@var{musicexpr}} is inverted interval by
'... is inverted interval-by-interval ...' to make it clearer.

http://codereview.appspot.com/4173065/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Janek Warchoł
2011/2/19 Graham Percival 
>
> On Sat, Feb 19, 2011 at 02:32:45PM +0100, Janek Warchoł wrote:
> > PS Graham, i'm sorry if you felt offended by that kiss thing - i meant
> > it as a joke only, referring to what you said to Owen Tuz at frogs
> > list.
>
> No, I wasn't at all offended, and I agree that it was a good joke.

Glad to hear that :)

> My lack of reply in the past 26 hours was a health issue,

Oh. I hope that you're fine now.

> not a lack of interest, and certainly not a lack of appreciation for
> this nice gesture!

You are welcome :)
I hope to be able to cook another present in the future, however i'd
prefer to finish flags and stems thing first. May i ask you to post
your opinion in "transition between full-length and shortened stems -
please discuss" thread on -devel?

> I will try to quantify the problem, as Han-wen asked for.
>
> Cheers,
> - Graham
>
> PS one kiss -- on the cheek, mind you -- is yours, if you come to
> Glasgow while I'm here.

;P
I'm not planning any travel soon, but if i ever visit Scotland i'll
surely try to contact you :)

cheers,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Graham Percival
On Sat, Feb 19, 2011 at 02:32:45PM +0100, Janek Warchoł wrote:
> PS Graham, i'm sorry if you felt offended by that kiss thing - i meant
> it as a joke only, referring to what you said to Owen Tuz at frogs
> list:

No, I wasn't at all offended, and I agree that it was a good joke.
My lack of reply in the past 26 hours was a health issue, not a
lack of interest, and certainly not a lack of appreciation for
this nice gesture!

I will try to quantify the problem, as Han-wen asked for.

Cheers,
- Graham

PS one kiss -- on the cheek, mind you -- is yours, if you come to
Glasgow while I'm here.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Janek Warchoł
2011/2/19 Han-Wen Nienhuys :
> 2011/2/19 Janek Warchoł :
>> 2011/2/19 Han-Wen Nienhuys :
>>> I also updated the issue.  In summary, I don't think the issue is a
>>> problem, and I think fixing it is contraproductive.
>>
>> I'm not sure if i made myself clear. *I've already prepared* a
>> modification for 250 out of 262 regtests that didn't end on a barline.
>> So i'd prefer not to see several hour of my work wasted...
>
> Yes, that's why I feel a bit sad about having to write that, and I
> know you will feel angry and sad for it, my apologies.

I feel sad and angry, but to be honest it's not exactly because my
regtests patch is a failure.
6 days ago i've sent an e-mail titled "transition between full-length
and shortened stems - please discuss", containing a fix for a
problematic output we have, complete with compiled proof-sheets,
engraved examples and blahblah. It required 7 minutes to look at the
pdfs and choose which variant of the solution was better. Then
somebody would push it, and i'd be able to continue my work (on the
next part of the 'shortened flags issue'). Unfortunately only Werner
replied; i felt disappointed, but decided to do something productive
instead of nagging you, so that lilypond could benefit from my spare
time. That's how the idea of fixing some frog issue came up, and now
it looks that this will fail, too.
Now, that's really disappointing :(

> That said, if
> we would have all regtests ending in a barline for some silly reason,
> I would probably propose a frogs issue to remove all of the redundant
> notes.

Great.
So basically it means that my whole idea of a "surprise fix" was wrong...
I assumed that issue description provides all important information
about an issue, including whether to fix it or not, and if anything
should be checked first.

> Also, the change introduces all kinds of false diffs if the fragment
> is close to a single line of length.
>
> I'm not sure of the exact reasoning behind 'frogs' issues, but before
> they should be packaged up to be small, so nobody spends many hours on
> them.

Actually this one had had quite a low estimated time - 1 hour. So
either i was unexpectedly slow or the time was estimated badly.
Nevermind.

Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Jan Warchoł
2011/2/19 David Kastrup :
> Janek Warchoł  writes:
>
>> PS Graham, i'm sorry if you felt offended by that kiss thing - i meant
>> it as a joke only, referring to what you said to Owen Tuz at frogs
>> list:
>>
>> 2010/11/15 Graham Percival :
>>> (...)
>
> I think it quite contraproductive to offer kisses to frogs.  Lilypond
> definitely can make better use of frogs than princes.

:)

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Han-Wen Nienhuys
2011/2/19 Janek Warchoł :
> 2011/2/19 Han-Wen Nienhuys :
>> 2011/2/17 Janek Warchoł :
>>> Hi,
>>>
>>> I wanted to make Graham happy, so looked through the tracker, picked
>>> an existing frog issue and made a patch without discussing it for 5
>>> hours.
>>> :)
>>> It's issue 1489 (make regtests end on a barline).
>>> I think it doesn't make sense to post it on Rietveld...
>>> It's here (112 kB, too big for an attachment):
>>> http://www.sendspace.com/file/j3yq1e
>>
>>
>> I also updated the issue.  In summary, I don't think the issue is a
>> problem, and I think fixing it is contraproductive.
>
> I'm not sure if i made myself clear. *I've already prepared* a
> modification for 250 out of 262 regtests that didn't end on a barline.
> So i'd prefer not to see several hour of my work wasted...

Yes, that's why I feel a bit sad about having to write that, and I
know you will feel angry and sad for it, my apologies.   That said, if
we would have all regtests ending in a barline for some silly reason,
I would probably propose a frogs issue to remove all of the redundant
notes.

Also, the change introduces all kinds of false diffs if the fragment
is close to a single line of length.

I'm not sure of the exact reasoning behind 'frogs' issues, but before
they should be packaged up to be small, so nobody spends many hours on
them. Also, could we dispense on esthetic changes on developer-only
parts (like the regtest) ?

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Janek Warchoł
2011/2/19 Han-Wen Nienhuys :
> 2011/2/17 Janek Warchoł :
>> Hi,
>>
>> I wanted to make Graham happy, so looked through the tracker, picked
>> an existing frog issue and made a patch without discussing it for 5
>> hours.
>> :)
>> It's issue 1489 (make regtests end on a barline).
>> I think it doesn't make sense to post it on Rietveld...
>> It's here (112 kB, too big for an attachment):
>> http://www.sendspace.com/file/j3yq1e
>
>
> I also updated the issue.  In summary, I don't think the issue is a
> problem, and I think fixing it is contraproductive.

I'm not sure if i made myself clear. *I've already prepared* a
modification for 250 out of 262 regtests that didn't end on a barline.
So i'd prefer not to see several hour of my work wasted...

Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Han-Wen Nienhuys
2011/2/17 Janek Warchoł :
> Hi,
>
> I wanted to make Graham happy, so looked through the tracker, picked
> an existing frog issue and made a patch without discussing it for 5
> hours.
> :)
> It's issue 1489 (make regtests end on a barline).
> I think it doesn't make sense to post it on Rietveld...
> It's here (112 kB, too big for an attachment):
> http://www.sendspace.com/file/j3yq1e


I also updated the issue.  In summary, I don't think the issue is a
problem, and I think fixing it is contraproductive.


-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread David Kastrup
Janek Warchoł  writes:

> PS Graham, i'm sorry if you felt offended by that kiss thing - i meant
> it as a joke only, referring to what you said to Owen Tuz at frogs
> list:
>
> 2010/11/15 Graham Percival :
>> On Mon, Nov 15, 2010 at 6:30 PM, Owen Tuz  wrote:
>>> Hi -
>>>   Having talked about C++ and Scheme, I went and picked one in tcl/tk
>>> instead. The original issue is here:
>>> http://code.google.com/p/lilypond/issues/detail?id=1275
>>
>> I could kiss you.  I've been hoping for months -- actually, literally
>> years plural -- that somebody would look through the tracker, pick an
>> existing "frog" problem, and send in a patch without needing to
>> discuss it for 5 hours.  You have just made me very, very happy.  :)
>> (and if you haven't noticed already, that's not an easy thing to do!)
>
> :(

I think it quite contraproductive to offer kisses to frogs.  Lilypond
definitely can make better use of frogs than princes.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Janek Warchoł
2011/2/19 Han-Wen Nienhuys :
> 2011/2/18 Janek Warchoł :
>
>> I expected that resulting file build/out/test-results/index.html,
>> containing comparisons between unmodified and modified regtests, will
>> show differencies in the 67 regtests i changed. But surprisingly it
>> shows many more differencies in files i didn't change - even in ones
>> beginning with letter D and above. I have no idea why this happened...
>> I attach the patch file. It looks normal, shows changes to 67 files.
>
> What kind of changes did you see?

It shows differencies in ouput. Some of them are big - like an
additional line break - and some are so small that i'm not sure what
changed at all.
Here is a screenshot, 550kB (a picture is worth more than a thousand
words :P): http://www.sendspace.com/file/pk46i4
Basically, the comparison at build/out/test-results/index.html is full
of situations like 3rd and 4th in the attachment
(tabulature-grace-notes and palm-mute) - lots of green shadow, but
apparently nothing moved.

There are also some comparisons with text-only output (i suppose it's
about performance, as you said) - like this:

6.864924

time: 0
cells   : 2420945
/home/janek/lilypond-git/input/regression/lyrics-bar.profile

time:0 (0.000)
cells   :  4026817 (-0.249)
/home/janek/lilypond-git/input/regression/lyrics-bar.profile

Any ideas?

PS Graham, i'm sorry if you felt offended by that kiss thing - i meant
it as a joke only, referring to what you said to Owen Tuz at frogs
list:

2010/11/15 Graham Percival :
> On Mon, Nov 15, 2010 at 6:30 PM, Owen Tuz  wrote:
>> Hi -
>>   Having talked about C++ and Scheme, I went and picked one in tcl/tk
>> instead. The original issue is here:
>> http://code.google.com/p/lilypond/issues/detail?id=1275
>
> I could kiss you.  I've been hoping for months -- actually, literally
> years plural -- that somebody would look through the tracker, pick an
> existing "frog" problem, and send in a patch without needing to
> discuss it for 5 hours.  You have just made me very, very happy.  :)
> (and if you haven't noticed already, that's not an easy thing to do!)

:(

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Fix to clarinet key names (issue 4182071)

2011-02-19 Thread Mike Solomon
Should do the trick.

http://codereview.appspot.com/4182071

I have no clue how convert-ly works: would anyone like to take on the task of 
implementing these conversions in that script?

Cheers,
MS
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: a present for Graham

2011-02-19 Thread Han-Wen Nienhuys
2011/2/18 Janek Warchoł :

> I expected that resulting file build/out/test-results/index.html,
> containing comparisons between unmodified and modified regtests, will
> show differencies in the 67 regtests i changed. But surprisingly it
> shows many more differencies in files i didn't change - even in ones
> beginning with letter D and above. I have no idea why this happened...
> I attach the patch file. It looks normal, shows changes to 67 files.

What kind of changes did you see?

The regtest also compares for memory and cpu use, but this test does
not work very well.

We should probably disable it by default.

-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


exact inversion (issue4173065)

2011-02-19 Thread benko . pal

Reviewers: ,

Message:
following up on modal transformation

Description:
exact inversion

Please review this at http://codereview.appspot.com/4173065/

Affected files:
  M Documentation/notation/pitches.itely
  M input/regression/modal-transforms.ly
  M ly/music-functions-init.ly
  M scm/modal-transforms.scm


Index: Documentation/notation/pitches.itely
diff --git a/Documentation/notation/pitches.itely  
b/Documentation/notation/pitches.itely
index  
78a222794d195e9ceae5c812971e5f6b2357a824..63c0ccce39465edcb1896eaa7e2940782e6fc002  
100644

--- a/Documentation/notation/pitches.itely
+++ b/Documentation/notation/pitches.itely
@@ -594,6 +594,7 @@ This section discusses how to modify pitches.
 @menu
 * Octave checks::
 * Transpose::
+* Inversion::
 * Modal transformations::
 @end menu

@@ -813,6 +814,23 @@ The relative conversion will not affect  
@code{\transpose},

 To use relative mode within transposed music, an additional
 @code{\relative} must be placed inside @code{\transpose}.

+@node Inversion
+@unnumberedsubsubsec Inversion
+
+@cindex inversion
+
+A music expression can be inverted with @code{\inversion}.
+The syntax is
+
+@example
+\inversion @var{frompitch} @var{topitch} @var{musicexpr}
+@end example
+
+@noindent
+This means that @code{@var{musicexpr}} is inverted interval by
+interval, and transposition is chosen so that @code{@var{frompitch}}
+is mapped to @code{@var{topitch}}.
+
 @node Modal transformations
 @unnumberedsubsubsec Modal transformations

Index: input/regression/modal-transforms.ly
diff --git a/input/regression/modal-transforms.ly  
b/input/regression/modal-transforms.ly
index  
907060151073b9e77e147a19b120bfae8350b3ae..7487f2b8bfe34d6cf1752fa8e244f6b50439f704  
100644

--- a/input/regression/modal-transforms.ly
+++ b/input/regression/modal-transforms.ly
@@ -22,12 +22,14 @@ motif = {
 \modalTranspose c' f' \cOctatonicScale \motif
 \retrograde \motif
 \modalInversion aes' b' \cOctatonicScale \motif
+   \inversion aes' b' \motif
   }
   {
 s1-"Octatonic motif" |
 s1-"motif transposed from c to f" |
 s1-"motif in retrograde" |
 s1-"motif inverted around aes to b" |
+   s1-"motif inverted exactly"
   }
 >>
   }
Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index  
34261c114b2d7f3e9606fa50c2d4f95bb0e7d869..ac62bffa9ae67575da8bbce6e60ec12fd8d18595  
100644

--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -480,6 +480,13 @@ using @var{scale}.")
   (change-pitches music transposer)
   music))

+inversion =
+#(define-music-function
+   (parser location around to music) (ly:music? ly:music? ly:music?)
+   (_i "Invert @var{music} about @var{around} and
+transpose from @var{around} to @var{to}.")
+   (music-invert around to music))
+
 musicMap =
 #(define-music-function (parser location proc mus) (procedure? ly:music?)
(_i "Apply @var{proc} to @var{mus} and all of the music it contains.")
Index: scm/modal-transforms.scm
diff --git a/scm/modal-transforms.scm b/scm/modal-transforms.scm
index  
cdaa015ccc08099c251c51304ece2c77a66c61d9..151fb8c3be06edcea7e213291989398428d43fea  
100644

--- a/scm/modal-transforms.scm
+++ b/scm/modal-transforms.scm
@@ -220,3 +220,20 @@ Typically used to construct a scale for input to  
transposer-factory

 (map retrograde-music reversed)

 music))
+
+(define-public (pitch-invert around to music)
+  "If @var{music} is a single pitch, inverts it about @var{around}
+and transposes from @var{around} to @var{to}."
+  (let ((p (ly:music-property music 'pitch)))
+(if (ly:pitch? p)
+   (ly:music-set-property!
+music 'pitch
+(ly:pitch-transpose to (ly:pitch-diff around p
+music))
+
+(define-public (music-invert around-pitch to-pitch music)
+  "Applies pitch-invert to all pitches in @var{music}."
+  (let ((around (car (extract-pitch-sequence around-pitch)))
+   (to (car (extract-pitch-sequence to-pitch
+ (music-map (lambda (x) (pitch-invert around to x)) music)))
+



___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel