[Haskell-cafe] I miss OO

Stephen Tetley stephen.tetley at gmail.com
Thu Nov 26 03:56:52 EST 2009


2009/11/26 Eugene Kirpichov <ekirpichov at gmail.com>:


> I think two concepts should be separated if one makes sense and is
> useful without the other. A note out of its time context is certainly
> useful, for example, it may probably be converted to a MIDI command or
> to a graphical glyph (which is further to be positioned by a layout
> engine).

Hello all

Following on from Eugene's point, for music - time is often a property
of the _evaluation_ of some musical structure (a note list or
whatever).

For instance, rendering a note list with rests to MIDI, requires
requires some tracking of time both so note-offs can be generated at
some delta after the note-on, and so rests can generate some 'blank'
delta.

Rendering to ABC or LilyPond (notation systems) - you could get by not
considering time at all, or only using it transitionally for
segmenting a note list into bars. Neither ABC or Lilypond files have a
notion of time, notes and rests are simply sequential.


Labelling note lists with onset times as they are constructed (rather
than as they are evaluated) can limit or at least make much more
complicated what you can do with a notelist:

For instance, to concatenate two notelists labelled with time you
would have to find the last onset from the first list and then
traverse the second list shifting each onset by that value.


Best wishes

Stephen

PS Luke Palmer's point "Type classes are not for name punning" should
be quote of the week in HWN.


More information about the Haskell-Cafe mailing list