packages feed

rhythmic-sequences 0.4.1.0 → 0.8.0.0

raw patch · 4 files changed

+20/−9 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Rhythmicity.MarkerSeqs: showZerosFor2PeriodMusic :: [(String, Double)] -> (String, [Integer])
+ Rhythmicity.MarkerSeqs: showZerosFor2PeriodMusic :: [(String, Word8)] -> (String, [Integer])

Files

CHANGELOG.md view
@@ -66,3 +66,7 @@  * Fourth version revised A. Added new function to be used in the "music" mode of PhLADiPreLiO. +## 0.8.0.0 -- 2024-04-07++* Eighth version. Switched to Word8 instead of Double. Made a versions window to provide possible updates for Double-related functionality. +
README.md view
@@ -41,6 +41,10 @@ appreciation for André's Rieu support also celebrates the Day. In Ukraine this day has several  important celebrations — Intercession of the Holy Theotokos (Pokrova), Cossacks' Day, Day of Defenders of Ukraine (especially relevant during the Russian war against Ukraine). +On the 12/032024 there was a Birthday of Emma Kok, the foundation founder. She turned 16. Therefore, the release 0.10.0.0 is additionally devoted i.e. tributed to her.++Besides, you can support Ukrainian people in various forms.+ All support is welcome, including donations for the needs of the Ukrainian army, IDPs and refugees.   If you would like to share some financial support with the Foundation Gastrostars, please, contact the mentioned foundation
rhythmic-sequences.cabal view
@@ -2,7 +2,7 @@ name:               rhythmic-sequences  -- The package version.-version:            0.4.1.0+version:            0.8.0.0  -- A short (one-line) description of the package. synopsis:@@ -24,9 +24,10 @@ maintainer:         oleksandr.zhabenko@yahoo.com  -- A copyright notice.-copyright:          (c) Oleksandr S. Zhabenko 2022-2023+copyright:          (c) Oleksandr S. Zhabenko 2022-2024 category:           Math, Data build-type:         Simple+bug-reports:        https://github.com/Oleksandr-Zhabenko/rhythmic-sequences/issues  -- Extra doc files to be distributed with the package, such as a CHANGELOG or a README. extra-doc-files:    CHANGELOG.md, README.md@@ -45,7 +46,7 @@     other-extensions: Strict, StrictData, NoImplicitPrelude      -- Other library packages from which modules are imported.-    build-depends:    base >=4.13 && <5+    build-depends:    base >=4.13 && <5       -- Directories containing source files.     hs-source-dirs:   src
src/Rhythmicity/MarkerSeqs.hs view
@@ -16,7 +16,9 @@ import GHC.Num import GHC.Real import GHC.Base+import GHC.Word import Data.List hiding (foldr)+import Data.Ord (Down(..))  import GHC.Show import Data.Bits import Numeric (showIntAtBase,showInt)@@ -86,7 +88,7 @@ -- efficiently just for the finite lists. Contains the modified code of the 'Data.List.unfoldr' -- function from the @base@ package. splitF :: Int -> [a] -> [[a]]-splitF n ys = let q = length ys `quot` n in take q . g (splitAt n) $ ys+splitF n ys = let (q,r) = length ys `quotRem` n in take (if r > 0 then q + 1 else q) . g (splitAt n) $ ys   where {-# INLINE g #-} -- Is a modified 'Data.List.unfoldr' code.         g f b0 = build (\c n ->           let go b = case f b of@@ -101,7 +103,7 @@   -> [a] -- ^ A list of 'Ord' data values that is evaluated for its rhythmic properties.   -> [[Integer]] getHashes2 selmarkNum ks xs = map (map toNum . filter (not . null) . map (idList ks) .  -- before this mapping the smallest element can potentially have 'orD' equal to 0 or greater than 0. The greatest element has 'orD' equal to @selmarkNum - 1@ (@= periodLength - 1@).- g [selmarkNum-1,selmarkNum-2..] . sort . + g [selmarkNum-1,selmarkNum-2..] . sortOn GHC.Base.id .     zipWith S2 [selmarkNum-1,selmarkNum-2..]) . splitF (fromIntegral selmarkNum) $ xs      where g (q:qs) xs@(x:ys) = let (js,rs) = span (== x) ys in map (\(S2 k y) -> As3 k q y) (x:js) : g qs rs            g _ _ = []@@ -117,7 +119,7 @@   -> [a]   -> Integer count1Hashes groupLength ks = sum . map createNewHash . countHashesPrioritized . getHashes2 groupLength ws -    where !ws = sortOn (*(-1)) . filter (>= 0) $ ks+    where !ws = sortOn Down . filter (>= 0) $ ks {-# INLINE count1Hashes #-}  {-| Data type to encode the changes  that are introduced by the position  of the group @@ -210,7 +212,7 @@   zipWith (createHashG f) positions . countHashesPrioritized . getHashes2 groupLength ws    where f = hashCorrections2F hc          positions = hashList hc-         !ws = sortOn (*(-1)) . filter (>= 0) $ ks+         !ws = sortOn Down . filter (>= 0) $ ks {-# INLINE countHashesG #-}  -- | General implementation of  the hash-based algorithm to evaluate the level of rhythmicity @@ -226,7 +228,7 @@ countHashes2G k hc groupLength ks  = -- sum .    zipWith (createHash2G k hc) positions . countHashesPrioritized . getHashes2 groupLength ws    where positions = hashList hc-         !ws = sortOn (*(-1)) . filter (>= 0) $ ks+         !ws = sortOn Down . filter (>= 0) $ ks {-# INLINE countHashes2G #-}  -- | Provided for testing.@@ -309,7 +311,7 @@ --  https://www.academia.edu/105067761/Why_some_lines_are_easy_to_pronounce_and_others_are_not_or_prosodic_unpredictability_as_a_characteristic_of_text (English text) --  https://www.academia.edu/105067723/%D0%A7%D0%BE%D0%BC%D1%83_%D0%B4%D0%B5%D1%8F%D0%BA%D1%96_%D1%80%D1%8F%D0%B4%D0%BA%D0%B8_%D0%BB%D0%B5%D0%B3%D0%BA%D0%BE_%D0%B2%D0%B8%D0%BC%D0%BE%D0%B2%D0%BB%D1%8F%D1%82%D0%B8_%D0%B0_%D1%96%D0%BD%D1%88%D1%96_%D0%BD%D1%96_%D0%B0%D0%B1%D0%BE_%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B4%D0%B8%D1%87%D0%BD%D0%B0_%D0%BD%D0%B5%D1%81%D0%BF%D1%80%D0%BE%D0%B3%D0%BD%D0%BE%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D1%96%D1%81%D1%82%D1%8C_%D1%8F%D0%BA_%D1%85%D0%B0%D1%80%D0%B0%D0%BA%D1%82%D0%B5%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D1%83 (Ukrainian text) showZerosFor2PeriodMusic -  :: [(String, Double)] -- The representation of the data to be analysed.+  :: [(String, Word8)] -- The representation of the data to be analysed.   -> (String, [Integer]) showZerosFor2PeriodMusic qqs = (breaks, rs)   where rs = concat . countHashesPrioritized . getHashes2 2 [1] . map snd $ qqs