Hi LilyPonders,

I'm trying to automagically select pieces within a library.
My first intention was to use 'tags' but it does not seem to work a that
level.
So here's the idea: let say I include a full library in one file and I want
to get a book with some pre-selected pieces only, e.g.:

\version "2.19.28"

my-first-piece = {
  \tag level-one {
    \relative c' {
      \mark "Level 1"
      c1 d e f g a b c
    }
  }
}

my-second-piece = {
  \tag level-one {
   \relative c' {
     \mark "Level 1"
     c2 d e f g a b c
   }
  }
}

my-third-piece = {
  \tag level-two {
    \relative c' {
      \mark "Level 2"
      c4 d e f g a b c
    }
  }
}

my-fourth-piece = {
  \tag level-two {
    \relative c' {
      \mark "Level 2"
      c8 d e f g a b c
    }
  }
}

%% Full library included:
my-library = \book {
  \score { \my-first-piece }
  \score { \my-second-piece }
  \score { \my-third-piece }
  \score { \my-fourth-piece }
}

%% Select pieces by level:
\book {
  \bookpart {
    %% Select only 'level 1 pieces':
    %\keepWithTag #'level-one {
      \my-library
    %}
    \header {
      title = "Level I"
    }
  }
  \bookpart {
    %% Select only 'level 2 pieces':
    %\keepWithTag #'level-two {
      \my-library
    %}
    \header {
      title = "Level II"
    }
  }
}


Any idea how to achieve that ?

Cheers,
~Pierre
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to