packages feed

csound-expression 5.3.4 → 5.4.0

raw patch · 11 files changed

+330/−74 lines, 11 filesdep ~csound-expression-dynamicdep ~csound-expression-opcodesdep ~csound-expression-typedPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: csound-expression-dynamic, csound-expression-opcodes, csound-expression-typed

API changes (from Hackage documentation)

+ Csound.Air.Sco: bn :: Sco a -> Sco a
+ Csound.Air.Sco: bnr :: Sco a
+ Csound.Air.Sco: dbn :: Sco a -> Sco a
+ Csound.Air.Sco: dbnr :: Sco a
+ Csound.Air.Sco: ddot :: Sco a -> Sco a
+ Csound.Air.Sco: den :: Sco a -> Sco a
+ Csound.Air.Sco: denr :: Sco a
+ Csound.Air.Sco: dhn :: Sco a -> Sco a
+ Csound.Air.Sco: dhnr :: Sco a
+ Csound.Air.Sco: dot :: Sco a -> Sco a
+ Csound.Air.Sco: dqn :: Sco a -> Sco a
+ Csound.Air.Sco: dqnr :: Sco a
+ Csound.Air.Sco: dsn :: Sco a -> Sco a
+ Csound.Air.Sco: dsnr :: Sco a
+ Csound.Air.Sco: dtn :: Sco a -> Sco a
+ Csound.Air.Sco: dtnr :: Sco a
+ Csound.Air.Sco: dwn :: Sco a -> Sco a
+ Csound.Air.Sco: dwnr :: Sco a
+ Csound.Air.Sco: en :: Sco a -> Sco a
+ Csound.Air.Sco: enr :: Sco a
+ Csound.Air.Sco: euc :: Double -> Double -> [Double] -> [Sco a] -> Sco a
+ Csound.Air.Sco: hn :: Sco a -> Sco a
+ Csound.Air.Sco: hnr :: Sco a
+ Csound.Air.Sco: qn :: Sco a -> Sco a
+ Csound.Air.Sco: qnr :: Sco a
+ Csound.Air.Sco: scoBpm :: Sig -> Sco a -> Sco a
+ Csound.Air.Sco: sn :: Sco a -> Sco a
+ Csound.Air.Sco: snr :: Sco a
+ Csound.Air.Sco: tn :: Sco a -> Sco a
+ Csound.Air.Sco: tnr :: Sco a
+ Csound.Air.Sco: trn :: Sco a -> Sco a
+ Csound.Air.Sco: wn :: Sco a -> Sco a
+ Csound.Air.Sco: wnr :: Sco a
+ Csound.Air.Wave: ldisk :: Str -> Sig2
+ Csound.Air.Wave: ldisk1 :: Str -> Sig
+ Csound.Air.Wave: losc :: Tab -> Sig2
+ Csound.Air.Wave: losc3 :: Tab -> Sig2
+ Csound.Air.Wave: loscCfd :: D -> Tab -> Sig2
+ Csound.Air.Wave: loscCfd' :: (D, D) -> D -> Tab -> Sig2
+ Csound.Air.Wave: monoLosc :: Tab -> Sig
+ Csound.Air.Wave: rdisk :: Str -> Sig2
+ Csound.Air.Wave: rdisk1 :: Str -> Sig
+ Csound.Air.Wave: rosc :: Tab -> Sig2
+ Csound.Control.Evt: delEvt :: Arg a => D -> Evt a -> Evt a
+ Csound.Control.Instr: schedStream :: (Arg a, Sigs b) => D -> D -> (a -> SE b) -> Evt a -> SE b
+ Csound.Control.Midi: midiCtrl7A :: D -> D -> D -> D -> D -> SE Sig
+ Csound.Control.Midi: midiCtrlA :: D -> D -> D -> SE Sig
+ Csound.Control.Midi: umidiCtrlA :: D -> D -> D -> SE Sig
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd (Csound.Typed.Control.Mix.Sco (Csound.Typed.Control.Mix.Mix a))
+ Csound.IO: instance Csound.Typed.Types.Tuple.Sigs a => Csound.IO.RenderCsd [Csound.Typed.Control.Mix.Sco (Csound.Typed.Control.Mix.Mix a)]
+ Csound.Tab: tabDur :: Tab -> D
+ Csound.Tab: wavAll :: String -> Tab
- Csound.Types: class (IsPrim a, RealFrac PrimOf a, Val a) => SigOrD a
+ Csound.Types: class (IsPrim a, RealFrac PrimOf a, Val a, Floating a) => SigOrD a

