Re: aleatoric box / frameEngraver
Hi, On Wed, Sep 25, 2013 at 9:26 AM, Mazzafrustu 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
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
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" 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
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" 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
"Karol Majewski" 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
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= (length siblings) 2) (eq? grob (first siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil X LEFT protrusion (- blot ;; Right edge: (if (or (and (>= (length siblings) 2) (eq? grob (last siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil X RIGHT protrusion (- blot ;; Text is only added to the first piece of a broken bracket. Possibly ;; the text should be added in parentheses to the pieces (as in a measure ;; count). 0.5 is a hardcoded padding value which controls the separation ;; between the text and the bracket. (if (or (and (>= (length siblings) 2) (eq? grob (first siblings))) (< (length siblings) 2)) (set! stil (ly:stencil-combine-at-edge stil Y dir text (* 0.5 staff-space stil)) % PURE HEIGHT ESTIMATION %%% % A pure height function is necessary so that the FrameBracket is taken into % account in page-breaking decisions. Without this function, the spacing engine % will fit too many systems on the page. The result is that an error will be % returned and the music will be compressed (regardless of collisions). #(define (frame-bracket-interface::pure-height grob start end) (let* ((text (ly:grob-property grob 'text (markup #:null))) (staff-space (ly:staff-symbol-staff-space grob)) (padding (* (ly:grob-property grob 'padding) staff-space)) (text-padding (* 0.5 staff-space)) ; distance between bracket and text ;; height of bracket "wings" (edge-height (* 1.0 staff-space)) (text-stil (grob-interpret-markup grob (markup text))) (text-stil-ext (ly:stencil-extent text-stil Y))) (cons (- (+ edge-height padding)) (+ text-padding (interval-length text-stil-ext) % ADD NEW GROB DEFINITIONS % #(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))
Re: aleatoric box / frameEngraver
Hi, On Mon, Jul 29, 2013 at 12:41 PM, David Nalesnik wrote: > Hi Karol, > > > On Sat, Jul 20, 2013 at 6:57 AM, Karol Majewski 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 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 Majewskiwrote: 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
Hi Karol, Harm-- On Mon, Jul 15, 2013 at 5:56 AM, Karol Majewski 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
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 symbolhttps://lists.gnu.org/mailman/listinfo/lilypond-user
Re: aleatoric box / frameEngraver
2013/7/14 Karol Majewski : > 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
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/13 Karol Majewski : > 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
Odp: aleatoric box / frameEngraver
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. Dnia 13-07-2013 o godz. 13:45 Karol Majewski napisał(a): > Hi again. This time i'm trying to modify frameEngraver written by David > Nalesnik (Big thanks). I'm using 2.16.2 version of LilyPond and > frameEngraver8.ly, which you can find here: > > http://lilypond.1069038.n5.nabble.com/attachment/139396/0/frameEngraver8.ly > > So, what I'm trying to achieve is to replace the frame with repeat > signs, so that you have: > > |: music :|---> > > This is so called indipendent repetition and it's very common in > contemporary music. > > I have no idea how to do this. Any Any ideas would be greatly > appreciated... > > > > > ___ > 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
aleatoric box / frameEngraver
Hi again. This time i'm trying to modify frameEngraver written by David Nalesnik (Big thanks). I'm using 2.16.2 version of LilyPond and frameEngraver8.ly, which you can find here: http://lilypond.1069038.n5.nabble.com/attachment/139396/0/frameEngraver8.ly So, what I'm trying to achieve is to replace the frame with repeat signs, so that you have: |: music :|---> This is so called indipendent repetition and it's very common in contemporary music. I have no idea how to do this. Any Any ideas would be greatly appreciated... ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user