Coldplay: In My Place

This example is for the drummers out there (and of course all other people who want to produce percussion-based music with MPS). The drum introduction of Coldplay’s In My Place is notated as shown below:

A possible context tree model in MPS looks like this:

This context trees uses two nested repetitions: one for repeating the two measures as a whole, and one for the cymbals, generating crash or hi-hat beats. Note that these repetitions use variables. The repretition count of the first repetition is assigned to the variable outerCount, the counter of the cymbal repetition is assigned to innerCount. These variables are evaluated in the if condition at the bottom of the tree. It produces open hi-hat beats in nearly all cases, except for the very first beat in the first measure. On this beat, both repetition counters have the value 1.

This is the equivalent syntactical representation:

title "In My Place"
composer "Coldplay"

composition
{
    time 4/4, tempo 72
    {
        repeat 2 as outerCount
        {
            parallel
            {
                fragment cymbals
                {
                    repeat 8 as innerCount
                    {
                        rhythm 8 
                        {
                            if outerCount == 1 and innerCount == 1
                            {
                                instrument crash
                            }
                            else
                            {
                                instrument hiHatOpen
                            }
                        }
                    }
                }

                instrument bassDrum
                {
                    rhythm 4 _8. 16 _16 16 8 _4
                }
                
                instrument snare
                {
                    rhythm _4 8. _16 _4 4    
                }
                
            }
        }
    }
}

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