adjusting first part of slur across system break
Dear LilyPonders, I've found information on how to alter the second half of slurs which span a line-break, but I can't find anything about adjusting the first half while keeping the cloned half at the default. I've constructed a simple example showing what happens when I break a certain slur. In the second version, I'd like the first half of the slur to begin above the stem (as it does in the unbroken example) while keeping the second half of the slur exactly as it is. Is there a way to do this by adjusting the workaround from the Difficult Tweaks section of the NR? I would appreciate any help you could give me with this! Thanks, David \version 2.12.2 \paper { indent = #0 ragged-right = ##t } top = \relative b' { \clef treble \time 3/4 c2 ( d4 e8 d c b a g ) \break c2 ( d4 \break e8 d c b a g ) } bottom = R2.*4 \score { \new Staff \new Voice { \voiceOne \top } \new Voice { \voiceTwo \bottom } } ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
first half of slurs across line-break
Dear LilyPonders, I've found information on how to alter the second half of slurs which span a line-break, but I can't find anything about adjusting the first half while keeping the cloned half at the default. I've constructed a simple example showing what happens when I break a certain slur. In the second version, I'd like the first half of the slur to begin above the stem (as it does in the unbroken example) while keeping the second half of the slur exactly as it is. Is there a way to do this by adjusting the workaround from the Difficult Tweaks section of the NR? I would appreciate any help you could give me with this! Thanks, David \version 2.12.2 \paper { indent = #0 ragged-right = ##t } top = \relative b' { \clef treble \time 3/4 c2 ( d4 e8 d c b a g ) \break c2 ( d4 \break e8 d c b a g ) } bottom = R2.*4 \score { \new Staff \new Voice { \voiceOne \top } \new Voice { \voiceTwo \bottom } } ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: adjusting first part of slur across system break
Thank you, Trevor and Mats. Overriding the positions property did the trick! David On Wed, Sep 30, 2009 at 6:01 PM, Trevor Daniels t.dani...@treda.co.ukwrote: David Nalesnik wrote Wednesday, September 30, 2009 10:16 PM I've found information on how to alter the second half of slurs which span a line-break, but I can't find anything about adjusting the first half while keeping the cloned half at the default. I've constructed a simple example showing what happens when I break a certain slur. In the second version, I'd like the first half of the slur to begin above the stem (as it does in the unbroken example) while keeping the second half of the slur exactly as it is. Is there a way to do this by adjusting the workaround from the Difficult Tweaks section of the NR? I would appreciate any help you could give me with this! It's easier than you think! The first half of the broken slur is just the original slur. So the following override inserted just before the note on which the slur starts will lift the start of the first part a bit: \once\override Slur #'positions = #'( 4 . 0 ) (Note that the slur positions are not continuously variable - changing them seems to cause discontinuous jumps in position sometimes. I don't know why.) This is not too bad, but if you want something more precise you'll need to tweak the control points of the slur. Trevor ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: [Issue?] hiding Accidental(s) on tied note(s) after a line break
Hi, According to Gardner Read: It is not necessary to repeat the accidental before a tied note . . . The one exception to this general rule occurs when the note or notes affected by the accidental and tied over the barline come at the end of a system or at the bottom of the page. It is helpful to the performer if the accidental is repeated . . . (Music Notation, p.131) I know I have spent a lot of time adding these accidentals in Finale (and redoing them whenever the layout changed), and I very much appreciate that 2.12.2 takes care of them automatically! On Fri, Oct 2, 2009 at 9:12 PM, Joe Neeman joenee...@gmail.com wrote: On Thu, 2009-10-01 at 13:53 -0700, Jonathan Wilkes wrote: On Saturday 30 May 2009 10:23:31 pm Werner LEMBERG wrote: shortest note playing here.) (shortest-starter-duration ,ly:moment? The duration of the shortest note that starts here.) + (hide-tied-accidental-after-break ,boolean? If set, an accidental +that appears on a tied note after a line break will not be displayed) (side-axis ,number? If the value is @code{#X} (or addr...@hidden@code{0}), the object is placed horizontally next to the other object. If the value is @code{#Y} addr...@hidden@code{1}, it is Joe, items in define-grob-properties.scm are sorted alphabetically. Please move it to the right location. Oops, I had originally named it show-tied-accidental-after-break. Thanks, Joe Hi Joe, I have a quick question about this property you've added (which is wonderful, btw): 1) Should tied accidentals after line breaks be suppressed by default? I don't know; that was the previous default value, so I left it the same. I don't mind particularly if someone wants to change it. I've looked through some scores, and even thought there's more examples than I thought there would be that show tied accidentals after breaks (mainly orchestral scores, and mainly 20th century pieces from the 70s) it seems in the vast majority of cases they aren't shown. On a related note, I like your original property name above, but I guess it would cause problems to change it now. Again, I won't object if someone else wants to change it (as long as there's a convert-ly rule). Joe ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: title on a separate page (Susan Dittmar)
Hi all, I'm trying to understand how the Scheme markup command works, and I noticed that it seems to work exactly the same way if one of the lines is commented out, like so: #(define-markup-command (vspace layout props amount) (number?) This produces a invisible object taking vertical space. ;(ly:make-stencil (cons -1 1) (cons 0 amount)) (ly:make-stencil (cons -1 1) (cons amount amount))) I'm wondering if there is a reason I'm not seeing to include both lines. Each line creates an invisible box, right? David ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user On Wed, Oct 7, 2009 at 5:21 AM, Susan Dittmar susan.ditt...@gmx.de wrote: But you'll need to make sure the music that's actually used in the sample is public domain. Please use some other music for the example. I do not know under which license, if at all, Eva pubished the tune. One of the reasons why I just posted an except... Susan ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
problems with routine to adjust inner points of slur
Hi LilyPonders, I'm trying to write a function which will make a slur more rounded by adjusting its middle points while leaving the note-attachments the same. I came up with something that works--except that when I try to modify two slurs, both slurs take on the new values for the second one. (If you uncomment the %\expandSlur #5 line you will see what I mean.) Can you tell me why this is happening, and what I can do to fix it? (Also, please let me know if there's a more elegant way to structure this...I'm sure that's part of the problem!) --David \version 2.12.2 \paper { indent = #0 ragged-right = ##t } #(define internal-offset #f) expandSlur = #(define-music-function (parser location input) (number?) (set! internal-offset input) #{ \once \override Slur #'control-points = #more-curve #} ) #(define (more-curve grob) (let ((coords (ly:slur::calc-control-points grob))) ; get control-points ; break list into component pairs (define first-pair (car coords)) (define second-pair (car (cdr coords))) (define third-pair (car (cdr (cdr coords (define fourth-pair (car (cdr (cdr (cdr coords) ; adjust y-coordinates of middle points (set-cdr! second-pair (+ internal-offset (cdr second-pair))) (set-cdr! third-pair (+ internal-offset (cdr third-pair))) ; reassemble control-point list (list first-pair second-pair third-pair fourth-pair) ) ) top = \relative c'' { \clef treble \time 3/4 \key c \major %default slur c2 ( d4 e8 d c b a g ) \expandSlur #2 c2 ( d4 e8 d c b a g ) %\expandSlur #5 c2 ( d4 e8 d c b a g ) } \score { \new Staff \new Voice { \top } } ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: problems with routine to adjust inner points of slur
Thank you so much, Neil--this works perfectly! David ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
dealing with multiple related grobs
Hi, I have a question about accessing information about several related grobs at once. For example, if I wanted to use information about a beam and a tuplet number positioned above it in a single procedure, where would these grobs be associated together, and how could I refer to them in turn? Thanks, David ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
different style of barline in-between staves
Hi Lilyponders, In the attached snippet, I want to connect the two staves with a dashed barline between the staves, while retaining a solid barline within the individual lines. (The bottom staff shows the two-voice structure of the Handel melody on the upper staff.) How would I go about doing this? Any help would be much appreciated! Thanks, David handel_ex.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: different style of barline in-between staves
Thank you, Robin--problem solved! On Thu, Dec 17, 2009 at 2:27 AM, Robin Bannister r...@dataway.ch wrote: David Nalesnik wrote: I want [...] a dashed barline between the staves, while retaining a solid barline within the individual lines. Add the following to your \layout{\context{\Score block: \override SpanBar #'glyph-name = #dashed Cheers, Robin ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Roman numerals and figured bass
Hi Bryn, On Wed, Feb 29, 2012 at 6:03 PM, Bryn Hughes bryn.hug...@gmail.com wrote: A related question: Does anyone have a template or resources for including a Roman numeral/figured bass analysis underneath a staff (preferably a piano staff)? I teach music theory and we routinely analyze chorales in this way. Ideally, the Roman numerals would include superscript figures, though to have the figures separate and simply smaller than the Roman numerals would work well too. Attached is the file I use for my theory classes. It works best if you add the analysis to a Lyrics context (as in the example). Hope this helps, David rN.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Roman numerals and figured bass
Hi Bryn, On Wed, Feb 29, 2012 at 6:32 PM, Bryn Hughes bryn.hug...@gmail.com wrote: This is wonderful! Thank you so much! Glad you like it! I should have an improved version fairly soon, and I'll be happy to post that when it's ready. (Please let me know if you run into any problems, or if you have any suggestions.) Thanks, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Roman numerals and figured bass
Hi Bryn, On Wed, Feb 29, 2012 at 8:25 PM, Bryn Hughes bryn.hug...@gmail.com wrote: I will, David. Thank you! This may be an ignorant question, but it is possible to reference your .ly file in another .ly file, so that it's easier to read the code I'm working on? Sure, you can save the function in a separate file and use \include to incorporate it in whatever file you wish. For an example of how this is done, see http://lilypond.org/doc/v2.15/Documentation/learning/style-sheets ) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi Harm, On Wed, Feb 29, 2012 at 6:57 PM, Thomas Morley thomasmorle...@googlemail.com wrote: Converting some files gave: Not smart enough to convert minimum-Y-extent. Vertical spacing no longer depends on the Y-extent of a VerticalAxisGroup. Please refer to the manual for details, and update manually. (or sth similiar). Could be fixed. I changed my mind about these files and fixed them too. Thank you so much for all your effort in this! One file gives me problems: forcing-fixed-distance-between-staves.ly Currently I don't know how to receive the promised results with the 2.14.2-commands. Suggestions? The following section of the NR explains how to do this: http://www.lilypond.org/doc/v2.14/Documentation/notation/explicit-staff-and-system-positioning It wouldn't be a problem to convert the snippet using these guidelines, but because of the duplication, maybe it should just be deleted? -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi Harm, staves swapped around are not shown in the NR. So if we can make it work, the snippet is worth to keep. I haven't been able to make this work either. Whenever I use negative values as in the original snippet I get programming errors such as insane spring distance requested, ignoring it. I can put one staff directly on top of the other, but that's as far as it goes. I can't imagine the use of reversing staves by this method. (After all, you can simply reverse their order in the StaffGroup block.) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Display score title differently on odd or even pages
Hi Jay, Is it possible to check whether the page is odd or even in creating the score title markup. I'm setting a group of hymns and I'd like the hymn number on the outside of the page. : The discussion at http://www.lilypond.org/doc/v2.14/Documentation/notation/reference-to-page-numbers is helpful in this regard. From define-markup-commands.scm, I took the definition of \page-ref discussed in the link and adapted it so that it returns a markup justified to the left or right sides of the page, depending on whether the page number is even or odd. Notice that I used piece for the title of each item. I'm not sure why substituting title gives no output. Hope this helps! -David title-alignment-by-even-or-odd.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi Harm, I attached a tarball with all fixed files (hope it's not to big). Perhaps you could test compiling them. IIRC you use windows, it should make no difference, but who knows ... Everything compiles :) All I get are warnings with a few of the files. I've attached the trimmed-down results. I'll get back to you soon about the text you want me to look at. -David GNU LilyPond 2.14.2 `adding-a-figured-bass-above-or-below-the-notes.ly' OK `adding-fingerings-to-tablatures.ly' OK `adjusting-lyrics-vertical-spacing.ly' OK `affecting-items-only-on-the-left-or-rigth-of-a-linebreak-barlines,-keysignatures,-clefs-etc..ly' OK `altering-the-number-of-stems-in-a-beam.ly' OK _ `ancient-accidentals.ly' A number of warnings of this type: ancient-accidentals.ly:27:6: warning: Could not find glyph-name for alteration 1 cisis^\markup { \typewriter vaticana } cis c ces ceses ancient-accidentals.ly:25:55: warning: Could not find glyph-name for alteration -1 cisis^\markup { \typewriter medicaea } cis c ces ceses ancient-accidentals.ly:29:55: warning: Could not find glyph-name for alteration -1 cisis^\markup { \typewriter mensural } cis c ces ceses [...] `automatic-beam-subdivisions.ly' OK `automatic-beams-two-per-two-in-4-4-or-2-2-time-signature.ly' OK `beam-endings-in-score-context.ly' OK `beam-grouping-in-7-8-time.ly' OK `changing-the-time-signature-without-affecting-the-beaming.ly' OK `chord-names-and-lyrics-without-a-staff.ly' A number of warnings of this type: chord-names-and-lyrics-without-a-staff.ly:14:20: warning: Lyric syllable does not have note. Use \lyricsto or associatedVoice. text = \lyricmode { Ho ho, ho ho ho. Ha ha, ha. } warning: staff-affinities should only decrease `chords-headword.ly' OK `clip-systems.ly' OK `coloring-individual-staff-lines.ly' OK `combining-pedal-notes-with-clef-changes.ly' OK ___ `combining-two-parts-on-the-same-staff.ly' combining-two-parts-on-the-same-staff.ly:26:8: warning: already have slur a4 c4. ( g8) a4 | combining-two-parts-on-the-same-staff.ly:26:8: warning: already have slur a4 c4. ( g8) a4 | combining-two-parts-on-the-same-staff.ly:32:12: warning: cannot end slur g4 e4.( d8 ) c4 | combining-two-parts-on-the-same-staff.ly:32:12: warning: cannot end slur g4 e4.( d8 ) c4 | combining-two-parts-on-the-same-staff.ly:33:14: warning: cannot end slur r2 g'4( f8 e ) | combining-two-parts-on-the-same-staff.ly:33:14: warning: cannot end slur r2 g'4( f8 e ) | `complex-compound-time-signatures.ly' OK `conducting-signs,-measure-grouping-signs.ly' OK `consecutive-tremolos.ly' OK __ `creating-a-schenker-graph.ly' creating-a-schenker-graph.ly:94:22: warning: weird stem size, check for narrow beams fis' g' a' creating-a-schenker-graph.ly:101:12: warning: weird stem size, check for narrow beams b' _ `cross-staff-chords---beaming-problems-workaround.ly' OK `custom-tuning-and-midi.ly' OK ___ Processing `defining-predefined-fretboards-for-other-instruments.ly' warning: Cannot find glyph warning: Cannot find glyph warning: Cannot find glyph ___ ___ `different-colored-note-heads-in-one-staff.ly' lots of warnings: warning: Incomplete keyAlterationOrder for key signature warning: No glyph found for alteration: 54/125 _ `displaying-bar-numbers-on-a-separate-staff.ly' OK `displaying-complex-chords.ly' OK `filtering-parts-from-the-command-line.ly' A number of these: warning: Could not find glyph-name for alteration 17/1000 `function-to-create-wygiwym-chord-names.ly' OK `hiding-staves-with-rests-only-for-some-all-voices.ly' OK `how-to-define-autobeamsettings-in-the--layout-block.ly' OK `how-to-improve-automatic-beam-groups-when-frequently-using--time.ly' OK `how-to-show-a-staff-and-ledger-lines-without-notes.ly' OK ___
Re: LSR updates: was: polychords: a working solution
Hi, On Sun, Mar 4, 2012 at 3:05 PM, Phil Holmes m...@philholmes.net wrote: - Original Message - From: Thomas Morley thomasmorle...@googlemail.com** To: James pkx1...@gmail.com Cc: Phil Holmes m...@philholmes.net; David Nalesnik david.nales...@gmail.com; lilypond-user lilypond-user@gnu.org Sent: Sunday, March 04, 2012 8:52 PM Subject: Re: LSR updates: was: polychords: a working solution Hi James, 2012/3/4 James pkx1...@gmail.com: Phil, On 4 March 2012 18:30, Phil Holmes m...@philholmes.net wrote: - Original Message - From: Thomas Morley thomasmorle...@googlemail.com** To: David Nalesnik david.nales...@gmail.com Cc: lilypond-user lilypond-user@gnu.org Sent: Saturday, March 03, 2012 11:14 PM Subject: Re: LSR updates: was: polychords: a working solution ... warning: MIDI channel wrapped around warning: remapping modulo 16 I never saw them before during my testings. And I can't appraise them. LIAR! http://lists.gnu.org/archive/**html/lilypond-devel/2011-06/** msg00833.htmlhttp://lists.gnu.org/archive/html/lilypond-devel/2011-06/msg00833.html ;) I think if look in the Archives you might find the others too. -- -- James I initially ran the entire set of updated files in one go using lilypond *.ly 2stderr.log This appears to be the problem--thank you for the link, James: I would have never suspected that this could create problems. I went ahead and ran the files producing the strange results individually, and lo and behold! the warnings are gone. Here's my summary: **no warnings when compiled alone** `different-color-note-heads-in-one-staff.ly’ `filtering-parts-from-the-command-line.ly’ `hymn-template-wilhelmus-van-nassouwe.ly' `incipit.ly' `markup-accacciaturas.ly' `positioning-segno-and-coda-without-line-break.ly' `using-the-input-tag-property-to-create-musical-outlines.ly' Sorry for any confusion! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi, On Sun, Mar 4, 2012 at 5:16 PM, Graham Percival gra...@percival-music.cawrote: On Mon, Mar 05, 2012 at 12:07:09AM +0100, Thomas Morley wrote: I just downloaded the LSR.tarball from today and ran a last successful test. I'd like to send it to Sebastiano. Please do. Shall we postpone the change of the description for increasing-spacing-between-staves.ly? No; if there's only one snippet left to alter, just stick that on your todo pile and fix it in the web interface after the entire thing is running 2.14. I just finished rewriting the description a moment ago. I'll fix it once the update is through. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi Harm, I just finished rewriting the description a moment ago. I'll fix it once the update is through. Anyway, I suppose I should add the file to the conversation. Please look through it and see if it's accurate, and I'll take care of adding it when the LSR is running 2.14.2. Oh, and congratulations on everything you've accomplished!!! -David increasing-spacing-between-staves.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LSR updates: was: polychords: a working solution
Hi Harm, On Sun, Mar 4, 2012 at 5:50 PM, Thomas Morley thomasmorle...@googlemail.com wrote: Hi David, Sorry, I've just sent a tarball to Sebastiano. I hope that all is correct. Everything compiles, and you fixed a number of things that didn't need fixing--that has to be good enough :) THANKS A LOT FOR ALL YOUR HELP!! You did the lion's share here, you really did, and this only got rolling because of you. (And I thought you said somewhere above that you would do anything but organize :) ) Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Grace at beginning of score
Hi Ornello, On Fri, Mar 9, 2012 at 7:20 AM, ornello dominik.hoer...@fun.de wrote: What is the right way to write a grace note at the beginning of the score (or after a clef/time/key signature change)? But this issue does not mention a workaround? Does anybody know a trick? The trick in this case is to add a grace note spacer to the other staff. Notice that I changed . . . to { . . . } in your example to make it work. { \new PianoStaff \new Staff { % changed from \key bes \major \time 4/4 \clef violin \new Voice { \grace a'8 ( a''1 ) } } % from \new Staff { % from \clef bass \new Voice { \key bes \major \grace s8 % spacer grace c1 } } % from } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Noteheads exactly over bar lines
Hi Ádám, I just realized that the solution is not as good as it seemed to be. It seems that if I use a markup, the distance between subsequent crotchets won't be the same, as the first crotchet of the measure (the one that is represented by the markup) will be placed a little more left than it should be. So I need a solution where the actual bar lines would move 'a bit to the right' in order to be in sync with the first notehead in the measure. What about using proportional spacing and then moving the bar line slightly to the right? Something like this: \version 2.15.30 { \time 2/4 \override Stem #'stencil = #point-stencil d' d' \once \override Staff.BarLine #'extra-offset = #'(1.5 . 0) d' d' } \layout { \context { \Score \override SpacingSpanner #'strict-note-spacing = ##t proportionalNotationDuration = #(ly:make-moment 1 8) } \context { \Staff \remove Time_signature_engraver } } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Noteheads exactly over bar lines
Hi Ádám, What about using proportional spacing and then moving the bar line slightly to the right? Attached is an attempt at automating this somewhat. I haven't tested it extensively, but I hope it will be useful. -David barline-through-note01.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Noteheads exactly over bar lines
Hi again, On Sat, Mar 10, 2012 at 9:45 AM, David Nalesnik david.nales...@gmail.comwrote: Hi Ádám, What about using proportional spacing and then moving the bar line slightly to the right? Attached is an attempt at automating this somewhat. I haven't tested it extensively, but I hope it will be useful. Looking at your example some more, it occurs to me that you want to move the SpanBar right. The attached example provides two functions. One centers the bar lines, the other the span bars. The adjustment of BarLine isn't really necessary with the example since the bar lines are transparent. Otherwise, both overrides would be necessary for both to align vertically. I've automated this further so you don't have to call the functions repeatedly. HTH, David barline-through-note02.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: lyric hyphen goes outside staff limits at line break
Hi Zsolt, On Sat, Mar 10, 2012 at 4:43 PM, -Eluze elu...@gmail.com wrote: Zsolt Cselényi wrote: For the above the first line is broken after three bla-s and the hyphen of the last bla sticks out completely on the right. hi I think the paper-width is very short, too - is that your intention? did you mean \cm Sorry, I can't reproduce this. The notes are so close together the hyphens are suppressed when I run this with 2.14.2. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Noteheads exactly over bar lines
Hi Ádám, thank you a lot for this solution. It is much better than anything I expected to achieve. Glad to hear it! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Aleatoric / modern notation
Hi, On Sun, Mar 11, 2012 at 3:18 AM, m...@apollinemike.com m...@apollinemike.com wrote: On Mar 11, 2012, at 8:53 AM, James Harkins wrote: At Sun, 11 Mar 2012 08:12:35 +0100, m...@apollinemike.com wrote: The best way to achieve that with current LilyPond is Scheme engravers. There have been a few examples of Scheme engravers posted on this list (if you search Scheme engraver you'll find one - there are also examples in the input/regression folder of the LilyPond source). You'd want to create one that begins and ends a spanner when it hears a given event (you can invent a BoxNoteEvent, for example) and acknowledges note columns in the interim, putting them in a grob-array called note-columns or what-have-you. Then, make a print method that extracts these note columns (or whatever grobs you're interested in) finds the min/max height and width, and draws a box at those dimensions. If you want to get fancy, you can add extra spacing width to the left of the first note column and the right of the last note column to make sure there are no collisions with the box and surrounding material. I see... would it be too much to ask you to send your engraver to me (off list if you prefer)? That's of course assuming you developed one for your own music. Normally I don't mind doing some research and experimentation on my own, but in this case -- Unfortunately, the way I created mine was way hackish and not at all extensible, intelligent, or suitable to your needs (I hijacked a beam grob). The best thing to do is go ahead w/ the score as if it were to have boxes and then put something like : c d %\startBoxedNotes e f g %\endBoxedNotes wherever you need it. There are enough people on this list who know Scheme that someone is likely to pop up w/ a more fleshed-out solution in the next 6 weeks, and if not, in 6 weeks (if not less), I'll have some time to give it a go. Awhile ago, I worked a little on an engraver which would add boxes to groups of notes (and include articulations and dynamics as well). I gave up on it, but decided to revive it in response to this thread. I hope what I've come up with will prove useful for frame notation. I've defined a grob, Frame, and given it several properties. One of these, 'padding, adds space between the frame and its contents, as you would expect. The length of the continuation line is controlled by the property 'extender-length. Then, there's 'extra-left-padding and 'extra-right-padding. These last are there to correct a shortcoming: I can't think of an artful way to accomodate an accidental before the first note of a group so there isn't a collision. Another problem is that the horizontal spacing doesn't adapt to the frame. I suppose this comes from the fact that I've hijacked a TextSpanner, so that collisions are reckoned with outside staff objects. Is there anything I can do about this? This is all very rough, but perhaps it can serve as a starting point. Any suggestions for improvement are welcome! HTH, David frameEngraver.ly Description: Binary data attachment: frameEngraver.png___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Aleatoric / modern notation
Hi Mike, Excellent work! I'm glad you think so! I've attached a new file that addresses some of the issues you identify above: --) It uses axis-group::width to box accidentals Beautiful! Now there's really no need for the extra padding properties. (I've kept them in the attached file, but combined them into a single property which takes a pair = 'extra-padding.) --) It creates a FrameStub grob to occupy the horizontal space that a frame line takes up (note that I don't know if this actually works - I'm not sure how to test it - but at least it doesn't crash!). Whenever you have a spanner that somehow occupies horizontal space at its bounds, you can create stub grobs that approximate this space. This technique also works for items that, for whatever reason, have heights that are difficult to approximate (see SpanBarStub and StemStub, for example). This works great for spacing on the left side. It wasn't working on the right, so I added 'extender-length in (plus a slight correction accounting for arrow-length, etc., which should be fairly easy to calculate). Now it will push everything forward nicely. One thing I've noticed, though, is that the line will not cross a bar line. If I increase the length of the extender, the bar line is simply pushed to the right. I figured out one way around this--namely, setting the X-extent of the bar line to (+inf.0 . -inf.0), which is what I do in the attached file. Of course this has other consequences. Is there any other way? --) It gets rid of some dead or unused code. Thank you very much for your improvements and explanations--I think I've learned quite a bit! Best, David frameEngraver3.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Default length of laissezvibrer ties
Hi Nick, I also played around with trying to make a callback function for \override LaissezVibrerTie #'control-points, but although Lilypond gives no error on the console, the LV tie doesn't appear at all when I try to use the callback. The following should work. (I've also substituted in a more current version of the snippet you incorporated. Same result, but I think it looks a little better.) \version 2.15.30 #(define ((alter-lv-tie-curve offsets) grob) (let ((coords (ly:semi-tie::calc-control-points grob))) (define (add-offsets coords offsets) (if (null? coords) '() (cons (cons (+ (caar coords) (car offsets)) (+ (cdar coords) (cadr offsets))) (add-offsets (cdr coords) (cddr offsets) (add-offsets coords offsets))) shapeLVTie = #(define-music-function (parser location offsets) (list?) #{ \once \override LaissezVibrerTie #'control-points = #(alter-lv-tie-curve offsets) #}) \relative c' { d8( e) ~ e4 ~ \shapeLVTie #'(0 0 0.75 -0.7 2.25 -0.7 3 0) e2\laissezVibrer } \relative c' { \override LaissezVibrerTie #'control-points = #(lambda (grob) (if (= UP (ly:grob-property grob 'direction)) ((alter-lv-tie-curve '(0 0 0.75 0.7 2.25 0.7 3 0)) grob) ((alter-lv-tie-curve '(0 0 0.75 -0.7 2.25 -0.7 3 0)) grob))) d8( e) ~ e4 ~ e2\laissezVibrer } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Callback function and applying to all notes in chord
Hi Nick, I was trying to make a callback function to lengthen LV ties (thanks to David Nalesnik for his help). It works fine when applied to single notes, but on a chord, only one of the two ties is lengthened. Is this due to an error in the code below or some more deep-rooted problem. If I reverse the order of the notes in the chord, the long and short ties swap around: Instead of overriding the property directly, I set 'control-points within an override of 'before-line-breaking. Seems to to the trick: \version 2.15.30 #(define ((alter-lv-tie-curve offsets) grob) (let ((coords (ly:semi-tie::calc-control-points grob))) (define (add-offsets coords offsets) (if (null? coords) '() (cons (cons (+ (caar coords) (car offsets)) (+ (cdar coords) (cadr offsets))) (add-offsets (cdr coords) (cddr offsets) (add-offsets coords offsets))) \relative c'' { \override LaissezVibrerTie #'before-line-breaking = #(lambda (grob) (set! (ly:grob-property grob 'control-points) (if (= UP (ly:grob-property grob 'direction)) ((alter-lv-tie-curve '(0 0 0.75 0.7 2.25 0.7 3 0)) grob) ((alter-lv-tie-curve '(0 0 0.75 -0.7 2.25 -0.7 3 0)) grob c f,1\laissezVibrer f, c'\laissezVibrer c f c' f\laissezVibrer } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: full rest side effect
Hi Jonathan, On Wed, Mar 14, 2012 at 1:56 PM, Jonathan Wilkes jancs...@yahoo.com wrote: Oops, I sent this to lilypond@googlecode by mistake. Please ignore there... Hello, In the following example the left hand gets rhythmically augmented. What screwy thing am I doing? This score boilerplate was generated using LilypondTool and I removed the irrelevant parts. In the absence of an explicit duration, LilyPond will continue to use the last duration given it. So all the notes in the new Staff context are assigned a dotted half times 2. Make the first note in the LH context a c4 -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Setting the width of system-starter curly braces
Hi Ádám, Unfortunately the curly brace created for these four instruments is way too wide. Is there a way to shrink the vertical size of the curly brace for the GrandStaff (so that it would have the same width as the curly brace of a GrandStaff consisting of only two instruments)? Another solution would be to scale the brace like so: \override GrandStaff.SystemStartBrace #'stencil = #(lambda (grob) (ly:stencil-scale (ly:system-start-delimiter::print grob) 0.75 1)) Here the brace is scaled horizontally to 0.75. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Setting the width of system-starter curly braces
Hi Ádám, this is quite weird. This code compiles fine. However, in my original score it doesn't work. After some more experimenting, I figured out that the problem is, that I have the \RemoveEmptyStaves in the \Staff context. After removing that, it compiled just fine. Maybe it's some bug. Anyway, the \RemoveEmptyStaves is not that important for this particular score, so I disabled it. Could you try this with your original file? (I can't think of an example with \RemoveEmptyStaves to check it with.) The function ly:stencil-scale needs a stencil to work with (hence the error you were getting), and this variant checks to see if we have one before calling it. \override GrandStaff.SystemStartBrace #'stencil = #(lambda (grob) (let ((brace (ly:system-start-delimiter::print grob))) (if (ly:stencil? brace) (ly:stencil-scale brace 0.75 1 Hope this helps! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Aleatoric / modern notation
Hi James, BTW, I didn't mention before, but it looks like I'm going to be using that feathered-beam function, derived from work by David, and this box-notation function, also coming from David's work. Oh, I just helped out a bit with that one--thanks definitely go to Harm. So David -- I guess I owe you a beer or three, or something. Glad this works for you--let me know if you run into any problems. Virtual beer(s) gladly accepted! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Move markup relative to parent from inside define-markup-command?
Hi Nick, On Thu, Mar 22, 2012 at 9:29 PM, Nick Payne nick.pa...@internode.on.netwrote: I'm using define-markup-command to simplify the indication of barring for a single chord, but what I have at the moment defaults to being centred on the note, and the vertical line indicating how many strings to cover is overlaid by the notehead unless the markup position is tweaked. Is it possible, if I have an additional numeric argument for the amount of shift needed, to apply that shift from inside the define-markup-command rather than having to use an external tweak? Do you mean something like the following (which duplicates the image you've uploaded)? \version 2.15.32 #(define-markup-command (mbarre layout props fretnum vdrop offset) (markup? number? number?) (interpret-markup layout props #{ \markup \translate #(cons offset 0) \small \bold { \concat { \postscript #(string-append 0.1 setlinewidth 0.7 -0.5 moveto 0 - (number-string vdrop) rlineto 0.5 0 rlineto stroke) $fretnum } } #} ) ) \relative c'' { e c4^\markup { \mbarre V #2.3 #0 } e c^\markup { \mbarre V #2.3 #-1.5 } } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Aleatoric / modern notation
Hi Ádám, I tried to use the frame engraver of this thread, but I was unable to do so. I'm constantly getting 'syntax error, unexpected EVENT_IDENTIFIER' errors and the LilyPond compiler won't recognize the \frameStart and \frameEnd commands. The only thing I changed was the version number itself, as I'm using the stable version (2.14.2). Do you have any idea what the problem could be? Or is this code using some specific feature of 2.15? I can't explain the difference in behavior, but with 2.14.2 you need to put \frameEnd and \frameStart after the note. So, the following can be substituted into the file attached earlier in this thread: \relative c'' { \override Stem #'transparent = ##t \override Beam #'transparent = ##t \once \override Frame #'extender-length = #8 dis'8[ \frameStart e f ges] \frameEnd s2 \once \override Frame #'extender-length = #11 d,8[ \frameStart e f g] \frameEnd s2 \once \override Staff.BarLine #'X-extent = #'(+inf.0 . -inf.0) % line can cross bar line s2 \once \override Frame #'extender-length = #3.5 fis'8[ \frameStart bes,, aes, e''] \frameEnd } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Multimeasure rests over a cadenza
Hi James, On Sun, Apr 8, 2012 at 9:22 AM, James Harkins jamshar...@gmail.com wrote: Hi, I am perfectly ripping my hair out trying to get multimeasure rests to display properly in another staff, over a cadenza. Reduced example illustrates. Possibly the following thread will be useful to you: http://www.mail-archive.com/lilypond-user@gnu.org/msg68492.html HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Moving notes in a chord to the opposite side of the stem?
Hi Paul, On Mon, Apr 9, 2012 at 4:47 PM, Nick Payne nick.pa...@internode.on.netwrote: On 10/04/12 06:56, Paul Morris wrote: Thomas Morley wrote: Am 9. April 2012 03:25 schrieb Paul Morris p...@paulwmorris.com p...@paulwmorris.com: Hello, Is there a way to manually move some of the notes in a chord to the opposite side of the stem, overriding the default placement? I have looked through the docs and did not find a simple way to do this (the NoteColumn #'force-hshift property only works with notes in different voices, and trying to \override NoteHead #'X-offset within a chord just returned an error). The best thing I came up with was this snippet:http://lsr.dsi.unimi.it/LSR/Item?id=505 Following its example I was able to get the results I needed by doing this: shiftR = { \once \override Stem #'X-offset = #.6 \once \override NoteHead #'X-offset = #.6 } c' e' g' 4 { c' e' } \\ { \voiceThree \shiftR g' } d' f' a' { d' } \\ { \voiceThree \shiftR f' a' } See attached screenshot. But it seems like there should be a way to do this without having to introduce another voice? Use a tweak. Perhaps: \version 2.14.2 horOff = #(define-music-function (parser location x-off music) (number? ly:music?) (set! (ly:music-property music 'tweaks) (acons 'extra-offset (cons x-off 0) (ly:music-property music 'tweaks))) music) %shiftR = { % \once \override Stem #'X-offset = #.6 % \once \override NoteHead #'X-offset = #.6 %} { c' e' \horOff #1.2 g' 4 % { c' e' } \\ { \voiceThree \shiftR g' } d' \horOff #1.2 f' \horOff #1.2 a' % { d' } \\ { \voiceThree \shiftR f' a' } } HTH, Harm Thank you! This works, but unfortunately (like the Hydra's heads) it introduces two other problems, one with horizontal spacing collisions and one with ledger lines. 1. Because the spacing engine does not take into account this low-level tweak, the tweaked notes sometimes collide with bar/measure lines and sometimes with other adjacent notes. Is there a way to use Scheme toalso increase the horizontal space given to the chord? (I am still a beginner at Scheme.) Can't help with the second problem, but for the first you could add additional horizontal space to either the barline or stem to increase their separation: \version 2.15.36 barspace = #(define-music-function (parser location extent) (pair?) #{ \once \override Staff.BarLine #'extra-spacing-width = #extent #}) stemspace = #(define-music-function (parser location extent) (pair?) #{ \once \override Staff.Stem #'X-extent = #extent #}) \relative c'' { c2 c c c \barspace #'(0 . 2) c c \stemspace #'(-2 . 0) c c } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user This seems to do the trick as far as horizontal spacing is concerned: \version 2.15.36 #(define ((shift offsets) grob) (let ((note-heads (ly:grob-array-list (ly:grob-object grob 'note-heads (map (lambda (p q) (set! (ly:grob-property p 'X-offset) q)) note-heads offsets))) displaceHeads = #(define-music-function (parser location offsets) (list?) #{ \once \override NoteColumn #'before-line-breaking = #(shift offsets) #} ) { \displaceHeads #'(0 1.2 0) c' e' g'4 \displaceHeads #'(0 1.2 1.2) d' f' a' } Hope this helps! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Moving notes in a chord to the opposite side of the stem?
Hi Paul, On Mon, Apr 9, 2012 at 9:50 PM, Paul Morris p...@paulwmorris.com wrote: Thanks David and Nick! More below... David Nalesnik wrote: Hi Paul, On Mon, Apr 9, 2012 at 4:47 PM, Nick Payne nick.pa...@internode.on.netwrote: On 10/04/12 06:56, Paul Morris wrote: Thank you! This works, but unfortunately (like the Hydra's heads) it introduces two other problems, one with horizontal spacing collisions and one with ledger lines. 1. Because the spacing engine does not take into account this low-level tweak, the tweaked notes sometimes collide with bar/measure lines and sometimes with other adjacent notes. Is there a way to use Scheme toalso increase the horizontal space given to the chord? (I am still a beginner at Scheme.) Can't help with the second problem, but for the first you could add additional horizontal space to either the barline or stem to increase their separation: \version 2.15.36 barspace = #(define-music-function (parser location extent) (pair?) #{ \once \override Staff.BarLine #'extra-spacing-width = #extent #}) stemspace = #(define-music-function (parser location extent) (pair?) #{ \once \override Staff.Stem #'X-extent = #extent #}) \relative c'' { c2 c c c \barspace #'(0 . 2) c c \stemspace #'(-2 . 0) c c } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user This seems to do the trick as far as horizontal spacing is concerned: \version 2.15.36 #(define ((shift offsets) grob) (let ((note-heads (ly:grob-array-list (ly:grob-object grob 'note-heads (map (lambda (p q) (set! (ly:grob-property p 'X-offset) q)) note-heads offsets))) displaceHeads = #(define-music-function (parser location offsets) (list?) #{ \once \override NoteColumn #'before-line-breaking = #(shift offsets) #} ) { \displaceHeads #'(0 1.2 0) c' e' g'4 \displaceHeads #'(0 1.2 1.2) d' f' a' } Hope this helps! -David Actually, David's approach appears to fix both problems! Ledger lines are extended and appear twice as wide, just like with other chords that have notes on both sides of the stem. The horizontal spacing seems to be working with standard noteheads. (Looks like a good candidate for the LSR.) Unfortunately a function I'm using to substitute custom stencils for NoteHead grobs seems to disrupt the horizontal spacing in some instances (particularly noticeable with bar lines). I haven't figured out the pattern yet. But worst case, that's something I can fix manually using the tweaks Nick suggested. Or maybe there is a way to expand David's function to access the Stem from the NoteColumn and automatically give it an X-offset too? A stripped down version of my code is below, if anyone is curious. It is still a bit long. Again, thanks so much! I really appreciate it, as it would take me forever to try and figure this stuff out on my own. -Paul \version 2.15.32 %Begin TwinNote scripts %Customizing note head stencils based on pitch %Defining stencils upTriangle = #(ly:make-stencil (list 'embedded-ps gsave currentpoint translate newpath -.1875 -.5 moveto .65625 .5 lineto 1.5 -.5 lineto closepath fill grestore ) (cons -.1875 1.5) (cons -.5 .5) ) downTriangle = #(ly:make-stencil (list 'embedded-ps gsave currentpoint translate newpath .08 .34 moveto .65625 -.4 lineto 1.2325 .34 lineto closepath 0.12 setlinewidth stroke newpath -.0775 .43 moveto .65625 -.43 lineto 1.39 .43 lineto closepath 0.1 setlinewidth stroke newpath -.1675 .48 moveto .65625 -.48 lineto 1.48 .48 lineto closepath 0.04 setlinewidth stroke grestore ) (cons -.1875 1.5) (cons -.5 .5) ) %Based on the pitch's semitone, which note head #(define (semitone-to-stencil semitone) (if (= (remainder semitone 2) 0) downTriangle upTriangle) ) %Get the pitch from the grob, convert to semitone #(define (stencil-notehead grob) (semitone-to-stencil (ly:pitch-semitones (ly:event-property (event-cause grob) 'pitch %End TwinNote scripts #(define ((shift offsets) grob) (let ((note-heads (ly:grob-array-list (ly:grob-object grob 'note-heads (map (lambda (p q) (set! (ly:grob-property p 'X-offset) q)) note-heads offsets))) displaceHeads = #(define-music-function (parser location offsets) (list?) #{ \once \override NoteColumn #'before-line-breaking = #(shift offsets) #} ) theMusic = { \displaceHeads #'(0 0 1.45) c' e' g' 4 \displaceHeads #'(0 1.45 1.45) d' f' a' \displaceHeads #'(0 1.45 1.45) d' f' a' \displaceHeads #'(0 0 1.45) c' e' g' \displaceHeads #'(-1.45 -1.45 0
Re: System in different colors
Hi, I tried \once \override but it didn't work. It should. You can also move the override of BarLine later as I do below. My problem however is, that the barline between my part 2 and three is already shown in the color of the part 3 where I think it is defined and belongs to part 2. I believe the issue here is that the barline is considered to _begin_ the new measure rather than end the old one. I can't think of a way around this except what James suggests. (Then there's the issue of the staff lines underneath the bar line, to which I don't have a ready answer.) BTW, your bars don't all add up. \version 2.14.2 #(set-global-staff-size 18.65) \header { title = System in different colors } \language deutsch staffVoice = \new Staff { \set Score.tempoHideNote = ##t \time 2/2 \key f \major \clef treble \tempo 2=78 \relative c' { \context Voice { \override Staff.Clef #'color = #red \override Staff.TimeSignature #'color = #red \override Staff.KeySignature #'color = #red \override NoteHead #'color = #red \override Staff.StaffSymbol #'color = #red \override Stem #'color = #red \override DynamicText #'color = #red \override Tie #'color = #red \override TextScript #'color = #red \override Staff.BarLine #'color = #red \override Staff.LedgerLineSpanner #'color = #red \partial 4*3 d' b4^\markup{ \larger {Part 1}}_\f c a f4 \stopStaff } \context Voice = melodyVoi { \dynamicUp %\partial 4*3 \startStaff \revert Staff.Clef #'color \revert Staff.KeySignature #'color \revert Staff.BarLine #'color \revert Staff.LedgerLineSpanner #'color \revert Staff.StaffSymbol #'color \revert NoteHead #'color \revert Stem #'color \revert Tie #'color \revert DynamicText #'color c4\(_\mf h c\) \bar || f c f c f c f c f c f c f c f c f c f c f c f c f c %% ? } \context Voice = melodyRep { f1 R1 \bar |. \stopStaff } \context Voice = interlude { \startStaff \override Staff.VerticalAxisGroup #'remove-first = ##t \override SystemStartBar #'color = #black \override Staff.StaffSymbol #'color = #red \override NoteHead #'color = #red \override Stem #'color = #red \override DynamicText #'color = #red \override Tie #'color = #red \override TextScript #'color = #red \override Accidental #'color = #red \override Rest #'color = #red \override Staff.LedgerLineSpanner #'color = #red f4^\markup { \larger {Part 3 }} e f g \override Staff.BarLine #'color = #red %% I moved this c,4 r h f' g r \bar || } } } \score { \staffVoice \layout {} } \paper {} Hope this helps, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: System in different colors
Hi Harm, how about inserting: \override Staff.BarLine #'layer = #10 in the \layout and \once \override Staff.BarLine #'X-extent = #'(-0 . 0.5) for the problematic BarLine. Think it should do the trick: Aha! Works beautifully. --David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: System in different colors
Hi Eluze, I believe the issue here is that the barline is considered to _begin_ the new measure rather than end the old one. I can't think of a way around this except what James suggests. (Then there's the issue of the staff lines underneath the bar line, to which I don't have a ready answer.) I don't think it's an issue. it's a question of timing - both voices define a bar at the same time (part 3 the initial bar which usually is not displayed at the beginning of a system) and its properties and - as usual - the latest wins. Yes, good point. I didn't realize that \startStaff is actually creating a new staff, in this case joined to the one before on the same line. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Flatten a tie without hardcoding control points?
Hi James, On Fri, Apr 20, 2012 at 3:32 AM, James Harkins jamshar...@gmail.com wrote: Maybe a simple question: Is there a way to flatten the curve of a tie that is as easy as overriding ratio for slurs? You can override 'ratio for ties too: \override Tie #'details #'ratio = #0.2 Another possibility is to override 'height-limit: \override Tie #'details #'height-limit = #0.75 I found control-points and this does change the tie's shape. But, I don't need to modify the x-extent, only the y-extent. It looks to me as if overriding the control points means that I would have to re-edit the control points by hand if horizontal spacing changes (which could happen, say, if I take the piece to the US and have to change the paper to letter size instead of A4). I found TieColumn's Y-extent property, but overriding it like this takes no effect: \once \override TieColumn #'Y-extent = #'(1 . 1.5) Also doesn't change the result in any way if the pair of numbers is reversed: (1.5 . 1). Searched LSR for tie, didn't find anything quite like this. I'm fairly sure a scheme function could handle it, but I'm probably a good year or two away from being able to attempt something like that on my own. As far as easier control of 'control-points goes, you can modify http://lsr.dsi.unimi.it/LSR/Snippet?id=639 like so: shapeTie = #(define-music-function (parser location offsets) (list?) #{ \once \override Tie #'control-points = #(alter-curve offsets) #}) #(define ((alter-curve offsets) grob) (let ((coords (ly:tie::calc-control-points grob))) (define (add-offsets coords offsets) (if (null? coords) '() (cons (cons (+ (caar coords) (car offsets)) (+ (cdar coords) (cadr offsets))) (add-offsets (cdr coords) (cddr offsets) (add-offsets coords offsets))) \relative c'' { c~ c \shapeTie #'(0 0 0 -0.15 0 -0.15 0 0) c~ c } This way the shape of the tie is modified by offsetting lilypond's default rather than you having to create the control points from scratch. HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Flatten a tie without hardcoding control points?
Hi, Oops--should have included the version. I'm using 2.15.37. With 2.14.2 and before you need the dollar sign: shapeTie = #(define-music-function (parser location offsets) (list?) #{ \once \override Tie #'control-points = #(alter-curve $offsets) #}) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Flying ties
Hi James, On Fri, Apr 20, 2012 at 8:58 AM, James Worlton jworl...@gmail.com wrote: On Fri, Apr 13, 2012 at 11:18 AM, James Worlton jworl...@gmail.com wrote: On Fri, Apr 13, 2012 at 10:59 AM, James pkx1...@gmail.com wrote: James On 13 April 2012 16:30, James Worlton jworl...@gmail.com wrote: I've found some odd tie behavior--not sure if it's known currently. Sorry, currently I can't test whether it also happens in earlier versions. The following code creates a flying tie situation around the upper and lower notes of the chord, in other words the ties lie far outside the staff. This happens probably because of the accidentals on the new line--if you take the \key out, removing the accidentals, the ties stay close to the notes: \version 2.15.36 \score { \new Staff { \relative a' { \key des \major a d f1~ \break q1 } } } James Worlton http://code.google.com/p/lilypond/issues/detail?id=379 is one of many tie issues or if not this one http://code.google.com/p/lilypond/issues/list?can=2q=tiescolspec=ID+Type+Status+Stars+Owner+Patch+Needs+Summarycells=tiles one of these will probably be this. It's also an area on our Google Summer of Code page http://lilypond.org/gsoc.html Not that 'helps' you. James Ah, okay. Sorry for the noise. I wish I had some coding skills and/or money to help the situation. James Worlton While playing around with tie settings I discovered that putting in a dummy override and copying one of the values from the 'details list will make the flying tie problem disappear: \version 2.15.36 \paper { #(set-paper-size a7) } musicA = \relative a' { \key des \major a d f1~^default \break q1 } musicB = \relative a' { \key des \major \override Tie #'details = #'((ratio . 0.333)) a d f1~^dummy override \break q1 } \score { \new Staff { \musicA \break \musicB } } Not sure what this means for the squashing of the bug, but it's a workaround at least. James Worlton ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user This is really interesting! I don't have any explanations, just an observation. Your override clears 'details except for 'ratio. Using the entire default list and commenting out entries one by one leads to some interesting results. Below is where the flying ties stop. (You get some variation with the remaining lines, too.) Not sure what it means, but maybe this observation is useful for correcting a bug, if such it is. -David \version 2.15.36 \paper { #(set-paper-size a7) } musicA = \relative a' { \key des \major a d f1~^default \break q1 } musicB = \relative a' { \key des \major \override Tie #'details = #'( ;(ratio . 0.333) ;(center-staff-line-clearance . 0.6) ;(tip-staff-line-clearance . 0.45) ;(note-head-gap . 0.2) ;(stem-gap . 0.35) ;(height-limit . 1.0) ;(horizontal-distance-penalty-factor . 10) ;(same-dir-as-stem-penalty . 8) ;(min-length-penalty-factor . 26) ;(tie-tie-collision-distance . 0.45) ;(tie-tie-collision-penalty . 25.0) ;(intra-space-threshold . 1.25) ;(outer-tie-vertical-distance-symmetry-penalty-factor . 10) (outer-tie-length-symmetry-penalty-factor . 10) (vertical-distance-penalty-factor . 7) (outer-tie-vertical-gap . 0.25) (multi-tie-region-size . 3) (single-tie-region-size . 4) (between-length-limit . 1.0) ) a d f1~^dummy override \break q1 } \score { \new Staff { \musicA \break \musicB } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Flying ties
Hi, Your override clears 'details except for 'ratio. Err...don't think that's accurate, but the rest stands! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Layout Set Staff Size
Hi Silvio, On Fri, Apr 20, 2012 at 10:47 AM, Silvio ARDITO silvioard...@gmail.comwrote: I need the following layout: [image: Immagine in linea 2] The result is a copy and paste from 2 .ly. The little up-right staff uses: *#(set-global-staff-size 11)* ; the rest uses: *#(set-global-staff-size 20)* . The command: *#(layout-set-staff-size 11)* in the \layout section gives a not valid result. Are there same (scheduled) enhancements since http://thread.gmane.org/gmane.comp.gnu.lilypond.general/66291 ? When you change the staff size like this, you also need to override the distance between the lines: \override Staff.StaffSymbol #'staff-space = #(/ 11 20) Also, take a look at this snippet: http://lilypond.org/doc/v2.15/Documentation/snippets/staff-notation Hope this helps, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Layout Set Staff Size
Hi, Also, take a look at this snippet: http://lilypond.org/doc/v2.15/Documentation/snippets/staff-notation That would be the one called Changing the staff size...! ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: parenthesizing arpeggios
Hi Urs, On Sun, Apr 22, 2012 at 6:37 PM, Urs Liska li...@ursliska.de wrote: Dear listers, I thought it should be simple and straightforward, but I don't understand how to put an arpeggio in brackets. If I use this code I only get a very small parenthesis: \version 2.15.36 \relative c' { %\once \override ParenthesesItem #'font-size = #6 c g' e'-\parenthesize \arpeggio } If I use the (commented out) override, I get a much bigger parenthesis but this doesn't work at all, because it is too wide and round. Is there a possibility to put brackets around objects and let the brackets adapt to the height of the objects (like spanners)? Here's something that works for arpeggios. The attached file is a bit large because I needed to include several functions from stencil.scm to draw the parentheses. (I included parenthesize-stencil, commented out, so you can see what the numbers in my override refer to.) The override of 'before-line-breaking is necessary for horizontal spacing. Sorry I don't have a simple solution involving ParenthesesItem. Perhaps someone else will have an idea. Best, David parenthesize-arpeggio.ly Description: Binary data attachment: parenthesize-arpeggio.png___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: parenthesizing arpeggios
Hi again! Here's something that works for arpeggios. The attached file is a bit large because I needed to include several functions from stencil.scm to draw the parentheses. Oh, what ever was I thinking! No need at all for all that duplicated code... This is all you need: \version 2.15.36 \relative c' { \override Arpeggio #'stencil = #(lambda (grob) (parenthesize-stencil (ly:arpeggio::print grob) 0.1 0.5 0.5 0.2)) \override Arpeggio #'before-line-breaking = #(lambda (grob) (set! (ly:grob-property grob 'X-extent) (ly:stencil-extent (ly:grob-property grob 'stencil) X))) \repeat unfold 4 { c g' e'-\arpeggio } cis dis fis gis cis dis gis-\arpeggio cis dis fis gis cis dis-\arpeggio cis dis fis gis cis-\arpeggio cis dis fis gis-\arpeggio } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: measure counter engraver
David, On Tue, Apr 24, 2012 at 12:41 AM, David Kastrup d...@gnu.org wrote: David Nalesnik david.nales...@gmail.com writes: The examples are written to work with the latest versions. (I'm using the current release candidate.) Then one could use make-engraver. True, true. My motivation here was to allow it to work with earlier versions. It's just the example that won't, without modification. I'd love for people to try this out, to see if it works in situations where you might want such a thing. (If you have a suggestion, see a problem, manage to break it, please do let me know!) Using define-event-class makes the file unfit for inclusion in multi-file runs of LilyPond since define-event-class permanently changes LilyPond. I'm a little confused by the word permanently. Here I understand that the new event-class, measure-counter-event, will persist between the files if I run a group of files containing my file, but will be gone in a new session not involving that file. Any problems which might result will only affect that multi-file run? I am working on a replacement URL:http://code.google.com/p/lilypond/issues/detail?id=2449, but the pending patch is just one of several changes needed for changing the event class hierarchy into a per-parser item instead of a global entity. Thank you, David--I appreciate this very much. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: measure counter engraver
David, .Any problems which might result will only affect that multi-file run? Basically every use of lilypond-book is a multi-file run. So are our regtests. Understood. I also won't upload this to the LSR at the current time since it could potentially cause annoyances the next time it is updated. But I don't think someone should necessarily be _scared_ to try my file out. If it's being used in a multi-file situation, the user would simply need to be on the lookout for unexpected results. If there are any, the solution is simply to run the files again without mine. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: measure counter engraver
Hi Phil, On Tue, Apr 24, 2012 at 9:13 AM, Phil Holmes m...@philholmes.net wrote: ** You're OK uploading it to the LSR providing you don't tag it with docs - it's only those that are imported into the documentation system. I'm just speaking here from the experience of checking a bunch of LSR files for the 2.14.2 update by running them as a group: a number of bizarre errors cropped up which disappeared when these files were run individually. (This was related to issue 1678.) Of course, I'll be involved with the update to 2.16 :) Unrelated issue: I notice that the original post with attached files hasn't shown up on archive 2 on either -user or -devel, even though I sent that post 13 hours ago. It appears on archive 1, but there the .ly file appears as a binary data file, which I cannot open. Am I guilty of top-posting here, or have I exceeded some attachment size limit (48K and 9K)? I wonder if I should repost the .ly file so it isn't lost to the archives. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: print tie without note it ties to?
Hi, Thank you. \laissezVibrer produces very short ties; is there a way to modify them so that they resemble normal ties? You might find this thread helpful: http://www.mail-archive.com/lilypond-user@gnu.org/msg70030.html -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: measure counter engraver
Hi, Unrelated issue: I notice that the original post with attached files hasn't shown up on archive 2 on either -user or -devel, even though I sent that post 13 hours ago. It appears on archive 1, but there the .ly file appears as a binary data file, which I cannot open. Am I guilty of top-posting here, or have I exceeded some attachment size limit (48K and 9K)? I wonder if I should repost the .ly file so it isn't lost to the archives. Well, the original post along with the attachments still hasn't shown up in lilypond-user, so I'm attaching the .ly file to this email. Hopefully, it will show up in the archives, -David measureCounterEngraver.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, On Fri, Apr 27, 2012 at 4:23 AM, Urs Liska li...@ursliska.de wrote: Hello Jan-Peter, thank you very much. This seems to solve the problem. Maybe it's not perfectly robust, though. The function now works when the number of lists exactly matches the number of slur fragments. I'm not sure if this has been the case earlier or if it had been a little bit more 'generous'. For the project at hand I can live with that anyway. I've rewritten shape-slur so that you should be able to use lists of offsets which don't match with the number of slur fragments. I've tested it somewhat, but if you run into a problem, let me know. Here's the relevant part: #(define ((shape-slur offsets) grob) (let* ( ;; have we been split? (orig (ly:grob-original grob)) ;; if yes, get the split pieces (our siblings) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )) (total-found (length siblings))) (define (helper sibs offs) (if (and (eq? (car sibs) grob) (pair? offs)) ((alter-curve (car offs)) grob) (if (pair? offs) (helper (cdr sibs) (cdr offs)) ((alter-curve '()) grob (if (= total-found 2) (helper siblings offsets) ((alter-curve offsets) grob Hope this helps! David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, On Fri, Apr 27, 2012 at 6:51 AM, David Nalesnik david.nales...@gmail.comwrote: Hi Urs, I've rewritten shape-slur so that you should be able to use lists of offsets which don't match with the number of slur fragments. I've tested it somewhat, but if you run into a problem, let me know. I noticed that you'll produce an error if you apply a list of lists to a slur which isn't broken (i.e., if a layout change results in a once-broken slur appearing on a single line). Here is a fix for that: #(define ((shape-slur offsets) grob) (let* ( ;; have we been split? (orig (ly:grob-original grob)) ;; if yes, get the split pieces (our siblings) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )) (total-found (length siblings))) (define (helper sibs offs) (if (and (eq? (car sibs) grob) (pair? offs)) ((alter-curve (car offs)) grob) (if (pair? offs) (helper (cdr sibs) (cdr offs)) ((alter-curve '()) grob (if (= total-found 2) (helper siblings offsets) (if (list? (car offsets)) ((alter-curve (car offsets)) grob) ((alter-curve offsets) grob) ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: \RemoveEmptyStaffContext doesn't remove empty staff
Hi, In some piano music, you may have three different levels, as it were, e.g. a melodic line in the treble, played by the right hand, a deep bass consisting of long notes in the left hand, and in between chords filling in the time between the bass notes, also played by the left hand. In such a situation, which would likely involve large jumps of the left hand that may even reach into the realm of the treble clef, the score is easier to read if you distribute the notes played by the left hand on two staves and have the line of the right hand in the third (uppermost) staff. And sometimes four can be used, as in Rachmaninoff's Prelude in C# minor where the number of staves to a system fluctuates between two and four: http://javanese.imslp.info/files/imglnks/usimg/0/02/IMSLP00333-Rachmaninoff_-_Fantasy_Pieces_2.pdf Can't think of an example off-hand that uses more. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, On Fri, Apr 27, 2012 at 11:46 AM, Urs Liska li...@ursliska.de wrote: Hi David, thank you for now. I'll look into it. But isn't it very likely that I have to reshape a slur anyway when it changes from broken to unbroken? In that case I'd even say the errors are a 'feature' so you notice it ... Provided it is documented enough not to drive you crazy ... Sure, that's true. Presumably when you're looking for that fine control, you've settled on the layout in all but the tiny details! Without the modification, though, the error would cause the file to fail and the error message is a little opaque. (Well, it's quite exact, but it takes some study to figure out how it happened.) I could create a warning here, something like: slur is not broken anymore. One thing you can do is \shapeSlur #'( ... list of offsets ...) or \shapeSlur #'(( ... list of offsets ...)) without the file failing. Since this function has come up again, I wonder if I could get your (and other people's) opinion on syntax. When I first wrote the offsetting function (http://lsr.dsi.unimi.it/LSR/Item?id=639)I thought that alists were a bother to type. But 'control-pojnts _is_ an alist '((x1 . y1) (x2 . y2) ... )) , so shouldn't we have something like this? \shapeSlur #'((dx1 . dy1) (dx2 . dy2) ...) I realize that there's more to type, but wouldn't this be clearer to use? (As well as being more consistent with how LilyPond represents this type of data)? Any thoughts? -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, On Fri, Apr 27, 2012 at 6:05 PM, Urs Liska li...@ursliska.de wrote: Am 27.04.2012 19:30, schrieb David Nalesnik: Hi Urs, On Fri, Apr 27, 2012 at 11:46 AM, Urs Liska li...@ursliska.de wrote: Hi David, thank you for now. I'll look into it. But isn't it very likely that I have to reshape a slur anyway when it changes from broken to unbroken? In that case I'd even say the errors are a 'feature' so you notice it ... Provided it is documented enough not to drive you crazy ... Sure, that's true. Presumably when you're looking for that fine control, you've settled on the layout in all but the tiny details! it's not only this. I think that with any slur that one might decide to shape manually a change in line break will spoil it anyway. So I'm not so sure it's a useful goal to make such a function fool-proof in this respect. Without the modification, though, the error would cause the file to fail and the error message is a little opaque. (Well, it's quite exact, but it takes some study to figure out how it happened.) Well, the file fails (at least lilypond says so), but it actually compiles, it's only the function that isn't applied. But you're right to assume that the normal user can't cope with the error messages ;-) I could create a warning here, something like: slur is not broken anymore. If that's possible in such functions, I'd find it very useful. Even better: tell the user: The slur has now X parts, please adapt the function call One thing you can do is \shapeSlur #'( ... list of offsets ...) or \shapeSlur #'(( ... list of offsets ...)) without the file failing. Since this function has come up again, I wonder if I could get your (and other people's) opinion on syntax. When I first wrote the offsetting function (http://lsr.dsi.unimi.it/LSR/Item?id=639)I thought that alists were a bother to type. But 'control-pojnts _is_ an alist '((x1 . y1) (x2 . y2) ... )) , so shouldn't we have something like this? \shapeSlur #'((dx1 . dy1) (dx2 . dy2) ...) I realize that there's more to type, but wouldn't this be clearer to use? (As well as being more consistent with how LilyPond represents this type of data)? First: I think this is a _very_ useful function that should even be made more widely known. I'm very glad that you think so! Second: your syntax suggestion looks very good to me. Of course it is more to type. But that is more than outweighed by the advantages. it's easier to write and it's especially much easier to read. When changing the offsets (which you do multiple times until you get a good result ...) I'm always finding me counting params (in order to find the right item to change) which surely takes more time and concentration than typing (once) a few brackets and points. Yes, I also find it very easy to make mistakes when typing in lists separated only by spaces. Trying out examples for the attached file, I was pleasantly surprised at how much easier-- and faster! -- it is to use the alist notation. Certainly, it is easier to read. Plus, I think it makes the offsetting function a bit less ugly. Third: I suggest to add support for PhrasingSlurs and Ties in order to make it more general. For PhrasingSlurs it's just a matter of writing a new entrance function, but for Ties you need new shape-ties and alter-tie-curve subroutines. See the attached file that is the result of an earlier enquiry on this mailing list. The functions themselves don't incorporate your newest additions (sorry, it's still a bit over my head), but you'll see what I mean. One solution is to use a syntax like this: \shapeCurve #Tie #'( ((dx1 . dy1) . . . )) and then to let the functions choose the right control-points callback from a list based on the name of the grob you're overriding. (Dmytro used this in a variant of his adaptation which I saw off-list.) I thought it might be nice to have \shapeSlur, \shapeTie, etc. To avoid duplicating so much code, I pass the relevant 'control-points callback to the functions which need it. Of course, you can extend this list to whatever takes control-points. As you mention, \shapePhrasingSlur would be the same as \shapeSlur. You can do \shapeTupletBracket in 2.14.2, but it looks like 'control-points is gone in 2.15. to sum up what I said: If you'd volunteer to do the following it would be a very valuable contribution to LilyPond's usability ;-) I'd be delighted to do whatever I can. - let the function check the number of arguments and give meaningful warnings instead of errors (count arguments and compare against number of slur siblings) It will do this. In the attached examples, some warnings will appear, and you can add elements and comment them out (with ; inside of the Scheme expression instead of the ordinary %) Tell me what you think! - don't try to make the function robust so that it accepts wrong input. This may be trivial from a programmer's perspective but I
Re: BarNumber-value?
Hi Harm, On Sun, Apr 29, 2012 at 5:55 PM, Thomas Morley thomasmorle...@googlemail.com wrote: Hi, in 2.14.2 I used a function to manipulate the BarNumber-stencil. It calls the value of the BarNumber as a string, via (ly:grob-property grob 'text). This doesn't work no longer with the latest devel-versions. (Due to the changes in Issue 2059 ?) (ly:grob-property grob 'text) now returns, e.g. (#procedure line-markup (layout props args) (2)) How to do with 2.15.36? Below a simplified example. \version 2.14.2 \relative c'' { \override Score.BarNumber #'break-visibility = #'#(#f #t #t) \override Score.BarNumber #'stencil = #(lambda (grob) (let* ((stil (ly:text-interface::print grob)) (text (ly:grob-property grob 'text)) (nmbr (string-number text))) (if (= (remainder nmbr 5) 0) (ly:grob-set-property! grob 'color red) (ly:grob-set-property! grob 'color black)) stil)) \repeat unfold 41 { c1 } } Lucky guess, but replacing text in your definition of nmbr with the following gets me a red number every five bars with 2.15.37: (markup-string text) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: lilypond-user Digest, Vol 113, Issue 99
Hi, On Sun, Apr 29, 2012 at 8:37 PM, MING TSANG tsan...@rogers.com wrote: \version 2.15.37 \relative c'' { \override Score.BarNumber #'break-visibility = #'#(#f #t #t) \override Score.BarNumber #'stencil = #(lambda (grob) (let* ((stil (ly:text-interface::print grob)) (text (ly:grob-property grob 'text)) ((markup-string text) (string-number text))) (if (= (remainder (markup-string text) 5) 0) (ly:grob-set-property! grob 'color red) (ly:grob-set-property! grob 'color black)) stil)) \repeat unfold 41 { c1 } } I try replacing nmbr with (markup-string text) as suggest by David Nalesnik and I get the following error. Appreciate help. This is how to do it: \relative c'' { \override Score.BarNumber #'break-visibility = #'#(#f #t #t) \override Score.BarNumber #'stencil = #(lambda (grob) (let* ((stil (ly:text-interface::print grob)) (text (ly:grob-property grob 'text)) (nmbr (string-number (markup-string text (if (= (remainder nmbr 5) 0) (ly:grob-set-property! grob 'color red) (ly:grob-set-property! grob 'color black)) stil)) \repeat unfold 41 { c1 } } Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplet number placement and ornament
Nick, In the following, even though I've turned off the tuplet bracket stencil, the tuplet number is still placed as though the stencil was there: \version 2.15.37 \relative c'' { \set tupletSpannerDuration = #(ly:make-moment 1 4) \override TupletBracket #'stencil = ##f \times 2/3 { g8 fis g g\mordent fis g } } Since the number is positioned according to where the bracket would be, you could override 'positions of TupletBracket: \relative c'' { \set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { g8 fis g \override TupletBracket #'positions = #'(3.34 . 3.34) g\mordent fis g } } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplet number placement and ornament
Hi again, Since the number is positioned according to where the bracket would be, you could override 'positions of TupletBracket: \relative c'' { \set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { g8 fis g \override TupletBracket #'positions = #'(3.34 . 3.34) g\mordent fis g } } If you want something more automatic, you could try the solution below. Basically, I'm setting the 'positions of TupletBracket to that of Beam and adding in an offset for correct positioning. It will work with downstems, too, but there will be a collision if you put the mordent on the middle note. (Of course the override is unnecessary in that case...) There's probably a radically simpler solution here, but for what it's worth... \version 2.15.37 #(define proc (lambda (grob) (let* ((first-note (car (ly:grob-array-list (ly:grob-object grob 'note-columns (note-heads (ly:grob-array-list (ly:grob-object first-note 'note-heads))) (stem (ly:grob-object (car note-heads) 'stem)) (beam (ly:grob-object stem 'beam)) (beam-pos (ly:grob-property beam 'positions)) (padding (ly:grob-property grob 'padding)) (beam-thick (* 0.5 (ly:grob-property beam 'beam-thickness))) (dir (ly:grob-property grob 'direction))) (coord-translate beam-pos (* dir (+ beam-thick padding)) \relative c'' { \set tupletSpannerDuration = #(ly:make-moment 1 4) \override TupletBracket #'positions = #proc %\override TupletBracket #'bracket-visibility = ##t \times 2/3 { g8 fis g g\mordent fis g } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: lilypond-user Digest, Vol 113, Issue 99
Hi Ming, On Mon, Apr 30, 2012 at 11:23 AM, MING TSANG tsan...@rogers.com wrote: Thank you, David. Is it possible not to print other numbers other than the multiple of five's? To to this, you only need to change one line of Harm's function (see below): \relative c'' { \override Score.BarNumber #'break-visibility = #'#(#f #t #t) \override Score.BarNumber #'stencil = #(lambda (grob) (let* ((stil (ly:text-interface::print grob)) (text (ly:grob-property grob 'text)) (nmbr (string-number (markup-string text ;; if you change 5 to 3 in the line below, you'll get a bar line every three bars; if you change it to 10, every ten ;; bars; etc. (if (= (remainder nmbr 5) 0) (ly:grob-set-property! grob 'color red) (ly:grob-set-property! grob 'color black)) stil)) \repeat unfold 41 { c1 } } Hope this helps! David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: lilypond-user Digest, Vol 113, Issue 99
Err.. ;; if you change 5 to 3 in the line below, you'll get a bar line every three bars; if you change it to 10, every ten ;; bars; etc. That's bar number of course! ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: lilypond-user Digest, Vol 113, Issue 99
Hi Ming, On Mon, Apr 30, 2012 at 4:53 PM, MING TSANG tsan...@rogers.com wrote: Hi, David, I asked the wrong question. The right one: Can I just print the multiple of fifth's (or 10's) only - the in between nar number should be blank? OK, I now see what you want. For that you can do something like this: \version 2.15.37 \relative c' { \override Score.BarNumber #'break-visibility = #end-of-line-invisible \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5) \repeat unfold 41 { c1 } } You can read more about this here: http://lilypond.org/doc/v2.15/Documentation/notation/bars#bar-numbers See Printing bar numbers at regular intervals. HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: removing sharp sign
Helge, On Tue, May 1, 2012 at 6:03 AM, Eluze elu...@gmail.com wrote: Am 01.05.2012 12:29, schrieb Helge Kruse: Hello, I am transcribing a score. I want to keep it as similar to the original as possible. In the following excerpt the C-sharp is continued with a tie on the next line. The measure #3 at the new line starts with C-sharp. When you have the tie from measure #3 to #4 the sharp is omitted. But surprisingly the C-sharp in the appoggiatura has the sharp sign. 1. How can I remove the # inside this grace note? You could do this: \once \override Accidental #'stencil = ##f HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How to adjust the Y-offset of volta spanners?
Hi Jim, On Wed, May 2, 2012 at 9:59 PM, lilyp...@umpquanet.com wrote: I have a first ending at the end of a line, which is nicely spaced (vertically). The second ending is at the beginning of the next line, and the right end of the spanner is above a rehearsal letter (/mark /default). There is more space than necessary between the rehearsal mark and the second ending volta spanner, and indeed, more than necessary under the entire second ending spanner. How might I adjust the Y-offset of the second ending volta spanner while leaving the first ending volta Y-offset unchanged? The height of the spanner doesn't appear to be responsive to 'Y-offset. It will move if you override 'padding, but this ordinarily will affect both pieces of the spanner (first and second endings) unless you use a function on the model of http://www.lilypond.org/doc/v2.15/Documentation/extending/difficult-tweaks Try this: \version 2.15.37 #(define (my-callback arg) (lambda (grob) (let* ((orig (ly:grob-original grob)) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() ))) (if (and (= (length siblings) 2) (eq? (car (last-pair siblings)) grob)) arg \relative c'' { \override Score.VoltaBracketSpanner #'padding = #(my-callback 3) \repeat volta 2 { \repeat unfold 6 { c4 d e f | } } \alternative { { c2 e | } { f2 g | f g | } } } \layout { ragged-right = ##t } You can change the number in the override to apply a different value to the padding affecting the second ending. Hope this helps! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Hide time signature numerator?
Even simpler: #(define time-signature-hide-numerator (lambda (grob) (let ((denom (number-string (cdr (ly:grob-property grob 'fraction) (grob-interpret-markup grob (make-lower-markup 2 (make-number-markup denom)) So it is! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, Hi David, as promised I tried out your updated function(s). Well, you can't call this a complete test suite, but it seems to work perfectly. Many thanks. Attached is a version showing that it also/still works with phrasingSlurs. I find the warnings very useful. I assume it isn't possible to find out and display the 'real' place in the source where the problem comes from? As it is, I only know that there is a changed curve that doesn't work anymore, but don't know where it is (which can of course be difficult to pin down in larger pieces. If it isn't possible to identify the calling line in the source code, would it be possible to mark the respective curve red? This way one could easily spot the problematic grob. You can do either, or both. The attached file will display a warning which includes the input location and (if you uncomment the relevant lines in shape-curve) print the curves in red. That a wrong number of pairs gives strange results is OK. That way one is gently pointed towards malformed input ;-) +1 So it works like a charm now :-) If you could still add the colour or line number feature - or tell me that you won't or can't do it - I could make a useable and distributably version of the file - maybe as a package together with displayControlPoints (see other mail in the other thread). Sure, please do! In the meantime, I'll keep tinkering with this and I'll send along any improvements. Thank you very much for your comments! Best, David shaping-curves02.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Urs, On Wed, May 9, 2012 at 10:13 AM, Urs Liska li...@ursliska.de wrote: Hi David, now I tested your new function. OK, I didn't test more than the sources you provided, but I think they give all the necessary combinations. So my conclusion is: This is awesome! I won't ever live without this (as long as LilyPond is concerned) anymore - as long as it won't get broken by new versions. Great! I'm very happy to hear this! One idea to make it even more comfortable and generic to use would be not to hard-code the color within the function. If one could somehow set the color outside the function one could personalize it to ones needs. As this is kind of a library thing, I think it isn't necessary to make this settable at runtime through the function call. Maybe one could define a variable for the color above the function, setting #black as default. Then anybody can easily see how to adapt it even if she/he doesn't understand the function itself. Ah, I just realized that this way one could still set the color in the music source by redefininge the variable ... I would be happy about this enhancement. But I really have to admit that this is quite low priority because the function is already extremely helpful. This isn't difficult to do. As you say, you could define a variable for color above the function. All you would need to do then is replace red with the name of the variable in the two places it occurs. In the attached file, I do this and give several ways of specifying the color you want. (Of course, it's the last definition that is actually used.) Best and thanks again Urs You're very welcome! Best, David shaping-curves03.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Adjustment to tablature output
Hi, On Wed, May 9, 2012 at 10:13 AM, Carl Sorensen c_soren...@byu.edu wrote: On 5/9/12 8:01 AM, Choan Gálvez choan.gal...@gmail.com wrote: Nice. But... it still results in the same ugly (to me) vertical alignments: letters with ascendant strokes look nice, letters with descendant strokes are aligned by its bottom, letters without ascendants or descendants leave a gap between its bottom and the line. See attachment. The challenge is that note heads are intended to be centered vertically on the desired placement. And apparently your usage for tablature is to have the fret labels *rest* on the staff line, rather than be *centered* in the staff gap. This is potentially resolvable, because markup text does have a baseline reference. It will require something more than adding the offset, however. Probably a new stencil function should be defined, and the stencil property of the TabNoteHead overwritten. I don't have time to write the new function right now, but I hope that pointing you (or others) in the right direction may help. I'm not confident I understand how you'd like the letters to align. If you want the bottom-most point of the letters to touch the staff line (even though this means that they won't line up as in the text I'm typing now), then the stencil override Carl mentions might be achieved like this: \new TabStaff \with { tablatureFormat = #fret-letter-tablature-format \override TabNoteHead #'whiteout = ##f } { \override TabNoteHead #'stencil = #(lambda (grob) (ly:stencil-translate-axis (ly:stencil-aligned-to (tab-note-head::print grob) Y -1) (ly:staff-symbol-line-thickness grob) Y)) e' f' fis' g' gis' a' ais' b' c'' cis'' d'' dis'' e'' f'' fis'' g'' gis'' } For some reason, the override won't work for me inside the \with block. Do you want some separation between the characters and the staff line? If not, the line-thickness of the staff line should be halved. HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Adjustment to tablature output
Hi Carl, I'm pretty sure he wants to use the *baseline* of the characters to align relative to the staff line. Ah, OK. Looking at the examples he's provided I see that that's exactly what he wants. So you can't use tab-note-head::print, since it centers the *total extent* of the characters. You need to find the character lookup from tab-note-head::print, and use the character lookup to get the markup to be displayed, and offset that from the staff line. You'll have to do all the calculations to get to the right string, I think. I hadn't thought to look at the markup for the text. Doing that I see that it's a vertically centered column. So using your tips, I get the following which I think is a step in the right direction: \new TabStaff \with { tablatureFormat = #fret-letter-tablature-format \override TabNoteHead #'whiteout = ##f } { \override TabNoteHead #'font-shape = #'italic \override TabNoteHead #'stencil = #(lambda (grob) (grob-interpret-markup grob (markup-string (ly:grob-property grob 'text e' f' fis' g' gis' a' ais' b' c'' cis'' d'' dis'' e'' f'' fis'' g'' gis'' } (@Choan: is this what you have in mind?) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Adjustment to tablature output
Hi Choan, This looks very nice and it's _exactly_ what I had in mind :) Glad to hear it! But that's my opinion, I'm not the OP -- Christopher Webster is. Oops--seems I got lost... -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
Hi Harm, On Thu, May 10, 2012 at 6:00 PM, Thomas Morley thomasmorle...@googlemail.com wrote: 2012/5/11 Thomas Morley thomasmorle...@googlemail.com: Hi David, I thought a while about your function. I'd like to suggest some changes. In the attached file you can see: - Elimination of `function' as argument of shape-curve and introducing it as local variable. I like this! I had thought of looking up the callback (as an alternative to passing it in), but hadn't found a way to do it. Nice! - A new condition added in shape-curve at the siblings-variable: ly:spanner? Right--otherwise overriding LaissezVibrerTie won't work. - In the music-function I added a new variable to specify the grob. Aha--I didn't realize you could drop the # in the latest versions. I like this too. Of course, if you want to stick with shapeSlur (and its ilk) you can define it like this: shapeSlur = #(define-music-function (parser location offsets) (list?) #{ \once \override Slur #'control-points = #(shape-curve offsets location) #}) These give the advantage to define only one music-function. Of course there is need to specify which grob should be applied. But now it works for all curves: Slur PhrasingSlur Tie RepeatTie LaissezVibrerTie I didn't test it very widly, but what do you think? I like it all. Oops, forgot to delete the wrong version-number.. Please switch to \version 2.15.36 or higher. I don't have 2.14.2 up to test, but this all should work there provided you add the # before the string? So: \shape #Slur #'( ... Thanks so much! Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
So: \shape #Slur #'( ... Looks awful. Why not call it with the syntax used for any override? \shape Slur #'( ... Yes, it is pretty horrible. I didn't realize that LilyPond would accept strings not enclosed in double quotes. Thanks, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: is shapeSlur broken?
On Thu, May 10, 2012 at 6:53 PM, Thomas Morley thomasmorle...@googlemail.com wrote: Hi David, 2012/5/11 David Nalesnik david.nales...@gmail.com: I don't have 2.14.2 up to test, but this all should work there provided you add the # before the string? So: \shape #Slur #'( ... I was wrong here. You can use \shape Slur . . . there too. I tested what's needed to make it work with 2.14.2 (therefor the 2.14.2-version-number in the file). Well, you can boil down the main-function quite easily, but `ly:input-warning' is not part of 2.14. Deleting the whole warning-part would mean a considerable loss of functionality. Here you can substitute ly:input-message (which doesn't stand out as well). Just for the record, to make this work in 2.14.2, you need to add dollar signs before the variables in the music function. So: shape = #(define-music-function (parser location grob offsets) (string? list?) #{ \once \override $grob #'control-points = #(shape-curve $offsets $location) #}) And I didn't think about an alternative for 2.14.2, hoping for 2.16 coming soon. Should be just around the corner! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
Hi Urs, On Fri, May 11, 2012 at 7:06 AM, Urs Liska li...@ursliska.de wrote: Am I right that you can't make a Stem dashed? I didnt find anything in the IR. What would then be the proper way to attach a dashed line to a note in place of the Stem? Here's something I came up with. It's not ideal. If you compare the substitute stems with ordinary stems, you'll find differences. (These relate, I think, to how rounded the lines are--to 'blot-diameter.) But hopefully this will do. The argument allows you to specify the number of dashes in your stem. \version 2.15.38 #(define (dashed-stem num) (lambda (grob) (let* ((stencil (ly:stem::print grob)) (ext (ly:stencil-extent stencil Y)) (len (interval-length ext)) (lst '()) (factors (map (lambda (x) (* (/ len (1- (* 2 num))) x)) (iota (* 2 num) (define (helper args) (set! lst (cons (make-line-stencil 0.13 ;; thickness 0 (+ (car ext) (car args)) 0 (+ (car ext) (cadr args))) lst)) (if (null? (cddr args)) lst (helper (cddr args (if (zero? num) stencil (apply ly:stencil-add (helper factors)) \relative c'' { \once \override Stem #'stencil = #(dashed-stem 2) c \once \override Stem #'stencil = #(dashed-stem 3) d \once \override Stem #'stencil = #(dashed-stem 4) e \once \override Stem #'stencil = #(dashed-stem 5) f } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
Hi again, On Fri, May 11, 2012 at 11:24 AM, David Nalesnik david.nales...@gmail.comwrote: Hi Urs, On Fri, May 11, 2012 at 7:06 AM, Urs Liska li...@ursliska.de wrote: Am I right that you can't make a Stem dashed? I didnt find anything in the IR. What would then be the proper way to attach a dashed line to a note in place of the Stem? Here's something I came up with. It's not ideal. If you compare the substitute stems with ordinary stems, you'll find differences. (These relate, I think, to how rounded the lines are--to 'blot-diameter.) But hopefully this will do. The argument allows you to specify the number of dashes in your stem. Looking at this some more, I've come up with an alternate which more closely duplicates an ordinary stem. Instead of using line segments, I used round-filled-box stencils, which is what Lily uses to draw stems. Everything is fine when the dashes aren't too small. If you ask for more than 6 at staff-size 20, though, some dashes won't appear. You see similar behavior if the staff size is reduced. (To see this, uncomment the line at the top of the function.) I'm not sure what's going on here, if this is a limitation of 'round-filled-box, or something I'm doing wrong. Anyway, here it is: \version 2.15.38 %#(set-global-staff-size 14) #(define (dashed-stem num) (lambda (grob) (let* ((stencil (ly:stem::print grob)) (X-ext (ly:stencil-extent stencil X)) (Y-ext (ly:stencil-extent stencil Y)) (b-d (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter)) (len (interval-length Y-ext)) (lst '()) (factors (map (lambda (x) (* (/ len (1- (* 2 num))) x)) (iota (* 2 num) (define (helper args) (set! lst (cons (ly:make-stencil `(round-filled-box (- ,(car X-ext)) ,(cdr X-ext) (- ,(+ (car Y-ext) (car args))) ,(+ (car Y-ext) (cadr args)) ,b-d) X-ext Y-ext) lst)) (if (null? (cddr args)) lst (helper (cddr args (if (zero? num) stencil (apply ly:stencil-add (helper factors)) \relative c'' { \once \override Stem #'stencil = #(dashed-stem 2) c \once \override Stem #'stencil = #(dashed-stem 3) d \once \override Stem #'stencil = #(dashed-stem 5) e \once \override Stem #'stencil = #(dashed-stem 6) f } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
Hi Harm, I suggest the code below. It's very close to your own but it seems to avoid the problems. When I tried your code out, the same problems happened for me! I concluded that this is an issue with the viewer in LilyPondTool, and sure enough, when I view PDF with external PDF-viewer, the problem disappears, and I see all 20 line segments with both your version and mine too. Certain aspects of your rewrite are clearer than mine--thank you! Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
Hi, On Sat, May 12, 2012 at 3:05 AM, Urs Liska li...@ursliska.de wrote: Hi David, Hi Thomas, thank you very much! I'm increasingly fascinated by LilyPond - and this mailing list. And I'll definitely have to learn how to write Scheme functions myself ... With your suggestions I can really solve the problem at hand, so thanks. What I especially like about the new solution is that it automatically uses the original Stem's thickness (so it's independent from overrides. Maybe it would be nice to be able to use this more generally (as a \stemDashed command). But for this it shouldn't have a fixed number of dashes but rather a consistent dash pattern (independent from the Stem's length. Although I don't really understand the function, I assume that the original Stem's length is already used. So it should be quite simple to use this and calculate the dashes from that? I don't expect to be able to apply such complex operations as curve's 'dash-definition. But if one would use two variables that are defined in the function's file one could then redefine them in the music file. I've come up with a simpler variant which makes use of the 'dashed-line function. (I didn't use this initially because I couldn't figure out how to get the roundedness of the line segments to match the ordinary stem's and also because I wanted to ensure a full-length dash at top and bottom.) These functions require two arguments: one for the length of the dash and one for the length of the spaces in between. Setting values might require some trial and error. Some combinations won't fit the length of the stem such that a segment appears at its end. See what you think! \version 2.15.38 #(define (dashed-stem on off) (lambda (grob) (let* ((stencil (ly:stem::print grob)) (X-ext (ly:stencil-extent stencil X)) (Y-ext (ly:stencil-extent stencil Y)) (width (interval-length X-ext)) (len (interval-length Y-ext))) (ly:output-def-set-variable! (ly:grob-layout grob) 'blot-diameter 0.08) (ly:stencil-translate (ly:make-stencil `(dashed-line ,width ,on ,off 0 ,len 0)) (cons 0 (interval-start Y-ext)) dashedStem = #(define-music-function (parser location on off) (number? number?) #{ \once \override Stem #'stencil = #(dashed-stem on off) #}) \relative c'' { \dashedStem #0.5 #0.75 c \dashedStem #0.5 #0.5 c \dashedStem #0.25 #0.5 c \dashedStem #0.25 #0.25 c } -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
On Sat, May 12, 2012 at 7:32 AM, David Nalesnik david.nales...@gmail.comwrote: I've come up with a simpler variant which makes use of the 'dashed-line function. (I didn't use this initially because I couldn't figure out how to get the roundedness of the line segments to match the ordinary stem's and also because I wanted to ensure a full-length dash at top and bottom.) Hmmm, Setting 'blot-diameter like I did actually affects regular stems and the newly-drawn stems not at all... So I guess the earlier method is the way to go. (That is, unless there is a way to change the rounding of the 'dashed-line stencil, or if such things really don't matter!) Those functions using 'round-filled-box could be tailored to match the capabilities of 'dashed-line. Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
Hi again, Hmmm, Setting 'blot-diameter like I did actually affects regular stems and the newly-drawn stems not at all... So remove this line if you use the newer function: (ly:output-def-set-variable! (ly:grob-layout grob) 'blot-diameter 0.8) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: LilyPond wins LoMuS 2012!
On Sat, May 12, 2012 at 6:41 AM, m...@apollinemike.com m...@apollinemike.com wrote: Hey LilyPond users, I have an exciting piece of news to share with you. LilyPond won LoMuS 2012, one of the most prestigious awards in the open source community for musical software. Congratulations!! What an honor! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
OK! This should do it. Those functions using 'round-filled-box could be tailored to match the capabilities of 'dashed-line. The rewrite combines both of the approaches above: it uses 'round-filled-box for the stencil, and allows you to specify the length of the dashes and the spaces in between the dashes. The trade-off is that you may need to play around with the values to get the stem to end with a dash, or to end with a dash which isn't cut off too much. I incorporated the alterations that Harm made because I think they make the code clearer. I imagine the function build-pos-list could be done more elegantly, but at least it works. Any suggestions for doing this more artfully are welcome! Thanks, David \version 2.15.38 %#(set-global-staff-size 30) #(define (make-round-filled-box x1 x2 y1 y2 blot-diameter) (ly:make-stencil (list 'round-filled-box (- x1) x2 (- y1) y2 blot-diameter) (cons x1 x2) (cons y1 y2))) #(define (build-pos-list len on off) (let ((lst '(0))) (define (helper) (let ((bottom (+ (car lst) on))) (if ( bottom len) (begin (set! lst (cons bottom lst)) (let ((top (+ (car lst) off))) (if ( top len) (begin (set! lst (cons top lst)) (helper)) (set! lst (cons len lst) (set! lst (cons len lst) (helper) (reverse lst))) #(define (dashed-stem on off) (lambda (grob) (let* ((blot (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter)) (stencil (ly:stem::print grob)) (X-ext (ly:stencil-extent stencil X)) (thickness (interval-length X-ext)) (Y-ext (ly:stencil-extent stencil Y)) (len (interval-length Y-ext)) (new-stencil empty-stencil) (factors (build-pos-list len on off))) (define (helper args) (if (= 2 (length args)) (begin (set! new-stencil (ly:stencil-add new-stencil (ly:stencil-translate-axis (make-round-filled-box (/ thickness -2) (/ thickness 2) (car args) (cadr args) blot) (interval-start Y-ext) Y))) (helper (cddr args))) new-stencil)) (if (or (zero? on) (zero? off)) stencil (helper factors) dashedStems = #(define-music-function (parser location on off) (number? number?) #{ \override Stem #'stencil = #(dashed-stem on off) #}) \relative c'' { \dashedStems #0.5 #0.4 c d e f,, a'8 g' f' g, } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Dashed Stem
On Sat, May 12, 2012 at 1:39 PM, David Kastrup d...@gnu.org wrote: I don't really understand the function, but maybe something like (define (build-pos-list len on off) (let helper ((lst '()) (next 0) (on on) (off off)) (if ( next len) (helper (cons next lst) (+ next on) off on) (reverse! lst (list len) will do. No idea whether this should have an even number of elements always or not. Thank you, David. This works like a charm! -David N. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Get the positions of a beam (or other grob with positions)
Hi Urs, On Thu, May 17, 2012 at 5:08 AM, Urs Liska li...@ursliska.de wrote: Hi, I am very much enjoying now to tweak slurs and other curves using offsets instead of hardcoded control-points. I wonder if it would be interesting to have a similar approach to grobs with a positions property (e.g. beams). While it is comparably easy to find usable #'positions for a beam this is then of course hard-coded and won't work if either the system-system spacing changes for whatever reason, or the music is transposed. Of course it must be quite straightforward to read out lilypond's decision and apply offsets to that in a music function? One issue here is that 'positions of Slur are calculated differently from Beam. You can find a function which offsets 'positions of Slur here: http://lsr.dsi.unimi.it/LSR/Snippet?id=748 Basically, this function offsets the Y-coordinate of the first and last control-points. For something like Beam, you can do something like this: \version 2.15.38 offsetBeamPositions = #(define-music-function (parser location offsets) (pair?) #{ \once \override Beam #'positions = #(lambda (grob) (let* ((func (assoc-get 'positions (cdr (ly:grob-basic-properties grob (pos (func grob))) ; both of above assignments may be replaced by: ; (pos (beam::place-broken-parts-individually grob)) (coord-translate pos offsets))) #}) \relative c'' { \offsetBeamPositions #'(-1 . -2) c8[ d e f] } I imagine that this could be generalized to cover other grobs using the 'positions property. With that in mind, I've had it look up the callback which calculates 'positions (the commented-out lines give you a variant which uses that specific callback for Beam). (Thank you Harm for showing me this method.) And if that works one could even enhance the \shape function? The wrapper function could check against a list of grob names and call the appropriate helper function (i.e. if its a Slur then call shape-curve). Maybe it's even possible to make that still more generic. Is it possible to check if a given grob has a given property? (i.e. if the grob has a control-points property then call shape-curve, else if it has positions then call shape-positions [elseif used so that a slurs control-points take precedence over its positions]). So it could be possible to write shape Slur #'((1 . 0) (3 . -2) (0 . 0) (0 . 1)) or shape Beam #'(2 . -1) or shape Arpeggio #'(-1 . 2) Would be awesome I think. Maybe one could even have more ideas to make this offset approach even more general/generic. Instead of ready-made functions, I would also appreciate hints on how to achieve this (as said, I'm quite interested in getting used to write Scheme functions myself, without always having to ask here). Though it is entirely too much fun to work out these puzzles, I'll leave it at that! I hope what I've given you will give you a place to start with this. Best, David Best Urs __**_ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/**listinfo/lilypond-userhttps://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi, On Fri, May 18, 2012 at 3:40 PM, Kieren MacMillan kieren_macmil...@sympatico.ca wrote: p.s. Come to think of it, wouldn't this be a good place for a Scheme engraver [written by someone who, unlike me, knows Scheme well]? To wit, if the measures in a piece aren't all 4/4, then our suggestion(s) won't work; and every time the total number of measures changes you need to update; etc. Couldn't there just be an engraver that says, “If I'm the k-th barline since the last system break, then break, otherwise noBreak”, that could be \consists-ed into the \Score? I can't believe that this works :) !! \version 2.15.38 #(define bars-per-line 4) #(define line-break-every-nth-engraver (lambda (context) (make-engraver (acknowledgers ((paper-column-interface engraver grob source-engraver) (let ((current-bar (ly:context-property context 'currentBarNumber))) (if (= (remainder current-bar bars-per-line) 1) (if (eq? #t (ly:grob-property grob 'non-musical)) (set! (ly:grob-property grob 'line-break-permission) 'force) (set! (ly:grob-property grob 'line-break-permission) '()) \relative c' { \repeat unfold 10 { \time 2/4 c4 c \time 4/4 c c c c \time 3/4 c c c \time 1/4 c \time 5/4 c c c c c \time 7/4 c c c c c c c \time 2/4 c c \time 7/8 c8 c c c c c c \time 2/2 c2 c } } \layout { \context { \Score %% the following line necessary if you want to put more %% measures to a line than Lily wants to allow \override NonMusicalPaperColumn #'line-break-permission = ##f \consists #line-break-every-nth-engraver } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
On Fri, May 18, 2012 at 6:50 PM, Kieren MacMillan kieren_macmil...@sympatico.ca wrote: Hi David, I can't believe that this works :) !! 1. Let's thank all the people (Han-Wen, Jan, David K., etc.) who have done such great work on the fundamentals, so that this actually works. Hear, hear! 2. Let's all (except David N) thank David N for taking my idea and running with it so successfully. =) Thank you for the great idea, Kieren! The 'Pond is the Place to Be™. K. +1000 -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi, On Fri, May 18, 2012 at 7:38 PM, Jay Anderson horndud...@gmail.com wrote: Slightly better would be to get rid of the bars-per-line define so it's self-contained: True, thank you--I've incorporated your suggestion below. Thinking about this some more, I figure the next logical step is to write an engraver which allows you to specify the number of measures for each line of the score. I've come up with the solution below. If you use the (commented-out) override and you have measures left over, these will be crammed into the last line. Without the 'line-break-permission override, Lily will space the remaining measures as usual. Hope this proves useful! Best, David \version 2.15.38 #(define (custom-line-breaks-engraver bar-list) (let ((total (1+ (car bar-list ;; not sure why increment necessary (lambda (context) (make-engraver (acknowledgers ((paper-column-interface engraver grob source-engraver) (let ((current-bar (ly:context-property context 'currentBarNumber))) (if (and (pair? bar-list) (= (remainder current-bar total) 0) (eq? #t (ly:grob-property grob 'non-musical))) (begin (set! (ly:grob-property grob 'line-break-permission) 'force) (if (not (null? (cdr bar-list))) (begin (set! bar-list (cdr bar-list)) (set! total (+ total (car bar-list (set! bar-list '( \relative c' { \repeat unfold 10 { \time 2/4 c4 c \time 4/4 c c c c \time 3/4 c c c \time 1/4 c \time 13/4 c c c c c c c c c c c c c \time 9/4 c c c c c c c c c \time 2/4 c c \time 7/8 c8 c c c c c c \time 2/2 c2 c } } \layout { \context { \Score %% The following line necessary if you want to put more %% measures to a line than Lily wants to allow. %% Remaining measures will be crammed into last line. %\override NonMusicalPaperColumn #'line-break-permission = ##f \consists #(custom-line-breaks-engraver '(1 2 3 4 5 1 2 3 4 5)) } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi Janek, On Sat, May 19, 2012 at 4:27 AM, Janek Warchoł janek.lilyp...@gmail.comwrote: David, a couple of thoughts: - what about looping the break pattern? I.e. \consists #(custom-line-breaks-engraver '(2 3 4)) = \consists #(custom-line-breaks-engraver '(2 3 4 2 3 4 2 3 4 ... 2 3 4))? Great idea--this means that you can fix the number of bars per line by using a single number as your argument. I'll see what I can do! - i'm not sure if this is desired or not, but changing current barNumber confuses your function: Yup, I suspected that it would! Substituting 'internalBarNumber for 'currentBarNumber seems to do the trick: \version 2.15.38 #(define (custom-line-breaks-engraver bar-list) (let ((total (1+ (car bar-list (lambda (context) (make-engraver (acknowledgers ((paper-column-interface engraver grob source-engraver) (let ((internal-bar (ly:context-property context 'internalBarNumber))) (if (and (pair? bar-list) (= (remainder internal-bar total) 0) (eq? #t (ly:grob-property grob 'non-musical))) (begin (set! (ly:grob-property grob 'line-break-permission) 'force) (if (null? (cdr bar-list)) (set! bar-list '()) (begin (set! bar-list (cdr bar-list)) (set! total (+ total (car bar-list)) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi again Janek, On Sat, May 19, 2012 at 6:40 AM, David Nalesnik david.nales...@gmail.comwrote: Hi Janek, On Sat, May 19, 2012 at 4:27 AM, Janek Warchoł janek.lilyp...@gmail.comwrote: David, a couple of thoughts: - what about looping the break pattern? I.e. \consists #(custom-line-breaks-engraver '(2 3 4)) = \consists #(custom-line-breaks-engraver '(2 3 4 2 3 4 2 3 4 ... 2 3 4))? Great idea--this means that you can fix the number of bars per line by using a single number as your argument. I'll see what I can do! OK, this incorporates your idea of looping. You specify a list as the argument of the function, and that grouping will loop until the end. The example below shows how you would get four measures per line. The score ends with whatever's left over, in this case the last two bars. If you want to see the 2 3 4 pattern, do lthis: \consists #(custom-line-breaks-engraver '(2 3 4)) Thanks for trying this out! Please let me know if you run into any problems or have any more suggestions. -David %% \version 2.15.38 #(define (custom-line-breaks-engraver bar-list) (let* ((working-copy bar-list) (total (1+ (car working-copy (lambda (context) (make-engraver (acknowledgers ((paper-column-interface engraver grob source-engraver) (let ((internal-bar (ly:context-property context 'internalBarNumber))) (if (and (pair? working-copy) (= (remainder internal-bar total) 0) (eq? #t (ly:grob-property grob 'non-musical))) (begin (set! (ly:grob-property grob 'line-break-permission) 'force) (if (null? (cdr working-copy)) (set! working-copy bar-list) (begin (set! working-copy (cdr working-copy (set! total (+ total (car working-copy \relative c' { \set Score.currentBarNumber = #4 \repeat unfold 10 { \time 5/4 c4 c c c c \time 3/4 c c c \time 3/2 c2 c c } } \layout { \context { \Score %\override NonMusicalPaperColumn #'line-break-permission = ##f \consists #(custom-line-breaks-engraver '(4)) } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi Johan, Please submit to LSR... Will do. The LSR is running 2.14.2 right now, so I'll have to make some changes. (In particular, the function uses David Kastrup's make-engraver macro which is fairly recent.) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Get the positions of a beam (or other grob with positions)
Hi Janek, On Sat, May 19, 2012 at 8:03 AM, Janek Warchoł janek.lilyp...@gmail.comwrote: Hi David all, i want to make arpeggios longer (so that they overshoot the chords a bit). I've modified your offsetBeamPositions function to work on Arpeggios instead of Beams (that was easy), but i'm quite surprised to find that it doesn't work correctly with cross-staff arpeggios. Do you have any ideas why? Maybe this is a bug in LilyPond? This isn't a bug: cross-staff arpeggios belong to a different context. In your case, they are a part of PianoStaff, so the override will have no impact. If you do this, it will work: offsetCrossStaffArpeggioPositions = #(define-music-function (parser location offsets) (pair?) #{ \override PianoStaff.Arpeggio #'positions = #(lambda (grob) (let* ((func (assoc-get 'positions (cdr (ly:grob-basic-properties grob (pos (func grob))) (coord-translate pos offsets))) #}) OK, that name is out of control :) HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Four Bars per Line/System, again :)
Hi Janek, On Sat, May 19, 2012 at 8:17 AM, Janek Warchoł janek.lilyp...@gmail.comwrote: Hi David, On Sat, May 19, 2012 at 2:56 PM, David Nalesnik david.nales...@gmail.com wrote: OK, this incorporates your idea of looping. You specify a list as the argument of the function, and that grouping will loop until the end. The example below shows how you would get four measures per line. The score ends with whatever's left over, in this case the last two bars. It's perfect! Thank you! Will be handy when i'll be revising my score of Allegri's Miserere (would you like a copy?). Sure! Please try it out on anything and everything you like. I tried it on a complex piano score, and no problems :) Best, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: TupletNumber placement - can you improve this function?
Hi Janek, today i've found this snippet: http://lsr.dsi.unimi.it/LSR/Item?id=646 The description says that it needs manual beaming to work, but i've tried using it with 2.15.36 and manual beaming was not necessary! The only downside i see is that non-kneed tuplets are positioned wrongly, so one has to turn this funciton on and off all the time. It also doesn't support TupletBrackets, but these are usually hidden with kneed beams. Just yesterday I was updating the score which was the reason for me writing this in the first place!! Probably about a hundred cross-staff tuplets, no brackets, and a manual adjustment needed for each one of them... Ugh. (The default flying numbers happen because the number is placed in the opening of the bracket, whether the bracket shows or not.) In 2.12 and 2.14 it was only necessary to call the functions once for the whole file, but here I ended up needing to turn them on and off repeatedly. (Still a lot of agony spared.) The conditions in the function were designed to leave ordinary beams untouched, and also to ignore tuplets with visible brackets. (In earlier versions of LilyPond, the functions actually would give OK results with ordinary beams.) I'll have to investigate, but possibly the actual override of 'Y-offset (or calling other functions related to Y) is having new effects. (You can see one effect by adding \override TupletBracket #'bracket-visibility = ##t -- no effort is made to position the number since the bracket is there, but we lose all horizontal and vertical positioning! This wouldn't happen in 2.14.) -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: TupletNumber placement - can you improve this function?
On Sat, May 19, 2012 at 5:02 PM, David Nalesnik david.nales...@gmail.comwrote: I'll have to investigate, but possibly the actual override of 'Y-offset (or calling other functions related to Y) is having new effects. (You can see one effect by adding \override TupletBracket #'bracket-visibility = ##t -- no effort is made to position the number since the bracket is there, but we lose all horizontal and vertical positioning! This wouldn't happen in 2.14.) BTW, I'm not trying to suggest that I believe there is some regression here!! -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: TupletNumber placement - can you improve this function?
Hi, today i've found this snippet: http://lsr.dsi.unimi.it/LSR/Item?id=646 The description says that it needs manual beaming to work, but i've tried using it with 2.15.36 and manual beaming was not necessary! The only downside i see is that non-kneed tuplets are positioned wrongly, so one has to turn this funciton on and off all the time. It also doesn't support TupletBrackets, but these are usually hidden with kneed beams. Maybe one of you would be able to improve it? It seems that we almost have a solid solution for tuplet numbers! OK, I got it to work with 2.15.38. There were two problems: (1) calling 'Y-extent for the tuplet bracket and (2) leaving X-offset and Y-offset unset for the situations that the functions tried to ignore. I tried it with the score I mentioned earlier, and no problems :) :) You don't need to change anything for the snippet to work with 2.14. -David lsr-646-update01.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user