humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
39 stars 9 forks source link

Add filter variant selection #688

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

Implemented with commit https://github.com/craigsapp/humlib/commit/8f63d65ee5daa6f29291136df38b6b1215199ddd

Variant tags can now be given to filters. And the filter filter is now accessible from filter records:

Examples:

Screen Shot 2022-04-19 at 11 34 17 PM

Such variants are ignored by default. In this case the music is being showed in a "diplomatic" rendering. To show the modern score, instructions are given on the line:

!!!filter-modern: modori -m

To run the filter-modern filters in the file, add a non-variant filter that specifies which filter variant (set) to run:

!!!filter: filter -v modern
Screen Shot 2022-04-19 at 11 37 12 PM

The compiling process with deactivate both the non-variant and the variant versions:

Screen Shot 2022-04-19 at 11 37 29 PM

Pipelines can be given in filter variants:

Screen Shot 2022-04-19 at 11 44 30 PM

Or there can be multiple filter variant lines (the order of the lines in the file will be the order that the commands are run:

Screen Shot 2022-04-19 at 11 45 34 PM

In this case the "diplomatic" score will not be transposed, but the modernized one is transposed.

Here is an example where both the original and modern scores will be transposed:

Screen Shot 2022-04-19 at 11 47 14 PM

The order of the commands in this case are:

transpose -t -P4         # apply to the original score
filter -v modern
modori -m

An alternate order is to run the transpose command after the modern filter variants have been processed:

Screen Shot 2022-04-19 at 11 48 49 PM

In which case the filter command order is:

filter -v modern
modori -m
transpose -t -P4           # apply to the modernized score

Here is an example of applying multiple filters variant groups (first the "modern" and the the "fifth" variants):

Screen Shot 2022-04-19 at 11 52 24 PM

Alternately:

Screen Shot 2022-04-19 at 11 53 31 PM

Running only the fifth variant:

Screen Shot 2022-04-19 at 11 54 38 PM

Running only the modern variant:

Screen Shot 2022-04-19 at 11 54 54 PM

Another use could be to extract parts, such as:

!!!filter-clarinet: extract -k 5

Then to show that part, the non-variant filter:

!!!filter: filter -v clarinet

could be run.