packages feed

hmt 0.1 → 0.2

raw patch · 6 files changed

+37/−12 lines, 6 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

- Music.Theory.Pitch: instance (Eq a) => Eq (SRO a)
- Music.Theory.Pitch: instance (Show a) => Show (SRO a)
+ Music.Theory.Parse: pco :: String -> [Int]
+ Music.Theory.Pitch: instance Eq a => Eq (SRO a)
+ Music.Theory.Pitch: instance Show a => Show (SRO a)
- Music.Theory.Pct: bip :: (Integral a) => [a] -> [a]
+ Music.Theory.Pct: bip :: Integral a => [a] -> [a]
- Music.Theory.Pct: cf :: (Integral n) => [n] -> [[a]] -> [[a]]
+ Music.Theory.Pct: cf :: Integral n => [n] -> [[a]] -> [[a]]
- Music.Theory.Pct: cg_r :: (Integral n) => n -> [a] -> [[a]]
+ Music.Theory.Pct: cg_r :: Integral n => n -> [a] -> [[a]]
- Music.Theory.Pct: ciseg :: (Integral a) => [a] -> [a]
+ Music.Theory.Pct: ciseg :: Integral a => [a] -> [a]
- Music.Theory.Pct: cmpl :: (Integral a) => [a] -> [a]
+ Music.Theory.Pct: cmpl :: Integral a => [a] -> [a]
- Music.Theory.Pct: dim :: (Integral a) => [a] -> [(a, [a])]
+ Music.Theory.Pct: dim :: Integral a => [a] -> [(a, [a])]
- Music.Theory.Pct: dis :: (Integral t) => [Int] -> [t]
+ Music.Theory.Pct: dis :: Integral t => [Int] -> [t]
- Music.Theory.Pct: doi :: (Integral a) => Int -> [a] -> [a] -> [[a]]
+ Music.Theory.Pct: doi :: Integral a => Int -> [a] -> [a] -> [[a]]
- Music.Theory.Pct: ess :: (Integral a) => [a] -> [a] -> [[a]]
+ Music.Theory.Pct: ess :: Integral a => [a] -> [a] -> [[a]]
- Music.Theory.Pct: fn :: (Integral a) => [a] -> String
+ Music.Theory.Pct: fn :: Integral a => [a] -> String
- Music.Theory.Pct: has_ess :: (Integral a) => [a] -> [a] -> Bool
+ Music.Theory.Pct: has_ess :: Integral a => [a] -> [a] -> Bool
- Music.Theory.Pct: has_sc :: (Integral a) => [a] -> [a] -> Bool
+ Music.Theory.Pct: has_sc :: Integral a => [a] -> [a] -> Bool
- Music.Theory.Pct: has_sc_pf :: (Integral a) => ([a] -> [a]) -> [a] -> [a] -> Bool
+ Music.Theory.Pct: has_sc_pf :: Integral a => ([a] -> [a]) -> [a] -> [a] -> Bool
- Music.Theory.Pct: icf :: (Num a) => [[a]] -> [[a]]
+ Music.Theory.Pct: icf :: Num a => [[a]] -> [[a]]
- Music.Theory.Pct: ici :: (Num t) => [Int] -> [[t]]
+ Music.Theory.Pct: ici :: Num t => [Int] -> [[t]]
- Music.Theory.Pct: icseg :: (Integral a) => [a] -> [a]
+ Music.Theory.Pct: icseg :: Integral a => [a] -> [a]
- Music.Theory.Pct: imb :: (Integral n) => [n] -> [a] -> [[a]]
+ Music.Theory.Pct: imb :: Integral n => [n] -> [a] -> [[a]]
- Music.Theory.Pct: iseg :: (Integral a) => [a] -> [a]
+ Music.Theory.Pct: iseg :: Integral a => [a] -> [a]
- Music.Theory.Pct: issb :: (Integral a) => [a] -> [a] -> [String]
+ Music.Theory.Pct: issb :: Integral a => [a] -> [a] -> [String]
- Music.Theory.Pct: mxs :: (Integral a) => [a] -> [a] -> [[a]]
+ Music.Theory.Pct: mxs :: Integral a => [a] -> [a] -> [[a]]
- Music.Theory.Pct: nrm :: (Ord a) => [a] -> [a]
+ Music.Theory.Pct: nrm :: Ord a => [a] -> [a]
- Music.Theory.Pct: nrm_r :: (Ord a) => [a] -> [a]
+ Music.Theory.Pct: nrm_r :: Ord a => [a] -> [a]
- Music.Theory.Pct: pci :: (Integral a) => [a] -> [a] -> [[a]]
+ Music.Theory.Pct: pci :: Integral a => [a] -> [a] -> [[a]]
- Music.Theory.Pct: rs :: (Integral a) => [a] -> [a] -> [(SRO a, [a])]
+ Music.Theory.Pct: rs :: Integral a => [a] -> [a] -> [(SRO a, [a])]
- Music.Theory.Pct: rsg :: (Integral a) => [a] -> [a] -> [(SRO a, [a])]
+ Music.Theory.Pct: rsg :: Integral a => [a] -> [a] -> [(SRO a, [a])]
- Music.Theory.Pct: sb :: (Integral a) => [[a]] -> [[a]]
+ Music.Theory.Pct: sb :: Integral a => [[a]] -> [[a]]
- Music.Theory.Pct: spsc :: (Integral a) => [[a]] -> [String]
+ Music.Theory.Pct: spsc :: Integral a => [[a]] -> [String]
- Music.Theory.Pitch: all_RTnI :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_RTnI :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: all_RTnMI :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_RTnMI :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: all_Tn :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_Tn :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: all_TnI :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_TnI :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: all_TnMI :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_TnMI :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: all_rRTnMI :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: all_rRTnMI :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: complement :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: complement :: Integral a => [a] -> [a]
- Music.Theory.Pitch: d_dx :: (Num a) => [a] -> [a]
+ Music.Theory.Pitch: d_dx :: Num a => [a] -> [a]
- Music.Theory.Pitch: difference :: (Eq a) => [a] -> [a] -> [a]
+ Music.Theory.Pitch: difference :: Eq a => [a] -> [a] -> [a]
- Music.Theory.Pitch: dx_d :: (Num a) => a -> [a] -> [a]
+ Music.Theory.Pitch: dx_d :: Num a => a -> [a] -> [a]
- Music.Theory.Pitch: ic :: (Integral a) => a -> a
+ Music.Theory.Pitch: ic :: Integral a => a -> a
- Music.Theory.Pitch: icv :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: icv :: Integral a => [a] -> [a]
- Music.Theory.Pitch: int :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: int :: Integral a => [a] -> [a]
- Music.Theory.Pitch: invert :: (Integral a) => a -> [a] -> [a]
+ Music.Theory.Pitch: invert :: Integral a => a -> [a] -> [a]
- Music.Theory.Pitch: invertSelf :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: invertSelf :: Integral a => [a] -> [a]
- Music.Theory.Pitch: is_subset :: (Eq a) => [a] -> [a] -> Bool
+ Music.Theory.Pitch: is_subset :: Eq a => [a] -> [a] -> Bool
- Music.Theory.Pitch: is_superset :: (Eq a) => [a] -> [a] -> Bool
+ Music.Theory.Pitch: is_superset :: Eq a => [a] -> [a] -> Bool
- Music.Theory.Pitch: m5 :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: m5 :: Integral a => [a] -> [a]
- Music.Theory.Pitch: mn :: (Integral a) => a -> [a] -> [a]
+ Music.Theory.Pitch: mn :: Integral a => a -> [a] -> [a]
- Music.Theory.Pitch: mod12 :: (Integral a) => a -> a
+ Music.Theory.Pitch: mod12 :: Integral a => a -> a
- Music.Theory.Pitch: pc :: (Integral a) => a -> a
+ Music.Theory.Pitch: pc :: Integral a => a -> a
- Music.Theory.Pitch: pcset :: (Integral a) => [a] -> [a]
+ Music.Theory.Pitch: pcset :: Integral a => [a] -> [a]
- Music.Theory.Pitch: rotate :: (Integral n) => n -> [a] -> [a]
+ Music.Theory.Pitch: rotate :: Integral n => n -> [a] -> [a]
- Music.Theory.Pitch: rotate_right :: (Integral n) => n -> [a] -> [a]
+ Music.Theory.Pitch: rotate_right :: Integral n => n -> [a] -> [a]
- Music.Theory.Pitch: sro :: (Integral a) => SRO a -> [a] -> [a]
+ Music.Theory.Pitch: sro :: Integral a => SRO a -> [a] -> [a]
- Music.Theory.Pitch: sro_RTnI :: (Integral a) => [SRO a]
+ Music.Theory.Pitch: sro_RTnI :: Integral a => [SRO a]
- Music.Theory.Pitch: sro_RTnMI :: (Integral a) => [SRO a]
+ Music.Theory.Pitch: sro_RTnMI :: Integral a => [SRO a]
- Music.Theory.Pitch: sro_Tn :: (Integral a) => [SRO a]
+ Music.Theory.Pitch: sro_Tn :: Integral a => [SRO a]
- Music.Theory.Pitch: sro_TnI :: (Integral a) => [SRO a]
+ Music.Theory.Pitch: sro_TnI :: Integral a => [SRO a]
- Music.Theory.Pitch: sro_TnMI :: (Integral a) => [SRO a]
+ Music.Theory.Pitch: sro_TnMI :: Integral a => [SRO a]
- Music.Theory.Pitch: sros :: (Integral a) => [a] -> [(SRO a, [a])]
+ Music.Theory.Pitch: sros :: Integral a => [a] -> [(SRO a, [a])]
- Music.Theory.Pitch: subsequence :: (Eq a) => [a] -> [a] -> Bool
+ Music.Theory.Pitch: subsequence :: Eq a => [a] -> [a] -> Bool
- Music.Theory.Pitch: tmatrix :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: tmatrix :: Integral a => [a] -> [[a]]
- Music.Theory.Pitch: tn :: (Integral a) => a -> [a] -> [a]
+ Music.Theory.Pitch: tn :: Integral a => a -> [a] -> [a]
- Music.Theory.Pitch: tni :: (Integral a) => a -> [a] -> [a]
+ Music.Theory.Pitch: tni :: Integral a => a -> [a] -> [a]
- Music.Theory.Pitch: transposeTo :: (Integral a) => a -> [a] -> [a]
+ Music.Theory.Pitch: transposeTo :: Integral a => a -> [a] -> [a]
- Music.Theory.Pitch: transpositions :: (Integral a) => [a] -> [[a]]
+ Music.Theory.Pitch: transpositions :: Integral a => [a] -> [[a]]
- Music.Theory.Prime: cmp_prime :: (Integral a) => ([a] -> [a] -> Ordering) -> [a] -> [a]
+ Music.Theory.Prime: cmp_prime :: Integral a => ([a] -> [a] -> Ordering) -> [a] -> [a]
- Music.Theory.Prime: forte_prime :: (Integral a) => [a] -> [a]
+ Music.Theory.Prime: forte_prime :: Integral a => [a] -> [a]
- Music.Theory.Prime: rahn_prime :: (Integral a) => [a] -> [a]
+ Music.Theory.Prime: rahn_prime :: Integral a => [a] -> [a]
- Music.Theory.Set: se :: (Ord a) => Int -> [a] -> [[a]]
+ Music.Theory.Set: se :: Ord a => Int -> [a] -> [[a]]
- Music.Theory.Set: set :: (Ord a) => [a] -> [a]
+ Music.Theory.Set: set :: Ord a => [a] -> [a]
- Music.Theory.Table: sc :: (Integral a) => String -> [a]
+ Music.Theory.Table: sc :: Integral a => String -> [a]
- Music.Theory.Table: sc_name :: (Integral a) => [a] -> String
+ Music.Theory.Table: sc_name :: Integral a => [a] -> String
- Music.Theory.Table: sc_table :: (Integral a) => [(String, [a])]
+ Music.Theory.Table: sc_table :: Integral a => [(String, [a])]
- Music.Theory.Table: scs :: (Integral a) => [[a]]
+ Music.Theory.Table: scs :: Integral a => [[a]]

