Re: bottom of EPS output cut off (+ size of PDF files)
I wrote earlier about the bug in which Lilypond with the eps backend inaccurately calculates the bounding box, and Andrea provided a working solution (thank you). I turned it into this Bash script, which works well for me, though I don't understand why this process should be necessary. Intriguingly, when I run this script it produces a cropped PDF image which is about 10% the size of the PDF produced just by compiling with lilypond alone. In one example the full-page lilypond PDF, a single page with one system of music, was 160K; the PDF produced by lilycrop was 19K! ~/bin/lilycrop: #! /bin/sh set -e file=${1%.ly} lilypond $file pdftops -eps $file.pdf cat $file.eps | ps2eps $file_cut.eps epstopdf $file_cut.eps rm $file.eps $file_cut.eps mv $file_cut.pdf $file.pdf echo Cropped PDF '$file.pdf' produced from '$1' *** Andrew Cashner ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How can I write simultaneous music in \chordmode?
On Wed, Jan 07, 2015 at 04:46:48PM -0500, Kieren MacMillan wrote: Did you try adjusting the function to handle chords? As I wrote, ?This kind of thing would also automagically work ? or easily be made to work ? on chords.? (new emphasis) Unfortunately, that's beyond my Scheme-fu, and I have no spare time right now to climb that learning curve. We're in the same boat there. In fact, I'm not even sure I know how to write the specifications for what I would want such a function to do, and what it's interface should be. Minimum accidentals is not always my criterion of choice. There are times when a C# 7 chord (V chord of F#, 6 sharps) is fine, and there are other times when I'd rather call it a Db 7 (V chord of G-flat, 6 flats). Can \naturalizeMusic be made to consider the key signature that is in effect at the time? Even so, I have a chart in several flats where I just can't bring myself to use a C-flat 13 chord, and instead I call it a B 13, even though the melody note is clearly a G-flat. That's not minimum accidentals, it's just personal preference. I have zero idea how to begin spec'ing such a function for automagic conversion, let alone implement it. I get the feeling that this begins to encroach on certain topics posted recently by Peter Gentry, and I have to salute him for making the time to dive headfirst into the details of Scheme, but as you say, I don't have the time right now, nor the motivation, really. \tag works well enough for my needs, but I was puzzled to learn that simultaneous music \tag #'a {} \tag #'b {} doesn't work in chordmode. That makes me have to use some klunky work-arounds when extracting a fixed number of measures from chordmode music that contains tags. Btw, thanks for the pointer to chord-entry.scm -- I'll have a read. In the meantime, I hope my original question will continue to attract the collective brain cycles of the list. I can anticipate at least one question: q1) how would simultaneous chord music be engraved? a1) Selfishly, I don't need it to -- I strip out the unwanted tags, leaving only one remaining alternative before it gets engraved. So the engraver could throw an error if it was asked to engrave simult. chord music, if that were convenient. Or another possibility is that it could just overwrite the chord markup, with multiple markups one on top of the other. It'd make a big blob in the chord staff, but again, I don't care because I don't anticipate ever passing simultaneous music to the engraver. But I would like to be able to specify simultaneous chordmode music and then post-process the tags out before handing the music off to the engraver. If the only reason this syntax has never been allowed is because there's no way to engrave it, I'd be delighted to simply have the syntax be allowed, and have the engraver puke with a descriptive error message if I forget to strip the simultaneous music out. ( ... meanwhile ... ) I must thank you again, Kieren, because in the time it's taken me to consider and draft this reply, it's given me some insight on where the crux of my original problem lies. \ChordNames contexts can indeed support simultaneous music, I have learned. It is specifically \chordmode which does not. Also, I have learned what Lily does with simult. chords: she combines all the simultaneous notes, and tries to interpret that set of pitches as best she can, most often resulting in a number of strange chord alterations. Compilable example attached! It's still somewhat klunky, but it does at least meet my test of not artificially lengthening the number of beats/measures of music. Thanks for getting the thought processes going! Jim But I?m sure someone out there could make it work without too much trouble. If you want to take a stab at it yourself, files like chord-entry.scm will give you lots of ideas on how to manipulate chords. Cheers, Kieren. ___ Kieren MacMillan, composer www: http://www.kierenmacmillan.info email: i...@kierenmacmillan.info \version 2.18.2 music = \new Staff { gis'1 \tag #'(a c) c' \tag #'(b d) bis } seqChanges = \new ChordNames { \chordmode { gis1:maj7 } \tag #'a \relative c' c e g \tag #'b \relative c' bis disis fisis \tag #'c \chordmode { c1 } \tag #'d \chordmode { bis1 } } simChanges = \new ChordNames { \chordmode { gis1:maj7 } \tag #'a \relative c' c e g \tag #'b \relative c' bis disis fisis \tag #'c \chordmode { c1 } \tag #'d \chordmode { bis1 } } \markup Sequential tags make the music expressions have unequal length \score { \seqChanges \music } \markup Simultaneous tags make the music expressions the same length \score { \simChanges \music } \markup Tag a \score { \keepWithTag #'a \simChanges \keepWithTag #'a \music } \markup Tag b \score { \keepWithTag #'b \simChanges \keepWithTag #'b \music } \markup Tag c \score {
Re: How can I write simultaneous music in \chordmode?
Y'know, one other syntactic oddity this has shown me is that \chordmode requires the braces around its music expression, even if it is a single chord: \chordmode c1 is not okay, it has to be \chordmode { c1 } Not a problem, just a curiousity. On Wed, Jan 07, 2015 at 03:46:39PM -0800, Jim Long wrote: On Wed, Jan 07, 2015 at 04:46:48PM -0500, Kieren MacMillan wrote: Did you try adjusting the function to handle chords? As I wrote, ?This kind of thing would also automagically work ? or easily be made to work ? on chords.? (new emphasis) Unfortunately, that's beyond my Scheme-fu, and I have no spare time right now to climb that learning curve. We're in the same boat there. In fact, I'm not even sure I know how to write the specifications for what I would want such a function to do, and what it's interface should be. Minimum accidentals is not always my criterion of choice. There are times when a C# 7 chord (V chord of F#, 6 sharps) is fine, and there are other times when I'd rather call it a Db 7 (V chord of G-flat, 6 flats). Can \naturalizeMusic be made to consider the key signature that is in effect at the time? Even so, I have a chart in several flats where I just can't bring myself to use a C-flat 13 chord, and instead I call it a B 13, even though the melody note is clearly a G-flat. That's not minimum accidentals, it's just personal preference. I have zero idea how to begin spec'ing such a function for automagic conversion, let alone implement it. I get the feeling that this begins to encroach on certain topics posted recently by Peter Gentry, and I have to salute him for making the time to dive headfirst into the details of Scheme, but as you say, I don't have the time right now, nor the motivation, really. \tag works well enough for my needs, but I was puzzled to learn that simultaneous music \tag #'a {} \tag #'b {} doesn't work in chordmode. That makes me have to use some klunky work-arounds when extracting a fixed number of measures from chordmode music that contains tags. Btw, thanks for the pointer to chord-entry.scm -- I'll have a read. In the meantime, I hope my original question will continue to attract the collective brain cycles of the list. I can anticipate at least one question: q1) how would simultaneous chord music be engraved? a1) Selfishly, I don't need it to -- I strip out the unwanted tags, leaving only one remaining alternative before it gets engraved. So the engraver could throw an error if it was asked to engrave simult. chord music, if that were convenient. Or another possibility is that it could just overwrite the chord markup, with multiple markups one on top of the other. It'd make a big blob in the chord staff, but again, I don't care because I don't anticipate ever passing simultaneous music to the engraver. But I would like to be able to specify simultaneous chordmode music and then post-process the tags out before handing the music off to the engraver. If the only reason this syntax has never been allowed is because there's no way to engrave it, I'd be delighted to simply have the syntax be allowed, and have the engraver puke with a descriptive error message if I forget to strip the simultaneous music out. ( ... meanwhile ... ) I must thank you again, Kieren, because in the time it's taken me to consider and draft this reply, it's given me some insight on where the crux of my original problem lies. \ChordNames contexts can indeed support simultaneous music, I have learned. It is specifically \chordmode which does not. Also, I have learned what Lily does with simult. chords: she combines all the simultaneous notes, and tries to interpret that set of pitches as best she can, most often resulting in a number of strange chord alterations. Compilable example attached! It's still somewhat klunky, but it does at least meet my test of not artificially lengthening the number of beats/measures of music. Thanks for getting the thought processes going! Jim But I?m sure someone out there could make it work without too much trouble. If you want to take a stab at it yourself, files like chord-entry.scm will give you lots of ideas on how to manipulate chords. Cheers, Kieren. ___ Kieren MacMillan, composer www: http://www.kierenmacmillan.info email: i...@kierenmacmillan.info \version 2.18.2 music = \new Staff { gis'1 \tag #'(a c) c' \tag #'(b d) bis } seqChanges = \new ChordNames { \chordmode { gis1:maj7 } \tag #'a \relative c' c e g \tag #'b \relative c' bis disis fisis \tag #'c \chordmode { c1 } \tag #'d \chordmode { bis1 } } simChanges = \new ChordNames { \chordmode { gis1:maj7 } \tag #'a \relative c' c e g \tag #'b \relative c' bis disis fisis \tag #'c \chordmode { c1 } \tag #'d \chordmode { bis1 } } \markup
Re: how to detect position of note on stave?
Hi Graham, On Wed, Jan 7, 2015 at 4:39 PM, Graham King lilyp...@tremagi.org.uk wrote: I'm trying to replace a note with one of two special glyphs, depending on the note's position on the stave: if on the third line or above, stem down, otherwise stem up. Is it possible to extend the following code to detect automatically (and independently of clef or transposition) which glyph should be chosen? Sure--try this: \version 2.19.5 #(define ((note-head-musicglyph name) grob) (grob-interpret-markup grob (make-musicglyph-markup name))) \score { \shiftDurations #-1 #0 { \relative c' { \time 4/2 \override NoteHead #'stencil = #(lambda (grob) (let ((pos (ly:grob-property grob 'staff-position))) (if (= pos 0) (note-head-musicglyph noteheads.dM2mensural) (note-head-musicglyph noteheads.uM2mensural c c' }}} ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How can I write simultaneous music in \chordmode?
On 7/01/15 1:14 PM, Jim Long wrote: This works great. But I often have the same problem in chordmode music, the same problem meaning that I need to use tagged alternative bits of enharmonic music where the tagged alternatives are simultaneous so that they don't artificially lengthen the number of beats/bars of music. Unfortunately, simultaneous music doesn't work in \chordmode: foo = \new Staff \relative c' { \tag #'concert { b1 } \tag #'trumpet { ces1 } } fooChords = \new ChordNames \chordmode { \tag #'concert { b1 } \tag #'trumpet { ces1 } } \score { \transpose c d \keepWithTag #'trumpet \fooChords \foo } Lily complains with: x.ly:9:3: error: syntax error, unexpected $undefined Jim, I just tried the above in Lilypond 2.19.15, and it worked fine - maybe the simplest solution is an upgrade! Brett ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How can I write simultaneous music in \chordmode?
On Thu, Jan 08, 2015 at 11:19:44AM +1100, Brett Duncan wrote: Jim, I just tried the above in Lilypond 2.19.15, and it worked fine - maybe the simplest solution is an upgrade! Brett Thank you very much, Brett! That's good to know. Jim ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How can I write simultaneous music in \chordmode?
Thanks for the reply, Kieren, but that doesn't help. If others have input on the original question of how to write simultaneous tagged music in \chordmode, I'd love to hear it. Regards, Jim #(define (naturalize-pitch p) (let ((o (ly:pitch-octave p)) (a (* 4 (ly:pitch-alteration p))) ;; alteration, a, in quarter tone steps, ;; for historical reasons (n (ly:pitch-notename p))) (cond ((and ( a 1) (or (eq? n 6) (eq? n 2))) (set! a (- a 2)) (set! n (+ n 1))) ((and ( a -1) (or (eq? n 0) (eq? n 3))) (set! a (+ a 2)) (set! n (- n 1 (cond (( a 2) (set! a (- a 4)) (set! n (+ n 1))) (( a -2) (set! a (+ a 4)) (set! n (- n 1 (if ( n 0) (begin (set! o (- o 1)) (set! n (+ n 7 (if ( n 6) (begin (set! o (+ o 1)) (set! n (- n 7 (ly:make-pitch o n (/ a 4 #(define (naturalize music) (let ((es (ly:music-property music 'elements)) (e (ly:music-property music 'element)) (p (ly:music-property music 'pitch))) (if (pair? es) (ly:music-set-property! music 'elements (map (lambda (x) (naturalize x)) es))) (if (ly:music? e) (ly:music-set-property! music 'element (naturalize e))) (if (ly:pitch? p) (begin (set! p (naturalize-pitch p)) (ly:music-set-property! music 'pitch p))) music)) naturalizeMusic = #(define-music-function (parser location m) (ly:music?) (naturalize m)) foo = \new Staff { gis'1 } fooChords = \new ChordNames \chordmode { gis1:maj7 } \score { \naturalizeMusic \fooChords \foo } x.pdf Description: Adobe PDF document ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: system separator markup position
I found a kludge-solution: I created a new top staff, created a 0-line staff, removed all the other stencils, and then placed that staff directly overlapping with the top of the tall staff with explicit positioning. Whew! It works well enough. On Wed, Jan 7, 2015 at 11:59 AM, Neil Thornock neilthorn...@gmail.com wrote: In the following snippet, I've created an extra-tall staff, which is messing with the placement of the system separator markup. Is there some way around this? Like moving the position of the system separator or assigning some different Y-extent to something? \paper { system-separator-markup = \slashSeparator } { \override Staff.StaffSymbol #'line-positions = #'(14 -14) c'1 \break c' } { c'1 c' } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: avoiding lyric tie collisions
I wrote earlier about the problem of the lyric tie colliding with y and similar letters. No one responded (I suppose this is a bug), but I have found a workaround. I define a text-replacement for the non-breaking space character, U+00A0: \paper { #(add-text-replacements! '((| . ))) } Then in the lyrics I can type | when I need a bit of extra space between the lyric tie and a character: \lyricmode { y|~el cie -- lo~|y la tie -- rra } Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: system separator markup position
Hi Neil, On Wed, Jan 7, 2015 at 1:57 PM, Neil Thornock neilthorn...@gmail.com wrote: I found a kludge-solution: I created a new top staff, created a 0-line staff, removed all the other stencils, and then placed that staff directly overlapping with the top of the tall staff with explicit positioning. Whew! It works well enough. Why not add something like the following to your \paper block: system-system-spacing.basic-distance = 24 --David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: system separator markup position
On Wed, Jan 7, 2015 at 3:02 PM, David Nalesnik david.nales...@gmail.com wrote: Hi Neil, On Wed, Jan 7, 2015 at 1:57 PM, Neil Thornock neilthorn...@gmail.com wrote: I found a kludge-solution: I created a new top staff, created a 0-line staff, removed all the other stencils, and then placed that staff directly overlapping with the top of the tall staff with explicit positioning. Whew! It works well enough. Why not add something like the following to your \paper block: system-system-spacing.basic-distance = 24 I suggest this because it appears (in scm/page.scm) that the separator markup is placed after the positions of the systems on the page have been determined and therefore has no influence on vertical spacing. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
how to detect position of note on stave?
I'm trying to replace a note with one of two special glyphs, depending on the note's position on the stave: if on the third line or above, stem down, otherwise stem up. Is it possible to extend the following code to detect automatically (and independently of clef or transposition) which glyph should be chosen? \version 2.19.5 #(define ((note-head-musicglyph name) grob) (grob-interpret-markup grob (make-musicglyph-markup name))) \score { \shiftDurations #-1 #0 { \relative c' { \time 4/2 c c c c \once \override NoteHead #'stencil = #(note-head-musicglyph noteheads.uM2mensural) % #(note-head-musicglyph noteheads.dM2mensural) c1 }}} Thanks, in anticipation! -- Graham King ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How can I write simultaneous music in \chordmode?
Hi Jim, Thanks for the reply, Kieren, but that doesn't help. Did you try adjusting the function to handle chords? As I wrote, “This kind of thing would also automagically work — or easily be made to work — on chords.” (new emphasis) Unfortunately, that's beyond my Scheme-fu, and I have no spare time right now to climb that learning curve. But I’m sure someone out there could make it work without too much trouble. If you want to take a stab at it yourself, files like chord-entry.scm will give you lots of ideas on how to manipulate chords. Cheers, Kieren. ___ Kieren MacMillan, composer www: http://www.kierenmacmillan.info email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: system separator markup position
Thanks for the suggestion. While it does avoid the collision, it doesn't center the separator between staves. I believe the separator is spaced evenly between the vertical midpoint of each surrounding staff (line-position 0), and so when the bottom staff is that tall, it encroaches on the separator. It would be better if the separator were centered between the bottom line of the staff above it and the top line of the staff below it, or maybe calculated from the staves's actual Y-extent. On Wed, Jan 7, 2015 at 2:34 PM, David Nalesnik david.nales...@gmail.com wrote: On Wed, Jan 7, 2015 at 3:02 PM, David Nalesnik david.nales...@gmail.com wrote: Hi Neil, On Wed, Jan 7, 2015 at 1:57 PM, Neil Thornock neilthorn...@gmail.com wrote: I found a kludge-solution: I created a new top staff, created a 0-line staff, removed all the other stencils, and then placed that staff directly overlapping with the top of the tall staff with explicit positioning. Whew! It works well enough. Why not add something like the following to your \paper block: system-system-spacing.basic-distance = 24 I suggest this because it appears (in scm/page.scm) that the separator markup is placed after the positions of the systems on the page have been determined and therefore has no influence on vertical spacing. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: box around notes
i tried examples in this old post but none of them compile in 2.19.15. I created a sample example. Is it possible to set the box to wrap around the notes without having to set the dimensions? How can we move the notes so the box does not overlap with the repeat sign in the second example? http://lilypond.1069038.n5.nabble.com/file/n170210/Screen_Shot_2015-01-07_at_8.png \version 2.19.15 melody = \relative c'' { \set fingeringOrientations = #'(left) %1 \repeat volta 2 { g-3 c-2 f-11 -\markup { \with-dimensions #'( 0 . 0)#'(0 . 0) \box\with-dimensions #'(-2 . 2.5) #'(0 . 5.5) \null } d8-4 g,-0 d' g, d'-4 g,-0 d' g, } %2 \repeat volta 2 { d'-4 c'-2 f-11 -\markup { \with-dimensions #'( 0 . 0)#'(0 . 0) \box \with-dimensions #'(-2 . 2.5) #'(0 . 5.5) \null} g8-3 d-0 g d g8-4 d-0 g d } } \score { \new Staff { \melody } } -- View this message in context: http://lilypond.1069038.n5.nabble.com/box-around-notes-tp35581p170210.html Sent from the User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: how to detect position of note on stave?
Many thanks David, almost there... On Wed, 2015-01-07 at 18:09 -0600, David Nalesnik wrote: Hi Graham, On Wed, Jan 7, 2015 at 4:39 PM, Graham King lilyp...@tremagi.org.uk wrote: I'm trying to replace a note with one of two special glyphs, depending on the note's position on the stave: if on the third line or above, stem down, otherwise stem up. Is it possible to extend the following code to detect automatically (and independently of clef or transposition) which glyph should be chosen? Sure--try this: Merged into my original example, to illustrate a problem: \version 2.19.5 #(define ((note-head-musicglyph name) grob) (grob-interpret-markup grob (make-musicglyph-markup name))) \score { \shiftDurations #-1 #0 { \relative c' { \time 4/2 c c c c \once \override NoteHead #'stencil = #(lambda (grob) (let ((pos (ly:grob-property grob 'staff-position))) (if (= pos 0) (note-head-musicglyph noteheads.dM2mensural) (note-head-musicglyph noteheads.uM2mensural c1 }}} This works beautifully, except when the note is on a ledger line above or below the stave, in which case the ledger line is lost and horizontal spacing goes haywire. Example attached. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
system separator markup position
In the following snippet, I've created an extra-tall staff, which is messing with the placement of the system separator markup. Is there some way around this? Like moving the position of the system separator or assigning some different Y-extent to something? \paper { system-separator-markup = \slashSeparator } { \override Staff.StaffSymbol #'line-positions = #'(14 -14) c'1 \break c' } { c'1 c' } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user