On Sun, 12 Aug 2007, Rohan Drape wrote:

> Henning Thielemann <[EMAIL PROTECTED]> writes:
> > We need
> >  encodeOSCZeroBase :: OSC -> B.ByteString
> >   which converts a message by converting Double to Integer
> >   and does the message encoding (which is currently done by encodeOSC)
> >  delayOSC :: Double -> OSC -> OSC
> >   which shifts a message in time (i.e. changes time base)
> >  encodeOSC :: Double -> OSC -> B.ByteString
> >   calls delayOSC and encodeOSCZeroBase
> >
> > encodeOSCZeroBase can be used for non-realtime synthesis and encodeOSC for
> > realtime use.
>
> i'm not sure about this.  encodeOSC uses the conventional
> 'unix/utc' epoch.  encodeOSCZeroBase would not be 'zero'
> it would be the rather more obscure 'ntp epoch'.

But I indeed mean 'zero based'. Since scsynth doesn't know about Haskell's
OSC type we can use any time base, and I think time base 0 is the most
natural one. The actual time base needed for scsynth is added when
encoding the message.

Today we write something like this
  do now <- utc
     let msg = Bundle (now+effectStartTime) effect
     send fd (encodeOSC msg)

With my proposed change we would write
  do let msg = Bundle effectStartTime effect
     now <- utc
     send fd (encodeOSC now msg)

This has also the advantage that generation of scores does not depend on a
IO generated value (namely 'now').
_______________________________________________
haskell-art mailing list
haskell-art@lists.lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to