[Haskell-cafe] help with musical data structures

Michael Mossey mpm at alumni.caltech.edu
Sun Nov 15 01:51:13 EST 2009

I'm pretty new to Haskell so I don't know what kind of data structure I
should use for the following problem. Some kind of arrays, I guess.

One data item, called OrientedPCSet ("oriented pitch class set," a musical
term) will represent a set whose members are from the range of integers 0
to 11. This could probably be represented efficiently as some kind of bit
field for fast comparison.

Another item, PitchMatrix, will be a 2-d matrix of midi pitch numbers.
This matrix will be constructed via a backtracking algortithm with an
evaluation function at each step. It will probably be constructed by
adding one number at a time, starting at the top of a column and working
down, then moving to the next column. This matrix should probably be
implemented as an array of some sort for fast lookup of the item row x,
column y. It doesn't require update/modification to be as fast as lookup,
and it won't get very large, so some sort of immutable array may work.


More information about the Haskell-Cafe mailing list