phonetic-languages-rhythmicity-0.7.0.0: Allows to estimate the rhythmicity properties for the text
Copyright(c) OleksandrZhabenko 2021
LicenseMIT
Maintainerolexandr543@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010
Extensions
  • BangPatterns
  • MultiWayIf

Rhythmicity.PolyRhythm

Description

The module is highly experimental approach to estimate further the rhythmicity (using some extent of the music concept of polyrhythm) of the not very long lists (well, not longer than e. g. 30 elements). Is rather computationally expensive, so must be used with caution. If the period of rhythm is less than 5 or even 6 it is not effective.

Synopsis

Documentation

data Marker4s Source #

Constructors

D 
E 
F 
G 

Instances

Instances details
Eq Marker4s Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

Ord Marker4s Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

Show Marker4s Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

data PolyMrks Source #

Constructors

R4 Marker4s 
RP PolyMarkers 

Instances

Instances details
Eq PolyMrks Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

Ord PolyMrks Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

Show PolyMrks Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

data PolyRhythmBasis Source #

Data to specify some quantitative information of the structure of rhythmicity.

Constructors

PolyRhythm [Int] 

data PolyChoices Source #

Data to specify (mostly) the qualitative information of the structure of rhythmicity.

Constructors

PolyCh 

Fields

Instances

Instances details
Eq PolyChoices Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

validPolyChRhPair :: PolyChoices -> PolyRhythmBasis -> Bool Source #

The predicate to check whether the two given arguments can be used together to get meaningful results.

data Intermediate a Source #

Constructors

J a 
I PolyMarkers 

Instances

Instances details
Eq a => Eq (Intermediate a) Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

Ord a => Ord (Intermediate a) Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

getPolyChRhData Source #

Arguments

:: Ord a 
=> Char

The start of the RP PolyMarkers count in case of PolyMrks with Chars. The usual one can be 'a' or 'h'.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> [[PolyMrks]] 

similarityF1 Source #

Arguments

:: Char

The start of the counting.

-> PolyMrks 
-> PolyMrks 
-> Double

The initial value.

-> Double 

similarityF0 Source #

Arguments

:: Char

The start of the counting.

-> PolyMrks 
-> PolyMrks 
-> Double

The initial value.

-> Double 

The more straightforward variant of the similarityF1 function.

similarityLogics Source #

Arguments

:: Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

The function that uses a simple arithmetic logics to calculate the similarity of the two equal by length (if not they are truncated to the least one) lists of PolyMrks. Uses both increasing and decreasing functions.

similarityLogics0 Source #

Arguments

:: Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

The more straightforward variant of the similarityLogics function.

similarityLogicsGE Source #

Arguments

:: Double 
-> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 
 

similarityLogicsG1 Source #

Arguments

