Re: partcombine/divisi framework - let the fun begin!

2014-09-07 Thread Janek Warchoł
Hi,

2014-09-01 23:38 GMT+02:00 Keith OHara k-ohara5...@oco.net:
 On Sat, 30 Aug 2014 04:41:15 -0700, Janek Warchoł janek.lilyp...@gmail.com
 wrote:

 2014-08-29 8:53 GMT+02:00 Keith OHara k-ohara5...@oco.net:

 But if someone uses these definitions with music that uses tags for
 some other purpose, the tagged music will be left out.

 Hmm.  That's a problem, but i don't see a good solution yet.


 Simon's suggestion to use the more-selective \removeWithTag is a good
 solution.
 Just in case anyone uses the \divisibleStaff with his own tags, and might
 not think to include 'together in \keepWithTag score \divisibleStaff ... , I
 added a function to clean up the divI/divII/together tags when we are done
 with them.  These two changes are attached.

Thanks!  I have merged your changes with ensuring synchronization
that you suggested.  Code attached; it's also now available in
OpenLilyLib: 
https://github.com/openlilylib/openlilylib/tree/master/notation-snippets/divisi

best (and sorry for long reply),
Janek
\version 2.16.2 % absolutely necessary!

\header {
  snippet-title = Example snippet
  snippet-author = John Doe
  snippet-source = link to the mailing list archives or a website, if applicable
  snippet-description = \markup {
Briefly describe what the snippet does and how to use it.
  }
  % add comma-separated tags to make searching more effective:
  tags = 
  % is this snippet ready?  See meta/status-values.md
  status = 
}

%%
% here goes the snippet: %
%%

red = {
  % color the next note red
  \once \override NoteHead #'color = #red
  \once \override Stem #'color = #red
  \once \override Flag #'color = #red
}
\version 2.16.2

\include ./definitions.ily


% This example shows how snippet-name can be used.
% The implementation of the snippet is in the file
% `definitions.ily`.
% Documentation (if any) should be in `README.md`.

