J.S. Bach: Prelude in C Major, BWV 846

In this example, various MPS representations of the well-known Prelude in C Major, BWV 846 by J.S. Bach are demonstrated. For clarity, this example focuses on the first four measures of the compostion, the score representation of which looks like this:

An equivalent MPS context tree model looks like this:

This model describes the composition in terms of chord arpeggios, which are automatically generated using corresponding arpeggio generators. Note that the repetitive rhythms have to be specified only once and are automatically reused for every harmonic context change defined in the harmonic progression context at the top of the tree structure.

The language representation looks like this:

title "Prelude in C major"
composer "J.S. Bach"

composition
{
    time 4/4
    {
        harmonicProgression C Dm/C G7/B-B_4 C, harmonicRhythm 1 1 1 1
        {
            repeat 4, repeat 2
            {
                parallel
                {
                    arpeggioGenerator numberOfNotes 2 includeBassNote true
                    {
                        parallel
                        {
                            rhythm 2
                            rhythm _16 7/16
                        }
                    }
                    arpeggioGenerator numberOfNotes 3 startInversion 2 noteIndexSequence 0 1 2 0 1 2
                    {
                        rhythm _8 16 16 16 16 16 16
                    }
                }
            }
        }
    }
}

Note that a special exception is specified for the third harmony in the harmonic progression. The basic harmony is defined as G7/B, meaning a G dominant seventh chord with B in the bass. An additional suffix is provided, namely -B_4. This is a note exclusion, which is evaluated by the compiler when this harmony is tranformed into a concrete chord in the corresponding context. In this chord, the note B in the middle octave (4) is skipped, which can be verified in the score in measure 3.

The source code and the corresponding representations shown in this example are also available in the github example repository.