Re: bookOutputName
Hi Jonathan, some suggestions, inline, below... On Thu, 2015-07-30 at 20:25 +, Jenny^H^H^H^H^HJonathan wrote: Hi. I've been using LP 2.18.2 for a few months quite successfully. I'm on Windows 7. Recently I downloaded Frescobaldi. I then started having problems running LP, which I thought must be because I was using a couple of include files, and I didn't know how to tweek Frescobaldi to accept them. In your source files, it is good practice to use relative filenames for includes. So \include to/foo.ily rather than \include /some/path/to/foo.ily (I learned that lesson the hard way...) Then, in Frescobaldi: Preferences - Lilypond Preferences - Lilypond include path, and add /some/path I'm not sure whether Windows will require backslashes; you might need to experiment. So I uninstalled it (and LP, and reinstalled that). None of my previous ly files would compile any more. I was also running lilypond-windows rather than from the command line, but although the behaviour was slightly different, neither was working. I eventually worked out that the names of my include files had spaces, and LP could no longer recognise them. This seems quite reasonable (!) but before I correct the forty or so faulty documents, is there any explanation? Multiple possible explanations, but my personal preference would be to avoid spaces at all costs. These files can be operated on by various tools, and it only takes one programming- or configuration-error to mis-parse a filename that contains spaces. Better, and simpler, IMHO, to bite the bullet and change all instances of \include one file or four.ily to \include one_file_or_four.ily This will spare you a lot of grief in the long term, and will also spare anyone with whom you might subsequently share your work. Hope this helps -- Graham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Pull in external LilyPond files into a score of movements
Thank you all so much, i'm just getting into lilypond and trying to figure out how to make it work for my workflow. i have a solution i like to this, or similar, issue, which i will share soon. meanwhile, i have a question that will help me finish it: is there such a thing as a null0if, or a ternary operator that can be used inline? I want to do something like this: \header { title = \title } but if \title hasn't been defined (because I'm running an ily outside its container), then it fails. Would like to do something like title = \title || (to borrow javascript syntax - use \title var if it exists, else use an empty string). I guess if not, I can write a scheme function, but haven't delved into that yet, and trying to figure out the simplest approach. Thanks. -- View this message in context: http://lilypond.1069038.n5.nabble.com/Pull-in-external-LilyPond-files-into-a-score-of-movements-tp161839p179262.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: Pull in external LilyPond files into a score of movements
Pridie Nonas Augustas MMXV scripsit unlabeled : Thank you all so much, i'm just getting into lilypond and trying to figure out how to make it work for my workflow. i have a solution i like to this, or similar, issue, which i will share soon. meanwhile, i have a question that will help me finish it: is there such a thing as a null0if, or a ternary operator that can be used inline? I want to do something like this: \header { title = \title } but if \title hasn't been defined (because I'm running an ily outside its container), then it fails. Would like to do something like title = \title || (to borrow javascript syntax - use \title var if it exists, else use an empty string). I guess if not, I can write a scheme function, but haven't delved into that yet, and trying to figure out the simplest approach. I think the easiest way is to scheme it: (warning, I cannot test the code below right now): #(if (not (defined? 'title)) (set! title )) You can even meta-scheme it: #(define (define-default symbol) (if (not (defined? symbol)) (module-add! (current-module) symbol ))) #(map define-default '(title subtitle instrument composer)) ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: MIDI track names
On Mon, 2015-08-03 at 18:39 +0200, David Kastrup wrote: From lily/control-track-performer.cc: [...] No idea what happens when the Control_track_performer gets removed but I doubt it's useful. From the same file it appears that the Control_track_performer is interested in tempo or time signature changes, which would be consistent with the guideline In [MIDI file] format 1, the very first MTrk should consist of only the tempo (and time signature) events [...] (source: http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midifile/tempo.htm ; LilyPond MIDI files are format 1 files as the format parameter to the Midi_header constructor [lily/midi-chunk.cc] is always 1 [lily/performance.cc].) My guess is that removing the Control_track_performer will result in losing support for tempo and time signature changes in MIDI output. I've no idea whether the name control track also has some special meaning, although that would (in light of the above guideline that the track should be the initial track of a MIDI file) seem oddly restrictive since, according to (for example) http://www.fileformat.info/format/midi/corion.htm, the name of the first track of a format 1 MIDI file gives a name for the entire MIDI sequence (see the Sequence/Track Name meta-event). Has the control track performer access to the metadata from \header{}? In that case, I suggest to default the name to header’s „title“ setting. What do you think? Could work. Haven't looked into MIDI a lot though. Using properties from the \header block (which sounds in principle like a nice idea) is probably made more complicated by the fact that the title metadata in a \header block can be arbitrary LilyPond markup, and not necessarily a plain string that could be passed through directly to the MIDI output file (and still get acceptable output). To avoid possible problems with complex markups, a safer (and more general, in case the user really wishes to use a MIDI sequence name different from the title) option would be to just have support for customizing the name of the MIDI sequence independently of the \header block (for use by the Control_track_performer). -- Heikki Tauriainen ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: MIDI track names
Heikki Tauriainen g034...@welho.com writes: In that case, I suggest to default the name to header’s „title“ setting. What do you think? Could work. Haven't looked into MIDI a lot though. Using properties from the \header block (which sounds in principle like a nice idea) is probably made more complicated by the fact that the title metadata in a \header block can be arbitrary LilyPond markup, and not necessarily a plain string that could be passed through directly to the MIDI output file (and still get acceptable output). Markup stripping should be a solved problem since we prepare PDF metadata in the same manner. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Positioning Dynamics Contexts
On Tue, Aug 4, 2015 at 3:53 PM, Cynthia Karl pck...@mac.com wrote: Is there a useful way to get closer association of a staff and a dynamics context in the following snippet? Two things suggest themselves, although you may not like either idea: 1) You could add dynamicsA to the upper Staff (instead of it having its own Dynamics context). That would keep everything in it closer to the upper staff, viz. \new Staff \musicA \dynamicsA 2) Add some kind of invisible dynamic to dynamicsB when it has no content. In the example below I added a white hairpin that will continue until cancelled, preserving some space for the dynamicsB context: \version 2.18.2 musicA = \relative c'' {\repeat unfold 24 c4 \break \repeat unfold 24 d4} dynamicsA = {s1 s\p s s\f s s s1\p s\mp s\mf s\f s\ff s\fff} musicB = \relative c'' {\repeat unfold 24 b4\break\repeat unfold 24 a4} dynamicsB = {s1 s^espress. s s s\startTextSpan s\stopTextSpan s1-\tweak #'color #white \ s s s s s\!} \score { \new StaffGroup \new Staff \musicA \new Dynamics \dynamicsA \new Dynamics \dynamicsB \new Staff \musicB } hth, Kevin ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Positioning Dynamics Contexts
Is there a useful way to get closer association of a staff and a dynamics context in the following snippet? \version 2.19.23 musicA = \relative c'' {\repeat unfold 24 c4 \break \repeat unfold 24 d4} dynamicsA = {s1 s\p s s\f s s s1\p s\mp s\mf s\f s\ff s\fff} musicB = \relative c'' {\repeat unfold 24 b4\break\repeat unfold 24 a4} dynamicsB = {s1 s^espress. s s s\startTextSpan s\stopTextSpans1 s s s s s} \score { \new StaffGroup \new Staff \musicA \new Dynamics \dynamicsA \new Dynamics \dynamicsB \new Staff \musicB } The problem is in the 2nd staff where dynamicsB has no “content”. This results in the spacing engine positioning dynamicsA (almost) exactly in the middle of the two staves. I would prefer that even in the 2nd system dynamicsA should be a lot closer to the upper staff. Basically, I would like the 2nd system to be treated as if dynamicsB actually had some invisible content, forcing spacing like in the 1st system.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: MIDI track names
Am 2015-08-05 um 05:01 schrieb Heikki Tauriainen g034...@welho.com: Using properties from the \header block (which sounds in principle like a nice idea) is probably made more complicated by the fact that the title metadata in a \header block can be arbitrary LilyPond markup, and not necessarily a plain string that could be passed through directly to the MIDI output file (and still get acceptable output). Markup stripping should be a solved problem since we prepare PDF metadata in the same manner. Indeed. Thanks for the hint, David! Then pretty please implement it! I've submitted a patch for review at https://codereview.appspot.com/256230045/. THANK YOU! Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: MIDI track names
On Tue, 2015-08-04 at 22:54 +0600, Henning Hraban Ramm wrote: Am 2015-08-04 um 16:03 schrieb David Kastrup d...@gnu.org: Heikki Tauriainen g034...@welho.com writes: In that case, I suggest to default the name to header’s „title“ setting. What do you think? Could work. Haven't looked into MIDI a lot though. Using properties from the \header block (which sounds in principle like a nice idea) is probably made more complicated by the fact that the title metadata in a \header block can be arbitrary LilyPond markup, and not necessarily a plain string that could be passed through directly to the MIDI output file (and still get acceptable output). Markup stripping should be a solved problem since we prepare PDF metadata in the same manner. Indeed. Thanks for the hint, David! Then pretty please implement it! I've submitted a patch for review at https://codereview.appspot.com/256230045/. -- Heikki Tauriainen ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Positioning Dynamics Contexts
On Aug 4, 2015, at 10:04 AM, Kevin Barry barr...@gmail.com wrote: On Tue, Aug 4, 2015 at 3:53 PM, Cynthia Karl pck...@mac.com wrote: Is there a useful way to get closer association of a staff and a dynamics context in the following snippet? Two things suggest themselves, although you may not like either idea: 1) You could add dynamicsA to the upper Staff (instead of it having its own Dynamics context). That would keep everything in it closer to the upper staff, viz. \new Staff \musicA \dynamicsA I really like that idea because my real case is a 10 page ms with seven instruments, for which I need to produce not only a score but various combinations of parts; the 2nd idea of adding invisible stuff to the dynamics to keep them alive in all systems seems a little unwieldy. But I’ve run into a problem I don’t understand, illustrated by the following snippet: \version 2.19.23 PocoAccel = { \override TextSpanner.bound-details.left.text = poco accel. } musicA = \relative c'' {\repeat unfold 16 c4 } dynamicsAHigh = \new Dynamics {s1^AHigh s \PocoAccel s\startTextSpan s\stopTextSpan} dynamicsALow = \new Dynamics {s1^ALow s\p s s\f} musicB = \relative c'' {\repeat unfold 16 b4 } dynamicsBHigh = \new Dynamics { s1^BHigh s^espress. s s } dynamicsBLow = \new Dynamics { s1^BLow s\f s s } \score { \new StaffGroup \new Staff \dynamicsAHigh \musicA \dynamicsALow \new Staff \dynamicsBHigh \musicB \dynamicsBLow } Here I want each musical staff to have two dynamics contexts, one above the musical staff for text spanners, etc., and one below for articulations and dynamics. But the above snippet results in both dynamics contexts being placed below their musical staff instead of one above and one below. Shouldn’t the line: \new Staff \dynamicsAHigh \musicA \dynamicsALow resullt in the ordering in the score: dynamicsAHigh musicA dynamicsALow instead of musicA dynamicsAHigh dynamicsALow ? ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Positioning Dynamics Contexts
Cynthia Karl pck...@mac.com writes: Shouldn’t the line: \new Staff \dynamicsAHigh \musicA \dynamicsALow resullt in the ordering in the score: dynamicsAHigh musicA dynamicsALow instead of musicA dynamicsAHigh dynamicsALow ? Taking a look at ly/engraver-init.ly, the only context accepting a Dynamics context by default is a GrandStaff, so one is created on-demand when \dynamicsAHigh is created and placed in the existing StaffGroup below the last created context, which is the \new Staff in that line. Now you probably want to change StaffGroup in order to let it accept Dynamics as well. This will still not change your arrangement though. Unless you work with alignAboveContext and alignBelowContext settings, you'll likely rather need something like \dynamicsHigh \new Staff \musicA \dynamicsLow instead. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: MIDI track names
Henning Hraban Ramm lilypon...@fiee.net writes: Am 2015-08-04 um 16:03 schrieb David Kastrup d...@gnu.org: Heikki Tauriainen g034...@welho.com writes: In that case, I suggest to default the name to header’s „title“ setting. What do you think? Could work. Haven't looked into MIDI a lot though. Using properties from the \header block (which sounds in principle like a nice idea) is probably made more complicated by the fact that the title metadata in a \header block can be arbitrary LilyPond markup, and not necessarily a plain string that could be passed through directly to the MIDI output file (and still get acceptable output). Markup stripping should be a solved problem since we prepare PDF metadata in the same manner. Then pretty please implement it! A different possibility to set the MIDI title, as Heikki suggested, would also be ok. I found no tool (in MacPorts, that is) that can make such fixes to MIDI files. Do you still accept donations? Too few, namely all of them. But it sounds like you are not talking about a donation as much as for recompensation for a feature. As I said, the MIDI code is not really one of my strong suits. I was only pointing out that most of the pieces should, in theory, be already there. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Positioning Dynamics Contexts
On Tue, Aug 4, 2015 at 5:08 PM, Cynthia Karl pck...@mac.com wrote: Shouldn’t the line: \new Staff \dynamicsAHigh \musicA \dynamicsALow resullt in the ordering in the score: dynamicsAHigh musicA dynamicsALow No: the result is that they are all part of the same Staff, and dynamics are positioned below a staff by default - when they are not in their own context (and you can't, as David pointed out, put a Dynamics context inside a Staff context). In your example there is no need to specify \new Dynamics - really you are just adding a voice that contains spacer rests and dynamics (A Dynamics context is not necessary). Assuming you still want to keep the notes and dynamics in separate variables the code below should do what you want. Note the two places where I replaced a caret ^ with an underscore _ to put text below the Staff. I would also recommend giving some consideration to merging the high and low dynamics variables (obviously it depends on your score, but I can't imagine many scores where it is desirable to separate them like that). \version 2.18.2 PocoAccel = { \override TextSpanner.bound-details.left.text = poco accel. } musicA = \relative c'' {\repeat unfold 16 c4 } dynamicsAHigh = {s1^AHigh s \PocoAccel s\startTextSpan s\stopTextSpan} dynamicsALow = {s1_ALow s\p s s\f} musicB = \relative c'' {\repeat unfold 16 b4 } dynamicsBHigh = { s1^BHigh s^espress. s s } dynamicsBLow = { s1_BLow s\f s s } \score { \new StaffGroup \new Staff \dynamicsAHigh \musicA \dynamicsALow \new Staff \dynamicsBHigh \musicB \dynamicsBLow } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Temporary change to macro definition
In the attached file, I made a macro \count such that a^\count a^\count a^\count is understood as a^1 a^2 a^3... I also wrote a macro \repeatWithCount such that \repeatWithCount 3 { a^\acount } also evaluates to a^1 a^2 a^3. However, (for aesthetic reasons!) I would prefer to use \count in both situations. Is it possible to modify the \repeatWithCount function so that it basically says (set! count count-auto) (do the \repeatWithCount work) (set! count count-manual) ? If I directly define repeatWithCount = #(define-music-function (parser location n music) ...) then the 'music' parameter is evaluated before repeatWithCount gets its chance to redefine \count. If this were TeX, I could say something like \def\repeatWithCount{\def\count\countAuto \RealRepeatWithCount} \def\RealRepeatWithCount#1#2{ % do the work, then \def\count\countManual} However, trying something like this (i.e. returning #{ \RealRepeatWithoutCount #}) does not work in Lilypond. Is there a way to do this? Thanks, -- Jérôme \version 2.18.2 % Counting notes % #(begin ; manual counting (define music-note-count 0) (define czero (define-music-function (parser location) () (set! music-note-count 0) #{ #})) (define cset (define-music-function (parser location x) (number?) (set! music-note-count x) #{ #} )) (define (make-count-markup n) (markup #:fontsize -1 #:bold #:sans (number-string n))) (define counter-manual (define-music-function (parser location) () (set! music-note-count (+ 1 music-note-count)) (make-music 'TextScriptEvent 'direction 1 'text (make-count-markup music-note-count)) )) ; automatic counting (define counter-symbol 'Counter) (define counter-auto (make-music 'TextScriptEvent 'direction 1 'text counter-symbol)) (define acount counter-auto) (define count counter-manual) (define (substitute-count music n) (let* ( (name (ly:music-property music 'name)) (prop (ly:music-mutable-properties music)) (out (list name)) (add-out! (lambda (s v) (set! out (append! out (list s v) ) (map (lambda (x) (let* ( (s (car x)) (v (cdr x)) ) ; inner let* (if (eq? s 'element) (set! v (substitute-count v n))) (if (member s '(elements articulations)) (set! v (map (lambda (y) (substitute-count y n)) v))) (if (and (eq? name 'TextScriptEvent) (eq? s 'text) (eq? v counter-symbol)) (set! v (make-count-markup n))) (add-out! s v))) ; lambda prop) (apply make-music out) )) (define (repeat-with-count n music) (make-music 'SequentialMusic 'elements (map (lambda (i) (substitute-count music (+ 1 i))) (iota n)) ) ) (define repeatWithCount (define-music-function (parser location n music) (number? ly:music?) (make-music 'SequentialMusic 'elements (map (lambda (i) (substitute-count music (+ 1 i))) (iota n)) ) )) ) % begin % foo = { a4^\count a^\count a^\count } qux = \repeatWithCount 5 { c'^\acount } \foo \qux ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Rest in Lyrics
Hi all, Sorry for the late acknowledgment (vacation mode). This example worked like a charm, and possible other suggestions too (I'm going through them now). Thank you, once more, Alberto On 02/08/15 22:35, Thomas Morley wrote: 2015-08-02 23:00 GMT+02:00 Alberto Simões al...@alfarrabio.di.uminho.pt: Hello I know it is not a common practice, but I would like to put in the middle of the lyrics text, a quarter rest (in parenthesis), in order to make it clear that nothing should be sang in that note (and also because I am trying to copy what was written by the composer). I tried to look up in the snippets repository, but didn't find anything useful (probably didn't look properly). Thank you, Alberto ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user Try: { c''4 d'' e'' f'' } \addlyrics { c d \markup { \raise #0.8 \parenthesize \fontsize #-6 \rest #4 } f } HTH, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Pull in external LilyPond files into a score of movements
Thanks so much, Jérôme! I think I understand the syntax there, but I can't actually get it to work. I will try to explain, now that I have more time, exactly what I am attempting. I am working on a multi-movement orchestral score. I want to be able to print a final score using bookparts, but while I work on each movement, I want to render it in isolation. I don't expect to publish the separate movements, so I don't care if they are perfect, but I need them to play and render as I am working. I will eventually need to make parts too, but at the moment I'm not thinking that far ahead. So, here is my file structure: FullScore.ly - this contains \version and \paper, and then it defines variables title, composer, etc. Then, it includes the first movement's .ly; then it resets title, composer, etc. to \null so that they won't be repeated on each movement. Now, each movement is an .ly file too, e.g. movtI.ly - in this, I set movtTitle, I set global key, time, and tempo, and a var for midiTempo. Then I set each instrument's music as a music block, e.g. scoreAFlute = \relative c'' { \global ... } Finally, at the end of the movt. file I include score_def.ly score_def.ly is a single file, having info that is shared for every movement. It defines instruments and assigns the previously set music to them, e.g. scoreAFlutePart = \new Staff \with { instrumentName = Flute shortInstrumentName = Fl. midiInstrument = flute } \scoreAFlute Then it sets a \bookpart, which contains a \header and two \scores - one for display rendering, and one for midi rendering (uses articulate.ly) This is where I am having the problem - I say it's all the same for every file, but the one thing that is different is that the header elements are unique - those are delivered as variables in the \header block. This is fine, in the structure as above, when I render the full score. But if I try to render a single movement, the variables are not defined, so I get an error. That's why I was hoping to either a) set the variable in the movt.ly file, like title = \title || , or b) do that right in the score_def, so that in the header I could just do title = \title || , So I tried your solution, and I keep getting an error - I've tried putting it in various places, and changing the syntax every way I can think of, but it's always an error. Of course, I AM AN IDIOT - I just moved the variables from the fullscore into each movt.ly file, and set them all to except the first movt., and I get exactly what I want. So, no real problem - I just was not thinking clearly before I guess. BUT, I would still love to find out how to do this, as I know it will come up again in some other context. At any rate, thanks again for trying to help - I really appreciate it! On 8/4/2015 8:23 AM, Jérôme Plût-2 [via Lilypond] wrote: Pridie Nonas Augustas MMXV scripsit unlabeled : Thank you all so much, i'm just getting into lilypond and trying to figure out how to make it work for my workflow. i have a solution i like to this, or similar, issue, which i will share soon. meanwhile, i have a question that will help me finish it: is there such a thing as a null0if, or a ternary operator that can be used inline? I want to do something like this: \header { title = \title } but if \title hasn't been defined (because I'm running an ily outside its container), then it fails. Would like to do something like title = \title || (to borrow javascript syntax - use \title var if it exists, else use an empty string). I guess if not, I can write a scheme function, but haven't delved into that yet, and trying to figure out the simplest approach. I think the easiest way is to scheme it: (warning, I cannot test the code below right now): #(if (not (defined? 'title)) (set! title )) You can even meta-scheme it: #(define (define-default symbol) (if (not (defined? symbol)) (module-add! (current-module) symbol ))) #(map define-default '(title subtitle instrument composer)) ___ lilypond-user mailing list [hidden email] /user/SendEmail.jtp?type=nodenode=179263i=0 https://lists.gnu.org/mailman/listinfo/lilypond-user If you reply to this email, your message will be added to the discussion below: http://lilypond.1069038.n5.nabble.com/Pull-in-external-LilyPond-files-into-a-score-of-movements-tp161839p179263.html To unsubscribe from Pull in external LilyPond files into a score of movements, click here http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=161839code=aXJhc2hraW5AZ21haWwuY29tfDE2MTgzOXwxMzk0NDAzNzIw. NAML