| |
Haskore Programming
Due November 8
-
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.
-
Write Haskore programs to generate stochastic melodies based
on the following ideas:
 |
Choose notes from a scale by selecting randomly using:
 |
a uniform random distribution, and |
 |
some non-uniform distribution. |
|
 |
Given a starting note, choose intervals (positive or
negative) using:
 |
a uniform random distribution, and |
 |
some non-uniform distribution. |
|
 |
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:
 |
The number n, i.e. the length of the "history". |
 |
The range of the random numbers in the list. |
 |
The method of choosing the number of random numbers to
drop at each step in the algorithm.
|
|
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.
|