Re: Generating music expressions from within \applyContext?
Hi, I haven't a working solution, but some thoughts: The \applyContext is one event in time, so you can set context-properties *once*. This might be a case for a midi-performer. This is an engraver inside the midi-block, so it should be possible to create a scheme-performer to set the midiExpression property inside the Staff context. --- this is not an easier way! And I don't have a computer nearby right now, to test, if moving the dynamic performer into another context helps. Another approach might be a music-function, that produces SimultaneousMusic with the note(s) and the dynamic midi events in separate streams. ( e.g. << { \music } { \dynamicevents } >> ) Just some thoughts right now. I am quite busy right now, so if there are no helpful answers within two weeks, you can ask me again and I can provide some code. Jan-Peter Am 26. Juli 2016 00:51:49 MESZ, schrieb "H. S. Teoh": >Hi, > >I have a Scheme function that returns a music expression. >Unfortunately, >the expression returned depends on the properties of the context it's >evaluated in. I.e., based on the current setting of >Staff.dynamicAbsoluteVolumeFunction it will return a different number >of >events in the music expression. > >Is this possible? > >The background of this is that I'm writing a Scheme function that >generates single-note crescendos by emitting a series of \set >Staff.midiExpression = ... events. Currently I've written a Scheme >function that's able to generate these events; however, it requires me >to specify numerical starting / ending values for midiExpression. I'd >like to be able to specify dynamics instead of numerical values, and >have the Scheme function automatically look up the numerical values >based on the current volume function defined for the Staff. > >However, so far I haven't been able to figure out how to read the Staff >properties except using \applyContext with a lambda, and AFAICT it's >not >possible to return a music expression from this lambda? > >Or is there another (hopefully simpler?) way to achieve what I want? > > >--T > >___ >lilypond-user mailing list >lilypond-user@gnu.org >https://lists.gnu.org/mailman/listinfo/lilypond-user -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Generating music expressions from within \applyContext?
Hi, I have a Scheme function that returns a music expression. Unfortunately, the expression returned depends on the properties of the context it's evaluated in. I.e., based on the current setting of Staff.dynamicAbsoluteVolumeFunction it will return a different number of events in the music expression. Is this possible? The background of this is that I'm writing a Scheme function that generates single-note crescendos by emitting a series of \set Staff.midiExpression = ... events. Currently I've written a Scheme function that's able to generate these events; however, it requires me to specify numerical starting / ending values for midiExpression. I'd like to be able to specify dynamics instead of numerical values, and have the Scheme function automatically look up the numerical values based on the current volume function defined for the Staff. However, so far I haven't been able to figure out how to read the Staff properties except using \applyContext with a lambda, and AFAICT it's not possible to return a music expression from this lambda? Or is there another (hopefully simpler?) way to achieve what I want? --T ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Making a multi measure rest shorter
On 7/25/16, 3:26 PM, "Thomas Morley"wrote: 2016-07-25 22:45 GMT+02:00 Steven Weber : > I’ve found lots of various ways to make a multi measure rest longer, but I’d > like to make one shorter. I’m trying to typeset a piece with a cadenza, and > the standard \cadenzaOn and Off have some issues I haven’t figured out how > to work around yet (specifically, bar lines in the cadenza keep showing up > in the parts, and I just want the standard single measure of rest), so I > thought I’d do it manually. Everything looks great in the score, but when I > do a part, I get a gigantic MMR. I tried modifying the X-extent of the MMR, > but that only seems to affect the “cadenza” text applied to the bar. > > > > Any clever ways of persuading LilyPond to make a MMR bar shorter instead of > longer? I think it would be far better to use cadenza, anyway, how about: \version "2.19.45" \score { \new Staff { \time 4/4 \clef bass \repeat unfold 5 { c4 d e f | g a b c' } \newSpacingSection \once \omit Staff.TimeSignature \override Score.SpacingSpanner.spacing-increment = #0 \time 75/4 \tweak usable-duration-logs #'(0) R1*75/4*1 ^\fermataMarkup _\markup { "Cadenza" } \once \omit Staff.TimeSignature \newSpacingSection \revert Score.SpacingSpanner.spacing-increment \time 4/4 \repeat unfold 5 { c4 d e f | g a b c' } } } Cheers, Harm That worked like a charm! I agree that using \cadenzaOn and Off would be the best approach, so I’ve attached a new version that does just that. What I wind up with is a mess (a MMR with a bar of notes typeset on top of it). What am I doing wrong? --Steven example.ly Description: example.ly ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Setting beams with new \time 4/4 command
On Mon 25 Jul 2016 at 21:21:26 (+0200), David Kastrup wrote: > David Wrightwrites: > > > I like being able to type \time 2,2,2,2 8/8 > > but is there a way to specify the same beaming pattern > > as briefly when it's really 4/4, so I don't get groups > > of four quavers? > > I have no idea what you mean with "when it's really 4/4". Is the meter > printed as 4/4? Or as 8/8 but it should be beamed like 4/4? > > Could you write some actual code and tell what is wrong with it? Or > even better: when you state "as briefly" that implies that there is a > way to write it verbosely that you know of. How about showing the > verbose code that actually does what you want so that one has a chance > at guessing just _what_ effect you would have wished to express more > succinctly? Happy to oblige. I've used a "desired" beaming pattern of 2,2,4 in this example just to make it obvious when I'm controlling it and when I'm not. After the LP defaults, the third example shows the ease which which I can specify the beaming pattern within the elegant new \time command when the time signature is in quavers. But I would like the same beaming pattern when the time signature is in crochets, and I just wondered if there's a short way of setting it like the first method illustrated in NM §1.2.3, or do I have to set it with the longer versions in examples 5 and 6? Cheers, David. \version "2.19.44" \header { tagline = ##f } \relative { \time 8/8 a'4 ^\markup { LP’s default for 8/8 } a a a a8 a a a a a a a a1 } \relative { \time 4/4 a'4 ^\markup { LP’s default for 4/4 } a a a a8 a a a a a a a a1 } \relative { \time 2,2,4 8/8 a'4 ^\markup { I can make it do this (as wanted) easily } a a a a8 a a a a a a a a1 } \relative { \time 2,2,4 4/4 a'4 ^\markup { Can I replace “2,2,4” with something else? } a a a a8 a a a a a a a a1 } \relative { \set Staff.timeSignatureFraction = 4/4 \time 2,2,4 8/8 a'4 ^\markup { or must I hack it like this? } a a a a8 a a a a a a a a1 } \relative { \overrideTimeSignatureSettings 4/4% timeSignatureFraction 1/4% baseMomentFraction 1,1,2 % beatStructure #'() % beamExceptions \time 4/4 a'4 ^\markup { or write it verbosely like this? } a a a a8 a a a a a a a a1 } beaming.pdf Description: Adobe PDF document ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Making a multi measure rest shorter
2016-07-25 22:45 GMT+02:00 Steven Weber: > I’ve found lots of various ways to make a multi measure rest longer, but I’d > like to make one shorter. I’m trying to typeset a piece with a cadenza, and > the standard \cadenzaOn and Off have some issues I haven’t figured out how > to work around yet (specifically, bar lines in the cadenza keep showing up > in the parts, and I just want the standard single measure of rest), so I > thought I’d do it manually. Everything looks great in the score, but when I > do a part, I get a gigantic MMR. I tried modifying the X-extent of the MMR, > but that only seems to affect the “cadenza” text applied to the bar. > > > > Any clever ways of persuading LilyPond to make a MMR bar shorter instead of > longer? I think it would be far better to use cadenza, anyway, how about: \version "2.19.45" \score { \new Staff { \time 4/4 \clef bass \repeat unfold 5 { c4 d e f | g a b c' } \newSpacingSection \once \omit Staff.TimeSignature \override Score.SpacingSpanner.spacing-increment = #0 \time 75/4 \tweak usable-duration-logs #'(0) R1*75/4*1 ^\fermataMarkup _\markup { "Cadenza" } \once \omit Staff.TimeSignature \newSpacingSection \revert Score.SpacingSpanner.spacing-increment \time 4/4 \repeat unfold 5 { c4 d e f | g a b c' } } } Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: getting repeat bar lines to print across an entire system
> And now I'm pissed, maybe I should revert this part of the code. > Okay, you do whatever you want man. We'll just say it works as intended by the developer. Or doesn't, but is too hard to fix. Or whatever. There will be no bug report. Got it. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: getting repeat bar lines to print across an entire system
2016-07-25 22:45 GMT+02:00 Robert Edge: > >> >> So I'd say this part of the code is not broken but works as it should, >> it's just not like you'd expect it should be. >> > > I'm not sure where you are seeing charts drawn like that. I did not say having seen such behaviour for multi-stave-scores. I tried to explain how LilyPond internally deals with BarLine and SpanBar and which problems this inherits. > I'm used to seeing this: > http://www.saxuet.qc.ca/TheSaxyPage/Realbook%20C/Four.jpg > > or this: http://www.ejazzlines.com/mc_files/2/paladia.gif > > or this: http://www.jwpepper.com/scores-png/2240034-4.png > > That's just the first 3 examples of that sort of bracket that google image > search gave me. I don't think I've ever encountered the convention Lilypond > has adopted in the real world. Again, I tried to explain how LilyPond internally deals with BarLine and SpanBar and which problems this inherits. I did not say the output for multi-stave-scores is desired or even correct. I just said the documentation is in line with the way LilyPond treats BarLines. Did you even think about the segno-example? > I get that the code base has evolved in such a way that implementing this > might be non-trivial. I don't think it follows from that that the current > implementation is correct. As said before, I doubt you can achieve the desired behaviour with simple bar-line-definitions. > Maybe I'm wrong, maybe there are a whole bunch of people out there preparing > charts for their upcoming sessions and expecting the bar lines to come out > looking like that. And now I'm pissed, maybe I should revert this part of the code. The LSR-snippet gives a workaround. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Making a multi measure rest shorter
I’ve found lots of various ways to make a multi measure rest longer, but I’d like to make one shorter. I’m trying to typeset a piece with a cadenza, and the standard \cadenzaOn and Off have some issues I haven’t figured out how to work around yet (specifically, bar lines in the cadenza keep showing up in the parts, and I just want the standard single measure of rest), so I thought I’d do it manually. Everything looks great in the score, but when I do a part, I get a gigantic MMR. I tried modifying the X-extent of the MMR, but that only seems to affect the “cadenza” text applied to the bar. Any clever ways of persuading LilyPond to make a MMR bar shorter instead of longer? Thanks! --Steven example.ly Description: example.ly ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: getting repeat bar lines to print across an entire system
> > So I'd say this part of the code is not broken but works as it should, > it's just not like you'd expect it should be. > > I'm not sure where you are seeing charts drawn like that. I'm used to seeing this: http://www.saxuet.qc.ca/TheSaxyPage/Realbook%20C/Four.jpg or this: http://www.ejazzlines.com/mc_files/2/paladia.gif or this: http://www.jwpepper.com/scores-png/2240034-4.png That's just the first 3 examples of that sort of bracket that google image search gave me. I don't think I've ever encountered the convention Lilypond has adopted in the real world. I get that the code base has evolved in such a way that implementing this might be non-trivial. I don't think it follows from that that the current implementation is correct. Maybe I'm wrong, maybe there are a whole bunch of people out there preparing charts for their upcoming sessions and expecting the bar lines to come out looking like that. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Setting beams with new \time 4/4 command
David Wrightwrites: > I like being able to type \time 2,2,2,2 8/8 > but is there a way to specify the same beaming pattern > as briefly when it's really 4/4, so I don't get groups > of four quavers? I have no idea what you mean with "when it's really 4/4". Is the meter printed as 4/4? Or as 8/8 but it should be beamed like 4/4? Could you write some actual code and tell what is wrong with it? Or even better: when you state "as briefly" that implies that there is a way to write it verbosely that you know of. How about showing the verbose code that actually does what you want so that one has a chance at guessing just _what_ effect you would have wished to express more succinctly? -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Setting beams with new \time 4/4 command
I like being able to type \time 2,2,2,2 8/8 but is there a way to specify the same beaming pattern as briefly when it's really 4/4, so I don't get groups of four quavers? Cheers, David. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: getting repeat bar lines to print across an entire system
2016-07-24 15:53 GMT+02:00 Robert Edge: > So there is a snippet here: http://lsr.di.unimi.it/LSR/Item?id=1032 > > That gets pretty close. > > I am assuming that no one writes that much scheme code unless the > functionality is broken in Lilypond proper. I'll prepare a bug report. It happens that I'm the one who wrote the printing-routine for the bracket-bar-lines. As well as the mentioned LSR-snippet. So some background: LilyPond splits the bar-lines into BarLines and SpanBars (if in a Context where SpanBars are supported). Those are different grobs and can be addressed separately, see the output of: \score { \new StaffGroup << \new Staff { R1 R } \new Staff { R1 R } >> \layout { \context { \Score \override SpanBar.color = #cyan } \context { \Staff \override BarLine.color = #red } } } 2016-07-24 17:43 GMT+02:00 Robert Edge : >> I'd also add that it is not so much the case the lilypond is broken >> and fails to function, but that lilypond just fails to provide a >> particular function that you have need of. > > > > By broken I mean failing to behave as the documentation says it should. > > see here: > http://lilypond.org/doc/v2.18/Documentation/notation/bars#bar-lines > > "In scores with many staves, a \bar command in one staff is automatically > applied to all staves. The resulting bar lines are connected between > different staves of a StaffGroup, PianoStaff, or GrandStaff." In the light of my words above I'd say the bracket-BarLines full-fill exactly whats documented: - They _are_ applied to all staves - They are connected in StaffGroup, etc Another example for this behaviour is the segno-bar-line. Try to insert \bar "S" in all relevant places of my previous example and you'll see every BarLine will get a segno-bar-line, but this segno-sign is _not_ printed as a SpanBar. So I'd say this part of the code is not broken but works as it should, it's just not like you'd expect it should be. That said, it _is_ sometimes wanted to add those brackettips, but it's not possible by defining a certain BarLine. Or more precisely, it's not impossible to define a BarLine only showing a bracketip above-right and another with a bracketip above-left, and another for above-left-and-right. Then the same for barckettips below. Then you would need to set the relevant context-property (whichBar) every time. I'd say: a can of worms, if I ever saw one. Thus you need some other command to add those brackettips where desired. And ofcourse it should be possible to print brackettips for one StaffGroup but not for another StaffGroup of the same score (see the commented part of the LSR-snippet for an example.) Hence the LSR-snippet. It _is_ a workaround, yes, but until someone comes up with a proper solution, the best method I can think of (although I've to say I didn't looked into its code again, it could likely be improved or shortened or ...) I'm not sure how a proper implementation _could_ work. As said above I doubt it can be done with BarLines. For sure it's out of my depth. Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
OT: Barrios - Una limosna
https://www.youtube.com/watch?v=20LtiaBra7M-- /oiram/bin/selom/ /Da ognuno secondo le proprie capacità ad ognuno secondo i propri bisogni./ /MIB-kernellinux-tester/ http://mariomoles.altervista.org/[1] Linux[2] MIB[3] Lilypond[4] Frescobaldi[5] Rosegarden[6] [1] http://mariomoles.altervista.org/ [2] https://www.kernel.org/ [3] http://mib.pianetalinux.org/blog/ [4] http://lilypond.org/ [5] http://www.frescobaldi.org/ [6] http://www.rosegardenmusic.com/ ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Retrieving 'tweaks from a grob
David Kastrupwrites: > Don't do that. The acknowledger is the place for _setting_ > properties, and of course a first acknowledger has no chance to see > properties set by a second acknowledger. Instead, use the > acknowledger to _record_ the grobs. Then you use the > process-acknowledged hook to actually process them. This includes > looking at properties (like the ones set by the Tweak_engraver). process-acknowledged may be called multiple times (if some of the processing creates new grobs), so be sure to clear out your list of grobs after having processed them (no announcements of newly created grobs will be made until all process-acknowledged hook calls are through, so this happens properly serialized). -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Retrieving 'tweaks from a grob
Urs Liskawrites: > Hi all, > > in the ScholarLY package we're attaching a (newly defined) property > 'input-annotation to a grob, either through an implicit \once \override > or a \tweak, depending on the invocation syntax: > > The attached file > annotate.ly > shows both ways, first the override, then the tweak. Today I finally > realized that the "tweaked" ones are not processed properly, that is, > while they are attached to the grob they aren't retrieved in the later > engraver processing. > > The output of \displayMusic (attachment display-music) shows the > different ways the annotations are attached to the grobs: > > The first one provides an explicit override, and so 'input-annotation is > a property of the following note. This can be retrieved with > ly:grob-property (which works in > https://github.com/openlilylib/scholarly/blob/master/annotate/engraver.ily#L66). > > The second one is the result of an implicit \tweak where it is fond in > the 'tweaks property of the music expression. > > So, my question is: if I'm iterating over the grobs in an engraver's > acknowledger (as per the link above), how can I first determine if the > grob('s music) has a 'tweaks property and second retrieve that > property? Don't do that. The acknowledger is the place for _setting_ properties, and of course a first acknowledger has no chance to see properties set by a second acknowledger. Instead, use the acknowledger to _record_ the grobs. Then you use the process-acknowledged hook to actually process them. This includes looking at properties (like the ones set by the Tweak_engraver). > I have been able to retrieve the thing through selecting from a > ly:grob-alist-chain, but that seems cumbersome and error-prone. There > must be an easier way. However, ly:music-property which should be the > way to go here doesn't seem possible because I (think I) can't > reference the "music" argument here. You can usually get the event-cause of a grob (which may or may not exist) and then use ly:event-property from there. But it seems much saner to just go through the process-acknowledged route/hook. > OMG, I have the impression this request is completely uncomprehensible ... At least your code and example output is completely useless because it relies on external packages which you do not either quote or reference. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Retrieving 'tweaks from a grob
Hi all, in the ScholarLY package we're attaching a (newly defined) property 'input-annotation to a grob, either through an implicit \once \override or a \tweak, depending on the invocation syntax: The attached file annotate.ly shows both ways, first the override, then the tweak. Today I finally realized that the "tweaked" ones are not processed properly, that is, while they are attached to the grob they aren't retrieved in the later engraver processing. The output of \displayMusic (attachment display-music) shows the different ways the annotations are attached to the grobs: The first one provides an explicit override, and so 'input-annotation is a property of the following note. This can be retrieved with ly:grob-property (which works in https://github.com/openlilylib/scholarly/blob/master/annotate/engraver.ily#L66). The second one is the result of an implicit \tweak where it is fond in the 'tweaks property of the music expression. So, my question is: if I'm iterating over the grobs in an engraver's acknowledger (as per the link above), how can I first determine if the grob('s music) has a 'tweaks property and second retrieve that property? I have been able to retrieve the thing through selecting from a ly:grob-alist-chain, but that seems cumbersome and error-prone. There must be an easier way. However, ly:music-property which should be the way to go here doesn't seem possible because I (think I) can't reference the "music" argument here. OMG, I have the impression this request is completely uncomprehensible ... Best Urs \version "2.19.45" \include "scholarly/package.ly" test = { % First invocation, attaches the 'input-annotation as a \once \override \musicalIssue \with { message = "A test" } Accidental cis'4 % Second invocation, attaches a \tweak \criticalRemark NoteHead \with { message = "Test" } c'4 d' } \displayMusic \test(make-music 'SequentialMusic 'elements (list (make-music 'SequentialMusic 'elements (list (make-music 'NoteEvent 'tweaks (list (list 'input-annotation (list (quote input-file-name) "document.ly") (cons (quote context-id) "tmpBD7bwR") (cons 'location #) (cons (quote type) (quote critical-remark)) (cons (quote message) "Test"))) 'duration (ly:make-duration 2) 'pitch (ly:make-pitch 0 0)) (make-music 'NoteEvent 'pitch (ly:make-pitch 0 1) 'duration (ly:make-duration 2)) (make-music 'SequentialMusic 'elements (list (make-music 'SequentialMusic 'elements (list (make-music 'ContextSpeccedMusic 'context-type 'Bottom 'element (make-music 'OverrideProperty 'once #t 'pop-first #t 'grob-value (list (list (quote input-file-name) "document.ly") (cons (quote context-id) "tmpBD7bwR") (cons 'location #) (cons (quote type) (quote critical-remark)) (cons (quote message) "Test")) 'grob-property-path (list (quote input-annotation)) 'symbol 'NoteHead)) (make-music 'NoteEvent 'duration (ly:make-duration 2) 'pitch (ly:make-pitch 0 0 (make-music 'NoteEvent 'pitch (ly:make-pitch 0 1) 'duration (ly:make-duration 2 ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Adding space between staves and Dynamics
Hi, Simon It helped a lot. I confess that page is very difficult to understand. At least for me :-) Your suggestion worked great, but now I have almost no space between different line scores (getting the upper voice upper lyrics glues to the lower voice lower lyrics). I tried setting \override VerticalAxisGroup.default-staff-staff-spacing.minimum-distance = #17 both in Staff and ChoirStaff contexts without any luck. Suggestions? :-) Thanks On Mon, Jul 25, 2016 at 12:18 AM, Simon Albrechtwrote: > Am 24.07.2016 um 16:37 schrieb Alberto Simões: > >> How can I add a little more space between the Dynamics and the lower >> staff upper lyrics? (see attach). >> > > Override VerticalAxisGroup.nonstaff-nonstaff-spacing in either of the > contexts, see < > http://lilypond.org/doc/v2.19/Documentation/notation/flexible-vertical-spacing-within-systems > >. > > HTH, Simon > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: bis
On Mon, Jul 25, 2016 at 6:54 AM,wrote: > > Thanks a lot, I'll check it out! > > Erik > > > - Ursprungligt meddelande - > Från: > "Andrew Bernard" > > Till: > "lilypond-user Mailinglist" > Kopia: > > Skickat: > Mon, 25 Jul 2016 19:23:40 +1000 > Ämne: > Re: bis > > > > Hi Erik, > > This is a use for a text spanner with centred text that I had been > asking about on the list for some time, Eventually I wrote a function > to do it with the kind help of Thomas Morley also. Very useful - I > always said so! > This is a good solution, but one drawback is the left and right bounds of the text spanner aren't set to the column that holds the bar lines, rather to the NoteColumn objects. One consequence is that you wouldn't get automatic alignment with bar lines, if that's what you want. Another solution is available on the LSR: http://lsr.di.unimi.it/LSR/Snippet?id=954. Add this function: textedMeasureBracket = #(define-music-function (parser location str mus) (markup? ly:music?) #{ \override Staff.MeasureCounter.stencil = #(lambda (grob) (test-stencil grob str)) \startMeasureCount #mus \stopMeasureCount #} ) Use it like this: twice = \markup { \italic "bis" } { \textedMeasureBracket \twice { g'1 g'1 } } HTH, David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: bis
Thanks a lot, I'll check it out! Erik - Ursprungligt meddelande - Från: "Andrew Bernard"Till:"lilypond-user Mailinglist" Kopia: Skickat:Mon, 25 Jul 2016 19:23:40 +1000 Ämne:Re: bis Hi Erik, This is a use for a text spanner with centred text that I had been asking about on the list for some time, Eventually I wrote a function to do it with the kind help of Thomas Morley also. Very useful - I always said so! Have a look at this - it may do what you require. Andrew == snip version "2.19.37" include "/home/andro/lib/lilypond/scheme.ily" % Annotation bracket with centred text. % Andrew Bernard and Thomas Morley TextSpannerCentredText = #(define-music-function (text extra-length) (string? pair?) "Use TextSpanner semantics to create spanner brackets with centred text" #{ once override TextSpanner.after-line-breaking = #(lambda (grob) (let* ( ;; get stencil of grob (stil (ly:grob-property grob 'stencil)) ;; get spanner length (spanner-len (interval-length (ly:stencil-extent stil X))) ;; make stencil from text arg (text-stil (grob-interpret-markup grob (markup #:sans #:upright text))) ;; get text length (text-len (interval-length (ly:stencil-extent text-stil X ;; if text length exceeds the spanner length we cannot really proceed. ;; do nothing - make an ordinary text spanner and warn. (if (>= text-len spanner-len) (begin (ly:warning "text length longer than spanner") #f ) (let* ( ;; get direction, up or down (dir (ly:grob-property grob 'direction)) ;; some padding (padding 1) ;; line thickness (thickness 0.25) ;; extra length on left, negative values shorten (left-ext (car extra-length)) ;; extra length on right, negative values shorten (right-ext (cdr extra-length)) ;; calculate length considering text length (path-part-len (/ (- spanner-len text-len) 2)) ;; make left bracket stencil (path-left-part-stil (make-path-stencil `( moveto ,(- left-ext) ,(* -1 dir) lineto ,(- left-ext) 0 lineto ,path-part-len 0 ) thickness 1 1 #f)) ;; make right bracket stencil (path-right-part-stil (make-path-stencil `( moveto ,(+ path-part-len right-ext) ,(* -1 dir) lineto ,(+ path-part-len right-ext) 0 lineto 0 0 ) thickness 1 1 #f)) ;; make complete stencil combining left and right parts ;; and text (full-stil (stack-stencils X RIGHT padding (list path-left-part-stil (centered-stencil text-stil) path-right-part-stil))) ) ;; set grob stencil to fully constructed stencil (ly:grob-set-property! grob 'stencil full-stil) #} ) { c' d' ees' fis' once override TextSpanner.direction = #DOWN TextSpannerCentredText "6"" #'(0 . 0) g' startTextSpan a' bes' c'' stopTextSpan TextSpannerCentredText "x3" #'(2 . 1) bes'startTextSpan a' g' c'stopTextSpan TextSpannerCentredText "x3" #'(2 . -6) c''1startTextSpan c''1stopTextSpan } == snip ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplets in compound meter
Am 25.07.2016 um 12:00 schrieb Malte Meyn: > > > Am 25.07.2016 um 11:44 schrieb Andrew Bernard: >> So they are tuplet 10/9. Can you not simply set the tuplet numbers >> accordingly? >> >> \once \override TupletNumber.text = "" > > I could. But like my solutions with scaled durations, the input > doesn’t really reflect the output. And when you have many of these > tuplets, it’s much to type. So I wondered whether it would be > possible/nice to have a more flexible \tuplet command. > >> What does Scriabin put for the tuplet number? > > He uses 5 (IMO the only correct solution, it’s definitely 5 quarters, > not 10 eights). How about \version "2.19.45" scaledTuplet = #(define-music-function (ratio frac mus)(integer? fraction? ly:music?) #{ \once \override TupletNumber.text = #(format "~a" (/ (car frac) ratio)) \tuplet #frac #mus #} ) \relative c' { \time 9/8 \scaledTuplet 2 10/9 { c4 c c c c } } ? What I didn't take into account is tuplet's optional argument for the tuplet spanner duration. HTH Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplets in compound meter
Hi Malte, Does the input have to match the output? Does it have to be ‘real’? I never thought of lilypond that way. I have to do hundreds of these sorts of mods also. Can’t you just write a function and say something like: \tn 5 [And live with the ‘inelegance’?] Andrew On 25/07/2016, 8:00 PM, "Malte Meyn"wrote: Am 25.07.2016 um 11:44 schrieb Andrew Bernard: > So they are tuplet 10/9. Can you not simply set the tuplet numbers accordingly? > > \once \override TupletNumber.text = "" I could. But like my solutions with scaled durations, the input doesn’t really reflect the output. And when you have many of these tuplets, it’s much to type. So I wondered whether it would be possible/nice to have a more flexible \tuplet command. > What does Scriabin put for the tuplet number? He uses 5 (IMO the only correct solution, it’s definitely 5 quarters, not 10 eights). ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplets in compound meter
Am 25.07.2016 um 11:44 schrieb Andrew Bernard: So they are tuplet 10/9. Can you not simply set the tuplet numbers accordingly? \once \override TupletNumber.text = "" I could. But like my solutions with scaled durations, the input doesn’t really reflect the output. And when you have many of these tuplets, it’s much to type. So I wondered whether it would be possible/nice to have a more flexible \tuplet command. What does Scriabin put for the tuplet number? He uses 5 (IMO the only correct solution, it’s definitely 5 quarters, not 10 eights). ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: tuplets in compound meter
Hi Malte, So they are tuplet 10/9. Can you not simply set the tuplet numbers accordingly? \once \override TupletNumber.text = "" What does Scriabin put for the tuplet number? I have to use this technique extensively for the New Complexity scores I engrave, where it gets a lot weirder than this. Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
tuplets in compound meter
Hi list, I’m setting Sriabin’s “Vers la flamme” in LilyPond. This piece in 9/8 contains tuplets where 5 quarter notes replace 9 eights, or 4 and a half quarters. But of course I cannot write \tuplet 5/4½ or \tuplet 5/(9/2). \tuplet 10/9 won’t help because it prints the numerator 10. I could do something like \tuplet 5/9 \scaleDurations 1/2 { r4 ... } or \tuplet 5/9 { r4*1/2 ... } but wouldn’t it be nice to have a version of tuplet that works better with compound meter? \tuplet 5/4½ is a special example but \tuplet 2/1½ is more common (it is often written as \tuplet 2/3 but I’ve seen already some editions that follow what Peter calls the “mathematical rule” at http://lilypondblog.org/2014/09/how-to-write-readable-tuplets/ strictly). I don’t have an idea for a good syntax here, any suggestions? Malte ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: bis
Hi Erik, This is a use for a text spanner with centred text that I had been asking about on the list for some time, Eventually I wrote a function to do it with the kind help of Thomas Morley also. Very useful - I always said so! Have a look at this - it may do what you require. Andrew == snip \version "2.19.37" \include "/home/andro/lib/lilypond/scheme.ily" % Annotation bracket with centred text. % Andrew Bernard and Thomas Morley TextSpannerCentredText = #(define-music-function (text extra-length) (string? pair?) "Use TextSpanner semantics to create spanner brackets with centred text" #{ \once \override TextSpanner.after-line-breaking = #(lambda (grob) (let* ( ;; get stencil of grob (stil (ly:grob-property grob 'stencil)) ;; get spanner length (spanner-len (interval-length (ly:stencil-extent stil X))) ;; make stencil from text arg (text-stil (grob-interpret-markup grob (markup #:sans #:upright text))) ;; get text length (text-len (interval-length (ly:stencil-extent text-stil X ;; if text length exceeds the spanner length we cannot really proceed. ;; do nothing - make an ordinary text spanner and warn. (if (>= text-len spanner-len) (begin (ly:warning "text length longer than spanner") #f ) (let* ( ;; get direction, up or down (dir (ly:grob-property grob 'direction)) ;; some padding (padding 1) ;; line thickness (thickness 0.25) ;; extra length on left, negative values shorten (left-ext (car extra-length)) ;; extra length on right, negative values shorten (right-ext (cdr extra-length)) ;; calculate length considering text length (path-part-len (/ (- spanner-len text-len) 2)) ;; make left bracket stencil (path-left-part-stil (make-path-stencil `( moveto ,(- left-ext) ,(* -1 dir) lineto ,(- left-ext) 0 lineto ,path-part-len 0 ) thickness 1 1 #f)) ;; make right bracket stencil (path-right-part-stil (make-path-stencil `( moveto ,(+ path-part-len right-ext) ,(* -1 dir) lineto ,(+ path-part-len right-ext) 0 lineto 0 0 ) thickness 1 1 #f)) ;; make complete stencil combining left and right parts ;; and text (full-stil (stack-stencils X RIGHT padding (list path-left-part-stil (centered-stencil text-stil) path-right-part-stil))) ) ;; set grob stencil to fully constructed stencil (ly:grob-set-property! grob 'stencil full-stil) #} ) { c' d' ees' fis' \once \override TextSpanner.direction = #DOWN \TextSpannerCentredText "6\"" #'(0 . 0) g' \startTextSpan a' bes' c'' \stopTextSpan \TextSpannerCentredText "x3" #'(2 . 1) bes'\startTextSpan a' g' c'\stopTextSpan \TextSpannerCentredText "x3" #'(2 . -6) c''1\startTextSpan c''1\stopTextSpan } == snip ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
lilypond-book: warning: cannot detect textwidth from LaTeX
Hi folks I've searched the archives but couldn't find an answer to this problem. I have a file.lytex file which contains these lines: %% \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \begin{document} \lilypondfile[noindent,line-width=15\cm]{23.10.63.ly} \end{document} %% I compile it with the below command. What's wrong with it? I set the width of the lilypond file, while the document width is already set by \documentclass. What else is missing? Thanks Federico $ make lilypond-book --include=/home/fede/Documenti/spartiti/ly --output=out file.lytex; lilypond-book (GNU LilyPond) 2.19.45 Reading file.lytex... Running `latex' on file `/tmp/tmphleGw3.tex' to detect default page settings. lilypond-book: warning: Unable to auto-detect default settings: latex: /home/fede/.local/lilypond/usr/lib/libz.so.1: no version information available (required by /lib64/libpng16.so.16) latex: /home/fede/.local/lilypond/usr/lib/libjpeg.so.62: no version information available (required by /lib64/libpoppler.so.58) latex: /home/fede/.local/lilypond/usr/lib/libtiff.so.5: no version information available (required by /lib64/libpoppler.so.58) latex: /home/fede/.local/lilypond/usr/lib/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /lib64/libpoppler.so.58) lilypond-book: warning: cannot detect textwidth from LaTeX Dissecting... lilypond-book: error: file not found: 23.10.63.ly Traceback (most recent call last): File "/home/fede/.local/lilypond/usr/bin/lilypond-book", line 789, in ? main () File "/home/fede/.local/lilypond/usr/bin/lilypond-book", line 772, in main chunks = do_file (files[0]) File "/home/fede/.local/lilypond/usr/bin/lilypond-book", line 611, in do_file chunks = find_toplevel_snippets (source, global_options.formatter) File "/home/fede/.local/lilypond/usr/bin/lilypond-book", line 362, in find_toplevel_snippets snip = klass (type, m, formatter, line_number, global_options) File "/home/fede/.local/lilypond/usr/share/lilypond/current/python/book_snippets.py", line 825, in __init__ global_options.include_path, global_options.original_dir)).read () File "/home/fede/.local/lilypond/usr/share/lilypond/current/python/book_base.py", line 27, in find_file exit (1) TypeError: 'str' object is not callable Makefile:20: recipe for target 'file.pdf' failed make: *** [file.pdf] Error 1 ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user