The composite filter extracts the composite rhythm of a score, which is an intersection of note attacks from all staves in the score. Music can be assigned to two groups to display separate polyrhythmic streams of composite rhythms.

Options

Simple composite rhythm

The basic usage of the composite filter without options collapses note rhythms from all parts into a single rhythm line. Given the following score:

a composite rhythm line will be added underneath the original score:

Display analysis only

The input score can be suppressed by adding the -x option, leaving only the composite rhythm staff:

Shrinking input or analysis parts

To emphasize the composite analysis, the -l option can be used to shrink the input score. To shrink the input score to 55%, use -l 55:

Try changinge the 55% value in the above text to change the size of the original score. Alternatively, the -L option can be used to shrink the composite analysis:

System decoration adjustments

If the score has staff number interpretations, such as *staff2, and a matching staff-decoration reference record, the analysis data will be attached to the input score with a single line rather than being included in the original system bracing or brackets.

System label

If parts in the score are labeled using an *I" interpretation, the composite rhythm line will also be labeled.

Analysis stem direction

By default the stem directions for the composite rhythm analysis will be down. To display with stem-ups, add the -u option:

Polyrhythmic groupings

A score can be grouped into two separate composite rhythm streams for use in polyrhythm analysis. Each part or voice in a part can be labeled with the interpretations *grp:A and *grp:B. These labels will then be used to split the score into two composite rhythms. Example scores with this markup can be found in the Polyrhythm Project dataset on VHV.

Here is an example score with group A and B labels:

Extracting notes by group

The -o option (for output) can be used to extract notes from a particular group, here is an example of extracting the group A notes:

Notes in the other group will be converted into invisible rests. And here is an extraction of the B group notes:

Coloring groups in scores

To visualize the two groups in a score, use the colorgroups filter. Group A will be highlighted in red, and Group B will be shown in blue:

Coloring notes in the composite rhythm

The -C option can be used to also color notes in the full composite rhythm according to which group the note is derived. When the composite rhythm note represents a note attack in both groups, then it is colored green:

Group composite rhythms

If a score has group labels, then the -g option can be used to add composite rhythms for each groups:

If the full composite rhythm is not desired, add the -F option to remove it:

Coincidence analysis

The -c option can be added to generate a composite rhythm of the notes attacks that are shared between group A and B:

Marking coincidences

Use the -m option to mark notes in the score and composite analyses that are coincidence notes:

To mark only the coincidence notes in the input score without displaying any analyses, use the -M option:

Display and color all analyses

Numeric analyses

Event counts

The -e option can be added to show the event count for each composite rhythm staff at the start of the music:

In addition, event counts are added at the bottom of the output score in reference records for further numeric processing, such as the following examples:

!!!group-b-event-count: 24
!!!group-a-event-count: 24
!!!composite-event-count: 42
!!!coincidence-event-count: 6

These lines can be shown in VHV if the filter is compiled (causing the output anlaysis score to replace the input score in the VHV text editor).

These values can then be processed automatically, such as extracting the coincidence event count from the Humdrum score in a command-line interface:

composite -ce file | grep "^\!\!\!coincidence-event-count:" | sed 's/.*: *//'

Numeric analysis features

Various analysis features can be extracted from a score along with composite rhythms. These are selected with the -A option. Here is a list of the characters than can be given in a string argument after the -A option flag:

character meaning
n notes onset count

Note onset counts

To extract a count of note onsets for each composite rhythm event, add the letter n to the -A option string:

Here is an example of counting the note onsets for each event in the full composite rhythm and then noting the metric position of the event:

humcat h://jrp/Jos/Jos2721-La_Bernardina.krn | bin/composite -An \
	| beat -p | extractx -s 1,3 | ridx -H | sortcount -p | sort -k 3
2.24	.	0
1.35	6	1
3.59	8	1
4.04	1	1
4.93	2	1
4.93	3	1
6.73	4	1
7.17	7	1
8.52	5	1
1.79	8	2
11.21	1	2
2.69	2	2
2.69	6	2
4.04	4	2
5.83	7	2
7.17	3	2
7.17	5	2
0.45	8	3
1.79	3	3
3.59	5	3
4.04	1	3
4.04	7	3

11.21% of the cases are two note onsets occurring at the beginning of a measure. Three-note events occur at the half-note positions (1, 3, 5, 7) with position 3 being about 1/2 as common as the other positions.