diff --git a/csound-expression.cabal b/csound-expression.cabal
--- a/csound-expression.cabal
+++ b/csound-expression.cabal
@@ -1,5 +1,5 @@
 Name:          csound-expression
-Version:       4.6.1
+Version:       4.7
 Cabal-Version: >= 1.6
 License:       BSD3
 License-file:  LICENSE
@@ -68,7 +68,7 @@
   Ghc-Options:    -Wall
   Build-Depends:
         base >= 4, base < 5, process, data-default, Boolean >= 0.1.0, colour >= 2.0, transformers >= 0.3,
-        csound-expression-typed >= 0.0.7.3.1, csound-expression-dynamic >= 0.1.4.1, 
+        csound-expression-typed >= 0.0.7.4, csound-expression-dynamic >= 0.1.4.2, temporal-media >= 0.5.0,
         csound-expression-opcodes >= 0.0.2
   Hs-Source-Dirs:      src/
   Exposed-Modules:
diff --git a/src/Csound/Air/Misc.hs b/src/Csound/Air/Misc.hs
--- a/src/Csound/Air/Misc.hs
+++ b/src/Csound/Air/Misc.hs
@@ -17,6 +17,9 @@
     -- * GUI
     lpJoy,
 
+    -- * Effects
+    delaySample,
+
     -- * Function composition
     funSeq, funPar
 ) where
@@ -216,3 +219,8 @@
 funPar :: Num a => [a -> a] -> a -> a
 funPar fs a = sum $ fmap ($ a) fs
 
+-- | Delay by certain number of samples
+--
+-- > delaySample numOfSamples asig
+delaySample :: D -> Sig -> Sig
+delaySample nsamples asig = delay asig nsamples
diff --git a/src/Csound/Air/Sampler.hs b/src/Csound/Air/Sampler.hs
--- a/src/Csound/Air/Sampler.hs
+++ b/src/Csound/Air/Sampler.hs
@@ -21,6 +21,7 @@
 
 import Data.Monoid
 import Data.Boolean
+import Temporal.Class
 
 import Csound.Typed
 import Csound.Control
@@ -35,7 +36,7 @@
 
 -- | Triggers the signal with the first stream and turns it off with the second stream.
 evtTrig :: (Sigs a) => Tick -> Tick -> a -> a
-evtTrig x st a = runSeg $ sloop $ slim st $ sdel x $ sloop (slim x $ toSeg a)
+evtTrig x st a = runSeg $ loop $ lim st $ del x $ loop (lim x $ toSeg a)
 
 -- | Toggles the signal with event stream.
 evtToggle :: (Sigs a) => Tick -> a -> a
@@ -47,7 +48,7 @@
 -- No it's not every sequence note triggers it
 -- but it's best to limit them anyway
 evtTap :: (Sigs a) => D -> Tick -> a -> a
-evtTap dt x a = runSeg $ sdel x $ sloop $ slim x $ toSeg $ takeSnd dt a
+evtTap dt x a = runSeg $ del x $ loop $ lim x $ toSeg $ takeSnd dt a
 
 -- | Plays a list signals. It triggers the signal with event stream and silences
 -- all the rest in the list so that only one signal is playing. We can create simple
@@ -61,7 +62,7 @@
 
 -- | Triggers one signal after another with an event stream.
 evtCycle :: (Sigs a) => Tick -> Tick -> [a] -> a
-evtCycle start stop sigs = runSeg $ sloop $ slim stop $ sdel start $ sloop $ sflow $ fmap (slim start . toSeg) sigs
+evtCycle start stop sigs = runSeg $ loop $ lim stop $ del start $ loop $ mel $ fmap (lim start . toSeg) sigs
 
 -----------------------------------------------------------
 -- Char sampler
@@ -69,7 +70,7 @@
 -- | Triggers a signal when one of the chars from the first string is pressed.
 -- Stos signal from playing when one of the chars from the second string is pressed.
 charTrig :: (Sigs a) => String -> String -> a -> a
-charTrig starts stops asig = runSeg $ sloop $ slim (strOn stops) $ toSeg $ retrig (const $ return asig) (strOn starts)
+charTrig starts stops asig = runSeg $ loop $ lim (strOn stops) $ toSeg $ retrig (const $ return asig) (strOn starts)
 
 -- | Plays a signal while a key is pressed.
 charPush :: Sigs a => Char -> a -> a