Files

Help/hmt.help.lhs view
@@ -5,17 +5,23 @@  > tn 4 [1,5,6] +> sro (rnrtnmi "T4") (pco "156")+ $ sro T4I 156 3BA  > tni 4 [1,5,6] +> sro (rnrtnmi "T4I") (pco "156")+ $ echo 156 | sro T4  | sro T0I 732  > let f n = invert 0 . tn n > in f 4 [1,5,6] +> (sro (rnrtnmi "T0I") . sro (rnrtnmi "T4")) (pco "156")+ $ pcom pcseg iseg 01549 | pcom iseg icseg | pcom icseg icset 145 @@ -39,6 +45,8 @@  > bip [0,10,9,5,7,2,8,11,3,4,1,6] +> bip (pco "0t95728e3416")+ $ pg 5-Z17 | bip | sort -u > 5-Z17.bip ; \   pg 5-Z37 | bip | sort -u > 5-Z37.bip ; \   comm 5-Z17.bip 5-Z37.bip -1 -2 | wc -l@@ -47,6 +55,9 @@  > import Data.List +> let f g = sort (g [1..4])+> in f Music.Theory.Permutations.permutations == f permutations+ > let f = nub . map bip . permutations . sc > in f "5-Z17" `intersect` f "5-Z37" @@ -78,6 +89,8 @@ ... $ +> import Data.Maybe+ > let { n = 4 >     ; s = filter ((== n) . length) scs >     ; x = map permutations s@@ -353,4 +366,4 @@ $ echo 024579 | sro RT4I 79B024 -> sro (rnrtnmi "RT4I") [0,2,4,5,7,9]+> sro (rnrtnmi "RT4I") (pco "024579")
Music/Theory.hs view
@@ -3,8 +3,7 @@                      module Music.Theory.Pct,                      module Music.Theory.Prime,                      module Music.Theory.Set,-                     module Music.Theory.Table,-                     module Music.Theory.Permutations) where+                     module Music.Theory.Table) where  import Music.Theory.Parse import Music.Theory.Pitch@@ -12,4 +11,3 @@ import Music.Theory.Prime import Music.Theory.Set import Music.Theory.Table-import Music.Theory.Permutations
Music/Theory/Parse.hs view
@@ -1,6 +1,7 @@-module Music.Theory.Parse (rnrtnmi) where+module Music.Theory.Parse (rnrtnmi, pco) where  import Control.Monad+import Data.Char import Music.Theory.Pitch import Text.ParserCombinators.Parsec @@ -31,3 +32,12 @@          (\e -> error ("rnRTnMI parse failed\n" ++ show e))           id           (parse p "" s)++pco :: String -> [Int]+pco s =+    let s' = dropWhile isSpace s+        s'' = takeWhile (\c -> elem c "0123456789taAebB") s'+        f c | c `elem` "taA" = 10+            | c `elem` "ebB" = 11+            | otherwise = read [c]+    in map f s''
Music/Theory/Pitch.hs view
@@ -38,7 +38,7 @@ invertSelf [] = [] invertSelf (x:xs) = invert x (x:xs) --- | Composition on inversion about zero and transpose.+-- | Composition of inversion about zero and transpose. tni :: (Integral a) => a -> [a] -> [a] tni n = tn n . invert 0 
README view
@@ -3,5 +3,5 @@ Music theory operations in haskell, primarily focussed on 'set theory'. -(c) rohan drape, 2006-2009+(c) rohan drape, 2006-2010     gpl, http://gnu.org/copyleft/
hmt.cabal view
@@ -1,15 +1,15 @@ Name:              hmt-Version:           0.1+Version:           0.2 Synopsis:          Haskell Music Theory Description:       Haskell music theory library License:           GPL Category:          Music-Copyright:         Rohan Drape, 2006-2009+Copyright:         Rohan Drape, 2006-2010 Author:            Rohan Drape Maintainer:        rd@slavepianos.org Stability:         Experimental-Homepage:          http://www.slavepianos.org/rd/-Tested-With:       GHC == 6.8.2+Homepage:          http://slavepianos.org/rd/?t=hmt+Tested-With:       GHC == 6.10.3 Build-Type:        Simple Cabal-Version:     >= 1.6 @@ -17,7 +17,7 @@                    Help/hmt.help.lhs  Library-  Build-Depends:   base == 3.*,+  Build-Depends:   base == 4.*,                    containers,                    parsec,                    permutation@@ -30,3 +30,7 @@                    Music.Theory.Set                    Music.Theory.Table                    Music.Theory.Permutations++Source-Repository  head+  Type:            darcs+  Location:        http://slavepianos.org/rd/sw/hmt