Assignment 4
Home Up Assignment 1 Assignment 2 Assignment 3 Assignment 4 Assignment 5

 

Haskore Programming

Due November 8

  1. Define an arpeggiator function: Given a chord represented as a parallel composition of equal-duration notes, return something that approximates its arpeggiation, i.e. the playing of each note in succession until all of them are sounding as in the original chord.  The duration of the resultant arpeggiation should be the same as the duration of the original chord.  Also, your function should take an argument to control the rate of arpeggiation.
     

  2. Write Haskore programs to generate stochastic melodies based on the following ideas:
    bullet

    Choose notes from a scale by selecting randomly using:
    bullet

    a uniform random distribution, and

    bullet

    some non-uniform distribution.

    bullet

    Given a starting note, choose intervals (positive or negative) using:
    bullet

    a uniform random distribution, and

    bullet

    some non-uniform distribution.

    bullet

    Choose notes using the following approximation to 1/f fractional noise:
    Start with an infinite list of random numbers.  The sum of the first n random numbers
    is the pitch of the first note.  Now generate a random number between 1 and n, and drop that many numbers from the list.  The next note is the sum of the first n numbers from the resulting list.  Repeat this process indefinitely.  Note that there are several control parameters in this algorithm:
    bullet

    The number n, i.e. the length of the "history".

    bullet

    The range of the random numbers in the list.

    bullet

    The method of choosing the number of random numbers to drop at each step in the algorithm.
     

  3. Define Haskell functions "invert", "retro", "retroInvert", and "invertRetro" to implement the concepts of inversion, retrograde, retrograde inversion, and inverted retrograde, respectively, as used in twelve-tone music theory. You may assume that the input is to these functions is
    created by an application of the "line" function in Haskore. Prove that "retro . retro", "invert . invert", and "retroInvert . invertRetro" are the identity function on values created by "line".

Solution.