diff --git a/src/Csound/Air/Seg.hs b/src/Csound/Air/Seg.hs
--- a/src/Csound/Air/Seg.hs
+++ b/src/Csound/Air/Seg.hs
@@ -1,7 +1,6 @@
+{-# Language TypeFamilies #-}
 module Csound.Air.Seg (
-	Seg, toSeg, runSeg,
-	slim, sflow, spar, sloop, 
-	sdel, srest, 
+	Seg, toSeg, runSeg,	
 	constLim, constDel, constRest, limSnd
 ) where
 
@@ -9,6 +8,8 @@
 import Data.Monoid
 import Data.Boolean
 
+import Temporal.Class
+
 import Csound.Typed
 import Csound.SigSpace
 import Csound.Control
@@ -44,6 +45,24 @@
 
 instance SigSpace a => SigSpace (Seg a) where
 	mapSig f x = fmap (mapSig f) x
+
+type instance DurOf (Seg a) = Tick
+
+instance Sigs a => Compose (Seg a) where
+	mel = sflow
+	har = spar
+
+instance Sigs a => Delay (Seg a) where
+	del = sdel
+
+instance Sigs a => Loop (Seg a) where
+	loop = sloop
+
+instance (Sigs a, Num a) => Rest (Seg a) where
+	rest = srest
+
+instance Sigs a => Limit (Seg a) where
+	lim = slim
 
 seq1 :: Tick -> a -> Seg a
 seq1 dt a = Lim dt (Unlim a)
diff --git a/src/Csound/Air/Wav.hs b/src/Csound/Air/Wav.hs
--- a/src/Csound/Air/Wav.hs
+++ b/src/Csound/Air/Wav.hs
@@ -1,5 +1,5 @@
  -- | Sound file playback
-module Csound.Air.Wav(
+ module Csound.Air.Wav(
     -- * Stereo
     readSnd, loopSnd, loopSndBy, 
     readWav, loopWav, readSegWav, 
@@ -44,8 +44,10 @@
 import Data.Boolean
 import Control.Applicative hiding((<*))
 
+import Temporal.Media
+
 import Control.Monad.Trans.Class
-import Csound.Dynamic hiding (int)
+import Csound.Dynamic hiding (int, Sco)
 
 import Csound.Typed
 import Csound.Typed.Opcode
@@ -53,7 +55,7 @@
 import Csound.Control.Instr(withDur, sched)
 
 import Csound.SigSpace(mapSig)
-import Csound.Control.Evt(metroE, eventList)
+import Csound.Control.Evt(metroE, loadbang)
 
 import Csound.Air.Spec
 
@@ -62,16 +64,16 @@
 
 -- | Takes only given amount (in seconds) from the signal (the rest is silence).
 takeSnd :: Sigs a => D -> a -> a
-takeSnd dt asig = trigs (const $ return asig) $ eventList [(0, dt, unit)]
+takeSnd dt asig = sched (const $ return asig) $ withDur dt $ loadbang
 
 -- | Delays signals by the given amount (in seconds).
 delaySnd :: Sigs a => D -> a -> a
-delaySnd dt asig = trigs (const $ return asig) $ eventList [(dt, infiniteDur, unit)]
-
+delaySnd dt = segmentSnd dt infiniteDur 
+    
 -- | Delays a signal by the first argument and takes only second argument amount
 -- of signal (everything is measured in seconds).
 segmentSnd ::Sigs a => D -> D -> a -> a
-segmentSnd del dur asig = trigs (const $ return asig) $ eventList [(del, dur, unit)]
+segmentSnd dt dur asig = sched (const $ return asig) $ fmap (del dt) $ withDur dur $ loadbang 
 
 -- | Repeats the signal with the given period.
 repeatSnd :: Sigs a => D -> a -> a
@@ -112,7 +114,7 @@
     | otherwise         = filelen $ text fileName
 
 -- | Produces repeating segments with the given time in seconds.
-segments :: D -> Evt (D, Unit)
+segments :: D -> Evt (Sco Unit)
 segments dt = withDur dt $ metroE (sig $ recip dt)
 
 -- Stereo
@@ -314,14 +316,10 @@
 lphase :: D -> Sig -> Sig -> Sig -> Sig
 lphase irefdur kloopstart kloopend kspeed  = atimpt
     where
-        kstart1 = kloopstart / sig irefdur
-        kend1 = kloopend / sig irefdur
-        ifqbas = 1 / irefdur
-        kfqrel = kspeed * sig ifqbas / (kend1 - kstart1)
+        kfqrel = kspeed / (kloopend - kloopstart)
         andxrel = phasor kfqrel
         atimpt = andxrel * (kloopend-kloopstart) + kloopstart
 
-
 ----------------------------------------------------------------------
 
 -- | Looping phasor. It creates a looping pointer to the file.
@@ -408,7 +406,8 @@
 ramChn :: Bool -> Int -> Fidelity -> Phsr -> Sig -> Sig
 ramChn isMono n winSize (Phsr file start end speed) pitch = 
     ifB (abs speed <* 0.001) 0 $ 
-        ramTab winSize (mkTab isMono n file ) (lphase (filelen $ text file) start end speed) pitch
+        ramTab winSize (mkTab isMono n file ) (lphase (filelen $ text file) start end (speed * srFactor)) (pitch * srFactor)
+    where srFactor = sig $ (filesr $ text file) / getSampleRate
 
 mkTab :: Bool -> Int ->  String -> Tab
 mkTab isMono chn file 
diff --git a/src/Csound/Base.hs b/src/Csound/Base.hs
--- a/src/Csound/Base.hs
+++ b/src/Csound/Base.hs
@@ -20,6 +20,9 @@
     module Data.Monoid,
     module Control.Applicative,
 
+    module Temporal.Media,
+    module Temporal.Class,
+
     -- * Opcodes
     module Csound.Typed.Opcode
 ) where
@@ -32,14 +35,17 @@
 import Csound.SigSpace
 import Csound.Options
 
+import Temporal.Media
+import Temporal.Class
+
 import Data.Boolean
 import Data.Default
 import Data.Monoid
 import Control.Applicative hiding ((<*))
     
 import Csound.Typed.Opcode hiding (
-    button, display, space, lfo, initc7, ctrl7
-    , oscInit, oscListen, oscSend, 
+    button, display, space, lfo, initc7, ctrl7,
+    oscInit, oscListen, oscSend, 
     lpshold, loopseg, loopxseg,
-    partikkel, syncgrain, granule, sndwarp, sndwarpst, fof2)
-
+    partikkel, syncgrain, granule, sndwarp, sndwarpst, fof2,
+    line, delay)
diff --git a/src/Csound/Control/Evt.hs b/src/Csound/Control/Evt.hs
--- a/src/Csound/Control/Evt.hs
+++ b/src/Csound/Control/Evt.hs
@@ -3,7 +3,7 @@
     Evt(..), Bam, Tick, 
 
     -- * Core functions
-    boolToEvt, evtToBool, sigToEvt, stepper,
+    boolToEvt, evtToBool, sigToEvt, evtToSig, stepper,
     filterE, filterSE, accumSE, accumE, filterAccumE, filterAccumSE,
 
     Snap, snapshot, snaps, sync, syncBpm, 
@@ -28,12 +28,20 @@
 import Data.Boolean
 import Data.Tuple
 
-import Csound.Typed
+import Temporal.Media
+
+import Csound.Typed hiding (evtToBool)
 import Csound.Typed.Opcode
 import Csound.Types(atArg)
 
 type Tick = Evt Unit
 
+evtToSig :: D -> (Evt D) -> Sig
+evtToSig initVal evts = retrigs (return . sig) $ fmap return $ devt initVal loadbang <> evts
+
+evtToBool :: Evt a -> BoolSig
+evtToBool a = ( ==* 1) $ changed $ return $ evtToSig 0 $ cycleE [1, 0] a
+
 -- | Constant event stream. It produces the same value (the first argument)
 -- all the time.
 devt :: D -> Evt a -> Evt D
@@ -58,8 +66,9 @@
 impulseE = sigToEvt . impulse
 
 -- | Makes an event stream from list of events.
-eventList :: [(D, D, a)] -> Evt [(D, D, a)]
-eventList es = fmap (const es) loadbang
+eventList :: [(D, D, a)] -> Evt (Sco a)
+eventList es = fmap (const $ har $ fmap singleEvent es) loadbang
+    where singleEvent (start, duration, content) = del start $ str duration $ temp content
 
 -- | Behaves like 'Csound.Opcode.Basic.changed', but returns an event stream.
 changedE :: [Sig] ->  Evt Unit
diff --git a/src/Csound/Control/Instr.hs b/src/Csound/Control/Instr.hs
--- a/src/Csound/Control/Instr.hs
+++ b/src/Csound/Control/Instr.hs
@@ -73,24 +73,19 @@
     -- the time domain (stretching the timeline) you can do it in the Mix-version
     -- (after the invokation of the instrument). All notes are rescaled all the
     -- way down the Score-structure. 
-    CsdSco(..), Mix, sco, mix, eff, CsdEventList(..), CsdEvent, 
+    Sco, Mix, sco, mix, eff,
     mixLoop, sco_, mix_, mixLoop_, mixBy, 
     infiniteDur,
+
+    module Temporal.Media,
     
     -- * Evt  
 
-    -- ** Singlular
-    trig, sched, retrig, schedHarp, schedUntil, schedToggle,
-    trig_, sched_, schedUntil_, 
-    trigBy, schedBy, schedHarpBy,
+    sched, retrig, schedHarp, schedUntil, schedToggle,
+    sched_, schedUntil_, 
+    schedBy, schedHarpBy,
     withDur,
 
-    -- ** Plural
-    trigs, scheds, retrigs, schedHarps, schedUntils, 
-    trigs_, scheds_, schedUntils_, 
-    trigsBy, schedsBy, schedHarpsBy,
-    withDurs,
-
     -- ** Misc
     alwaysOn,
 
@@ -99,35 +94,33 @@
     Outs(..), onArg, AmpInstr(..), CpsInstr(..)
 ) where
 
-import Csound.Typed
+import Csound.Typed 
 import Csound.Typed.Opcode hiding (initc7)
 import Csound.Control.Overload
+import Temporal.Media(Event(..), mapEvents)
 
 import Csound.Control.Evt(metroE, repeatE, splitToggle, loadbang)
+import Temporal.Media hiding (delay, line, chord, stretch)
 
 -- | Mixes the scores and plays them in the loop.
-mixLoop :: (CsdSco f, Sigs a) => f (Mix a) -> a
-mixLoop a = sched instr $ withDur dur $ repeatE unit $ metroE $ sig $ 1 / dur
-    where 
-        notes = toCsdEventList a
-        dur   = double $ csdEventListDur notes
-
-        instr _ = return $ mix notes
+mixLoop :: (Sigs a) => Sco (Mix a) -> a
+mixLoop a = sched instr $ withDur dt $ repeatE unit $ metroE $ sig $ 1 / dt
+    where  
+        dt = dur a   
+        instr _ = return $ mix a
 
 -- | Mixes the procedures and plays them in the loop.
-mixLoop_ :: (CsdSco f) => f (Mix Unit) -> SE ()
-mixLoop_ a = sched_ instr $ withDur dur $ repeatE unit $ metroE $ sig $ 1 / dur
+mixLoop_ :: Sco (Mix Unit) -> SE ()
+mixLoop_ a = sched_ instr $ withDur dt $ repeatE unit $ metroE $ sig $ 1 / dt
     where 
-        notes = toCsdEventList a
-        dur   = double $ csdEventListDur notes
-
-        instr _ = mix_ notes
+        dt = dur a
+        instr _ = mix_ a
 
 
 -- | Invokes an instrument with first event stream and 
 -- holds the note until the second event stream is active.
-schedUntils :: (Arg a, Sigs b) => (a -> SE b) -> Evt [a] -> Evt c -> b
-schedUntils instr onEvt offEvt = scheds instr' $ withDurs infiniteDur onEvt
+schedUntil :: (Arg a, Sigs b) => (a -> SE b) -> Evt a -> Evt c -> b
+schedUntil instr onEvt offEvt = sched instr' $ withDur infiniteDur onEvt
     where 
         instr' x = do 
             res <- instr x
@@ -143,85 +136,24 @@
 
 -- | Invokes an instrument with first event stream and 
 -- holds the note until the second event stream is active.
-schedUntils_ :: (Arg a) => (a -> SE ()) -> Evt [a] -> Evt c -> SE ()
-schedUntils_ instr onEvt offEvt = scheds_ instr' $ withDurs infiniteDur onEvt
+schedUntil_ :: (Arg a) => (a -> SE ()) -> Evt a -> Evt c -> SE ()
+schedUntil_ instr onEvt offEvt = sched_ instr' $ withDur infiniteDur onEvt
     where 
         instr' x = do 
             res <- instr x
             runEvt offEvt $ const $ turnoff
             return res
 
--- | Sets the same duration for all events. It's useful with the functions @scheds@, @schedsBy@, @scheds_@. 
-withDurs :: D -> Evt [a] -> Evt [(D, a)]
-withDurs dt = fmap $ fmap $ \x -> (dt, x) 
-
 -------------------------------------------------------------------------
 -------------------------------------------------------------------------
 -- singular
 
 -- | Sets the same duration for all events. It's useful with the functions @sched@, @schedBy@, @sched_@. 
-withDur :: D -> Evt a -> Evt (D, a)
-withDur dt = fmap $ \x -> (dt, x) 
-
--------------------------------------------------------------------------
--- sinlgular case for event triggers
-
-fromPlural :: (Evt [a] -> b) -> (Evt a -> b)
-fromPlural f = f . fmap return
-
-fromPluralBy :: ((c -> Evt [a]) -> c -> b) -> ((c -> Evt a) -> c -> b)
-fromPluralBy f instr c = f (fmap return . instr) c
-
--- | Triggers an instrument with an event stream. The event stream
--- contains triples:
---
--- > (delay_after_event_is_fired, duration_of_the_event, argument_for_the_instrument)
-trig :: (Arg a, Sigs b) => (a -> SE b) -> Evt (D, D, a) -> b
-trig f = fromPlural $ trigs f
-
--- | It's like the function @trig@, but delay is set to zero.
-sched :: (Arg a, Sigs b) => (a -> SE b) -> Evt (D, a) -> b
-sched f = fromPlural $ scheds f
+withDur :: D -> Evt a -> Evt (Sco a)
+withDur dt = fmap (str dt . temp)
 
 retrig :: (Arg a, Sigs b) => (a -> SE b) -> Evt a -> b
-retrig f = fromPlural $ retrigs f
-
--- | An instrument is triggered with event stream and delay time is set to zero 
--- (event fires immediately) and duration is set to infinite time. The note is 
--- held while the instrument is producing something. If the instrument is silent
--- for some seconds (specified in the first argument) then it's turned off.
-schedHarp :: (Arg a, Sigs b) => D -> (a -> SE b) -> Evt a -> b
-schedHarp dt f = fromPlural $ schedHarps dt f
-
--- | Invokes an instrument with first event stream and 
--- holds the note until the second event stream is active.
-schedUntil :: (Arg a, Sigs b) => (a -> SE b) -> Evt a -> Evt c -> b
-schedUntil f eOn eOff = schedUntils f (fmap return eOn) eOff
-
--- | Triggers a procedure on the event stream.
-trig_ :: Arg a => (a -> SE ()) -> Evt (D, D, a) -> SE ()
-trig_ f = fromPlural $ trigs_ f
-
--- | Triggers a procedure on the event stream. A delay time is set to zero.
-sched_ :: Arg a => (a -> SE ()) -> Evt (D, a) -> SE ()
-sched_ f = fromPlural $ scheds_ f
-
--- | Invokes an instrument with first event stream and 
--- holds the note until the second event stream is active.
-schedUntil_ :: Arg a => (a -> SE ()) -> Evt a -> Evt c -> SE ()
-schedUntil_ f eOn eOff = schedUntils_ f (fmap return eOn) eOff
-
--- | A closure to trigger an instrument inside the body of another instrument.
-trigBy :: (Arg a, Sigs b, Arg c) => (a -> SE b) -> (c -> Evt (D, D, a)) -> c -> b
-trigBy f = fromPluralBy $ trigsBy f
-
--- | A closure to trigger an instrument inside the body of another instrument.
-schedBy :: (Arg a, Sigs b, Arg c) => (a -> SE b) -> (c -> Evt (D, a)) -> c -> b
-schedBy f = fromPluralBy $ schedsBy f
-
--- | A closure to trigger an instrument inside the body of another instrument.
-schedHarpBy :: (Arg a, Sigs b, Arg c) => D -> (a -> SE b) -> (c -> Evt a) -> c -> b
-schedHarpBy dt f = fromPluralBy $ schedHarpsBy dt f
+retrig f = retrigs f . fmap return
 
 -- | Executes some procedure for the whole lifespan of the program,
 alwaysOn :: SE () -> SE ()
