On Jun 24, 2010, at 11:14 AM, Martin Drautzburg wrote:
Another question is: how much past and future knowledge do I need. (I believe
the fundamental property of music is that things are ordered). In order to
compute Volumes from Moments I can get pretty much away without the past, but
computing Moments from Volumes definitely requires knowing "where I am",
because each new Moment has to be placed after a preceding Moment.
You can use pattern matching against lists. For example:
process_rhythm_scheme :: RhythmScheme -> Rhythm
process_rhythm_scheme ( (Just foo, Just bar )
: (Just foo', Just bar')
: (Just foo'', Just bar'')
: rest ) = undefined
will match a RhythmScheme where the first three entries are wholly defined, and will bind its values to foo, bar, foo', bar', rest, and so on.