Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On Jun 2, 2011, at 8:55 PM, n.putt...@gmail.com wrote: > > http://codereview.appspot.com/4547058/diff/7004/lily/stem.cc > File lily/stem.cc (right): > > http://codereview.appspot.com/4547058/diff/7004/lily/stem.cc#newcode439 > lily/stem.cc:439: me->set_property ("stencil", SCM_BOOL_F); > This looks like a hack; it's certainly not idiomatic (I can see only one > place where a stencil is set in code, and in that case it's a valid > stencil) > I uploaded a new version that doesn't engrave a stem for a rhythmic head unless the head has a stem attachment. That seems to work - lemme know what you think! Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
http://codereview.appspot.com/4547058/diff/7004/lily/stem.cc File lily/stem.cc (right): http://codereview.appspot.com/4547058/diff/7004/lily/stem.cc#newcode439 lily/stem.cc:439: me->set_property ("stencil", SCM_BOOL_F); This looks like a hack; it's certainly not idiomatic (I can see only one place where a stencil is set in code, and in that case it's a valid stencil) http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On Jun 1, 2011, at 10:54 PM, n.putt...@gmail.com wrote: > I'm afraid it's still a bit flaky: > > \relative c' { > \override NoteHead #'stem-attachment = ##f > c8 d e f > } > > Program received signal SIGSEGV, Segmentation fault. > 0x0040bbfb in ly_cdr (x=0x404) at ./include/lily-guile.hh:199 > 199 inline SCM ly_cdr (SCM x) { return SCM_CDR (x); } > (gdb) bt > #0 0x0040bbfb in ly_cdr (x=0x404) at > ./include/lily-guile.hh:199 > #1 0x0045a3ad in Beam::calc_beaming (smob=0x71e2c7d0) at > beam.cc:314 Thanks! Should be fixed in the most recent patchset. Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
I'm afraid it's still a bit flaky: \relative c' { \override NoteHead #'stem-attachment = ##f c8 d e f } Program received signal SIGSEGV, Segmentation fault. 0x0040bbfb in ly_cdr (x=0x404) at ./include/lily-guile.hh:199 199 inline SCM ly_cdr (SCM x) { return SCM_CDR (x); } (gdb) bt #0 0x0040bbfb in ly_cdr (x=0x404) at ./include/lily-guile.hh:199 #1 0x0045a3ad in Beam::calc_beaming (smob=0x71e2c7d0) at beam.cc:314 http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
LGTM http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
LGTM http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
Hey Neil, I think this does the trick. Cheers, MS Sorry - by "this" I meant "this new patchset uploaded on rietveld." Fatigue... Cheers, MS http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On 2011/05/31 16:33:22, Neil Puttock wrote: Hi Mike, Have you considered what might happen if a user tries to get rid of all stems? \relative c' { \once \override NoteHead #'stem-attachment = ##f c4 } -> segfault I think I'd prefer an event to control this (I realize this greatly increases the complexity for little benefit though), mainly as it would allow a hypothetical \noStem command to be postfix instead of a variation on \tweak. Cheers, Neil Hey Neil, I think this does the trick. Cheers, MS http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
Hi Mike, Have you considered what might happen if a user tries to get rid of all stems? \relative c' { \once \override NoteHead #'stem-attachment = ##f c4 } -> segfault I think I'd prefer an event to control this (I realize this greatly increases the complexity for little benefit though), mainly as it would allow a hypothetical \noStem command to be postfix instead of a variation on \tweak. Cheers, Neil http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On 2011/05/31 12:39:03, Graham Percival wrote: On 2011/05/31 06:59:21, http://mike_apollinemike.com wrote: > Graham, could you include this in your next countdown? I see trees of green, red roses too, I watch them bloom for me and you and the broken input/regression/drums.ly And I think to myself, what a wonderful world. I hear babies cry, I watch them grow, They'll learn much more, than I'll ever know, like a ton of programming error: Grob direction requested while calculation in progress. continuing, cross fingers errors. And I think to myself, ohh what a wonderful world Should be fixed in the newest patch set! Cheers, MS http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On 2011/05/31 06:59:21, mike_apollinemike.com wrote: Graham, could you include this in your next countdown? I see trees of green, red roses too, I watch them bloom for me and you and the broken input/regression/drums.ly And I think to myself, what a wonderful world. I hear babies cry, I watch them grow, They'll learn much more, than I'll ever know, like a ton of programming error: Grob direction requested while calculation in progress. continuing, cross fingers errors. And I think to myself, ohh what a wonderful world http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On May 28, 2011, at 2:28 PM, carl.d.soren...@gmail.com wrote: > Do we need to change the definition of stem-attachment in > scm/define-grobs.scm to be ,boolean-or-number-pair? (and maybe define a > new ,boolean-or-number-pair predicate)? > To my knowledge, #f can be used for all properties. So I'd say that it's OK to use #f here. > Do we need to make any changes to ly/note-head-scheme.cc? > Nope. > Do we need to check for #f in ly/note-collision.cc? > Yup (fixed in new patch). > I just did a git grep stem-attachment and saw these places where > stem-attachment was used. Thanks! Graham, could you include this in your next countdown? Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
Do we need to change the definition of stem-attachment in scm/define-grobs.scm to be ,boolean-or-number-pair? (and maybe define a new ,boolean-or-number-pair predicate)? Do we need to make any changes to ly/note-head-scheme.cc? Do we need to check for #f in ly/note-collision.cc? I just did a git grep stem-attachment and saw these places where stem-attachment was used. Thanks, Carl http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On Sat, May 28, 2011 at 08:23:19AM +, mts...@gmail.com wrote: > Just touching base to see if people felt this patch is pushable after > the changes suggested by Carl. > > http://codereview.appspot.com/4547058/ I've added it here: http://code.google.com/p/lilypond/issues/detail?id=1672 so that I can include it in the next patches countdown. Cheers, - Graham ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
Just touching base to see if people felt this patch is pushable after the changes suggested by Carl. Cheers, MS http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On May 22, 2011, at 3:23 PM, carl.d.soren...@gmail.com wrote: > > What if instead of setting a boolean stem-ignore, you just set > stem-attachment = ##f in order to get this behavior? This would be > consistent > with setting stencil = ##f in order to eliminate the stencil. > > If you want to keep a separate boolean, I think I'd prefer the name > no-stem to stem-ignore. The object of the property is to get a notehead > without a stem, and no-stem seems to communicate that better than > stem-ignore, IMO. > > Carl > Great idea! It slims down the patch by a factor of 3. I've uploaded a new patch w/ your suggestions @ http://codereview.appspot.com/4547058. Lemme know what you think! Cheers, Mike ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
What if instead of setting a boolean stem-ignore, you just set stem-attachment = ##f in order to get this behavior? This would be consistent with setting stencil = ##f in order to eliminate the stencil. If you want to keep a separate boolean, I think I'd prefer the name no-stem to stem-ignore. The object of the property is to get a notehead without a stem, and no-stem seems to communicate that better than stem-ignore, IMO. Carl http://codereview.appspot.com/4547058/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
On May 22, 2011, at 10:10 AM, Trevor Daniels wrote: > Hi Mike > > The interface to this looks rather clumsy. > > As you want to ignore only the extreme note > head on a stem I'd prefer this to be controlled > by a property of Stem, rather than NoteHead. > Then you don't need to use tweak, with the need > for careful positioning, and could even define > predefs like \stemDownShort. > > Trevor Hey Trevor, Thanks for the feedback! I think your suggestion would work in most cases, but for this one: \displayMusic \relative c' { 2 ^"IV & III" } you couldn't do it just based on the extremal noteheads. Cheers, MS ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058)
Hi Mike The interface to this looks rather clumsy. As you want to ignore only the extreme note head on a stem I'd prefer this to be controlled by a property of Stem, rather than NoteHead. Then you don't need to use tweak, with the need for careful positioning, and could even define predefs like \stemDownShort. Trevor - Original Message - From: To: Cc: ; Sent: Sunday, May 22, 2011 8:38 AM Subject: Allows LilyPond to ignore certain note-heads in a stem. (issue4547058) Reviewers: , Message: I put this together to do some work with harmonics. It seems to do the trick OK. I've been running this test file to see if it breaks anything: \relative c' { \stemDown \stemUp \repeat unfold 8 8 \stemDown \repeat unfold 8 8 1 } Description: Allows LilyPond to ignore certain note-heads in a stem. Please review this at http://codereview.appspot.com/4547058/ Affected files: M lily/note-head.cc M lily/stem.cc M scm/define-grob-properties.scm Index: lily/note-head.cc diff --git a/lily/note-head.cc b/lily/note-head.cc index aeb7b4a19bd395bb730178820fcf5c8d150127df..1252c3413bee1b3a4951e63677cd21fbede72399 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -190,6 +190,7 @@ ADD_INTERFACE (Note_head, "accidental-grob " "glyph-name " "stem-attachment " +"stem-ignore " "style " ); Index: lily/stem.cc diff --git a/lily/stem.cc b/lily/stem.cc index 04bc4105922e0ecfbca2ea41da058b007ff25fe7..cf2ce0b8d684d4f7e0b5cc92a224b85e0f4a66e7 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -123,10 +123,6 @@ Stem::set_stemend (Grob *me, Real se) Grob * Stem::support_head (Grob *me) { - extract_grob_set (me, "note-heads", heads); - if (heads.size () == 1) -return heads[0]; - return first_head (me); } @@ -176,6 +172,8 @@ Stem::extremal_heads (Grob *me) for (vsize i = heads.size (); i--;) { Grob *n = heads[i]; + if (to_boolean (n->get_property ("stem-ignore"))) +continue; int p = Staff_symbol_referencer::get_rounded_position (n); Direction d = LEFT; @@ -202,6 +200,8 @@ Stem::note_head_positions (Grob *me) for (vsize i = heads.size (); i--;) { Grob *n = heads[i]; + if (to_boolean (n->get_property ("stem-ignore"))) +continue; int p = Staff_symbol_referencer::get_rounded_position (n); ps.push_back (p); Index: scm/define-grob-properties.scm diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 7fd0b138190bf35f20d9fcec62934c92af86839b..1d2ba756e1aa8212b6399b38d87f14e62c22ae6c 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -836,6 +836,8 @@ structure.") pair where the stem attaches to the notehead.") (stem-end-position ,number? "Where does the stem end (the end is opposite to the support-head)?") + (stem-ignore ,boolean? "Should a note-head be ignored by (meaning +not connected to) its stem?") ;;[TODO: doco] (stem-spacing-correction ,number? "Optical correction amount for stems that are placed in tight configurations. For opposite ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel