apologies yet again, another two mis-directed replies...
--- Begin Message ---
Henning Thielemann <[EMAIL PROTECTED]> writes:
> I boiled the problems down to a simple example. There are no errors
> reported about the messages, but the result is not what we expect.
This is an NTP/UTC issue.
OSC timestamps are in NTP, but at a user level the
hosc/hsc3 libraries (and sclang) work with UTC.
The encodeOSC function from hosc converts
from UTC to NTP.
In your text, replacing:
> nonrealtime =
>do let tsMsgs = map (uncurry Bundle) msgs
with:
nonrealtime =
do let tsMsgs = ntpZeroed (map (uncurry Bundle) msgs)
and adding:
ntpZeroed :: [OSC] -> [OSC]
ntpZeroed l = map f l
where f (Bundle t c) = Bundle (t - 2208988800.0) c
f (Message _ _) = undefined
works here.
Also, given the a post 30-July-2007 version of
http://slavepianos.org/rd/sw/sw-76/Rhs/Score.hs
the below is the nrt test file i have, it first plays
the score in rt, then writes a score to "/tmp/nrt.score"
and renders it to "/tmp/nrt.wav".
Regards,
Rohan
++
import Sound.OpenSoundControl (OSC(Bundle))
import Sound.SC3
import qualified Sound.SC3.UGen.Noise.Base as N
import Rhs.Score (Score(..), playScore, writeScore)
import System.Cmd
-- Illustrate Score
g = out 0 (pan2 o (N.rand (UGenId 0) (-1) 1) 1)
where f = Control KR "freq" 440
o = sinOsc AR f 0 * envGen KR 1 1 0 1 RemoveSynth envPerc' * 0.1
s = Score (Bundle 0.0 [send_instr, make_group] : notes)
where send_instr = d_recv (graphdef "test" (graph g))
make_group = g_new [(1, AddToTail, 0)]
f (t,n) = Bundle t [s_new "test" (-1) AddToTail 1 [("freq", n)]]
notes = take 128 (map f (zip [0.0, 0.05 ..] [330, 350 ..]))
main = do withSC3 ((flip playScore) s)
writeScore "/tmp/nrt.score" s
system "scsynth -N /tmp/nrt.score _ /tmp/nrt.wav 44100 WAVE float"
--- End Message ---
___
haskell-art mailing list
haskell-art@lists.lurk.org
http://lists.lurk.org/mailman/listinfo/haskell-art