Files

csound-expression.cabal view
@@ -1,5 +1,5 @@ Name:          csound-expression-Version:       5.3.4+Version:       5.4.0 Cabal-Version: >= 1.22 License:       BSD3 License-file:  LICENSE@@ -85,10 +85,10 @@         colour >= 2.0,         transformers >= 0.3,         containers,-        csound-expression-typed >= 0.2.4,-        csound-expression-dynamic >= 0.3.6,+        csound-expression-typed >= 0.2.5,+        csound-expression-dynamic >= 0.3.7,         temporal-media >= 0.6.3,-        csound-expression-opcodes >= 0.0.5.0+        csound-expression-opcodes >= 0.0.5.1   default-language: Haskell2010   Hs-Source-Dirs:      src/   Exposed-Modules:@@ -116,6 +116,7 @@         Csound.Air.Fm         Csound.Air.Pan         Csound.Air.Padsynth+        Csound.Air.Sco          Csound.Types         Csound.Tab
src/Csound/Air.hs view
@@ -1,18 +1,18 @@ -- | The vital tools.-module Csound.Air (      +module Csound.Air (     -- | The basic sound waves: pure sine, sawtooth, square, triangle, LFOs.     module Csound.Air.Wave,     -- | Hard and soft sync     module Csound.Air.Wave.Sync,      -- | Envelope generators.-    module Csound.Air.Envelope,  +    module Csound.Air.Envelope,      -- | Filters-    module Csound.Air.Filter, +    module Csound.Air.Filter,      -- | Argument modifiers-    module Csound.Air.ModArg,     +    module Csound.Air.ModArg,      -- | Sound file playback     module Csound.Air.Wav,@@ -22,21 +22,24 @@     module Csound.Air.Granular.Morpheus,      -- | Spectral Processing-    module Csound.Air.Spec, +    module Csound.Air.Spec,      -- | Effects: reverbs, choruses, delays etc.-    module Csound.Air.Fx,  -    module Csound.Air.Fx.FxBox,  +    module Csound.Air.Fx,+    module Csound.Air.Fx.FxBox,      -- | Widgets to make live performances.-    module Csound.Air.Live, +    module Csound.Air.Live,      -- | A multitap looper.-    module Csound.Air.Looper, +    module Csound.Air.Looper,      -- | Patches.-    module Csound.Air.Patch,   +    module Csound.Air.Patch, +    -- | Shortcuts for Scores.+    module Csound.Air.Sco,+     -- | Scheduling signals with event streams     module Csound.Air.Seg, @@ -70,6 +73,7 @@ import Csound.Air.Live import Csound.Air.Looper import Csound.Air.Patch+import Csound.Air.Sco import Csound.Air.Seg import Csound.Air.Sampler import Csound.Air.Pan
src/Csound/Air/Looper.hs view
@@ -12,7 +12,7 @@ import Data.Boolean hiding (cond) import Csound.Typed import Csound.Typed.Gui hiding (button)-import Csound.Control.Evt+import Csound.Control.Evt hiding (delEvt) import Csound.Control.Instr import Csound.Control.Gui import Csound.Control.Sf
+ src/Csound/Air/Sco.hs view
@@ -0,0 +1,114 @@+-- | Utils for Scores+module Csound.Air.Sco(+    euc, dot, ddot, scoBpm, trn,+    -- * Shortcuts+    -- | Naming conventions :+    --+    -- First part @x@ can be [b | w | h | q | e | s | t | d[x] ]+    --+    -- @b@ means brewis @(str 2)@+    --+    -- @w@ means whole @(str 1)@+    --+    -- @h@ means half @(str $ 1/2)@+    --+    -- @q@ means quater @(str $ 1/4)@+    --+    -- @e@ means eighth @(str $ 1/8)@+    --+    -- @s@ means sixteenth @(str $ 1/16)@+    --+    -- @t@ means thirty second @(str $ 1/32)@+    --+    -- @d[x]@ means dotted [x] @(str 1.5 $ x)@+    bn, wn, hn, qn, en, sn, tn,+    dbn, dwn, dhn, dqn, den, dsn, dtn,++    -- ** Pauses+    -- | Naming conventions are the same as for 'time string'.+    bnr, wnr, hnr, qnr, enr, snr, tnr,+    dbnr, dwnr, dhnr, dqnr, denr, dsnr, dtnr,+) where++import Csound.Typed.Types+import Csound.Typed.Control+import Temporal.Media++-- | Euclidean beats.+--+-- Scales series of scores by apllying series of stretching transformations.+--+-- > euc totalLength initDelay durations scores+euc :: Double -> Double -> [Double] -> [Sco a] -> Sco a+euc len delTime durs scos =+  go (delTime, rest (sig $ double delTime)) $ zip (cycle durs) (cycle scos)+  where+    go :: (Double, Sco a) -> [(Double, Sco  a)] -> Sco a+    go (time, res) xs = case xs of+      []             -> res+      (dt, a) : tl ->+        let nextTime = time + dt+        in  if nextTime < len+              then go (nextTime, mel [res, str (sig $ double dt) a]) tl+              else let dtReduced = len - time+                   in  mel [res, str (sig $ double dtReduced) a]++-- | Sets tempo in beats per minute,+-- if 1 "Dur" is equal to 1 second before transformation.+scoBpm :: Sig -> (Sco a -> Sco a)+scoBpm beat = str (x1/x0)+    where x0 = 0.25+          x1 = 60/beat++-- | Means 'three notes'. Plays three notes as fast as two.+trn :: Sco a -> Sco a+trn = str (2/3)++bn, wn, hn, qn, en, sn, tn  :: Sco a -> Sco a++bn = str 2+wn = id+hn = str $ 1/2+qn = str $ 1/4+en = str $ 1/8+sn = str $ 1/16+tn = str $ 1/32++dbn, dwn, dhn, dqn, den, dsn, dtn :: Sco a -> Sco a++-- | Synonym to @'str' (3/2)@+dot :: Sco a -> Sco a+dot = str $ 3/2++-- | double 'dot', str with 1.75+ddot :: Sco a -> Sco a+ddot = str 1.75++dbn = dot . bn+dwn = dot . wn+dhn = dot . hn+dqn = dot . qn+den = dot . en+dsn = dot . sn+dtn = dot . tn++bnr, wnr, hnr, qnr, enr, snr, tnr :: Sco a++wnr = rest 1++bnr = bn wnr+hnr = hn wnr+qnr = qn wnr+enr = en wnr+snr = sn wnr+tnr = tn wnr++dbnr, dwnr, dhnr, dqnr, denr, dsnr, dtnr :: Sco a++dbnr = dbn wnr+dwnr = dwn wnr+dhnr = dhn wnr+dqnr = dqn wnr+denr = den wnr+dsnr = dsn wnr+dtnr = dtn wnr
src/Csound/Air/Wave.hs view
@@ -49,12 +49,18 @@     urspline, birspline,      -- * Buzzes-    buz, gbuz, buz', gbuz'+    buz, gbuz, buz', gbuz',++    -- * Loop over files in ram+    losc, losc3, rosc, monoLosc, loscCfd, loscCfd',++    -- * Loop over files from disk+    ldisk, rdisk, ldisk1, rdisk1 ) where  import Csound.Typed import Csound.Typed.Opcode hiding (lfo)-import Csound.Tab(sine, cosine, triTab, pwTab, sawTab, sqrTab)+import Csound.Tab(sine, cosine, triTab, pwTab, sawTab, sqrTab, tabDur)  type Wave = Sig -> SE Sig @@ -448,4 +454,58 @@  urndRawPw :: Double -> Sig -> SE Sig urndRawPw duty = urndOscBy (pwTab duty)++-----------------------------++-- | Loops with cross-fades at the ends.+-- We can specify loop segment (in seconds).+loscCfd' :: (D, D) -> D -> Tab -> Sig2+loscCfd' (start, end) rel tb = ar2 $ flooper 1 1 start end rel tb++-- | Loops with cross-fades at the ends. Uses entire file length+loscCfd :: D -> Tab -> Sig2+loscCfd rel tb = ar2 $ flooper 1 1 0 (tabDur tb - rel - 0.1) rel tb++-- | Reversed loop over table stereo files. Uses flooper under the hood.+rosc :: Tab -> Sig2+rosc tb = ar2 $ flooper 1 (-1) 0 (tabDur tb) 0 tb++-- | Loop over table stereo files. Uses loscil3 under the hood.+-- Watch out for sample rates! If file sample rate is different+-- from global project sample rate then playback will be distorted.+losc :: Tab -> Sig2+losc tb = loscil 1 1 tb `withDs` [1, 1]++-- | Loop over table stereo files with cubic interpolation. Uses loscil3 under the hood.+-- Watch out for sample rates! If file sample rate is different+-- from global project sample rate then playback will be distorted.+losc3 :: Tab -> Sig2+losc3 tb = loscil3 1 1 tb `withDs` [1, 1]++-- | Loop over table mono files. Uses loscil3 under the hood.+-- Watch out for sample rates! If file sample rate is different+-- from global project sample rate then playback will be distorted.+monoLosc :: Tab -> Sig+monoLosc tb = loscil3 1 1 tb `withDs` [1, 1]++-- | Loop from disk (stereo files)+ldisk :: Str -> Sig2+ldisk name = diskin2 name `withDs` [1, 0, 1]++-- | Reversed loop from disk (stereo files)+rdisk :: Str -> Sig2+rdisk name = diskin2 name `withDs` [-1, 0, 1]++-- | Loop from disk (mono files)+ldisk1 :: Str -> Sig+ldisk1 name = diskin2 name `withDs` [1, 0, 1]++-- | Reversed loop from disk (mono files)+rdisk1 :: Str -> Sig+rdisk1 name = diskin2 name `withDs` [-1, 0, 1]+++++ 
src/Csound/Base.hs view
@@ -45,6 +45,7 @@ import Data.Monoid import Control.Applicative hiding ((<*)) + import Csound.Typed.Opcode hiding (     button, display, space, lfo, initc7, ctrl7,     oscInit, oscListen, oscSend,
src/Csound/Control/Evt.hs view
@@ -9,7 +9,7 @@     Snap, snapshot, readSnap, snaps, snaps2, sync, syncBpm,      -- * Opcodes-    metro, gaussTrig, dust, metroSig, dustSig, dustSig2, impulseE, changedE, triggerE, loadbang, impulse, metroE,+    metro, gaussTrig, dust, metroSig, dustSig, dustSig2, impulseE, changedE, triggerE, loadbang, impulse, metroE, delEvt,      -- * Higher-level event functions     devt, eventList,@@ -247,7 +247,7 @@  takeByWeight :: (Tuple a, Arg a) => [Sig] -> [a] -> D -> a takeByWeight accumWeights vals atD =-    guardedArg (zipWith (\w val -> (atD `lessThan` ir w, val)) accumWeights vals) (last vals)+    guardedTuple (zipWith (\w val -> (sig atD `lessThan` w, val)) accumWeights vals) (last vals)  accumWeightList :: Num a => [a] -> [a] accumWeightList = go 0@@ -340,4 +340,11 @@ -- | Drops events while the predicate is true. dropWhileE :: (a -> BoolD) -> Evt a -> Evt a dropWhileE p = fmap fst . filterE (notB . snd) . accumE (1 :: D) (\a s -> let s1 = s ==* 1 &&* p a in ((a, s1), ifB s1 1 0))++-- | Delays event stream by given amount of seconds+delEvt :: Arg a => D -> Evt a -> Evt a+delEvt dt ev = Evt $ \bam -> do+  insId <- newInstr bam+  runEvt ev $ \a -> scheduleEvent insId dt 0 a+ 
src/Csound/Control/Instr.hs view
@@ -84,6 +84,7 @@     sched, retrig, schedHarp, schedUntil, schedToggle,     sched_, schedUntil_,     schedBy, schedHarpBy,+    schedStream,     withDur, monoSched,      -- * Api@@ -169,6 +170,20 @@     writeRef ref 0     when1 onSig $ writeRef ref =<< instr msg     readRef ref+++-- | Plays infinite notes for a given instrument with event stream.+-- It allows for note overlap on release. We can specify release time on seconds+-- in the first argument.+--+-- > schedStream releaseTime instr evt+schedStream :: (Arg a, Sigs b) => D -> D -> (a -> SE b) -> Evt a -> SE b+schedStream start rel ins evt = do+  (insId, res) <- newOutInstr ins+  runEvt evt $ \x -> do+    scheduleEvent (negateInstrRef insId) 0 rel x+    scheduleEvent insId start (-1) x+  return res  ------------------------------------------------------------------------- -------------------------------------------------------------------------
src/Csound/Control/Midi.hs view
@@ -14,6 +14,7 @@     midiKeyOn, midiKeyOff,     -- * Reading midi note parameters     cpsmidi, ampmidi, initc7, ctrl7, midiCtrl7, midiCtrl, umidiCtrl,+    midiCtrl7A, midiCtrlA, umidiCtrlA,     ampmidinn,      -- ** Custom temperament@@ -167,7 +168,7 @@  genAmpCpsSig :: (Msg -> D) -> ((Msg -> SE Sig) -> SE Sig) -> SE MonoArg genAmpCpsSig key2cps midiFun = do-    ref <- newGlobalRef ((0, 0) :: (Sig, Sig))+    ref <- newGlobalCtrlRef ((0, 0) :: (Sig, Sig))     status <- midiFun (instr ref)     (amp, cps) <- readRef ref     return $ makeMonoArg (amp, cps) status@@ -187,7 +188,7 @@  filteredGenAmpCpsSig :: (Msg -> D) -> ((Msg -> SE Sig) -> SE Sig) -> (D -> BoolD) -> SE MonoArg filteredGenAmpCpsSig key2cps midiFun condition  = do-    ref <- newGlobalRef ((0, 0) :: (Sig, Sig))+    ref <- newGlobalCtrlRef ((0, 0) :: (Sig, Sig))     status <- midiFun (instr ref)     (amp, cps) <- readRef ref     return $ makeMonoArg (amp, cps) status@@ -213,7 +214,7 @@  genHoldAmpCpsSig :: (Msg -> D) -> ((Msg -> SE ()) -> SE ()) -> SE (Sig, Sig) genHoldAmpCpsSig key2cps midiFun = do-  ref <- newGlobalRef ((0, 0) :: (Sig, Sig))+  ref <- newGlobalCtrlRef ((0, 0) :: (Sig, Sig))   midiFun (instr ref)   (amp, cps) <- readRef ref   return (downsamp amp, downsamp cps)@@ -236,8 +237,8 @@  namedAmpCpsSig:: String -> SE (Sig, Sig, Sig) namedAmpCpsSig name = do-  ref <- newGlobalRef ((0, 0) :: (Sig, Sig))-  statusRef <- newGlobalRef (0 :: Sig)+  ref <- newGlobalCtrlRef ((0, 0) :: (Sig, Sig))+  statusRef <- newGlobalCtrlRef (0 :: Sig)   status <- trigByNameMidi name (instr statusRef ref)   writeRef statusRef status   let resStatus = ifB (downsamp status ==* 0) 0 1@@ -266,8 +267,8 @@  midiKeyOnBy :: MidiFun Sig -> D -> SE (Evt D) midiKeyOnBy midiFun key = do-  chRef  <- newGlobalRef (0 :: Sig)-  evtRef <- newGlobalRef (0 :: Sig)+  chRef  <- newGlobalCtrlRef (0 :: Sig)+  evtRef <- newGlobalCtrlRef (0 :: Sig)   writeRef chRef =<< midiFun instr    alwaysOn $ do@@ -284,8 +285,8 @@  midiKeyOffBy :: MidiFun Sig -> D -> SE Tick midiKeyOffBy midiFun key = do-  chRef  <- newGlobalRef (0 :: Sig)-  evtRef <- newGlobalRef (0 :: Sig)+  chRef  <- newGlobalCtrlRef (0 :: Sig)+  evtRef <- newGlobalCtrlRef (0 :: Sig)   writeRef chRef =<< midiFun instr    alwaysOn $ do@@ -305,19 +306,33 @@ initc7 :: D -> D -> D -> SE () initc7 = initMidiCtrl --- | Initializes midi control and get the value in the specified range.+-- | Initializes control rate midi control and get the value in the specified range. midiCtrl7 :: D -> D -> D -> D -> D -> SE Sig midiCtrl7 chno ctrlno ival imin imax = do     initc7 chno ctrlno ival-    return $ ctrl7 chno ctrlno imin imax+    return $ kr $ ctrl7 chno ctrlno imin imax --- | Initializes midi control and get the value in the range (-1) to 1.+-- | Initializes control rate midi control and get the value in the range (-1) to 1. midiCtrl :: D -> D -> D -> SE Sig midiCtrl chno ctrlno ival = midiCtrl7 chno ctrlno ival (-1) 1 --- | Unipolar midiCtrl. Initializes midi control and get the value in the range 0 to 1.+-- | Unipolar control rate midiCtrl. Initializes midi control and get the value in the range 0 to 1. umidiCtrl :: D -> D -> D -> SE Sig umidiCtrl chno ctrlno ival = midiCtrl7 chno ctrlno ival 0 1++-- | Initializes audio-rate midi control and get the value in the specified range.+midiCtrl7A :: D -> D -> D -> D -> D -> SE Sig+midiCtrl7A chno ctrlno ival imin imax = do+    initc7 chno ctrlno ival+    return $ ar $ ctrl7 chno ctrlno imin imax++-- | Initializes audio-rate midi control and get the value in the range (-1) to 1.+midiCtrlA :: D -> D -> D -> SE Sig+midiCtrlA chno ctrlno ival = midiCtrl7A chno ctrlno ival (-1) 1++-- | Unipolar audio-rate midiCtrl. Initializes midi control and get the value in the range 0 to 1.+umidiCtrlA :: D -> D -> D -> SE Sig+umidiCtrlA chno ctrlno ival = midiCtrl7A chno ctrlno ival 0 1  -------------------------------------------------------------- 
src/Csound/IO.hs view
@@ -79,6 +79,7 @@ import Csound.Control.Gui  import Csound.Options(setSilent, setDac, setAdc, setDacBy, setAdcBy, setCabbage)+import Temporal.Class(Harmony(..))  import qualified Data.List as L @@ -109,22 +110,36 @@  #if __GLASGOW_HASKELL__ >= 710 instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd a where-    renderCsdBy opt a = render opt (return a)-    csdArity a = CsdArity 0 (tupleArity a)+  renderCsdBy opt a = render opt (return a)+  csdArity a = CsdArity 0 (tupleArity a)  instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (SE a) where-    renderCsdBy opt a = render opt a-    csdArity a = CsdArity 0 (outArity a)+  renderCsdBy opt a = render opt a+  csdArity a = CsdArity 0 (outArity a)  instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (Source a) where-    renderCsdBy opt a = renderCsdBy opt (fromSource a)-    csdArity a = CsdArity 0 (tupleArity $ proxySource a)+  renderCsdBy opt a = renderCsdBy opt (fromSource a)+  csdArity a = CsdArity 0 (tupleArity $ proxySource a)       where  instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (Source (SE a)) where-    renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)-    csdArity a = CsdArity 0 (tupleArity $ proxySE $ proxySource a)+  renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)+  csdArity a = CsdArity 0 (tupleArity $ proxySE $ proxySource a) +instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd (Sco (Mix a)) where+  renderCsdBy opt a = renderCsdBy opt (mix a)+  csdArity a = CsdArity 0 (tupleArity $ proxy a)+    where+      proxy :: Sco (Mix a) -> a+      proxy = const undefined++instance {-# OVERLAPPABLE #-} Sigs a => RenderCsd [Sco (Mix a)] where+  renderCsdBy opt a = renderCsdBy opt (mix $ har a)+  csdArity a = CsdArity 0 (tupleArity $ proxy a)+    where+      proxy :: [Sco (Mix a)] -> a+      proxy = const undefined+ #endif  proxySource :: Source a -> a@@ -364,59 +379,74 @@ #if __GLASGOW_HASKELL__ < 710  -- Sig+setArity n a = CsdArity 0 n -instance RenderCsd Sig                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig                  where { renderCsdBy opt a = render opt (return a)             , csdArity = setArity 1 }+instance RenderCsd (SE Sig)             where { renderCsdBy opt a = render opt a }                    , csdArity = setArity 1 }+instance RenderCsd (Source Sig)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)    , csdArity = setArity 1 }+instance RenderCsd (Source (SE Sig))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a)  , csdArity = setArity 1 }  -- Sig2 -instance RenderCsd Sig2                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig2)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig2)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig2))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig2                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 2 }+instance RenderCsd (SE Sig2)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 2 }+instance RenderCsd (Source Sig2)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 2 }+instance RenderCsd (Source (SE Sig2))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 2 }  -- Sig3 -instance RenderCsd Sig3                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig3)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig3)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig3))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig3                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 3 }+instance RenderCsd (SE Sig3)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 3 }+instance RenderCsd (Source Sig3)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 3 }+instance RenderCsd (Source (SE Sig3))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 3 }  -- Sig4 -instance RenderCsd Sig4                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig4)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig4)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig4))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig4                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 4 }+instance RenderCsd (SE Sig4)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 4 }+instance RenderCsd (Source Sig4)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 4 }+instance RenderCsd (Source (SE Sig4))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 4 }  -- Sig5 -instance RenderCsd Sig5                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig5)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig5)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig5))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig5                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 5 }+instance RenderCsd (SE Sig5)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 5 }+instance RenderCsd (Source Sig5)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 5 }+instance RenderCsd (Source (SE Sig5))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 5 }  -- Sig6 -instance RenderCsd Sig6                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig6)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig6)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig6))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig6                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 6 }+instance RenderCsd (SE Sig6)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 6 }+instance RenderCsd (Source Sig6)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 6 }+instance RenderCsd (Source (SE Sig6))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 6 }  -- Sig7 -instance RenderCsd Sig7                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig7)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig7)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig7))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig7                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 7 }+instance RenderCsd (SE Sig7)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 7 }+instance RenderCsd (Source Sig7)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 7 }+instance RenderCsd (Source (SE Sig7))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 7 } + -- Sig8 -instance RenderCsd Sig8                  where { renderCsdBy opt a = render opt (return a) }-instance RenderCsd (SE Sig8)             where { renderCsdBy opt a = render opt a }-instance RenderCsd (Source Sig8)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a) }-instance RenderCsd (Source (SE Sig8))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) }+instance RenderCsd Sig8                  where { renderCsdBy opt a = render opt (return a)            , csdArity = setArity 8 }+instance RenderCsd (SE Sig8)             where { renderCsdBy opt a = render opt a                     , csdArity = setArity 8 }+instance RenderCsd (Source Sig8)         where { renderCsdBy opt a = renderCsdBy opt (fromSource a)   , csdArity = setArity 8 }+instance RenderCsd (Source (SE Sig8))    where { renderCsdBy opt a = renderCsdBy opt (fromSourceSE a) , csdArity = setArity 8 }+++instance RenderCsd (Sco (Mix Sig))       where { renderCsdBy opt a = renderCsdBy opt $ mix a , csdArity = setArity 1 }+instance RenderCsd (Sco (Mix Sig2))      where { renderCsdBy opt a = renderCsdBy opt $ mix a , csdArity = setArity 2 }+instance RenderCsd (Sco (Mix Sig3))      where { renderCsdBy opt a = renderCsdBy opt $ mix a , csdArity = setArity 3 }+instance RenderCsd (Sco (Mix Sig4))      where { renderCsdBy opt a = renderCsdBy opt $ mix a , csdArity = setArity 4 }+instance RenderCsd (Sco (Mix Sig5))      where { renderCsdBy opt a = renderCsdBy opt $ mix a , csdArity = setArity 5 }++instance RenderCsd [Sco (Mix Sig)]       where { renderCsdBy opt a = renderCsdBy opt $ mix $ har a , csdArity = setArity 1 }+instance RenderCsd [Sco (Mix Sig2)]      where { renderCsdBy opt a = renderCsdBy opt $ mix $ har a , csdArity = setArity 2 }+instance RenderCsd [Sco (Mix Sig3)]      where { renderCsdBy opt a = renderCsdBy opt $ mix $ har a , csdArity = setArity 3 }+instance RenderCsd [Sco (Mix Sig4)]      where { renderCsdBy opt a = renderCsdBy opt $ mix $ har a , csdArity = setArity 4 }+instance RenderCsd [Sco (Mix Sig5)]      where { renderCsdBy opt a = renderCsdBy opt $ mix $ har a , csdArity = setArity 5 }  #endif
src/Csound/Tab.hs view
@@ -9,7 +9,7 @@      -- * Table querries -    nsamp, ftlen, ftsr, ftchnls, ftcps,+    nsamp, ftlen, ftsr, ftchnls, ftcps, tabDur,      -- * Table granularity     TabFi, fineFi, coarseFi,@@ -23,7 +23,7 @@      -- * Read from files     WavChn(..), Mp3Chn(..),-    wavs, wavLeft, wavRight, mp3s, mp3Left, mp3Right, mp3m,+    wavs, wavAll, wavLeft, wavRight, mp3s, mp3Left, mp3Right, mp3m,     readNumFile, readTrajectoryFile, readPvocex, readMultichannel,      -- * (In)Harmonic series@@ -271,6 +271,10 @@ instance Default Mp3Chn where     def = Mp3All +-- | Load lossless stereo file to table.+wavAll :: String -> Tab+wavAll name = wavs name 0 WavAll+ -- | Reads left channel of audio-file wavLeft :: String -> Tab wavLeft file = wavs file 0 WavLeft@@ -799,6 +803,11 @@ -- | Transforms phasor that is defined in seconds to relative phasor that ranges in 0 to 1. sec2rel :: Tab -> Sig -> Sig sec2rel tab x = x / (sig $ ftlen tab / getSampleRate)++-- | Table length in seconds for files that are read with GEN01+-- (which a re read with functions like wavs, wavTab, wavLeft, wavRight).+tabDur :: Tab -> D+tabDur t = ftlen t / (ftsr t * ftchnls t)  ---------------------------------------------------