\markup Color a note red:
{
  d' \red d'( d')
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-09-01 Thread Keith OHara

The development version 2.19.13 with the expanded remove-staves capability is 
now available.

On Sat, 30 Aug 2014 04:41:15 -0700, Janek Warchoł janek.lilyp...@gmail.com 
wrote:

2014-08-29 8:53 GMT+02:00 Keith OHara k-ohara5...@oco.net:


But if someone uses these definitions with music that uses tags for
some other purpose, the tagged music will be left out.


Hmm.  That's a problem, but i don't see a good solution yet.


Simon's suggestion to use the more-selective \removeWithTag is a good solution.
Just in case anyone uses the \divisibleStaff with his own tags, and might not 
think to include 'together in \keepWithTag score \divisibleStaff ... , I added 
a function to clean up the divI/divII/together tags when we are done with them. 
 These two changes are attached.

I see now that the clean-up function I had to add was already available among several 
useful tag filters from  http://lsr.di.unimi.it/LSR/Item?id=871

Users of these definitions, with music that uses \tag#'part for example, need 
to adapt their \keepWithTag if they want to separate out the 'divI part, and 
also keep whatever they have tagged with 'part: \keepWithTag divI.part 
\music\version 2.19.13

\include definitions.ily

\layout {
  short-indent = 2\cm
  indent = 2\cm
  line-width = 10\cm
}

music = {
  \together
  c'4 d' e' f'
  
\tag#'score { s_\markup\italic balance with winds }
\sharedStems
  { a'4 f' a' g' }
  { f' d' f' e' }
  
  \voiceDivisi {
g' b' d' b'
d'' b' g' b'-\tag#'part \upbow
  }
  {
g'4 e' g' e'
b' g' b' g'-\tag#'part \upbow
  }
  
\tag#'editorial {s4\ s s s\f }
\tag#'score { s_\markup\italic balance  }
\staffDivisi
  { a' f'' g' q b' }
  { a' e' b' e'' a' q }
  
  \together
  c' d' e' f'
  \soloI { g' b' d' b' }
  \together
  f' a' d' f' f' a' e' g'
  f' e' d' c'
}

\markup \bold { Violin I part: }
\new Staff \with {
  instrumentName = Violin I
  shortInstrumentName = V I
} \keepWithTag divI.editorial.part \music

\markup \bold { Violin II part: }
\new Staff \with {
  instrumentName = Violin II
  shortInstrumentName = V II
} \keepWithTag divII.editorial.part \music

\markup \bold { Combined: }
\keepWithTag editorial.score \divisibleStaff Violin \music


definitions.ily
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-08-30 Thread Janek Warchoł
2014-08-29 8:53 GMT+02:00 Keith OHara k-ohara5...@oco.net:
 Janek Warchoł janek.lilypond at gmail.com writes:

 I'm working on putting together a set of functions for handling parts
 that split into multiple voices and/or staves


 Attachment (definitions.ily): text/x-lilypond, 2359 bytes
 Attachment (example.ly): text/x-lilypond, 825 bytes
 Attachment (example.pdf): application/pdf, 33 KiB

 I like the way 'definitions.ily' uses  parallel music constructions
 to ensure that the parts re-synchronize even if there is a note missing
 in the input.

 You should do something similar for the \together segments.

Ok, will do.

 As you have it now, the together segments are un-tagged, so are included
 in all three staves (two of which are not printed).
 But if someone uses these definitions with music that uses tags for
 some other purpose, the tagged music will be left out.

Hmm.  That's a problem, but i don't see a good solution yet.
best,
Janek

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-08-30 Thread Simon Albrecht


Am 29.08.2014 um 08:53 schrieb Keith OHara:

Janek Warchoł janek.lilypond at gmail.com writes:


I'm working on putting together a set of functions for handling parts
that split into multiple voices and/or staves



Attachment (definitions.ily): text/x-lilypond, 2359 bytes
Attachment (example.ly): text/x-lilypond, 825 bytes
Attachment (example.pdf): application/pdf, 33 KiB

I like the way 'definitions.ily' uses  parallel music constructions
to ensure that the parts re-synchronize even if there is a note missing
in the input.

You should do something similar for the \together segments.
As you have it now, the together segments are un-tagged, so are included
in all three staves (two of which are not printed).
But if someone uses these definitions with music that uses tags for
some other purpose, the tagged music will be left out.
A problem which always comes up when trying to use tags in more than one 
layer. A workaround is the use of \removeWithTag in place of 
\keepWithTag, e.g. replace

\keepWithTag together.part
by
\removeWithTag divI.divII.score
, if you understand what I mean. (in complex projects, finding the right 
solution so all the included files and tags and layout definitions etc. 
work together well is likely a headache; but when the solution finally 
is there and it compiles as it should, relief is great...)


Or is it worth a thought to add support for different layers of tagging? 
For example

- \tag, \tagA and \tagB  or
- \tag 1 foo and \tag 2 bar (optional third argument).

Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-08-30 Thread Keith OHara
Simon Albrecht simon.albrecht at mail.de writes:

 Am 29.08.2014 um 08:53 schrieb Keith OHara:

  You should do something similar for the \together segments.
  As you have it now, the together segments are un-tagged, so are
  included in all three staves (two of which are not printed).

Oops. We need the 'together' segments to be included in all three staves,
so it is printed (twice) if the music is set on a wide page where
'together' segments are on the same line as separate-staff divisi.


  But if someone uses these definitions with music that uses tags for
  some other purpose, the tagged music will be left out.

 A problem which always comes up when trying to use tags in more than one 
 layer. A workaround is the use of \removeWithTag in place of 
 \keepWithTag, e.g. replace
\keepWithTag together
 by
\removeWithTag divI.divII

Yes. That method will at least preserve music that the user has tagged
for some other purpose, and it co-exists with \removeWithTag for other
purposes.

The way \keepWithTag keeps completely untagged music is convenient, but
quickly causes trouble if we use tags for other purposes.  I see there 
is an enhancement request already 
https://code.google.com/p/lilypond/issues/detail?id=4083



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-08-29 Thread Keith OHara
Janek Warchoł janek.lilypond at gmail.com writes:

 I'm working on putting together a set of functions for handling parts
 that split into multiple voices and/or staves


 Attachment (definitions.ily): text/x-lilypond, 2359 bytes
 Attachment (example.ly): text/x-lilypond, 825 bytes
 Attachment (example.pdf): application/pdf, 33 KiB

I like the way 'definitions.ily' uses  parallel music constructions
to ensure that the parts re-synchronize even if there is a note missing
in the input.  

You should do something similar for the \together segments.
As you have it now, the together segments are un-tagged, so are included
in all three staves (two of which are not printed).
But if someone uses these definitions with music that uses tags for 
some other purpose, the tagged music will be left out.







___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


partcombine/divisi framework - let the fun begin!

2014-08-28 Thread Janek Warchoł
Hi all,

I'm working on putting together a set of functions for handling parts
that split into multiple voices and/or staves (using functionality
David Kastrup implemented in
https://code.google.com/p/lilypond/issues/detail?id=3518).  I attach a
first version and i'd be interested in your comments.

best,
Janek
\version 2.19.13

together = { \tag #'together ^\markup \bold a2 }

soloI =
#(define-music-function (parser location mus) (ly:music?)
   #{
 
   \tag #'together ^\markup \bold SoloI
   \tag #'divI { #mus }
   \tag #'together { #mus }
   \tag #'divII #(mmrest-of-length mus)
 
   #})

sharedStems =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
 
   \tag divI  { #m1 }
   \tag divII { #m2 }
   \tag together ^\markup \bold div
   \tag together  #m1 #m2 
 
   #})

voiceDivisi =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
 
   \tag divI  { #m1 }
   \tag divII { #m2 }
   \tag together  { \dynamicUp #m1 } \\ { \dynamicDown #m2 } 
 
   #})

staffDivisi =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
 \unset Staff.keepAliveInterfaces
 
   \tag divI  { #m1 }
   \tag divII { #m2 }
   \tag together #(skip-of-length m1)
   \tag together #(skip-of-length m2)
 
 \set Staff.keepAliveInterfaces = #'()
   #})

divisibleStaff =
#(define-music-function (parser location name music) (string? ly:music?)
   (let ((nameI (string-append name  I))
 (nameII (string-append name  II)))
 #{
   \new GrandStaff \with {
 \consists Keep_alive_together_engraver
   } 
 \new Staff \with {
   \override VerticalAxisGroup.remove-first = ##t
   \override VerticalAxisGroup.remove-empty = ##t
   \override VerticalAxisGroup.remove-layer = 1
   keepAliveInterfaces = #'()
   instrumentName = #nameI
   shortInstrumentName = #nameI
 }
 \keepWithTag divI \music

 \new Staff \with {
   \override VerticalAxisGroup.remove-first = ##t
   \override VerticalAxisGroup.remove-empty = ##t
   \override VerticalAxisGroup.remove-layer = 1
   keepAliveInterfaces = #'()
   instrumentName = #nameII
   shortInstrumentName = #nameII
 }
 \keepWithTag divII \music

 \new Staff \with {
   instrumentName = #name
   shortInstrumentName = #name
   \override VerticalAxisGroup.remove-layer = 2
 }
 \keepWithTag together \music
   
 #}))
\version 2.19.13

\include definitions.ily

\layout {
  short-indent = 2\cm
  indent = 2\cm
  line-width = 10\cm
}

music = {
  \together
  c'4 d' e' f'
  \sharedStems
  { a' f' a' g' }
  { f' d' f' e' }
  \voiceDivisi {
g' b' d' b'
d'' b' g' b'
  }
  {
g'4 e' g' e'
b' g' b' g'
  }
  \staffDivisi
  { a' f'' g' q b' }
  { a' e' b' e'' a' q }
  \together
  c' d' e' f'
  \soloI { g' b' d' b' }
  \together
  f' a' d' f' f' a' e' g'
  f' e' d' c'
}

\markup \bold { Violin I part: }
\new Staff \with {
  instrumentName = Violin I
  shortInstrumentName = V I
} \keepWithTag divI \music

\markup \bold { Violin II part: }
\new Staff \with {
  instrumentName = Violin II
  shortInstrumentName = V II
} \keepWithTag divII \music

\markup \bold { Combined: }
\divisibleStaff Violin \music


example.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: partcombine/divisi framework - let the fun begin!

2014-08-28 Thread Janek Warchoł
2014-08-28 19:23 GMT+02:00 Janek Warchoł janek.lilyp...@gmail.com:
 I attach a first version and i'd be interested in your comments.

PS this code requires LilyPond 2.19.13, which has not yet been
released.  Anyone wishing to try out the example should compile
LilyPond from source; take a look at
https://github.com/janek-warchol/cli-tools/blob/master/lilypond/intro-text.md
https://github.com/janek-warchol/cli-tools/blob/master/lilypond/build-lily.sh
for a user-friendly way of doing this.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user