Re: aleatoric box / frameEngraver
Hi, On Wed, Sep 25, 2013 at 9:26 AM, Mazzafrustu mazzafru...@gmail.com wrote: Hi all, is it possible to use the frame Engraver in a cross-staff situation, like piano or (like in my situation) marimba? I wrote the marimba part using the \change Staff lines. No, unfortunately not at this time. (If I remember correctly, there are problems with the placement of the timing bracket.) [By the way, if you're replying to a digest, please do edit out all the irrelevant content. Thanks!] --David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Hi, just found a small bug in frameEngraver-bars-and-boxes.ly. When the main *.ly file includes more than one *.ly file, like: \include "1.ly"\include "2.ly" ... and each of those files (1.ly, 2.ly) includes frameEngraver-bars-and-boxes.ly, then I cannot compile the main.ly, because of: fatal error: Cannot redefine event class `frame-event' \include 1.ly \include 2.ly \include frameEngraver-bars-and-boxes.ly\include frameEngraver-bars-and-boxes.ly %\version 2.17.23 % Uncomment the following line to show the skylines. %#(ly:set-option 'debug-skylines) %#(set-global-staff-size 10) % Note: In order to prevent bleed-over from one session to another, it is % recommended that .ly files using the following functions be processed % individually (rather than in a batch). %%% CREATE NEW EVENT CLASSES %%% % NOTE: The following definitions work as of version 2.17.22. If you are using % an earlier version, please see % https://codereview.appspot.com/10965043/diff/8001/input/regression/scheme-text-spanner.ly % to make necessary changes. #(define-event-class 'frame-event 'span-event) #(define-event-class 'frame-extender-event 'span-event) %% MUSIC DESCRIPTIONS %% #(define frame-types '( (FrameEvent . ((description . Signals where a frame starts and stops.) (types . (general-music frame-event span-event event)) )) )) #(define frame-extender-types '( (FrameExtenderEvent . ((description . Signals where a frame extender line stops.) (types . (general-music frame-extender-event span-event event)) )) )) #(for-each (lambda (x) (set! x (map (lambda (x) (set-object-property! (car x) 'music-description (cdr (assq 'description (cdr x (let ((lst (cdr x))) (set! lst (assoc-set! lst 'name (car x))) (set! lst (assq-remove! lst 'description)) (hashq-set! music-name-to-property-table (car x) lst) (cons (car x) lst))) x)) (set! music-descriptions (append x music-descriptions))) (list frame-types frame-extender-types)) #(set! music-descriptions (sort music-descriptions alist?)) % ADD NEW GROB INTERFACES %% #(ly:add-interface 'frame-interface A box for frame notation. '(frame-elements)) #(ly:add-interface 'frame-extender-interface An extender line (with arrow) for frame notation. '(frame)) #(ly:add-interface 'frame-bracket-interface A bracket with text (possibly to indicate duration) for frame notation. '(bracket-elements columns edge-height extender no-bracket side-support-elements)) #(ly:add-interface 'frame-stub-interface A stub for horizontal spacing of frames. '(no-arrowhead elements frame)) % CREATE NEW GROB PROPERTIES %%% #(define (define-grob-property symbol type? description) (if (not (equal? (object-property symbol 'backend-doc) #f)) (ly:error (_ symbol ~S redefined) symbol)) (set-object-property! symbol 'backend-type? type?) (set-object-property! symbol 'backend-doc description) symbol) #(map (lambda (x) (apply define-grob-property x)) `( (extender-Y-offset ,number? Vertical displacement of extender line from center staff line) (no-arrowhead ,boolean? If #t, do not draw an arrowhead on a frame extender line. Default is #f.) (no-bracket ,boolean? If #t, do not draw bracket in frame notation. Default is #f.) (repeat-barlines ,boolean? If #t, use repeat barlines in frame notation. Otherwise, use boxes.) )) WIDTH/HEIGHT FUNCTIONS % Thanks to Mike Solomon for explanations and code. % The following functions calculate dimensions for those grobs which have % stencils: Frame, FrameExtender, and FrameBracket. Grobs with stencils % should not use the 'axis-group-interface for calculating height and width. % Relevant grobs have been stored in arrays other than 'elements, which % is the grob-array used by the axis-group-interface for its calculations. #(define (dim-hack grob ax) (let* ((frame-elts (ly:grob-object grob 'frame-elements)) (common (ly:grob-common-refpoint-of-array grob frame-elts ax)) (rel (ly:relative-group-extent frame-elts common ax)) (off (ly:grob-relative-coordinate grob common ax))) ;(format #t rel-~a: ~a off: ~a~% ax rel off) (coord-translate rel (- off #(define (height-hack grob) (dim-hack grob Y)) #(define (width-hack grob) (dim-hack grob X)) #(define (bracket-width grob) (let* ((bracket-elts (ly:grob-object grob 'bracket-elements)) (common (ly:grob-common-refpoint-of-array
Re: aleatoric box / frameEngraver
Karol Majewski karo...@wp.pl writes: Hi, just found a small bug in frameEngraver-bars-and-boxes.ly. When the main *.ly file includes more than one *.ly file, like: \include 1.ly \include 2.ly ... and each of those files (1.ly, 2.ly) includes frameEngraver-bars-and-boxes.ly, then I cannot compile the main.ly, because of: Why should one be able to include the code in frameEngraver-bars-and-boxes.ly twice in a single document? -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Let's say I work on two pieces of music: piece-one.ly and piece-two.ly. Each of them has some files included, like deutsch.ly or frameEngraver-bars-and-boxes.ly. Now I want to combine both files into one PDF document. To achieve this, I create a new *.ly file (main.ly) which has piece-one.ly and piece-two.ly included. And now the error happens. Of course, I can exclude frameEngraver-bars-and-boxes.ly from piece-one.ly and piece-two.ly and include it into main.ly. But then... if I want to compile piece-one.ly separetly - I have to include it again. The point is that it is not comfortable to repeat this process again and again. Dnia 11-08-2013 o godz. 17:30 David Kastrup napisał(a): Karol Majewski karo...@wp.pl writes: Hi, just found a small bug in frameEngraver-bars-and-boxes.ly. When the main *.ly file includes more than one *.ly file, like: \include 1.ly \include 2.ly ... and each of those files (1.ly, 2.ly) includes frameEngraver-bars-and-boxes.ly, then I cannot compile the main.ly, because of: Why should one be able to include the code in frameEngraver-bars-and-boxes.ly twice in a single document? -- David Kastrup ___ 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: aleatoric box / frameEngraver
Am 11.08.2013 19:13, schrieb Karol Majewski: Let's say I work on two pieces of music: piece-one.ly and piece-two.ly. Each of them has some files included, like deutsch.ly or frameEngraver-bars-and-boxes.ly. Now I want to combine both files into one PDF document. To achieve this, I create a new *.ly file (main.ly) which has piece-one.ly and piece-two.ly included. And now the error happens. Of course, I can exclude frameEngraver-bars-and-boxes.ly from piece-one.ly and piece-two.ly and include it into main.ly. But then... if I want to compile piece-one.ly separetly - I have to include it again. The point is that it is not comfortable to repeat this process again and again. In such a case you can - define an arbitrary variable in frameEngraver-bars-and-boxes.ly - write a function that only includes that file if the variable isn't defined yet. HTH Urs Dnia 11-08-2013 o godz. 17:30 David Kastrup napisał(a): Karol Majewski karo...@wp.pl writes: Hi, just found a small bug in frameEngraver-bars-and-boxes.ly. When the main *.ly file includes more than one *.ly file, like: \include 1.ly \include 2.ly ... and each of those files (1.ly, 2.ly) includes frameEngraver-bars-and-boxes.ly, then I cannot compile the main.ly, because of: Why should one be able to include the code in frameEngraver-bars-and-boxes.ly twice in a single document? -- David Kastrup ___ 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 ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
How would the code for that function look? I can't quite picture what you mean. Thanks! Am 11.08.2013 19:13, schrieb Karol Majewski: Let's say I work on two pieces of music: piece-one.ly and piece-two.ly. Each of them has some files included, like deutsch.ly or frameEngraver-bars-and-boxes.ly. Now I want to combine both files into one PDF document. To achieve this, I create a new *.ly file (main.ly) which has piece-one.ly and piece-two.ly included. And now the error happens. In such a case you can - define an arbitrary variable in frameEngraver-bars-and-boxes.ly - *write a function that only includes that file if the variable isn't defined yet.* HTH Urs - composer | sound designer -- View this message in context: http://lilypond.1069038.n5.nabble.com/aleatoric-box-frameEngraver-tp147962p149010.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: aleatoric box / frameEngraver
Hi, On Mon, Jul 29, 2013 at 12:41 PM, David Nalesnik david.nales...@gmail.comwrote: Hi Karol, On Sat, Jul 20, 2013 at 6:57 AM, Karol Majewski karo...@wp.pl wrote: OK, so have repeat signs in \markup \Score. Now I need the extender. How can I modify David's function to start the extender without frame? For example: c'4 \extenderStart s4*2 \extenderStop Again, I think the best course of action here is not to omit the frame; rather, you would replace the frame with repeat-bar stencils. The problem that I'm facing is that I can't find a convenient function in the barline interface to produce a barline stencil. It's possible to quote massive portions of scm\bar-line.scm in the .ly file and then make some adaptations to the print function for Frame and the width function for FrameStub (see the latest version of the file at http://www.mail-archive.com/lilypond-user@gnu.org/msg83197/frameEngraver25.ly). That works, but it's just too awful. The attached file will let you do the aleatoric notation with repeat barlines without resorting to wholesale copying (or adding things to the end of scm\bar-line.scm). The barlines have been recreated. They are scaleable. There are now two options available with the same file: box notation, or repeat-barline notation. Boxes are the default. You can select barlines like so: \override Frame.repeat-barlines = ##t Both can be used in the same file, successively or simultaneously in different staves. Because it's so long, I've put the engraver in a file to be included. HTH, David frameEngraver-bars-and-boxes.ily Description: Binary data frameEngraver-boxes-and-repeats-example.ly Description: Binary data ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Hi Karol, On Sat, Jul 20, 2013 at 6:57 AM, Karol Majewski karo...@wp.pl wrote: OK, so have repeat signs in \markup \Score. Now I need the extender. How can I modify David's function to start the extender without frame? For example: c'4 \extenderStart s4*2 \extenderStop Again, I think the best course of action here is not to omit the frame; rather, you would replace the frame with repeat-bar stencils. The problem that I'm facing is that I can't find a convenient function in the barline interface to produce a barline stencil. It's possible to quote massive portions of scm\bar-line.scm in the .ly file and then make some adaptations to the print function for Frame and the width function for FrameStub (see the latest version of the file at http://www.mail-archive.com/lilypond-user@gnu.org/msg83197/frameEngraver25.ly). That works, but it's just too awful. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Dnia 15-07-2013 o godz. 13:54 David Nalesnik napisał(a): Hi Karol, Harm-- On Mon, Jul 15, 2013 at 5:56 AM, Karol Majewski karo...@wp.pl wrote: Sorry, Thomas... I forgot to mention that I want to place repeat signs in the middle of the bar! Mea culpa. That's why at first I tried to modify frameEngraver. It would be great to have something like: \repeatStart c'4 d' e' \repeatStop s4*3 \repeatExtenderStop I believe this would be a matter of revising the stencil function which creates the box to draw two repeat bar lines instead. This, hopefully, is workable without building the bar lines up from scratch. Here is function that I try to modify: [BTW, I've been working at this, and added some features to what you're quoting here: a bracket for indicating timing, and the possibility of breaking the whole affair across lines. I'll try to post it later today with some comments about problems. I'm at my wit's end with it, so I'd welcome any help anyone could offer.] --David OK, so have repeat signs in \markup \Score. Now I need the extender. How can I modify David's function to start the extender without frame? For example: c'4 \extenderStart s4*2 \extenderStop Thanks in advance! ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Sorry, Thomas... I forgot to mention that I want to place repeat signs in the middle of the bar! Mea culpa. That's why at first I tried to modify frameEngraver. It would be great to have something like: \repeatStart c'4 d' e' \repeatStop s4*3 \repeatExtenderStop Here is function that I try to modify: \version 2.16.2 #(define my-grob-descriptions '()) #(define my-event-classes (ly:make-context-mod)) defineEventClass = #(define-void-function (parser location class parent) (symbol? symbol?) (ly:add-context-mod my-event-classes `(apply ,(lambda (context class parent) (ly:context-set-property! context 'EventClasses (event-class-cons class parent (ly:context-property context 'EventClasses '() ,class ,parent))) \defineEventClass #'frame-event #'span-event \defineEventClass #'frame-extender-event #'span-event #(define (add-grob-definition grob-name grob-entry) (let* ((meta-entry (assoc-get 'meta grob-entry)) (class (assoc-get 'class meta-entry)) (ifaces-entry (assoc-get 'interfaces meta-entry))) (set-object-property! grob-name 'translation-type? list?) (set-object-property! grob-name 'is-grob? #t) (set! ifaces-entry (append (case class ((Item) '(item-interface)) ((Spanner) '(spanner-interface)) ((Paper_column) '((item-interface paper-column-interface))) ((System) '((system-interface spanner-interface))) (else '(unknown-interface))) ifaces-entry)) (set! ifaces-entry (uniq-list (sort ifaces-entry symbol?))) (set! ifaces-entry (cons 'grob-interface ifaces-entry)) (set! meta-entry (assoc-set! meta-entry 'name grob-name)) (set! meta-entry (assoc-set! meta-entry 'interfaces ifaces-entry)) (set! grob-entry (assoc-set! grob-entry 'meta meta-entry)) (set! my-grob-descriptions (cons (cons grob-name grob-entry) my-grob-descriptions #(define (define-grob-property symbol type? description) (if (not (equal? (object-property symbol 'backend-doc) #f)) (ly:error (_ symbol ~S redefined) symbol)) (set-object-property! symbol 'backend-type? type?) (set-object-property! symbol 'backend-doc description) symbol) #(map (lambda (x) (apply define-grob-property x)) `((extend-line ,number? offset to endpoint of frame extender line) (extra-padding ,pair? extra room on left and right of frame) (extender-Y-offset ,number? vertical displacement of extender line from center staff line))) #(define frame-types '((FrameEvent . ((description . Used to signal where frames start and stop.) (types . (general-music frame-event span-event event)) #(define frame-extender-types '((FrameExtenderEvent . ((description . Used to signal where a frame extender line stops.) (types . (general-music frame-extender-event span-event event)) #(set! frame-types (map (lambda (x) (set-object-property! (car x) 'music-description (cdr (assq 'description (cdr x (let ((lst (cdr x))) (set! lst (assoc-set! lst 'name (car x))) (set! lst (assq-remove! lst 'description)) (hashq-set! music-name-to-property-table (car x) lst) (cons (car x) lst))) frame-types)) #(set! frame-extender-types (map (lambda (x) (set-object-property! (car x) 'music-description (cdr (assq 'description (cdr x (let ((lst (cdr x))) (set! lst (assoc-set! lst 'name (car x))) (set! lst (assq-remove! lst 'description)) (hashq-set! music-name-to-property-table (car x) lst) (cons (car x) lst))) frame-extender-types)) #(set! music-descriptions (append frame-types music-descriptions)) #(set! music-descriptions (append frame-extender-types music-descriptions)) #(set! music-descriptions (sort music-descriptions alist?)) #(define (frame-stencil grob) Draw a box around a group of notes for use in frame notation. (let* ((elts (ly:grob-object grob 'elements)) (box-padding (ly:grob-property grob 'padding)) (extra-padding (ly:grob-property grob 'extra-padding)) (padding-L (car extra-padding)) (padding-R (cdr extra-padding)) (height (ly:axis-group-interface::height grob)) (axis-group-width (ly:axis-group-interface::width grob)) (axis-group-width (coord-translate axis-group-width (cons padding-L padding-R))) (stencil (ly:make-stencil '() axis-group-width
Re: aleatoric box / frameEngraver
Hi Karol, Harm-- On Mon, Jul 15, 2013 at 5:56 AM, Karol Majewski karo...@wp.pl wrote: Sorry, Thomas... I forgot to mention that I want to place repeat signs in the middle of the bar! Mea culpa. That's why at first I tried to modify frameEngraver. It would be great to have something like: \repeatStart c'4 d' e' \repeatStop s4*3 \repeatExtenderStop I believe this would be a matter of revising the stencil function which creates the box to draw two repeat bar lines instead. This, hopefully, is workable without building the bar lines up from scratch. Here is function that I try to modify: [BTW, I've been working at this, and added some features to what you're quoting here: a bracket for indicating timing, and the possibility of breaking the whole affair across lines. I'll try to post it later today with some comments about problems. I'm at my wit's end with it, so I'd welcome any help anyone could offer.] --David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
2013/7/13 Karol Majewski karo...@wp.pl: OK, so now I'm playing with \set Score.repeatCommands = #'(start-repeat). The big question is: how can I apply repeat sign only to one staff inside PianoStaff. \set Staff.repeatCommands = #'(start-repeat) does not work. Hi Karol, how about \version 2.17.21 \layout { \context { \Score \remove Timing_translator \remove Default_bar_line_engraver \remove Repeat_acknowledge_engraver } \context { \Staff \consists Timing_translator \consists Default_bar_line_engraver \consists Repeat_acknowledge_engraver } } \new ChoirStaff \with { systemStartDelimiter = #'SystemStartBrace } \relative c' \new Staff { \time 3/4 c4 c c | \repeat volta 2 { c4 c c | } } \new Staff { \time 2/4 c4 c | \repeat volta 2 { c4 c | } c4 c | \bar |. } \new Staff { \time 3/8 c4. | \repeat volta 2 { c8 c c | c4. | c8 c c | } } Taken from NR 1.2.3 Displaying rhythms - Polymetric notation http://lilypond.org/doc/v2.17/Documentation/notation/displaying-rhythms#polymetric-notation slightly modified. HTH, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
Yes, I tried that before. The point is that I don't want move these engravers, because it messes up the score (no bar numbers, some bar lines missing). Need some other way to insert those repeat signs. I can always put them in \markup { \score } and move them via extra-offset, but maybe there is simpler way? Hi Karol, how about \version 2.17.21 \layout { \context { \Score \remove Timing_translator \remove Default_bar_line_engraver \remove Repeat_acknowledge_engraver } \context { \Staff \consists Timing_translator \consists Default_bar_line_engraver \consists Repeat_acknowledge_engraver } } \new ChoirStaff \with { systemStartDelimiter = #'SystemStartBrace } \relative c' \new Staff { \time 3/4 c4 c c | \repeat volta 2 { c4 c c | } } \new Staff { \time 2/4 c4 c | \repeat volta 2 { c4 c | } c4 c | \bar |. } \new Staff { \time 3/8 c4. | \repeat volta 2 { c8 c c | c4. | c8 c c | } } Taken from NR 1.2.3 Displaying rhythms - Polymetric notation http://lilypond.org/doc/v2.17/Documentation/notation/displaying-rhythms#polymetric-notation slightly modified. HTH, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
2013/7/14 Karol Majewski karo...@wp.pl: Yes, I tried that before. The point is that I don't want move these engravers, because it messes up the score (no bar numbers, some bar lines missing). Need some other way to insert those repeat signs. I can always put them in \markup { \score } and move them via extra-offset, but maybe there is simpler way? [..] Perhaps with the code below: \version 2.16.2 % For 2.17.21 change glyphs: % .|: for the starting repeat-sign, % :|. for the ending repeat-sign. startSingleStaffRepeat = { % Some effort needed to make it work. % The simple command % @samp{\\once \\override Staff.BarLine #'glyph-name = #:|} % doesn't work sufficient. \once \override Staff.BarLine #'break-visibility = ##(#t #t #t) \once \override Staff.BarLine #'before-line-breaking = #(lambda (grob) (ly:grob-set-property! grob 'glyph |:)) } stopSingleStaffRepeat = { \once \override Staff.BarLine #'glyph-name = #:| } \new PianoStaff \relative c' \new Staff { \time 3/4 % We need to set the SpanBar-glyph, otherwise the BarLine-glyph from % the bottom-Staff would determine the SpanBar-glyph. \override PianoStaff.SpanBar #'glyph-name = #| \startSingleStaffRepeat c4 c c| \stopSingleStaffRepeat c4 c c| c4 c c| \break \startSingleStaffRepeat c4 c c| \stopSingleStaffRepeat c4 c c| c4 c c| } \new Staff { \time 3/4 c4 c c | \startSingleStaffRepeat c4 c c | \stopSingleStaffRepeat c4 c c | \break c4 c c | \startSingleStaffRepeat c4 c c | \stopSingleStaffRepeat c4 c c | } \new Staff \repeat unfold 2 { c4 c c | c4 c c | \startSingleStaffRepeat c4 c c | \stopSingleStaffRepeat } Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user