Re: enlarge vertical distance in time signature
Dear Thomas, thanks, I think, this will be a good solution for me! 2012/10/30 Thomas Morley > 2012/10/29 Stefan Thomas : > [...] > > The problem is: > > I would like to have a score with drumstaff and a "normal" staff. And > only > > in the normal Staff shall be a wider time signature. > > I give you an short example: > [...] > > Hi Stefan, > > next try: > > I defined `customTime´ containing all functionality of \time and > printing a wider TimeSignature in DrumStaff only. > Disadvantage: > It has to be used _in_ the DrumStaff or, if used in a global-variable, > this \global has to be applied to the DrumStaff. > This makes the Devnull-context dispensable. If Devnull is part of some > included template, `customTime´ will produce weird output. To avoid > it, uncomment the \layout in the code below. > -> http://lists.gnu.org/archive/html/lilypond-user/2012-10/msg00654.html > > \version "2.16.0" > > % \layout { > % \context { > % \Devnull > % \alias "DrumStaff" > % } > % } > > customTime = > #(define-music-function (parser location baseline-skip beat-structure frac) > (number? (number-list? '()) fraction?) > (let* ((num (car frac)) > (denom (cdr frac))) > #{ > \override DrumStaff.TimeSignature #'stencil = >#(lambda (grob) > (grob-interpret-markup grob > #{ > \markup %\fontsize #5 > \vcenter > \override #`(baseline-skip . > ,baseline-skip) > \column { > \number > #(number->string num) > \number > #(number->string denom) > } > #})) >$(make-music >'TimeSignatureMusic >'beat-structure beat-structure >'denominator denom >'numerator num) > #})) > > % test > > global = { > \customTime #3 #'(4 3) 7/8 > s2.. > \customTime #3 #'(2 2 2 3) 9/8 > s8*9 > } > > drumnotes = \drummode { > wbl4 wbl wbh4. > \repeat "unfold" 3 { wbl4 } wbh4. > } > somenotes = \relative c' { > c4 b c4 d8 > e4 e f e8 d c > } > \score { > << > %\new Devnull \global > \new Staff \somenotes > > \new DrumStaff \with { > \override StaffSymbol #'line-count = #6 > } > << \global \drumnotes >> > >> > } > > For now this is the best I can deliver, I didn't manage to find a > scheme-accessable definition for the formating of the > default-TimeSignature. > There _are_ formating-procedures in time-signature-settings.scm, but > they are used in `compoundMeter´ only. > > > Regards, > Harm > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
pabuhr writes: >Other than that (same with denom), the code looks fine to me. > > Works! However, (and there is always a however ;-), the font and font > size are not the same as the regular (default) time signature. \number $(number->string num) -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
Other than that (same with denom), the code looks fine to me. Works! However, (and there is always a however ;-), the font and font size are not the same as the regular (default) time signature. Is there a a way to grab these two pieces of information from the regular timestamp stencil and set them in this stencil? ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
pabuhr writes: >I consider it much nicer to make "strg" of type fraction?, and then num >can be (car strg) and denom can be (cdr strg). >and >can just be \spreadTimeSignature #8 2/4 ... which is nicer on the eyes. > > I was intrigued and tried to modify the code as you suggested as a > learning exercise. But I ran into a problem I do not understand. I > assumed that fraction is a pair of two numbers, so num and denom are > of type number. "column" needs strings so the numbers have to be > converted. However, I get the following error: > test12.ly:18:25: error: syntax error, unexpected NUMBER_IDENTIFIER >(number->string > $num) > /usr/local/lilypond/usr/share/lilypond/current/ly/init.ly:61:0: error: error > in #{ ... #} > > I think I'm close but missing some subtle issue about the types. > > > > \version "2.16.0" > \language english > #(set-global-staff-size 30) > > spreadTimeSignature = > #(define-music-function (parser location baselineSkip strg music)(number? > fraction? ly:music?) > (let* ((num (car strg)) >(denom (cdr strg))) >#{ >\override Staff.TimeSignature #'stencil = >#(lambda (grob) > (grob-interpret-markup grob > #{ > \markup %\fontsize #5 > \vcenter > \override #`(baseline-skip . ,baselineSkip) > \column { >(number->string $num) This needs to be $(number->string num) instead, as the expression you want to splice in here "as if it were written in LilyPond" includes the Scheme call. Other than that (same with denom), the code looks fine to me. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
I consider it much nicer to make "strg" of type fraction?, and then num can be (car strg) and denom can be (cdr strg). and can just be \spreadTimeSignature #8 2/4 ... which is nicer on the eyes. I was intrigued and tried to modify the code as you suggested as a learning exercise. But I ran into a problem I do not understand. I assumed that fraction is a pair of two numbers, so num and denom are of type number. "column" needs strings so the numbers have to be converted. However, I get the following error: test12.ly:18:25: error: syntax error, unexpected NUMBER_IDENTIFIER (number->string $num) /usr/local/lilypond/usr/share/lilypond/current/ly/init.ly:61:0: error: error in #{ ... #} I think I'm close but missing some subtle issue about the types. \version "2.16.0" \language english #(set-global-staff-size 30) spreadTimeSignature = #(define-music-function (parser location baselineSkip strg music)(number? fraction? ly:music?) (let* ((num (car strg)) (denom (cdr strg))) #{ \override Staff.TimeSignature #'stencil = #(lambda (grob) (grob-interpret-markup grob #{ \markup %\fontsize #5 \vcenter \override #`(baseline-skip . ,baselineSkip) \column { (number->string $num) (number->string $denom) } #})) $(make-music 'TimeSignatureMusic 'beat-structure '() 'denominator denom 'numerator num) $music #})) % test \relative c' { \spreadTimeSignature #3 2/4 c8 c c c \spreadTimeSignature #8 3/4 c16 c c c c c c c c4 } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
2012/10/29 Stefan Thomas : [...] > The problem is: > I would like to have a score with drumstaff and a "normal" staff. And only > in the normal Staff shall be a wider time signature. > I give you an short example: [...] Hi Stefan, next try: I defined `customTime´ containing all functionality of \time and printing a wider TimeSignature in DrumStaff only. Disadvantage: It has to be used _in_ the DrumStaff or, if used in a global-variable, this \global has to be applied to the DrumStaff. This makes the Devnull-context dispensable. If Devnull is part of some included template, `customTime´ will produce weird output. To avoid it, uncomment the \layout in the code below. -> http://lists.gnu.org/archive/html/lilypond-user/2012-10/msg00654.html \version "2.16.0" % \layout { % \context { % \Devnull % \alias "DrumStaff" % } % } customTime = #(define-music-function (parser location baseline-skip beat-structure frac) (number? (number-list? '()) fraction?) (let* ((num (car frac)) (denom (cdr frac))) #{ \override DrumStaff.TimeSignature #'stencil = #(lambda (grob) (grob-interpret-markup grob #{ \markup %\fontsize #5 \vcenter \override #`(baseline-skip . ,baseline-skip) \column { \number #(number->string num) \number #(number->string denom) } #})) $(make-music 'TimeSignatureMusic 'beat-structure beat-structure 'denominator denom 'numerator num) #})) % test global = { \customTime #3 #'(4 3) 7/8 s2.. \customTime #3 #'(2 2 2 3) 9/8 s8*9 } drumnotes = \drummode { wbl4 wbl wbh4. \repeat "unfold" 3 { wbl4 } wbh4. } somenotes = \relative c' { c4 b c4 d8 e4 e f e8 d c } \score { << %\new Devnull \global \new Staff \somenotes \new DrumStaff \with { \override StaffSymbol #'line-count = #6 } << \global \drumnotes >> >> } For now this is the best I can deliver, I didn't manage to find a scheme-accessable definition for the formating of the default-TimeSignature. There _are_ formating-procedures in time-signature-settings.scm, but they are used in `compoundMeter´ only. Regards, Harm <>___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
2012/10/29 David Kastrup : [...] > I consider it much nicer to make "strg" of type fraction?, and then num > can be (car strg) and denom can be (cdr strg). > > and > >> \spreadTimeSignature #8 "2/4" > > can just be \spreadTimeSignature #8 2/4 ... which is nicer on the eyes. Hi David, thanks for the hint. I overlooked it. -Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
Thomas Morley writes: [...] I know that the discussion has moved beyond the first version, but I still want to point out something: > \version "2.16.0" > > spreadTimeSignature = > #(define-music-function (parser location baselineSkip strg > music)(number? string? ly:music?) > (let* ((num (car (string-split strg #\/))) >(denom (cadr (string-split strg #\/ I consider it much nicer to make "strg" of type fraction?, and then num can be (car strg) and denom can be (cdr strg). and > \spreadTimeSignature #8 "2/4" can just be \spreadTimeSignature #8 2/4 ... which is nicer on the eyes. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
Dear Thomas, thanks very much for Your code, again! The problem is: I would like to have a score with drumstaff and a "normal" staff. And only in the normal Staff shall be a wider time signature. I give you an short example: global = { \time #'(4 3) 7/8 s2.. \time #'(2 2 2 3) 9/8 s8*9 } drumnotes = \drummode { wbl4 wbl wbh4. \repeat "unfold" 3 {wbl4 } wbh4. } somenotes = \relative c' { c4 b c4 d8 e4 e f e8 d c } \score { << \new Devnull \global \new Staff \somenotes \new DrumStaff \with { \override StaffSymbol #'line-count = #6 % \widerTimeSignature #3 % this doesn't work! } { \drumnotes } >> } 2012/10/28 Thomas Morley > 2012/10/28 Stefan Thomas : > > Dear Thomas, > > thanks for Your code! > > I think the code is not the best for my special aim. > > I just want to have a different time-signature style for a custom > percussion > > staff with 6 instead of five lines. > > So, I just would like to change this special thing only in this staff. I > > would like to do this in the "with" block, if possible. > > The timesignatures itself are defined in a global variable. > > > > 2012/10/28 Thomas Morley > >> > >> 2012/10/28 Stefan Thomas : > >> > Dear community, > >> > I would like to know how to enlarge the vertical distance between > >> > enumerator > >> > and denominator of a time signature. > >> > I hope, this will be possible. > >> > > >> > ___ > >> > lilypond-user mailing list > >> > lilypond-user@gnu.org > >> > https://lists.gnu.org/mailman/listinfo/lilypond-user > >> > > >> > >> Hi Stefan, > >> > >> try: > >> > >> \version "2.16.0" > >> > >> spreadTimeSignature = > >> #(define-music-function (parser location baselineSkip strg > >> music)(number? string? ly:music?) > >> (let* ((num (car (string-split strg #\/))) > >>(denom (cadr (string-split strg #\/ > >> #{ > >>\override Staff.TimeSignature #'stencil = > >> #(lambda (grob) > >> (grob-interpret-markup grob > >>#{ > >> \markup %\fontsize #5 > >> \vcenter > >> \override #`(baseline-skip . ,baselineSkip) > >> \column { > >> \number $num > >> \number $denom > >> } > >>#})) > >>$(make-music > >>'TimeSignatureMusic > >>'beat-structure '() > >>'denominator (string->number denom) > >>'numerator (string->number num)) > >> > >>$music > >> #})) > >> > >> % test > >> > >> \relative c' { > >> \spreadTimeSignature #8 "2/4" > >> c8 c c c > >> > >> \spreadTimeSignature #8 "3/4" > >> c16 c c c c c c c c4 > >> } > >> > >> > >> Usage: \spreadTimeSignature # "" > >> > >> Setting \time is integrated in the function. > >> There might arise a problem because of > >> 'beat-structure '() > >> If so, delete > >>$(make-music > >>'TimeSignatureMusic > >>'beat-structure '() > >>'denominator (string->number denom) > >>'numerator (string->number num)) > >> > >>$music > >> and use default \time x/y after the function-call. > >> > >> > >> HTH, > >> Harm > > > > > > How about: > > \version "2.16.0" > > widerTimeSignature = > #(define-music-function (parser location baseline-skip music)(number? > ly:music?) > (let* ((num (number->string (ly:music-property music 'numerator))) > (denom (number->string (ly:music-property music 'denominator > #{ > \override Staff.TimeSignature #'stencil = >#(lambda (grob) > (grob-interpret-markup grob > #{ > \markup > \vcenter > \override #`(baseline-skip . > ,baseline-skip) > \column { > \number $num > \number $denom > } > #})) > $music > #})) > > % test > > global = { > \widerTimeSignature #3 > \time 15/16 > } > > \new DrumStaff \with { > \override StaffSymbol #'line-count = #6 > % \widerTimeSignature #3 > % \time 15/16 > } > > { \global \drummode { bd4 sn bd toml8 toml bd } } > > With the possibility to place \widerTimeSignature in \global or in \with. > Using the latter there's need to write the TimeSignature after > \widerTimeSignature. > > > Cheers, > Harm > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
2012/10/28 Thomas Morley : > 2012/10/28 Stefan Thomas : >> Dear Thomas, >> thanks for Your code! >> I think the code is not the best for my special aim. >> I just want to have a different time-signature style for a custom percussion >> staff with 6 instead of five lines. >> So, I just would like to change this special thing only in this staff. I >> would like to do this in the "with" block, if possible. >> The timesignatures itself are defined in a global variable. >> >> 2012/10/28 Thomas Morley >>> >>> 2012/10/28 Stefan Thomas : >>> > Dear community, >>> > I would like to know how to enlarge the vertical distance between >>> > enumerator >>> > and denominator of a time signature. >>> > I hope, this will be possible. >>> > >>> > ___ >>> > lilypond-user mailing list >>> > lilypond-user@gnu.org >>> > https://lists.gnu.org/mailman/listinfo/lilypond-user >>> > >>> >>> Hi Stefan, >>> >>> try: >>> >>> \version "2.16.0" >>> >>> spreadTimeSignature = >>> #(define-music-function (parser location baselineSkip strg >>> music)(number? string? ly:music?) >>> (let* ((num (car (string-split strg #\/))) >>>(denom (cadr (string-split strg #\/ >>> #{ >>>\override Staff.TimeSignature #'stencil = >>> #(lambda (grob) >>> (grob-interpret-markup grob >>>#{ >>> \markup %\fontsize #5 >>> \vcenter >>> \override #`(baseline-skip . ,baselineSkip) >>> \column { >>> \number $num >>> \number $denom >>> } >>>#})) >>>$(make-music >>>'TimeSignatureMusic >>>'beat-structure '() >>>'denominator (string->number denom) >>>'numerator (string->number num)) >>> >>>$music >>> #})) >>> >>> % test >>> >>> \relative c' { >>> \spreadTimeSignature #8 "2/4" >>> c8 c c c >>> >>> \spreadTimeSignature #8 "3/4" >>> c16 c c c c c c c c4 >>> } >>> >>> >>> Usage: \spreadTimeSignature # "" >>> >>> Setting \time is integrated in the function. >>> There might arise a problem because of >>> 'beat-structure '() >>> If so, delete >>>$(make-music >>>'TimeSignatureMusic >>>'beat-structure '() >>>'denominator (string->number denom) >>>'numerator (string->number num)) >>> >>>$music >>> and use default \time x/y after the function-call. >>> >>> >>> HTH, >>> Harm >> >> > > How about: > > \version "2.16.0" > > widerTimeSignature = > #(define-music-function (parser location baseline-skip music)(number? > ly:music?) > (let* ((num (number->string (ly:music-property music 'numerator))) > (denom (number->string (ly:music-property music 'denominator > #{ > \override Staff.TimeSignature #'stencil = >#(lambda (grob) > (grob-interpret-markup grob > #{ > \markup > \vcenter > \override #`(baseline-skip . ,baseline-skip) > \column { > \number $num > \number $denom > } > #})) > $music > #})) > > % test > > global = { > \widerTimeSignature #3 > \time 15/16 > } > > \new DrumStaff \with { > \override StaffSymbol #'line-count = #6 > % \widerTimeSignature #3 > % \time 15/16 > } > > { \global \drummode { bd4 sn bd toml8 toml bd } } > > With the possibility to place \widerTimeSignature in \global or in \with. > Using the latter there's need to write the TimeSignature after > \widerTimeSignature. > > > Cheers, > Harm Hi again, I forgot one thing: please change \override Staff.TimeSignature #'stencil = ... into \override DrumStaff.TimeSignature #'stencil = ... This will limit the override to the DrumStaff. Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
2012/10/28 Stefan Thomas : > Dear Thomas, > thanks for Your code! > I think the code is not the best for my special aim. > I just want to have a different time-signature style for a custom percussion > staff with 6 instead of five lines. > So, I just would like to change this special thing only in this staff. I > would like to do this in the "with" block, if possible. > The timesignatures itself are defined in a global variable. > > 2012/10/28 Thomas Morley >> >> 2012/10/28 Stefan Thomas : >> > Dear community, >> > I would like to know how to enlarge the vertical distance between >> > enumerator >> > and denominator of a time signature. >> > I hope, this will be possible. >> > >> > ___ >> > lilypond-user mailing list >> > lilypond-user@gnu.org >> > https://lists.gnu.org/mailman/listinfo/lilypond-user >> > >> >> Hi Stefan, >> >> try: >> >> \version "2.16.0" >> >> spreadTimeSignature = >> #(define-music-function (parser location baselineSkip strg >> music)(number? string? ly:music?) >> (let* ((num (car (string-split strg #\/))) >>(denom (cadr (string-split strg #\/ >> #{ >>\override Staff.TimeSignature #'stencil = >> #(lambda (grob) >> (grob-interpret-markup grob >>#{ >> \markup %\fontsize #5 >> \vcenter >> \override #`(baseline-skip . ,baselineSkip) >> \column { >> \number $num >> \number $denom >> } >>#})) >>$(make-music >>'TimeSignatureMusic >>'beat-structure '() >>'denominator (string->number denom) >>'numerator (string->number num)) >> >>$music >> #})) >> >> % test >> >> \relative c' { >> \spreadTimeSignature #8 "2/4" >> c8 c c c >> >> \spreadTimeSignature #8 "3/4" >> c16 c c c c c c c c4 >> } >> >> >> Usage: \spreadTimeSignature # "" >> >> Setting \time is integrated in the function. >> There might arise a problem because of >> 'beat-structure '() >> If so, delete >>$(make-music >>'TimeSignatureMusic >>'beat-structure '() >>'denominator (string->number denom) >>'numerator (string->number num)) >> >>$music >> and use default \time x/y after the function-call. >> >> >> HTH, >> Harm > > How about: \version "2.16.0" widerTimeSignature = #(define-music-function (parser location baseline-skip music)(number? ly:music?) (let* ((num (number->string (ly:music-property music 'numerator))) (denom (number->string (ly:music-property music 'denominator #{ \override Staff.TimeSignature #'stencil = #(lambda (grob) (grob-interpret-markup grob #{ \markup \vcenter \override #`(baseline-skip . ,baseline-skip) \column { \number $num \number $denom } #})) $music #})) % test global = { \widerTimeSignature #3 \time 15/16 } \new DrumStaff \with { \override StaffSymbol #'line-count = #6 % \widerTimeSignature #3 % \time 15/16 } { \global \drummode { bd4 sn bd toml8 toml bd } } With the possibility to place \widerTimeSignature in \global or in \with. Using the latter there's need to write the TimeSignature after \widerTimeSignature. Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
Dear Thomas, thanks for Your code! I think the code is not the best for my special aim. I just want to have a different time-signature style for a custom percussion staff with 6 instead of five lines. So, I just would like to change this special thing only in this staff. I would like to do this in the "with" block, if possible. The timesignatures itself are defined in a global variable. 2012/10/28 Thomas Morley > 2012/10/28 Stefan Thomas : > > Dear community, > > I would like to know how to enlarge the vertical distance between > enumerator > > and denominator of a time signature. > > I hope, this will be possible. > > > > ___ > > lilypond-user mailing list > > lilypond-user@gnu.org > > https://lists.gnu.org/mailman/listinfo/lilypond-user > > > > Hi Stefan, > > try: > > \version "2.16.0" > > spreadTimeSignature = > #(define-music-function (parser location baselineSkip strg > music)(number? string? ly:music?) > (let* ((num (car (string-split strg #\/))) >(denom (cadr (string-split strg #\/ > #{ >\override Staff.TimeSignature #'stencil = > #(lambda (grob) > (grob-interpret-markup grob >#{ > \markup %\fontsize #5 > \vcenter > \override #`(baseline-skip . ,baselineSkip) > \column { > \number $num > \number $denom > } >#})) >$(make-music >'TimeSignatureMusic >'beat-structure '() >'denominator (string->number denom) >'numerator (string->number num)) > >$music > #})) > > % test > > \relative c' { > \spreadTimeSignature #8 "2/4" > c8 c c c > > \spreadTimeSignature #8 "3/4" > c16 c c c c c c c c4 > } > > > Usage: \spreadTimeSignature # "" > > Setting \time is integrated in the function. > There might arise a problem because of > 'beat-structure '() > If so, delete >$(make-music >'TimeSignatureMusic >'beat-structure '() >'denominator (string->number denom) >'numerator (string->number num)) > >$music > and use default \time x/y after the function-call. > > > HTH, > Harm > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: enlarge vertical distance in time signature
2012/10/28 Stefan Thomas : > Dear community, > I would like to know how to enlarge the vertical distance between enumerator > and denominator of a time signature. > I hope, this will be possible. > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > Hi Stefan, try: \version "2.16.0" spreadTimeSignature = #(define-music-function (parser location baselineSkip strg music)(number? string? ly:music?) (let* ((num (car (string-split strg #\/))) (denom (cadr (string-split strg #\/ #{ \override Staff.TimeSignature #'stencil = #(lambda (grob) (grob-interpret-markup grob #{ \markup %\fontsize #5 \vcenter \override #`(baseline-skip . ,baselineSkip) \column { \number $num \number $denom } #})) $(make-music 'TimeSignatureMusic 'beat-structure '() 'denominator (string->number denom) 'numerator (string->number num)) $music #})) % test \relative c' { \spreadTimeSignature #8 "2/4" c8 c c c \spreadTimeSignature #8 "3/4" c16 c c c c c c c c4 } Usage: \spreadTimeSignature # "" Setting \time is integrated in the function. There might arise a problem because of 'beat-structure '() If so, delete $(make-music 'TimeSignatureMusic 'beat-structure '() 'denominator (string->number denom) 'numerator (string->number num)) $music and use default \time x/y after the function-call. HTH, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
enlarge vertical distance in time signature
Dear community, I would like to know how to enlarge the vertical distance between enumerator and denominator of a time signature. I hope, this will be possible. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user