Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-18 Thread ArnoldTheresius
Thomas Morley wrote
 On 2013/02/14 09:21:07, dak wrote:
 
 So the message is we can do, but we still need to figure out _what_
 we can do.  Proposals?
 
 Well, currently I don't have a good idea.
 
 Though, some time ago Arnold posted his approach on -user:
 http://lists.gnu.org/archive/html/lilypond-user/2012-06/msg00278.html
 direct link to his code:
 http://old.nabble.com/file/p33991423/pitchedArticulations.ly
 
 Perhaps this might be useful, I hadn't a closer look, though.
 
 https://codereview.appspot.com/7323060/
 
 ___
 lilypond-devel mailing list

 lilypond-devel@

 https://lists.gnu.org/mailman/listinfo/lilypond-devel

I'll try to collect the information:

The 'pitched articulation' is:
- add the accidental of a pitch above the articulation symbol
 and or
- ... below the articulation smybol

This (these) pitch(es) may be defined by:
- entering the pitch
- specifying the interval from the ornamented note (notehead)
most common usage is: a minor or major second above or below a single tone,
not assigned to a chord.
only delayed turn / reverseturn is usually placed on a skip, where no
pitch is available to apply the interval.

Formatting:
- the accidental is usually some smaller in size than the articulation is.
- Mostly (prall, mordent, turn, reverseturn) the accidentals are
horizontally centered, vertically as close as the extent allows.
- for the trill two positions are suitable:
  - horizontally right aligned, vertically the accidental close above the
'r' of the 'tr', thus overlapping into the 'tr' symbol extent
  - horizontally appended to the right of the 'tr' symbol, the accidental is
raised by some value
The best method for this combining of the glyphs seem to be done by a
stencil function.

Additional:
- It may be required in some situation to put some parentheses (or brackets
to indicate an editorial note) around the added accidentals.

Syntax for the user to enter:
- commands like \majorPrall, \minorPrall, \majorMordent, \majorMinorTurn,
\minorNeutralReverseturn (which define the offset interval) seem (to me) to
be the most simple way to specify those pitched articulations, whenever they
are aligned to exactly one note.
- In other situations (e.g. delayed turn, quarter tone trill) it may be the
best to enter the pitch(es) manually. One possible style might be
'\pitchedArticulation [pitch-up] [pitch-down] [articulation symbol]', where
pitch-up and pitch-down may also be the locial value 'false' to indicate 'no
articulation to put here'.

I hope, this helps.
ArnoldTheresius



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Issue-3174-Implement-accidental-markup-and-pitched-command-for-transposable-accidental-markups-issue-tp140921p141114.html
Sent from the Dev mailing list archive at Nabble.com.

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


Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-18 Thread David Kastrup
ArnoldTheresius arnold.we...@siemens.com writes:

 Thomas Morley wrote
 On 2013/02/14 09:21:07, dak wrote:
 
 So the message is we can do, but we still need to figure out _what_
 we can do.  Proposals?
 
 Well, currently I don't have a good idea.
 
 Though, some time ago Arnold posted his approach on -user:
 http://lists.gnu.org/archive/html/lilypond-user/2012-06/msg00278.html
 direct link to his code:
 http://old.nabble.com/file/p33991423/pitchedArticulations.ly
 
 Perhaps this might be useful, I hadn't a closer look, though.
 
 https://codereview.appspot.com/7323060/

 I'll try to collect the information:

 The 'pitched articulation' is:
 - add the accidental of a pitch above the articulation symbol
  and or
 - ... below the articulation symbol

Not really.  Pitched articulations don't just concern an accidental
(see pitched trills in the manual), but the case we are concerned about
right here are accidentals stacked with an articulation.

 This (these) pitch(es) may be defined by:
 - entering the pitch
 - specifying the interval from the ornamented note (notehead)

We don't specify intervals elsewhere in LilyPond.  There is not even a
useful entry form for that.

 most common usage is: a minor or major second above or below a single
 tone, not assigned to a chord.

I don't really think anybody thinks about ornamentations with respect to
their intervals but rather with respect to the current scale.  That
might be different with atonal music, but I don't think embellishments
belong in there.

 only delayed turn / reverseturn is usually placed on a skip, where
 no pitch is available to apply the interval.

