csound-expression-typed 0.0.7.0 → 0.0.7.1
raw patch · 4 files changed
+99/−74 lines, 4 filesdep ~csound-expression-dynamicPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: csound-expression-dynamic
API changes (from Hackage documentation)
- Csound.Typed.Types.Prim: instance Num (Sig, Sig)
- Csound.Typed.Types.Prim: instance Num (Sig, Sig, Sig)
- Csound.Typed.Types.Prim: instance Num (Sig, Sig, Sig, Sig)
- Csound.Typed.Types.Prim: instance Num (Sig, Sig, Sig, Sig, Sig, Sig)
- Csound.Typed.Types.Prim: instance Num (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)
- Csound.Typed.Types.Tuple: instance Sigs (Sig, Sig)
- Csound.Typed.Types.Tuple: instance Sigs (Sig, Sig, Sig, Sig)
- Csound.Typed.Types.Tuple: instance Sigs (Sig, Sig, Sig, Sig, Sig, Sig)
- Csound.Typed.Types.Tuple: instance Sigs (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)
+ Csound.Typed.Types.Tuple: instance Num (Sig8, Sig8)
+ Csound.Typed.Types.Tuple: instance Num (Sig8, Sig8, Sig8, Sig8)
+ Csound.Typed.Types.Tuple: instance Num Sig2
+ Csound.Typed.Types.Tuple: instance Num Sig3
+ Csound.Typed.Types.Tuple: instance Num Sig4
+ Csound.Typed.Types.Tuple: instance Num Sig6
+ Csound.Typed.Types.Tuple: instance Num Sig8
+ Csound.Typed.Types.Tuple: instance Sigs (Sig8, Sig8)
+ Csound.Typed.Types.Tuple: instance Sigs (Sig8, Sig8, Sig8, Sig8)
+ Csound.Typed.Types.Tuple: instance Sigs Sig2
+ Csound.Typed.Types.Tuple: instance Sigs Sig4
+ Csound.Typed.Types.Tuple: instance Sigs Sig6
+ Csound.Typed.Types.Tuple: instance Sigs Sig8
+ Csound.Typed.Types.Tuple: type Sig2 = (Sig, Sig)
+ Csound.Typed.Types.Tuple: type Sig3 = (Sig, Sig, Sig)
+ Csound.Typed.Types.Tuple: type Sig4 = (Sig, Sig, Sig, Sig)
+ Csound.Typed.Types.Tuple: type Sig5 = (Sig, Sig, Sig, Sig, Sig)
+ Csound.Typed.Types.Tuple: type Sig6 = (Sig, Sig, Sig, Sig, Sig, Sig)
+ Csound.Typed.Types.Tuple: type Sig8 = (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)
Files
- csound-expression-typed.cabal +2/−2
- src/Csound/Typed/Render.hs +14/−13
- src/Csound/Typed/Types/Prim.hs +0/−47
- src/Csound/Typed/Types/Tuple.hs +83/−12
csound-expression-typed.cabal view
@@ -1,5 +1,5 @@ Name: csound-expression-typed-Version: 0.0.7.0+Version: 0.0.7.1 Cabal-Version: >= 1.6 License: BSD3 License-file: LICENSE@@ -25,7 +25,7 @@ Ghc-Options: -Wall Build-Depends: base >= 4, base < 5, ghc-prim, containers, transformers >= 0.3, Boolean >= 0.1.0, colour >= 2.0, data-default, deepseq,- wl-pprint, stable-maps >= 0.0.3.3, csound-expression-dynamic >= 0.1.1+ wl-pprint, stable-maps >= 0.0.3.3, csound-expression-dynamic >= 0.1.2 Hs-Source-Dirs: src/ Exposed-Modules: Csound.Typed
src/Csound/Typed/Render.hs view
@@ -26,12 +26,12 @@ import Csound.Typed.Gui.Gui(guiStmt, panelIsKeybdSensitive) -toCsd :: Tuple a => Options -> SE a -> GE Csd-toCsd options sigs = do +toCsd :: Tuple a => Maybe Int -> Options -> SE a -> GE Csd+toCsd mnchnls_i options sigs = do saveMasterInstr (constArity sigs) (masterExp sigs) saveMidiMap -- save midi innstruments handleMissingKeyPannel- renderHistory (outArity sigs) options+ renderHistory mnchnls_i (outArity sigs) options handleMissingKeyPannel :: GE () handleMissingKeyPannel = do@@ -46,25 +46,25 @@ renderOut_ = renderOutBy_ def renderOutBy_ :: Options -> SE () -> IO String-renderOutBy_ options sigs = evalGE options $ fmap renderCsd $ toCsd options (fmap (const unit) sigs)+renderOutBy_ options sigs = evalGE options $ fmap renderCsd $ toCsd Nothing options (fmap (const unit) sigs) renderOut :: Sigs a => SE a -> IO String renderOut = renderOutBy def renderOutBy :: Sigs a => Options -> SE a -> IO String-renderOutBy options sigs = evalGE options $ fmap renderCsd $ toCsd options sigs+renderOutBy options sigs = evalGE options $ fmap renderCsd $ toCsd Nothing options sigs renderEff :: (Sigs a, Sigs b) => (a -> SE b) -> IO String renderEff = renderEffBy def renderEffBy :: (Sigs a, Sigs b) => Options -> (a -> SE b) -> IO String-renderEffBy options eff = renderOutBy options $ eff =<< getIns+renderEffBy options eff = evalGE options $ fmap renderCsd $ toCsd (Just (arityIns $ funArity eff)) options (eff =<< getIns) -renderHistory :: Int -> Options -> GE Csd-renderHistory nchnls opt = do+renderHistory :: Maybe Int -> Int -> Options -> GE Csd+renderHistory mnchnls_i nchnls opt = do keyEventListener <- getKeyEventListener hist1 <- getHistory- instr0 <- execDepT $ getInstr0 nchnls opt hist1 + instr0 <- execDepT $ getInstr0 mnchnls_i nchnls opt hist1 terminatorInstrId <- saveInstr =<< terminatorInstr expr2 <- getSysExpr terminatorInstrId saveAlwaysOnInstr =<< saveInstr (SE expr2)@@ -83,8 +83,8 @@ maybeAppend ma = maybe id (:) ma getNoteEvents = fmap $ \(instrId, evt) -> (instrId, [evt]) -getInstr0 :: Int -> Options -> History -> Dep ()-getInstr0 nchnls opt hist = do+getInstr0 :: Maybe Int -> Int -> Options -> History -> Dep ()+getInstr0 mnchnls_i nchnls opt hist = do globalConstants midiAssigns midiInitCtrls@@ -98,9 +98,10 @@ globalConstants = do setSr $ defSampleRate opt setKsmps $ defBlockSize opt- setNchnls (max 1 nchnls)+ setNchnls (max 1 nchnls) setZeroDbfs 1-+ maybe (return ()) setNchnls_i mnchnls_i + midiAssigns = mapM_ renderMidiAssign $ midis hist midiInitCtrls = mapM_ renderMidiCtrl $ midiCtrls hist
src/Csound/Typed/Types/Prim.hs view
@@ -456,50 +456,3 @@ ftcps :: Tab -> D ftcps = on1 $ opr1 "ftcps" ----------------------------------------------------- numeric instances--instance Num (Sig, Sig) where- (a1, a2) + (b1, b2) = (a1 + b1, a2 + b2)- (a1, a2) * (b1, b2) = (a1 * b1, a2 * b2)- negate (a1, a2) = (negate a1, negate a2)-- fromInteger n = (fromInteger n, fromInteger n)- signum (a1, a2) = (signum a1, signum a2)- abs (a1, a2) = (abs a1, abs a2)--instance Num (Sig, Sig, Sig) where- (a1, a2, a3) + (b1, b2, b3) = (a1 + b1, a2 + b2, a3 + b3)- (a1, a2, a3) * (b1, b2, b3) = (a1 * b1, a2 * b2, a3 * b3)- negate (a1, a2, a3) = (negate a1, negate a2, negate a3)-- fromInteger n = (fromInteger n, fromInteger n, fromInteger n)- signum (a1, a2, a3) = (signum a1, signum a2, signum a3)- abs (a1, a2, a3) = (abs a1, abs a2, abs a3)--instance Num (Sig, Sig, Sig, Sig) where- (a1, a2, a3, a4) + (b1, b2, b3, b4) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4)- (a1, a2, a3, a4) * (b1, b2, b3, b4) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4)- negate (a1, a2, a3, a4) = (negate a1, negate a2, negate a3, negate a4)-- fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n)- signum (a1, a2, a3, a4) = (signum a1, signum a2, signum a3, signum a4)- abs (a1, a2, a3, a4) = (abs a1, abs a2, abs a3, abs a4)--instance Num (Sig, Sig, Sig, Sig, Sig, Sig) where- (a1, a2, a3, a4, a5, a6) + (b1, b2, b3, b4, b5, b6) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4, a5 + b5, a6 + b6)- (a1, a2, a3, a4, a5, a6) * (b1, b2, b3, b4, b5, b6) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4, a5 * b5, a6 * b6)- negate (a1, a2, a3, a4, a5, a6) = (negate a1, negate a2, negate a3, negate a4, negate a5, negate a6)-- fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n)- signum (a1, a2, a3, a4, a5, a6) = (signum a1, signum a2, signum a3, signum a4, signum a5, signum a6)- abs (a1, a2, a3, a4, a5, a6) = (abs a1, abs a2, abs a3, abs a4, abs a5, abs a6)--instance Num (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig) where- (a1, a2, a3, a4, a5, a6, a7, a8) + (b1, b2, b3, b4, b5, b6, b7, b8) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4, a5 + b5, a6 + b6, a7 + b7, a8 + b8)- (a1, a2, a3, a4, a5, a6, a7, a8) * (b1, b2, b3, b4, b5, b6, b7, b8) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4, a5 * b5, a6 * b6, a7 + b7, a8 + b8)- negate (a1, a2, a3, a4, a5, a6, a7, a8) = (negate a1, negate a2, negate a3, negate a4, negate a5, negate a6, negate a7, negate a8)-- fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n)- signum (a1, a2, a3, a4, a5, a6, a7, a8) = (signum a1, signum a2, signum a3, signum a4, signum a5, signum a6, signum a7, signum a8)- abs (a1, a2, a3, a4, a5, a6, a7, a8) = (abs a1, abs a2, abs a3, abs a4, abs a5, abs a6, abs a7, abs a8)
src/Csound/Typed/Types/Tuple.hs view
@@ -8,6 +8,8 @@ Tuple(..), TupleMethods, makeTupleMethods, fromTuple, toTuple, tupleArity, tupleRates, defTuple, + Sig2, Sig3, Sig4, Sig5, Sig6, Sig8,+ -- ** Outs Sigs, outArity, @@ -143,20 +145,22 @@ -- | The tuples of signals. class (Tuple a, Num a) => Sigs a where +type Sig2 = (Sig, Sig)+type Sig3 = (Sig, Sig, Sig)+type Sig4 = (Sig, Sig, Sig, Sig)+type Sig5 = (Sig, Sig, Sig, Sig, Sig)+type Sig6 = (Sig, Sig, Sig, Sig, Sig, Sig)+type Sig8 = (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)+ instance Sigs Sig-instance Sigs (Sig, Sig)-instance Sigs (Sig, Sig, Sig, Sig)-instance Sigs (Sig, Sig, Sig, Sig, Sig, Sig)-instance Sigs (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)-{--instance Sigs ( (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)- , (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig) )+instance Sigs Sig2+instance Sigs Sig4+instance Sigs Sig6+instance Sigs Sig8 -instance Sigs ( (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)- , (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)- , (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig)- , (Sig, Sig, Sig, Sig, Sig, Sig, Sig, Sig) )--}+instance Sigs (Sig8, Sig8)+instance Sigs (Sig8, Sig8, Sig8, Sig8)+ outArity :: Tuple a => SE a -> Int outArity = tupleArity . proxy where@@ -276,4 +280,71 @@ proxy :: SE a -> a proxy = const undefined ++-------------------------------------------------+-- numeric instances++instance Num Sig2 where+ (a1, a2) + (b1, b2) = (a1 + b1, a2 + b2)+ (a1, a2) * (b1, b2) = (a1 * b1, a2 * b2)+ negate (a1, a2) = (negate a1, negate a2)++ fromInteger n = (fromInteger n, fromInteger n)+ signum (a1, a2) = (signum a1, signum a2)+ abs (a1, a2) = (abs a1, abs a2)++instance Num Sig3 where+ (a1, a2, a3) + (b1, b2, b3) = (a1 + b1, a2 + b2, a3 + b3)+ (a1, a2, a3) * (b1, b2, b3) = (a1 * b1, a2 * b2, a3 * b3)+ negate (a1, a2, a3) = (negate a1, negate a2, negate a3)++ fromInteger n = (fromInteger n, fromInteger n, fromInteger n)+ signum (a1, a2, a3) = (signum a1, signum a2, signum a3)+ abs (a1, a2, a3) = (abs a1, abs a2, abs a3)++instance Num Sig4 where+ (a1, a2, a3, a4) + (b1, b2, b3, b4) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4)+ (a1, a2, a3, a4) * (b1, b2, b3, b4) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4)+ negate (a1, a2, a3, a4) = (negate a1, negate a2, negate a3, negate a4)++ fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n)+ signum (a1, a2, a3, a4) = (signum a1, signum a2, signum a3, signum a4)+ abs (a1, a2, a3, a4) = (abs a1, abs a2, abs a3, abs a4)++instance Num Sig6 where+ (a1, a2, a3, a4, a5, a6) + (b1, b2, b3, b4, b5, b6) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4, a5 + b5, a6 + b6)+ (a1, a2, a3, a4, a5, a6) * (b1, b2, b3, b4, b5, b6) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4, a5 * b5, a6 * b6)+ negate (a1, a2, a3, a4, a5, a6) = (negate a1, negate a2, negate a3, negate a4, negate a5, negate a6)++ fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n)+ signum (a1, a2, a3, a4, a5, a6) = (signum a1, signum a2, signum a3, signum a4, signum a5, signum a6)+ abs (a1, a2, a3, a4, a5, a6) = (abs a1, abs a2, abs a3, abs a4, abs a5, abs a6)++instance Num Sig8 where+ (a1, a2, a3, a4, a5, a6, a7, a8) + (b1, b2, b3, b4, b5, b6, b7, b8) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4, a5 + b5, a6 + b6, a7 + b7, a8 + b8)+ (a1, a2, a3, a4, a5, a6, a7, a8) * (b1, b2, b3, b4, b5, b6, b7, b8) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4, a5 * b5, a6 * b6, a7 + b7, a8 + b8)+ negate (a1, a2, a3, a4, a5, a6, a7, a8) = (negate a1, negate a2, negate a3, negate a4, negate a5, negate a6, negate a7, negate a8)++ fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n, fromInteger n)+ signum (a1, a2, a3, a4, a5, a6, a7, a8) = (signum a1, signum a2, signum a3, signum a4, signum a5, signum a6, signum a7, signum a8)+ abs (a1, a2, a3, a4, a5, a6, a7, a8) = (abs a1, abs a2, abs a3, abs a4, abs a5, abs a6, abs a7, abs a8)++instance Num (Sig8, Sig8) where+ (a1, a2) + (b1, b2) = (a1 + b1, a2 + b2)+ (a1, a2) * (b1, b2) = (a1 * b1, a2 * b2)+ negate (a1, a2) = (negate a1, negate a2)++ fromInteger n = (fromInteger n, fromInteger n)+ signum (a1, a2) = (signum a1, signum a2)+ abs (a1, a2) = (abs a1, abs a2)++instance Num (Sig8, Sig8, Sig8, Sig8) where+ (a1, a2, a3, a4) + (b1, b2, b3, b4) = (a1 + b1, a2 + b2, a3 + b3, a4 + b4)+ (a1, a2, a3, a4) * (b1, b2, b3, b4) = (a1 * b1, a2 * b2, a3 * b3, a4 * b4)+ negate (a1, a2, a3, a4) = (negate a1, negate a2, negate a3, negate a4)++ fromInteger n = (fromInteger n, fromInteger n, fromInteger n, fromInteger n)+ signum (a1, a2, a3, a4) = (signum a1, signum a2, signum a3, signum a4)+ abs (a1, a2, a3, a4) = (abs a1, abs a2, abs a3, abs a4)+