Page  495 ï~~A MAX Counterpoint Generator for Simulating Stylistic Traits of Stravinsky, Bartok and Other Composers Malcolm E. Bell Prairie Bible College P.O. Box 4116, Three Hills, Alberta, Canada TOM 2N0 (403) 443-5511 ABSTRACT A real-time, interactive MAX program has been developed to simulate the contrapuntal characteristics of compositions by numerous composers including Palestrina, Bach, Stravinsky and Bartok, and to also explore new contrapuntal styles. While the program user performs a melodic line on a MIDI keyboard, the MAX program generates the desired contrapuntal line to accompany it. (Alternatively, the program may receive the melodic line from a MIDI sequencer.) The program allows the user to specify vertical and horizontal intervals, rhythmic patterns, and all occurrence probabilities. Any of these parameters may be altered during a real-time performance. INTRODUCTION While following a melodic input, from either a live MIDI synthesizer performance or a stored MIDI sequencer file, this interactive MAX program can generate an accompanying contrapuntal line, in real-time. The user can specify musical parameters for vertical intervals between the melodic input and the generated counterpoint line, horizontal intervals between adjacent pitches in the counterpoint line, and rhythmic patterns in the counterpoint line. If the melodic input and the user-specified intervallic and rhythmic parameters all adhere to a particular style of counterpoint (ie. Palestrina, Bach or Bartok), then the program's output will be characteristic of the desired contrapuntal style. The successful simulation of a particular contrapuntal style is first dependent on the proper contrapuntal analysis of the style, in order to provide the musical parameters necessary to imitate it. Any contrapuntal musical example may be analyzed to determine its most frequently-used vertical and horizontal pitch class intervals. For example, in Bartok's Sixth Quartet, my. I, measures 214-221, the most frequent vertical interval classes are 3, 8, 0, and 6 (semitones), while the most frequent horizontal interval classes are 1, 2, 3, and 4 (semitones). In Stravinsky's Sonata for Two Pianos, measures 1 - 13, the most frequent vertical interval classes are 7, 11, 2, and 3 (semitones), while the most frequent horizontal interval classes are 2, 4, 1, and 3 (semitones). Rhythmic patterns are also a distinguishing characteristic of a contrapuntal style. For example, Stravinsky's Sonata for Two Pianos, measures 1 - 13, employs four successive sixteenth-notes 17% of the time, two successive eighth-notes 27% of the time, two sixteenth-notes followed by an eighth-note 21% of the time, and a dotted eighth-note followed by a sixteenth-note 8% of the time. PARAMETER SPECIFICATION Prior to the real-time generation of the counterpoint line, the user must specify 8 rhythmic patterns (for the free counterpoint mode of operation), 4 vertical pitch intervals, and 4 horizontal pitch intervals. Any or all of these parameters may be changed at any time during program operation. For example, the program might first be loaded with values to generate counterpoint in the style of a Bach invention. While the program is generating Bach counterpoint, the user can instantly change all parameters, immediately switching to a Bartok contrapuntal style, or the user can gradually switch one parameter at a time, to slowly transform into a Stravinsky contrapuntal style, or a newly-discovered contrapuntal style. IC MC PROCEEDINGS 1995 495 495

Page  496 ï~~intervals weighted:i V V3V4RP2 R3 R4 rhythmic patterns {:1 R R6 R7 R8 linear weighted interval horizontal intervals note-against- tree counterpoint note mode mode no Pitch meetsL. criteria? yes Pitch -> <- Rhythm Counterpoint Output Figure 1. Block Diagram of MAX Counterpoint Generator PITCH AND RHYTHM GENERATORS The vertical and horizontal intervals, along with their distribution probabilities are used to generate the contrapuntal pitches for a specific style. Each new pitch from the input melody triggers one of the four, weighted, vertical intervals. The chosen interval is added to (or subtracted from) the input melody pitch to generate the next contrapuntal pitch which is next checked against the four allowable horizontal intervals. If this pitch does not meet both vertical and horizontal intervallic criteria, it is discarded and replaced by a second pitch calculated from one of the remaining three, weighted, vertical intervals, and likewise tested for horizontal compatibility. If this second pitch does not meet intervallic criteria, it too, is discarded, and replaced by a pitch calculated from one of the two remaining vertical intervals. As soon as a newly-generated pitch meets both vertical and horizontal intervallic criteria, it is passed on to the output, where the rhythm generator governs the exact moment when the pitch will sound. If no pitch exists for which there is both vertical and horizontal compatibility, the user may opt to allow the program to momentarily ignore the horizontal interval parameter, allowing a pitch to be generated, or the user may instead opt to have the program insert a rest at that point in the counterpoint line. The user may choose between note-against-note counterpoint or free counterpoint. For note-against-note counterpoint, the counterpoint line is given the same rhythm as the input melody line. In the free counterpoint mode, the program will generate a variety of contrapuntal rhythmic patterns in accordance with the specified style. For this mode of operation, the program contains a table of 52 rhythmic patterns employing quarter, eighth, sixteenth, triplet and sextuplet patterns. The user may add additional patterns to this table. Up to eight weighted rhythmic patterns, characteristic of the style to be generated, may be specified. SUMMARY The counterpoint line is generated in real-time and output for playback on a MIDI synthesizer. The rhythm generator governs the timing and duration of each pitch and the pitch generator governs the value of each pitch. The velocity (volume) of each counterpoint pitch will match the velocity of its companion pitch in the input melody line. This program has realistically simulated contrapuntal styles characteristic of Palestrina, Bach, Stravinsky and Bartok, and has proven valuable for exploring new contrapuntal relationships. REFERENCES Clark, Thomas, Arrays, Win. C. Brown Communications, Inc., 1992. Puckette, Miller and Zicarelli, David, An Interactive Graphic Programming Environment MAX, Opcode Systems, Inc., 1990-91. 496 6IC MC PROCEEDINGS 1995