Humdrum Extras

cint manpage


    cint -- Extract counterpoint interval modules from polyphonic music.


    cint [input[> output]


-c Separate module intervals by commas instead of spaces.
-C Uncross crossed voices in a module (lowest pitches always at bottom of modules).
-h Display "h" character after harmonic intervals in counterpoint interval modules.
-H Suppress display of harmonic intervals in modules.
-m Display "m" character after harmonic intervals in counterpoint interval modules.
-M Suppress display of melodic intervals in modules.
-n # Set the module chain length.
-N char Note marker to pass through to modules.
-o Transpose the harmonic intervals to within an octave for the smallest harmonic interval in the module.
-O Transpose both harmonic intervals to within an octave range.
-p Place modules or module chains inside of parentheses.
-r Include rhythmic information spines in output.
-R Suppress displaying modules which contain rests.
-s Indicate attack/sustain states of notes in the module.
-S Indicate presence of a sustained note in a harmonic/melodic interval (but not which note).
-t Include the top melodic interval in the module description.
-T Display the top melodic interval rather than the bottom one.
-U Suppress extraction of modules containing perfect unisons in either top or bottom melodic interval positions.
-x Display note attack/sustain states on harmonic intervals (not on melodic intervals, see -s option above).
-y Enclose melodic intervals within curly braces.
-z Make diatonic intervals zero-offset (0 = unison).
--12 Display module intervals in base-12 (semitones, MIDI note number).
--40 Display module intervals in base-40.
--attack Create counterpoint interval module chains that start and end with two attacked notes, and may contain any number of sustain/attack pairs within the chain.
--chromatic Add chromatic alterations to diatonic interval descriptions.
--count When --search is used, returns a count of the number of matches.
--raw Extract counterpoint interval modules without formatting
--search regex Search for modules which match to regex.
--verse Arrange analysis spines as lyric verses suitable for printing in music notation.


    The cint program extracts counterpoint interval modules from music consisting of two or more single-voiced parts. The program combines functionality of hint (harmonic interval extractor) with that of mint (melodic interval extractor), both available in the standard Humdrum Toolkit.

    A counterpoint module consists of four notes as illustrated in the first measure of the musical example given below. A module contains two harmonic intervals (marked in blue) and two melodic intervals (marked in red) as highlighted in the second measure. Since any three of these intervals can be used to calculate the fourth, one of the intervals can be omitted from the description of the module without loss of information (as long as none of the four notes in the module are rests). Thus the number triple (10 -2 12) can serve as a compact description of the counterpoint module given in the following example:

    Here is sample input and default output analysis data from the cint program related to the above musical example. The output data includes a **cint spine containing the counterpoint module in its reduced three-interval description.

    cint input

    To recover the missing melodic interval of the top part in the third measure, the following equation can be used:

         Mt = H2 - H1 + Mb
    where H1 is the first harmonic interval, H2 is the second harmonic interval, Mt is the top melodic interval, and Mb is the bottom melodic interval. In other words, the top horizontal (melodic) interval is equal to the second harmonic interval minus the first harmonic interval plus the bottom horizontal interval. For the above example:
         Mt = (12-1) - (10-1) + -(2-1) + 1 = 2
    The subtraction of one from each diatonic interval is needed for setting the offset of diatonic intervals at 0 rather than 1 in order to correctly add and subtract intervals (0 = unison, 1 = second, 2 = third, etc.). The +1 at the end of the calculation shifts the interval offset back to 1 (1 = unison, 2 = second, 3 = third, etc.).

    Likewise, here are the equations to calculate each of the other three intervals given three of the four counterpoint module intervals:

         H1 = H2 - Mt + Mb
         H2 = H2 + Mb - Mb
         Mb = H1 - H2 + Mt

    Interval selection and formatting

    By default, counterpoint modules will be reported as a list of three intervals: the first harmonic interval followed by the bottom melodic interval and ending with the second harmonic interval. The -t option can be used to also include the top melodic interval of the module (which will be placed after the bottom melodic interval in the sequence).

    cint input
    cint -t input

    The -T option can be used to display the top melodic interval of the counterpoint modules instead of the bottom melodic interval.

    cint input
    cint -T input

    In addition, the -H option will suppress display of both harmonic intervals, and -M suppresses melodic intervals.

    cint -M input
    cint -tH input

    For increased distinction between the two types of intervals, the melodic interval(s) can be placed within curly braces by using the -y option. The -m option can alternatively be used to place an "m" marker after each melodic interval:

    cint -m input
    cint -ty input

    Harmonic intervals can also be enclosed in square brackets (see module latices described further below for more useful application of square brackets). Alternatively, the -h option can be used to add an "h" character after each harmonic interval.

    cint -q input
    cint -h input

    The -c option can be used to separate intervals by commas rather than spaces:

    cint -c input
    cint -tcy input

    Parentheses can be placed around the counterpoint module interval set by adding the -p option:

    cint -p input
    cint -tpcy input

    Raw module output

    The --raw option is used to output counterpoint interval modules without formatting into data spines, and without including the original music.

    cint input
    cint --raw input

    Voice crossings and rests

    When voices cross, harmonic intervals will be reported as negative intervals. The following counterpoint module is (10 6 -3) with the second harmonic interval being a third, but with the top voice sounding below the bottom voice. The module (10 6 -3) can be expressed as (10 4 3) if the two voices are "uncrossed" as shown in the third measure of the example below.

    In the third measure of the above example, the bottom melodic interval changes from 6 to 4 when the voices are uncrossed:

          H2,new = -H2,old
          Mb,new = Mb,old + H2,old
    Calculations have to be done on zero-offset intervals:
          H2,new = -((3-1) + 1) = 3
          Mb,new = (6-1) + -(3-1) + 1 = 5 - 2 + 1 = 4

    Use the -C option to uncross any harmonic intervals. Using this option will cause all harmonic intervals to be positive, but the role of parts within the module will be lost (bottom voice can and up in top of module). For example, the module (10 6 -3) would be converted into (10 4 3) as shown in the above example.

    Intervals between notes and rests in a contrapuntal module are labeled as "R" as illustrated in the following example. When a rest is present in the module, the implicit top melodic interval may be unrecoverable if the rest is in the bottom voice (see the -t option for including the top melodic interval in the module description). The -R option can be given to cint to suppress extraction of modules which contain rests.

    cint input

    Data organization with more than two parts

    Counterpoint modules consist of pairs of voices. When more than two voices are present in polyphonic music, the count of pairings will increase faster than the number of voices. For two voices, there is one sequence of modules; for three voices there are three sequences; four voices yield six module sequences; five voices yield 10 sequences, and so on. Data for multiple parts can be extracted in several different ways. The default is a combinatorial display of all possible two-part modules, but options for more compact form can also be calculated.

    Combinatorial listing of modules

    By default, the cint program will list all combinations of pair-wise counterpoint modules which can be created between the parts in the music. In the output Humdrum data, the pairing are placed next to the bottom (leftmost) voice, with one spine for each **kern spine to the right of the current spine.

    Below is an example when there are four parts. The bottom part will list three modules after it, describing the module between the bottom part and each of the parts above it (to the right in the Humdrum data). This process iterates for each part, such that a list of all modules created with parts to the current part's right will be listed next to the music for that part.

    This data (with durations added) can be printed as music notation using the --verse option:

    The modules are listed above the part that forms the bottom of the module, and each "verse" of numbers indicates the top voice. For example, the three modules listed above the bass part are the modules against the three higher parts, with (10 -2 13) for the soprano/bass module, (6 -2 8) for the alto/bass module, and (1 -2 3) for the tenor/bass module.

    Part selection

    The -k option can be used to specify which **kern spines are used to calculate counterpoint modules. For example, a four-part texture will usually generate six **cint analysis spines; however, using the option -k 1,3 will cause only a single analysis spine where the modules are calculated between the first and third **kern spines:

    cin input

    cin -k 1,3 input

    Module lattices

    Multi-voice modules can be encoded more compactly using the -l option to generate module lattices which are vertical chains of modules (see horizontal chains in the next section). Note that lattices will not be exactly equivalent to the combinatorial form discussed above. In the combinatorial form, no two harmonic interval notes can both be sustained notes; however, the lattice form of modules allows for two sustained harmonic notes since only one note attack in one part in the lattice is needed to trigger a harmonic event (while all other parts could be sustained).

    In the following example, the same musical example as above is displayed as a lattice rather than as individual modules. In this case, 6 numbers are needed to encode the individual 6 modules.

    Individual modules can be extracted from the lattice with interval arithmetic. For example, the module between the bass and the soprano parts (10 -2 13), can be calculated like this:

        H1,B-S = (1-1) + (6-1) + (5-1) + 1 = 10
        Mb,B   = -2
        H2,B-S = (3-1) + (6-1) + (6-1) + 1 = 13
        ∴ moduleB-S = (10 -2 13)

    cint -lqy

    The default ordering of intervals in the lattice is time-wise, forming columns in the lattice. An alternate display by rows, giving a part-wise orientation to the lattice can be extracted by using the --rows option.

    cint -lp --rows

    Interleaved lattice modules

    A variant of module lattices related to the --rows display can be extracted by using the -L option. This option interleaves the modules found in the lattice between parts rather than as a single array of numbers. Here are equivalent forms of lattice data in a single array spine, and interleaved with the parts:

    cint -l
    cint -L

    Module chains

    Counterpoint modules can be linked together into chains of two or more modules. Each module is elided with the previous one by sharing a common harmonic interval. The -n option is used to indicate the length of the chain. By default, cint will extract single counter point modules. The following example show what would be extracted if "-n 2" is used to extract two successive modules at a time.

    The second measure in the above example shows two counterpoint modules chained together. In this case the length-2 chain is (10 -2 12 2 8). Notice that the harmonic and melodic intervals in the chain alternate in the interval description of the chain. Each counterpoint module is elided with the next when the chain length is greater than 1. For example, the two modules (10 -2 12) and (12 2 8) are elided so that the harmonic interval of 12 is not repeated in the description.

    cint -n 2 input
    cint input

    Sustain/Attack descriptors

    Counterpoint in real music often contains suspensions, passing tones, and other cases where the notes in the counterpoint pairings do not start notes in both parts at the same time. The following example show such a case where the top voice plays two notes while the bottom voice holds a single note.

    Measure two of the above example shows how the music is segmented for analysis with counterpoint modules. A note attack in either voice will initiate a new module, so the above example contains two counterpoint modules (5 1 6) and (6 2 6).

    The -s option can be given in order to mark whether each note in the counterpoint module is attacked or sustained from a previous note attack. Measure 3 of the above example shows the interval descriptions of the modules. The postfix character "s" indicates a sustained note, and "x" indicates a note attack. For harmonic intervals, the first s/x character represents the attack state of the bottom note, while the second character represents the attack state of the top note. For melodic intervals, the first character is for the first note, and the second character is for the second note (in case you were thinking it was the other way around).

    The -S option can be used to mark intervals which contain at least one sustained note without marking note attacks. For the above example, using the -S option would generate the modules (5 1s 6s) and (6s 2s 6), or the module chain (5 1s 6s 2s 6). Which note in the interval is sustained is unspecified.

    The -x option is similar to the -s option, but the attack/sustain markers are only affixed to the harmonic intervals (the first and last numbers in a standard module).

    The --attack option can be used to enforce two constraints on the extracted counterpoint modules. First, it requires that both starting pitches in the modules are note attacks; and secondly, the ending pair of notes must also be note attacks. Thus if there are any sustained notes within the initial counterpoint module, subsequent modules will be chained to the first until a module ending in two simultaneous notes attacks is found. Here is an example:

    In the case where --attack is used, the second and third modules are link into a chain of two modules. This causes the first harmonic interval in the chain (5) to contain two note attacks, and also the last two harmonic intervals (6). The intermediate harmonic intervals (the middle "6") contains one sustained and one attacked note. To construct a module which extends through the intermediate sustained note, just add all of the melodic intervals together:

         (1 - 1) + (2 - 1) + 1 = 2
    Thus, the counterpoint module which ignores the intermediate harmonic interval caused by a sustain and attack on F and d is (5 2 6).

    cint input
    cint --attack input

    Rhythmic descriptors

  • beat/offbeat
  • metric position
  • measure
  • absolute beat
  • duration

    Chromatic intervals and interval description variants

    Zero-offset diatonic intervals

    Musicians prefer to see diatonic intervals displayed with an offset starting at 1 for a unison. This means that "2" represents an interval of a second, 3 for thirds, and so on. However, when doing arithmetic manipulation of intervals, zero-offset intervals are more convenient to work with. This would mean that 0 = unison, 1 = second, 2 = third, and so on. To display diatonic intervals with a zero offset, use the -z option:

    cint input
    cint -z input

    Base-40 interval descriptions

    Base-40 is a method of encoding diatonic pitches as integers with chromatic alterations up to double sharps or flats. The base-40 chroma for pitches can be built up from the property that a minor second is a difference of 5 between pitch numbers in the base-40 system, and major seconds are a difference of 6. The C chroma value is set to the value 2 rather than 0 so that the octave values for C♭ and C♭♭ remain in the same octave as C♮ just above these pitches when using division by the base to extract the octave number. Here is a complete table of the base-40 chroma, using C=2 as the reference:

    Base-40 chroma values (pitch classes)

    To calculate an absolute pitch such as G4 (The G above middle C), multiply the octave by 40 and add the chroma value for the G pitch-class:

    G4 = 4 * 40 + 25 = 160 + 25 = 185
    Alternatively, G4 can be calculated by adding 3 half-steps (major seconds) and one minor second to C4 (represented as the number 162 in base-40):
    G4 = C4 + 3 * M2 + m2 = 162 + 3 * 6 + 5 = 162 + 23 = 185

    Note that base-40 pitch representations preserve chromatic alterations of diatonic pitch-classes (up to double sharps/flats). Therefore F♯4 (180) is not in the same as the base-40 pitch G♭4 (184). A useful property of the base-40 system is that the difference between pitch numbers in the base-40 system represent one-to-one mappings with diatonic intervals:

    Base-40 interval classes (d=diminished, m=minor, M=major, P=perfect, A=augmented)

    Octave reduction of harmonic intervals

    Wide intervals larger than an octave can be reduce to be within an octave by using the -o option. This will reduce the smallest vertical interval in the module (or module chain) so that it occurs less than an octave above the bottom note, and the top part will not cross under the bottom part. The highest harmonic interval in the module may exceed an octave since both upper notes will be transposed by the same octave amount.

    cint input
    cint -o input

    Module pitches

    The --pitches option can be used to display the underlying pitch grid used to calculate counterpoint modules. Here is some sample music to extract a pitch grid from:

    The --pitches option will extract only the pitch information from the parts, and only the first pitch in each spine of the part. The sonorities (harmonic slices) are preserved in the same style as the original Humdrum file. Sustained pitches across multiple sonorities are indicated in the same manner as ties in **kern data, using "_" (underscores) for intermediate tied notes, and "[" and "]" for starting and ending ties.

    cint --pitches input

    The options -7 (base-7, diatonic pitches), --12 (base-12, twelve-tone, MIDI pitches), or --40 (base-40 pitches) can be used in conjunction with the --pitches option to extract pitches into one of those three alternate numeric representations of pitch.

    cint --pitches -7 input
    cint --pitches --12 input
    cint --pitches --40 input

    Note that base-40 pitch enumerations can be converted into either base-7 or base-12, but the other two representations are exclusive and cannot map onto each other.

    Rhythmic information about each row of notes can be added to the data by including the -r option when using the --pitches option:

    cint --pitches -7 input
    cint --pitches -7 -r input

    The first column labeled **absq is the "absolute quarter note duration" location of each line in the file. In other words, if the column as a value 6.5, that means the notes on that line occur 6.5 quarter note durations after the start of the music. The **bar column indicates the measure number in which the notes occur, and **beat indicates the beat number within the music on which the notes occur. The beat is defined by the bottom number in the time signature, with compound meters such as 6/8 being assigned a beat of a dotted quarter note.

    Module searching

    The --search option can be used to search for modules or fragments of modules. The option is followed by a regular expression which is compared against constructed module strings. Below is an example search result for the module chain "7xs 1 6 sx -2 8xx". Any notes which form a module that matches to the search query will be marked with an "@" sign. These marks can be used to highlight notes in graphic notation of the music.

    myank -m 7-8 jrp://Bus1001a | cint --search "7xs 1 6sx -2 8xx" -x -n 2 

    Note that the search string "7xs 1 6sx -2 8xx" contains note-attack letters ("s" and "x"). When searching for note-attack information, the -x option must also be include. In other words, searching is done with the requested formatting of the search module strings. Also note that this search string contains a chain of two modules, so the -n 2 option is also required (or the chain length can be larger than 2).

     hum2muse results.krn | muse2ps =z21j | pstopnm -dpi=300 \
          | convert - -trim -resize '33%' -bordercolor white -border 10 results.png

    When the --count option is given while searching, only a count of the number of module patterns found matching the search query will be returned. The -f option can also be given to cause note counts to be output for each file or data segment as well as the total count. Here is an example of search for the "7xs 1 6sx -2 8xx" suspension in J.S. Bach chorales and the music of Josquin des Prez:

     cint --search "7xs 1 6sx -2 8xx" -x -n 2 h://370chorales --count 
     cint --search "7xs 1 6sx -2 8xx" -x -n 2 h://jrp/Jos --count

    In other words, the "7xs 1 6sx -2 8xx" suspension occurs infrequently in the chorales of J.S. Bach, but more often in the music of Josquin. To calculate the feature density in both repertories in order to do a better direct comparison:

        notecount -R h://370chorales 
           Notes in data: 84666
        notecount -R h://jrp/Jos     
           Notes in data: 438031
    Therefore the feature density in J.S. Bach chorales is 30/84666 = 0.035% and in Josquin it is 0.97%. In other words, the feature is about 30 times more common in the music of Josquin than in the chorales of Bach. For Palestrina, and intermediate composer between these two, the feature density is 0.73% which is slightly less than Josquin. Ockeghem's music has a feature density of 0.86% which is also close to Josquin's density. Beethoven string quartets have a feature density of 0.002%, which is about 10 times less than in Bach chorales:
     cint --search "7xs 1 6sx -2 8xx" -x -n 2 --count h://beethoven/quartets
     notecount -R h://beethoven/quartets
        Notes in data: 234098

    Suspension marking

    The --suspensions option is a special-purpose option that searches music for suspensions between pairs of voices. If the --mark option is used, the notes in the matching modules will be marked with the user-signifier "@", and the marked music can be printed with the marks highlighted. Here is an example: Here is a list of some suspensions which will be searched for when the --suspensions option is used (also using -x to attach note attack states to harmonic intervals, and using a chain length of two or more):

    [script to generate above images]

    Module note marking

    The -N option is used to add markers to counterpoint modules when a particular character is found in the **kern token for notes. User-definable characters in **kern tokens include: i, j, l, N, V, Z, @, @, +, |, <, and >. When the -N is used, any marker character found on any note in the score will be prefixed to the counterpoint module.
    cint -N@ -ty --raw

    Note ID tracking

    The --id option can be used to include more detailed note information within counterpoint modules. When this option is turned on, note ids will be extracted from local comments preceeding the note. The comment will have this form:
    where # is a unique integer value serving as a serial number for the note/rest.
    cint -N@ -ty --raw --id


    Bach chorale counterpoint interval modules

    Showing top 20 modules

    The following command pipeline shows the 20 most common counterpoint interval modules in 370 J.S. Bach Chorales. For example the most common module is (5 -2 6) at 2.33% of all modules extracted from the Bach chorales. The module (5 -2 6) meaning that a pair of voices form a harmonic interval of a 5th followed by a 6th, with the bottom part performing a falling second between these two harmonic intervals (and the top melodic interval implicitly being a unison).

    cint h://370chorales --raw | sortcount -p | head -n 20

    The --raw option is used to output a listing of all modules without any Humdrum spine structure or echoing of input music. The sortcount script collates the raw data extracted by cint, with the -p option causing sortcount to display counts as percentages. If the --raw option were not used, the formatting and input music could alternatively be stripped using this command pipeline:

    cint -ty h://370chorales | extract -i '**cint' | serialize | ridx -H

    For better readability of modules, the fourth interval (the top melodic interval) can be added with the -t option, and the -y option can be used to enclose the two melodic intervals in curly braces for better readability:

    cint -ty h://370chorales --raw | sortcount -p | head -n 20

    The module (5 {-2 1} 6) can be displayed graphically as shown below. There are two pairs of notes in the module: the first pair form a 5th harmonic interval, and the second pair forms a 6th harmonic interval. The bottom note moves down a step while the top note says on the same pitch:

    Adding attack/sustain information

    The above analysis finds that (5 -2 6) is the most common module in the Bach chorales. Now, with what sort of attack/sustain configuration does this module occur? A more refined analysis will keep track of whether or not the notes in the module are note attacks or note sustains. To do this with the cint program, use the -x option to mark attack/sustain states of notes as the letters "x" for note attacks, and "s" for note sustains. The first letter describes the state of the note in the bottom part, while the second letter describes the state of the note in the top part. For example "sx" means that the bottom note is sustained (from a previous module) while the top note is attacked at this harmonic interval. The harmonic intervals can be termed hard if both notes are attacked ("xx"), or soft if only one is attacked while the other is sustained ("sx" or "xs").

    cint -txy h://370chorales --raw | sortcount -p | head -n 20

    When considering attack/sustain states for the four notes of the module, the most common module is now (10xx 2 10xx) which in musical terms is a parallel tenth moving upwards, with all four notes of the module being attacked. For the (5 -2 6) module, the most common attack/sustain type is (5xx -2 6xs) which means that the two notes are attacked at the start of the module, and then bottom note moves down a step while the top note sustains. Here are all cases of (5 -2 6) present in the Bach chorales along with their relative frequencies, extracted with this command pipeline:

    cint -txy h://370chorales --raw | egrep "^5[xs]+ -2 6[xs]+" | sortcount -p

    Chromatic qualifiers

    By default the cint program outputs module intervals as purely diatonic intervals, such as 2 for seconds, 3 for thirds, etc. To add chromatic qualifiers to the intervals, use the --chromatic option. This will allow distinguishing related diatonic intervals such as m3 for minor thirds and M3 for major thirds.

    cint -txy --chromatic h://370chorales --raw | sortcount -p | head -n 20

    The most common module is (p5xx {-M2 p1} M6xs), which is a hard perfect 5th going to a soft major 6th, with the bottom part falling a major second and the top part remaining on the same pitch.

    Extracting the module (5 -2 6), while keeping track of sustain/attack states as well as chromatic alterations:

    cint -txy --chromatic h://370chorales --raw \
    | egrep -i "[mpad]5[sx]+ -[mpad]2 [mpad]6[sx]+" | sortcount -p | head -n 20

    A hard perfect fifth going to a soft major 6th is almost two times more common than going to a soft minor 6th. However a hard p5th going to a hard m6th is more than two times more common than going to a hard major 6th. The most common (5 -2 6) module with a diminished 5th is (d5xx -M2 m6xs) which occurs in 1.37% of the (5 -2 6) module subcategories.

    Module densities by vocal part

    Below are the top module categories for each paring of Soprano, Alto, Tenor and Bass. Here is an example command pipeline to extract Soprano–Bass pairings. Note that the -o option is used to transpose modules to be within a harmonic interval octave (such as re-categorizing 12ths as 5ths).

    extractx -f 1,4 h://370chorales | cint -o --raw | sortcount -p | head -n20


    The most common module between Sopranos and Tenors is a parallel 6th falling by a second. For Alto/Bass and Tenor/Bass, the most common module is a parallel 3rd rising by a second. Alto/Bass has the greatest module diversity, while Alto/Tenor has the least. The Alto/Tenor pairing is more likely to contain a harmonic interval of a 4th (probably indicating that triad tonics are more likely in the Alto while the Tenor is playing a fifth).

    Early Renaissance counterpoint interval modules

    The most common counterpoint interval modules in the music of Josquin des Prez:

    cint -txy h://jrp/Jos --raw | grep -v R | sortcount -p | head -n 20

    The most common module is a module starting with a 6th going to an octave in contrary motion, with the bottom note of the 6th interval sustained from an earlier sonority.

    The most common counterpoint interval modules in the music of Johannes Ockeghem:

    cint -txy h://jrp/Ock --raw | grep -v R | sortcount -p | head -n 20

    Comparing the two composers, both share their most common module of (6sx -2 8xx), as well as their second most common module of (3xx 2 3xx) (parallel 3rds rising stepwise).

    Parallel intervals

    Parallel 5ths

    How many parallel 5ths exist in the J.S. Bach chorales?

     cint h://370chorales --chromatic -Uo --raw | grep "^p5.*p5$" | sortcount -t

    The -U option is used to filter cases where a parallel 5th is played on repeated notes (which is a repeated 5th, not a parallel 5th). The -o option is used to count parallel 12ths (one octave + a 5th) as a parallel 5th.

    Compare to Josquin and Ockghem works:


    Overall density of parallel fifths in the three repertories:

    composer modules parallel 5ths percentage
    J.S. Bach Chorales 150,472 34 0.02%
    Josquin 715,598 775 0.11%
    Ockeghem 111,679 234 0.21%

    The density of parallel 5ths decreases from 0.21% for Ockeghem to 0.11% for Josquin to 0.02% for J.S. Bach chorales. This ordering is also chronological...

    Parallel 6ths

    Here is a similar analysis comparing parallel 6ths densities between the same repertories:

    J.S. Bach

    Commands to extract the data for the above table (the -U option is used to suppress modules which contain melodic unisons):

     cint h://370chorales --raw -Uo | grep '^6.*6$' | sortcount -p 
     cint h://jrp/Jos --raw -Uo | grep '^6.*6$' | sortcount -p 
     cint h://jrp/Ock --raw -Uo | grep '^6.*6$' | sortcount -p 

    Ockeghem has the most restricted set of melodic motions for the parallel 6ths. 91% of Ockeghem's parallel 6ths are stepwise, and most of the rest are by falling thirds. Ockeghem has more parallel 6ths rising by a second; while Josquin's and Bach's most common parallel 6th motion is falling by a second. Densities of parallel 6ths in each repertory:

    composer modules parallel 6ths percentage
    J.S. Bach Chorales 150,472 5,902 3.9%
    Josquin 715,598 11,352 1.6%
    Ockeghem 111,679 2,593 2.3%
    The density of parallel 6ths in Bach chorales is about twice as much as in the music of Josquin and Ockeghem.

    Contrary v Similar motion

    Here is an example of how to examine contrary versus similar motion in counterpoint interval modules. Use the -H option to exclude harmonic intervals from the module, and use -t to include the top melodic interval in the module. repeated notes in either voice of the module are filtered out in this analysis using the -U option of cint. Also grep is used to exclude modules containing soft harmonic intervals. After modules with soft harmonic intervals are removed, chromatic alterations of the diatonic notes are stripped with the sed command.
     cint h://370chorales -RUHts --raw --chromatic | grep -v "s" | sed 's/[mpadsx]//gi' | sortcount -p | head -n 20
     cint h://jrp/Jos -RUHts --raw --chromatic | grep -v "s" | sed 's/[mpadsx]//gi' | sortcount -p | head -n 20
     cint h://jrp/Ock -RUHts --raw --chromatic | grep -v "s" | sed 's/[mpadsx]//gi' | sortcount -p | head -n 20
    Bach chorales

    Here is a breakdown of contrary and similar motion modules for three repertories. The music of Josquin and Ockeghem have nearly equal amounts contrary and similar motion modules. Bach chorales show a preference for similar motion, with a preference for upward similar motion.

    repertory modules contrary similar similar up similar down
    J.S. Bach Chorales 42410
    Josquin 125139
    Ockeghem 24293
    [script to generate above table]

    Suspension formula counts in various repertories

    Suspension formulas can be extracted from music by using the --suspensions option of cint. Note that cint will not try to find all suspensions (or counterpoint modules) in music with sub-spines or chords (this applies in particular to piano music). However, vocal music and nearly all instruments other than piano should work well. The --raw option is used in conjunction with --suspensions so that the formula for each identified suspension will be listed. These can then be sorted and counted as in the following tables. You can use the note counts underneath each table to estimate the density of suspensions in each repertory for better direct comparisons.

    Works of Johannes Ockeghem:

     cint --suspensions --raw h://jrp/Ock | sortcount

    notecount -R h://jrp/Ock

    Works of Josquin des Prez:

     cint --suspensions --raw h://jrp/Jos | sortcount

    notecount: 438,031

    Works of Pierre de la Rue:

     cint --suspensions --raw h://jrp/Rue | sortcount

    notecount: 213,873

    Works of Mabrianus de Orto:

     cint --suspensions --raw h://jrp/Ort | sortcount

    notecount: 45,433

    Masses of Giovanni Pierluigi da Palestrina:

    notecount: 671,091

    370 Chorales of J.S. Bach:

     cint --suspensions --raw h://370chorales | sortcount

    notecount: 84,666

    Brandenburg concertos of J.S. Bach:

     cint --suspensions --raw h://brandenburg | sortcount

    notecount: 103,745

    WTC fugues of J.S. Bach:

     cint --suspensions --raw h://wtc1f h://wtc2f | sortcount

    notecount: 50,961

    London Symphonies of Joseph Haydn:

     cint --suspensions --raw h://haydn/sym | sortcount

    notecount: 201,236

    String quartets of Joseph Haydn:

     cint --suspensions --raw h://haydn/quartets | sortcount

    notecount: 338,373

    String quartets of Wolfgang Amadeus Mozart:

     cint --suspensions --raw h://mozart/quartets | sortcount

    notecount: 151,727

    String quartets of Ludwig van Beethoven:

     cint --suspensions --raw h://beethoven/quartets | sortcount

    notecount: 234,098


    Input arguments or piped data which are expected to be Humdrum files can also be web addresses. For example, if a program can process files like this:
           program file.krn
    It can also read the data over the web:
    Piped data works in a somewhat similar manner:
           cat file.krn | program
    is equivalent to a web file using ths form:
           echo | 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.krn
    will download the URL:
    Which is found in the 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



    Sub-spines will be ignored in the input data. The left-most sub-spine will be processed and all other sub-spines to the right will not. If there are chords present in a spine, only the left-most note in the chord will be considered.


    The compiled cint program can be downloaded for the following platforms:
    • Linux (i386 processors) (dynamically linked) compiled on 20 Dec 2013.
    • Mac OS X/i386 compiled on 13 Nov 2013.

    The source code for the program was last modified on 19 Sep 2013. Click here to go to the full source-code download page.