:: Double 
-> (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 
 

similarityLogicsG12 Source #

Arguments

:: Double 
-> (Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 
 

similarityLogicsGE0 Source #

Arguments

:: Double 
-> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 

The more straightforward variant of the similarityLogicsGE function.

similarityLogicsG0 Source #

Arguments

:: Double 
-> (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 
 

similarityLogicsG02 Source #

Arguments

:: Double 
-> (Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

An initial value.

-> [PolyMrks] 
-> [PolyMrks] 
-> Double 
 

similarityPoly Source #

Arguments

:: Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [[PolyMrks]] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

The function that uses a simple arithmetic logics to calculate the similarity of the two equal by length (if not they are truncated to the least one) lists of PolyMrks. Uses similarityLogics inside.

similarityPoly2 Source #

Arguments

:: [PolyMrks] 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [[PolyMrks]] 
-> Double 
 

similarityPolyGEE Source #

Arguments

:: (Int, [PolyMrks]) 
-> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

similarityPolyGE Source #

Arguments

:: Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 

similarityPolyG1 Source #

Arguments

:: (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

similarityPolyG12 Source #

Arguments

:: (Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

similarityPoly0 Source #

Arguments

:: Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [[PolyMrks]] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

The function that uses a simple arithmetic logics to calculate the similarity of the two equal by length (if not they are truncated to the least one) lists of PolyMrks. Uses similarityLogics0 inside. The more straightforward variant of the similarityPoly function.

similarityPoly20 Source #

Arguments

:: [PolyMrks] 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [[PolyMrks]] 
-> Double 
 

similarityPolyGEE0 Source #

Arguments

:: (Int, [PolyMrks]) 
-> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

similarityPolyGE0 Source #

Arguments

:: Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 

similarityPolyG0 Source #

Arguments

:: (Int -> Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

similarityPolyG02 Source #

Arguments

:: (Double -> Double -> Double) 
-> Char

The start of the counting.

-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> [(Int, [PolyMrks])] 
-> Double 
 

rhythmicityPoly Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

General function to estimate the inner rhythmicity of the Ordered list of values. For many cases its arguments can be guessed or approximated by some reasonable values. Nevertheless, it is a highly experimental one.

rhythmicityPolyGE Source #

Arguments

:: Ord a 
=> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

General function to estimate the inner rhythmicity of the Ordered list of values. For many cases its arguments can be guessed or approximated by some reasonable values. Nevertheless, it is a highly experimental one.

rhythmicityPolyG1 Source #

Arguments

:: Ord a 
=> (Int -> Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyG12 Source #

Arguments

:: Ord a 
=> (Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyGE0 Source #

Arguments

:: Ord a 
=> Either (Double -> Double -> Double) (Int -> Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

General function to estimate the inner rhythmicity of the Ordered list of values. For many cases its arguments can be guessed or approximated by some reasonable values. Nevertheless, it is a highly experimental one.

rhythmicityPolyG01 Source #

Arguments

:: Ord a 
=> (Int -> Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyG02 Source #

Arguments

:: Ord a 
=> (Double -> Double -> Double) 
-> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPoly0 Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double

The greater one corresponds to (probably) more rhythmic list.

General function to estimate the inner rhythmicity of the Ordered list of values. For many cases its arguments can be guessed or approximated by some reasonable values. Nevertheless, it is a highly experimental one. The more straightforward variant of the rhythmicityPoly function.

simpleF2 :: Double -> Double -> Double Source #

This function tries to increase the importance of the beginning of the line and decreases the importance of the ending of the line. It is not linear one.

rhythmicityPolyWeightedF2 Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyWeightedF3 Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyWeightedF20 Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

rhythmicityPolyWeightedF30 Source #

Arguments

:: Ord a 
=> Double

The initial value starting from which it counts. Usually, equals to 1.0.

-> Int

If the argument is less or equal to 4, then Marker4s is used, if it is greater than 4, then PolyMarkers is used.

-> PolyChoices 
-> PolyRhythmBasis 
-> [a] 
-> Double 

data ParseChRh Source #

Data type that is used to implement some parameter language to encode in the String argument information that is sufficient to transform the String into Double using the needed additional information provided by some other means.

Constructors

P0 String 
P1 Choices RhythmBasis Int

The number of the one of the functions to convert the phonetic languages elements into Double values (usually, durations).

P2 

Fields

Instances

Instances details
Eq ParseChRh Source # 
Instance details

Defined in Rhythmicity.PolyRhythm

readRhythmicity :: String -> Maybe ParseChRh Source #

A parser function to get the ParseChRh data. In case of success returns Just ParseChRh value. Nevertheless, the further checks (e. g. validPolyChRhPair or validChRhPair) is not applied by it, so they must be applied further during the usage. Examples of the usage: "c114+112=2" returns Just P1 (Ch 1 1 4) (Rhythm 1 1 2) 2 "ctttff7+112111=7*3" returns Just P2 (PolyCh [True,True,True,False,False] 7) (PolyRhythm [1,1,2,1,1,1]) 7 3.