Maybe.

 Formatting:
 - the accidental is usually some smaller in size than the articulation is.
 - Mostly (prall, mordent, turn, reverseturn) the accidentals are
 horizontally centered, vertically as close as the extent allows.
 - for the trill two positions are suitable:
   - horizontally right aligned, vertically the accidental close above the
 'r' of the 'tr', thus overlapping into the 'tr' symbol extent
   - horizontally appended to the right of the 'tr' symbol, the accidental is
 raised by some value
 The best method for this combining of the glyphs seem to be done by a
 stencil function.

Probably.  And arguably the default stencil function should be able to
do that.

 Additional:
 - It may be required in some situation to put some parentheses (or
 brackets to indicate an editorial note) around the added accidentals.

Maybe.

 Syntax for the user to enter:
 - commands like \majorPrall, \minorPrall, \majorMordent,
 \majorMinorTurn, \minorNeutralReverseturn (which define the offset
 interval) seem (to me) to be the most simple way to specify those
 pitched articulations, whenever they are aligned to exactly one note.

I consider them quite inappropriate.  For one thing, they are unnatural.
If I typeset a c\major scale with trills, I don't want to remember which
steps of the scale are whole and which are half notes.  For another,
intervals don't lead to enharmonic unambigous notes.

 - In other situations (e.g. delayed turn, quarter tone trill) it may
 be the best to enter the pitch(es) manually. One possible style might
 be '\pitchedArticulation [pitch-up] [pitch-down] [articulation
 symbol]', where pitch-up and pitch-down may also be the locial value
 'false' to indicate 'no articulation to put here'.

That does not match LilyPond's typical input patterns.  I'd use
something like \pitched and \underpitched here (\submarinePitched being
a bit too long).  Just use what is needed.  A double accidental is worth
the double trouble entry.

-- 
David Kastrup


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


Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-14 Thread dak

Reviewers: Trevor Daniels, thomasmorley65,

Message:
On 2013/02/13 23:27:55, thomasmorley65 wrote:

On 2013/02/13 22:56:30, Trevor Daniels wrote:
 I definitely prefer the alternative you suggest in para 3.
 You would not then need the warning, which is only necessary due to

the

 complicated 2-stage interface.



I'd second.


Here is the deal: I can rename the current \pitched to \withPitch
which is quite in line with \withMusicProperty.
\withPitch/\accidental is a basic mechanism for passing transposition
information from music to markups.

The questions are

a) is this mechanism sufficient for pitched ornaments?
b) are there useful applications apart from pitched ornaments?

If both answers are no, this approach does not lead anywhere.  With
regard to question a), the main question I see here is should this be
tied into the accidental rule system.  If it isn't, it remains the
user's task to properly distribute accidentals and cautionaries.  Now
fortunately, the question in-scale or out-of-scale remains
constant under _chromatic_ transposition (and modal transposition is
quite less complete), so while this is cumbersome, it still tackles
the basic problem of transposability.  It also begs the question
whether we should not just be passing pitch but also
force-accidental and cautionary and have the \accidental markup
heed them.

Actually, force-accidental does not make much sense since setting it
to #f would mean having to check whether the current accidental rules
would demand an accidental, and that is a check that is, I think,
beyond the design of this feature as long as should this be tied into
the accidental rule system can be answered with no.

So at any rate, the question this patch answers is the question can
we pass information about transposed accidentals through to markups,
and the answer is yes.  Is this a good interface to pitched
ornamentations has been answered no, and can it be a good building
block for a good interface to pitched ornamentations will depend on
what we agree on being a good interface to pitched ornamentations.

So the message is we can do, but we still need to figure out _what_
we can do.  Proposals?


Description:
Issue 3174: Implement \accidental markup and \pitched command for
transposable accidental markups

This is a building block for creating pitched ornaments behaving
sensibly under transposition.

It would be arguable to define \pitched differently so that it works
only on ornaments and does the stacking itself, like
c^\pitched\trill des

and instead give the current version of \pitched a name like \pitchify.

As it stands, here are the implemented meanings:

\accidental markup:
Draw an accidental based on the @var{pitch} property of the causing
event.  This is typically set in music using the (transposable)
@code{\pitched} command, like

@lilypond[verbatim,quote]
melody = \relative c'
  { \key c\major c2^\trill^\pitched des -\markup \accidental d! }
