Each line of output analysis corresponds to a line from the input musical score. In this case the first line of data contains only one note (4c) in the first spine. On the second line two voices are sounding, 4d in the first spine and 4c in the third spine. And so on.
Spines vs. FieldsBy default the voicecount program will count the number of active voices in all **kern data fields on a line. If a spine splits into two subspines, these will be considered as separate voices when counting.
The -s option is used to treat sub-spines in multiple data fields as a single unit. If a spine is split into two with two sounding notes in different subspines, it will still be counted as only one "voice". This is useful when counting activity by instruments which can have polyphonic lines, such as parts in a string quartet.
Counting by note
The voicecount program can also be used to count the number of notes sounding at the same time when the -n option is given. When counting pitches, all notes in a voice will be considered (such as in chords, or in subspines). In the following example there is only one voice, but that voice contains multiple notes played in chords.
Counting unique pitches
The -u option can be used to count all unique notes, ignoring any pitch in any voice which has already been counted. The -n is implied when counting unique pitches, so it does not have to be given as well. Pitches can be counted diatonically with the -7 option (where C4, C♯4, and C♭4 all count as the same pitch); as twelve-tone pitches with the --12 option (C♭4 and B♮3 are considered the same pitch); and diatonic pitches with chromatic inflection up to two sharps/flats with the --40 option. If no pitch model is given for counting unique notes, then --40 will be used, which keeps tracks of diatonic notes with up to two chromatic accidental alteration.
Counting by pitch class
Use the -c option to count unique pitch classes in each vertical sonority. This option should be given along with one of the options -7, --12, or --40; otherwise --40 will be inferred (chromatic pitches with up to double sharps/flats).
Counting note attacksThe -x option can be used to only count note attacks on each data line. All sustained notes on the line will be ignored.
The -m option can be used to sum analysis lines by measure. The barlines in the input data must contain measure numbers at the start of each measure to be counted. Unnumbered barlines will be ignored and subsequent data will be considered part of the preceding measure. The -m option is mostly only useful for counting notes within a measure and will not count the number of voices or pitch classes with in a measure in a useful manner.
The -M option can be used to prefix the duration of the measure before the count for each measure.
**kern spine countUsing the -k option will output a count of the total number of **kern spines in the file (which start at the top of the data). This is useful for searching for files with a specific number of voices or for determining the maximum voice count possible when using the -s option.
Multiple segments will be listed separately. Here is an example which counts the number of voices in 370 Bach 4-part chorales. The grep command removes the file segment names which are generated automatically when there is more than one segment of data input.
Duration-weighted voice/pitch counts
The -y (or --summary) option can be used to output a data table showing how often the musical texture is in a particular voice or pitch count.
For example, here are statistics for 370 Bach chorales:
The -c option can be used with -y to summarize the duration-weighted average number of pitch classes at all moments in the music. As demonstrated below, the average number of duration-weighted pitch class sonorities is 3.19, i.e. typically a triad (with triads typically occurring 72% of the time). 25% of the sonorities contain 4 pitch-classes sounding together—either as seventh chords or as non-harmonic tones.
Segment filteringThe -v option can be used to filter out musical segments which have an incomplete number of voices. If a file segment contains a record in the form:
!!voices: 4then the number of **kern spines in the file must be 4; otherwise, the segment will be skipped over when performing the voicecount analysis.
Compare a summary analysis of voice counts for the music of Josquin when counting all works including incomplete works with missing parts, and an analysis which removes files which have missing parts.
Including pieces with missing parts:
The duration-weighted average number of voices in all of Josquin's music changes to 3.30 from 3.25 when works with missing parts are removed from the summary analysis.
The -G option can be used to ignore grace notes in a score. Not that duration-weighted summaries automatically ignore grace notes since they have zero score duration.
Exclusive interpretations generated by voicecount
Bach chorale 4-voice double pitch simultaneitiesHere is an example use of voicecount to find the occurrences of two pitches shared between four voices in Bach chorales. In other words four voices are singing only two pitches, which means that two (or more) voices are singing the same pitch. The files and measure/beat locations are listed in the right-most column.
This situation occurs seven times in 370 Bach chorales. None of the cases involve simultaneous note attacks. Instead two or three notes sustain from a previous sonority (sustained notes are listed above in parentheses). Note that there is one case where the soprano, alto, and tenor all play the same pitch (chorale 56, measure 12, beat 4). This is also the only case where the double simultaneities occur on a beat.
To generate the final output, the data is passed twice through voicecount: once to count the number of actively singing voices, and a second time to count the number of unique pitches. The location program then appends the file, measure and beat location of the data lines, and ditto is used to resolve null tokens into their sustained notes.
Enharmonic spellings within a single sonority
Are there any sonorities in the 370 Bach chorales which contain any twelve-tone pitches that are given two different diatonic/chromatic spellings?
The answer is no, since the last two columns in the above results are always the same number.
Here is a list of cases in the Beethoven string quartets where enharmonic spelling differences occur. For example the first line in the list below contains a E♭ and D♯ at the same time.
Bach chorale harmonic unisonsHere is an example showing how to count the number of voices which sing on the same pitch as another voice at the same time.
Lines with unequal values in the last two columns indicate unisons between parts. The total number of unisons is: 2309 + 7 * 2 + 3 = 2326.
Compare the above method of counting harmonic unisons to using the hint command:
humcat -s h://370chorales | ditto | hint -a | serialize -c \ | grep "^P1$" | wc -l 2327The differnce between the two methods is that one sonority contains a case where three voices are singing the same pitch. The first method counts this as two unisons while the second case counts this as three unisons.
Bach chorale notes/measureHere is an example of how to determine the highest number of note attacks per measure in Bach chorales.
program file.krnIt can also read the data over the web:
program http://www.some-computer.com/some-directory/file.krnPiped data works in a somewhat similar manner:
cat file.krn | programis equivalent to a web file using ths form:
echo http://www.some-computer.com/some-directory/file.krn | program
Besides the http:// protocol, there is another special resource indicator prefix called humdrum:// which downloads data from the kernscores website. For example, using the URI humdrum://brandenburg/bwv1046a.krn:
program humdrum://brandenburg/bwv1046a.krnwill download the URL:
Musedata Bach Brandenburg Concerto collection.
This online-access of Humdrum data can also interface with the classical Humdrum Toolkit commands by using humcat to download the data from the kernscores website. For example, try the command pipeline:
humcat humdrum://brandenburg/bwv1046a.krn | census -k