Copyright | (c) 2022 Andrew A. Cashner |
---|---|
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Kircher's ark does require a small amount of free choice on the part of the user, in selecting which voice permutation and rhythm permutation to use from each column. We take the (for Kircher) theologically dangerous route of chance operations and generate a random number for the index of the voice and rhythm permutations.
Synopsis
- data Perm = Perm {
- voiceIndex :: Int
- rhythmIndex :: Int
- choosePerms :: IO Perm
- type SentencePerm = [Perm]
- type SectionPerm = [SentencePerm]
- sentencePerms :: PhrasesInLyricSentence -> IO SentencePerm
- sectionPerms :: PhrasesInLyricSection -> IO SectionPerm
- inputPerms :: [PhrasesInLyricSection] -> IO [[SentencePerm]]
Documentation
A Perm
stores the random number choices used to select voice and rhythm
permutations.
Perm | |
|
choosePerms :: IO Perm Source #
Make a pair of random numbers to select vperm and rperm:
- vperm is always one of 10 vperms per column
- rperm lists are variable in length, so we choose a larger number and
then take the modulo of the length of the list once it's selected (in
Aedifico
)
type SentencePerm = [Perm] Source #
Each sentence needs a list of perms, one per phrase
type SectionPerm = [SentencePerm] Source #
A list of perms for each sentence in the section
:: PhrasesInLyricSentence | number of permutations |
-> IO SentencePerm |
Generate a list of Perm
s of a given length to match a Sentence
sectionPerms :: PhrasesInLyricSection -> IO SectionPerm Source #
Generate perms for a whole section
inputPerms :: [PhrasesInLyricSection] -> IO [[SentencePerm]] Source #
Generate perms for the whole input structure