\new Staff { \melody }
\new Staff { \transpose c' e' \melody }
@end lilypond

\pitched music function: arguments pitch and music:
Give @var{music} a pitch of @var{pitch}.

Please review this at https://codereview.appspot.com/7323060/

Affected files:
  M ly/music-functions-init.ly
  M scm/define-markup-commands.scm


Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index  
c063b9585da50b8d9325f73aab5ebb4c0c45cd6e..f23e19a7c00d007793417ac490c23fe5063123bf  
100644

--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -963,6 +963,13 @@ partial =
 'Timing)
  'Score))

+pitched =
+#(define-music-function (parser location pitch music)
+   (ly:pitch? ly:music?)
+   (_i Give @var{music} a pitch of @var{pitch}.)
+   (set! (ly:music-property music 'pitch) pitch)
+   music)
+
 pitchedTrill =
 #(define-music-function
(parser location main-note secondary-note)
Index: scm/define-markup-commands.scm
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index  
7dd0f967ed26bea6631292e2832ad56efd5e9d98..23c2ae239e9bb83f745bdfed51ccc902bd61fd5b  
100755

--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -2750,6 +2750,34 @@ the possible glyphs.

 glyph))

+(define-markup-command (accidental layout props)
+  ()
+  #:category music
+  #:properties ((cause))
+  Draw an accidental based on the @var{pitch} property of the causing
+event.  This is typically set in music using the (transposable)
+@code{\\pitched} command, like
+
+@lilypond[verbatim,quote]
+melody = \\relative c'
+  { \\key c\\major c2^\\trill^\\pitched des -\\markup \\accidental d! }
+\\new Staff { \\melody }
+\\new Staff { \\transpose c' e' \\melody }
+@end lilypond
+  (let* ((event (cond ((ly:grob? cause) (event-cause cause))
+  ((ly:stream-event? cause) cause)
+  (else #f)))
+ (pitch (and event (ly:event-property event 'pitch
+(if (ly:pitch? pitch)
+

Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-14 Thread Werner LEMBERG

 Here is the deal: I can rename the current \pitched to \withPitch
 which is quite in line with \withMusicProperty.
 \withPitch/\accidental is a basic mechanism for passing
 transposition information from music to markups.
 
 The questions are
 
 a) is this mechanism sufficient for pitched ornaments?

I don't think so.  For example, mordents sometimes need *two*
accidentals, one written above and another one below.  But maybe this
can easily fixed by allowing a second, optional argument.

 b) are there useful applications apart from pitched ornaments?

Good question.  AFAIK, only ornaments need that.

 So the message is we can do, but we still need to figure out
 _what_ we can do.  Proposals?

I'm currently lacking inspiration, sorry.


Werner

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


Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-14 Thread thomasmorley65

On 2013/02/14 09:21:07, dak wrote:


So the message is we can do, but we still need to figure out _what_
we can do.  Proposals?


Well, currently I don't have a good idea.

Though, some time ago Arnold posted his approach on -user:
http://lists.gnu.org/archive/html/lilypond-user/2012-06/msg00278.html
direct link to his code:
http://old.nabble.com/file/p33991423/pitchedArticulations.ly

Perhaps this might be useful, I hadn't a closer look, though.

https://codereview.appspot.com/7323060/

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


Re: Issue 3174: Implement \accidental markup and \pitched command for transposable accidental markups (issue 7323060)

2013-02-13 Thread thomasmorley65

On 2013/02/13 22:56:30, Trevor Daniels wrote:

I definitely prefer the alternative you suggest in para 3.
You would not then need the warning, which is only necessary due to

the

complicated 2-stage interface.


I'd second.

Regarding:

melody =
\relative c' {
%\override Script #'script-priority = #-100
%\override TextScript #'script-priority = #100
\key c\major
c2^\trill^\pitched des
  -\markup
 \accidental
d!
c2^\prallprall^\pitched des
  -\markup  % \fontsize #-6 \translate #'(0.6 . 0)
 \accidental
d!
}
\new Staff { \melody }
\new Staff { \transpose c' e' \melody }

Without the commented commands, TextScript and Script are switching
their positions and aren't well aligned (worse while using \prallprall).

Rather a matter of documentation/example.

https://codereview.appspot.com/7323060/

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