algorithmic-composition-additional 0.1.1.0 → 0.2.0.0
raw patch · 9 files changed
+329/−335 lines, 9 filesdep +phonetic-languages-basisdep −bytestringdep ~algorithmic-composition-basicdep ~directorydep ~foldable-ixPVP ok
version bump matches the API change (PVP)
Dependencies added: phonetic-languages-basis
Dependencies removed: bytestring
Dependency ranges changed: algorithmic-composition-basic, directory, foldable-ix, mmsyn2-array, mmsyn3, mmsyn7l, mmsyn7ukr-common, phonetic-languages-simplified-base, process, ukrainian-phonetics-basic-array
API changes (from Hackage documentation)
- Composition.Sound.DIS5G6G: str2Durat1 :: Char -> Float
+ Composition.Sound.DIS5G6G: str2Durat1 :: Sound8 -> Float
- Composition.Sound.DIS5G6G: strToInt :: Char -> Int
+ Composition.Sound.DIS5G6G: strToInt :: Sound8 -> Int
- Composition.Sound.DIS5G6G: vStrToVInt :: String -> Intervals
+ Composition.Sound.DIS5G6G: vStrToVInt :: FlowSound -> Intervals
Files
- CHANGELOG.md +6/−0
- Composition/Sound/DIS5G6G.hs +12/−22
- Composition/Sound/Functional.hs +10/−10
- Composition/Sound/Overtones.hs +2/−3
- Composition/Sound/Uniq.hs +1/−3
- LICENSE +1/−1
- README.markdown +0/−291
- README.md +291/−0
- algorithmic-composition-additional.cabal +6/−5
CHANGELOG.md view
@@ -10,3 +10,9 @@ * First version revised A. Updated the dependency. No code revision is made. +## 0.2.0.0 -- 2022-08-17++* Second version. Switched to the dependencies without bytestring, updated the boundaries to+support the newer GHC-9.* series. Some code changes.++
Composition/Sound/DIS5G6G.hs view
@@ -44,8 +44,8 @@ import qualified Data.Foldable as F import System.Process import EndOfExe-import Melodics.ByteString.Ukrainian.Arr (convertToProperUkrainianS)-import Languages.Phonetic.Ukrainian.Syllable.Arr hiding (str2Durat1)+import Melodics.Ukrainian.ArrInt8 (Sound8,FlowSound,convertToProperUkrainianI8)+import Languages.Phonetic.Ukrainian.Syllable.ArrInt8 hiding (str2Durat1) import MMSyn7l import Composition.Sound.IntermediateF import Composition.Sound.Functional.Params@@ -53,14 +53,14 @@ -- | Generatlized version of the 'intervalsFromString' with a possibility to specify your own 'Intervals'. intervalsFromStringG :: Intervals -> String -> Intervals-intervalsFromStringG v = vStrToVIntG v . convertToProperUkrainianS+intervalsFromStringG v = vStrToVIntG v . convertToProperUkrainianI8 -- | The default way to get 'Intervals' from a converted Ukrainian text.-vStrToVInt :: String -> Intervals+vStrToVInt :: FlowSound -> Intervals vStrToVInt = (\rs -> listArray (0,length rs - 1) rs) . map (strToIntG defInt) -- | The default way to get number of semi-tones between notes in a single element of 'Intervals'.-strToInt :: Char -> Int+strToInt :: Sound8 -> Int strToInt = strToIntG defInt {-# INLINE strToInt #-} @@ -99,32 +99,22 @@ str2Durations :: String -> Float -> Durations str2Durations xs y | y > 0.0 && not (null xs) = durationsAver ((\rs -> listArray (0,length rs -1) rs) . map str2Durat1 .- convertToProperUkrainianS $ xs) y+ convertToProperUkrainianI8 $ xs) y | otherwise = error "Composition.Sound.DIS5G6G.str2Durations: Not defined for such arguments. " -- | A conversion to the 'Float' that is used inside 'str2Durations'.-str2Durat1 :: Char -> Float-str2Durat1 = getBFstLSorted' (-0.153016) [('-', (-0.101995)), ('0', (-0.051020)), ('1', (-0.153016)), ('a', 0.138231), ('b', 0.057143), - ('v', 0.082268), ('h', 0.076825), ('d', 0.072063), ('j', 0.048934), ('A', 0.055601), ('e', 0.093605), ('B', 0.070658), ('z', 0.056054), - ('y', 0.099955), ('C', 0.057143), ('k', 0.045351), ('l', 0.064036), ('m', 0.077370), ('n', 0.074240), ('o', 0.116463), ('p', 0.134830), - ('r', 0.049206), ('s', 0.074603), ('D', 0.074558), ('t', 0.110658), ('u', 0.109070), ('f', 0.062268), ('x', 0.077188), ('c', 0.053061), - ('w', 0.089342), ('E', 0.057596), ('F', 0.066077), ('q', 0.020227), ('i', 0.094150), ('g', 0.062948)]+str2Durat1 :: Sound8 -> Float+str2Durat1 = getBFstLSorted' 0.051020 [(1,0.138231),(2,9.3605e-2),(3,0.116463),(4,0.10907),(5,9.9955e-2),(6,9.415e-2),(7,2.0227e-2),(8,5.5601e-2),(9,5.5601e-2),(10,7.0658e-2),(11,7.0658e-2),(15,5.7143e-2),(16,5.7143e-2),(17,7.2063e-2),(18,7.2063e-2),(19,6.2948e-2),(20,6.2948e-2),(21,7.6825e-2),(22,7.6825e-2),(23,4.8934e-2),(24,4.8934e-2),(25,5.6054e-2),(26,5.6054e-2),(27,5.7143e-2),(28,6.4036e-2),(29,6.4036e-2),(30,7.737e-2),(31,7.737e-2),(32,7.424e-2),(33,7.424e-2),(34,4.9206e-2),(35,4.9206e-2),(36,8.2268e-2),(37,8.2268e-2),(38,5.3061e-2),(39,5.7596e-2),(40,5.7596e-2),(41,6.6077e-2),(42,6.6077e-2),(43,6.2268e-2),(44,6.2268e-2),(45,4.5351e-2),(46,4.5351e-2),(47,0.13483),(48,0.13483),(49,7.4603e-2),(50,0.110658),(51,0.110658),(52,7.7188e-2),(53,7.7188e-2),(54,7.4558e-2),(66,8.9342e-2)] -- | A full conversion to the 'Strengths' from a Ukrainian text. str2Volume :: String -> Strengths-str2Volume = (\rs -> listArray (0,length rs - 1) rs) . map (getBFstLSorted' 0.0 [('a', 0.890533), ('b', 0.211334), ('v', (-0.630859)), ('h', (-0.757599)), ('d', 0.884613), ('j', 0.768127), - ('A', (-0.731262)), ('e', (-0.742523)), ('B', (-0.588959)), ('z', (-0.528870)), ('y', 0.770935), ('C', (-0.708008)), ('k', (-0.443085)), - ('l', 0.572632), ('m', (-0.782349)), ('n', (-0.797607)), ('o', (-0.579559)), ('p', 0.124908), ('r', 0.647369), ('s', 0.155640), ('D', (-0.207764)), - ('t', -0.304443), ('u', 0.718262), ('f', (-0.374359)), ('x', (-0.251160)), ('c', (-0.392365)), ('w', 0.381348), ('E', (-0.189240)), - ('F', 0.251221), ('q', 0.495483), ('i', (-0.682709)), ('g', 0.557098)]) . convertToProperUkrainianS+str2Volume = (\rs -> listArray (0,length rs - 1) rs) . + map (getBFstLSorted' 0.06408817 [(1,0.27161466),(2,0.27192511),(3,0.28539351),(4,0.25250039),(5,0.2050935),(6,0.20026538),(7,2.218624e-2),(8,7.729654e-2),(9,7.729654e-2),(10,8.048113e-2),(11,8.048113e-2),(15,0.10977617),(16,0.10977617),(17,6.58655e-2),(18,6.58655e-2),(19,7.751571e-2),(20,7.751571e-2),(21,5.392745e-2),(22,5.392745e-2),(23,8.900757e-2),(24,8.900757e-2),(25,6.099951e-2),(26,6.099951e-2),(27,8.226452e-2),(28,0.11159399),(29,0.11159399),(30,0.14303837),(31,0.14303837),(32,5.639178e-2),(33,5.639178e-2),(34,6.354637e-2),(35,6.354637e-2),(36,8.404524e-2),(37,8.404524e-2),(38,5.616409e-2),(39,0.12541547),(40,0.12541547),(41,0.12838476),(42,0.12838476),(43,0.15776219),(44,0.15776219),(45,4.91782e-2),(46,4.91782e-2),(47,9.603085e-2),(48,9.603085e-2),(49,5.294375e-2),(50,5.047358e-2),(51,5.047358e-2),(52,7.905155e-2),(53,7.905155e-2),(54,7.512999e-2),(66,7.835033e-2)]) . convertToProperUkrainianI8 -- | A conversion to the 'Float' that is used inside 'str2Volume'. str2Vol1 :: String -> Float-str2Vol1 = getBFstLSorted' 0.0 [('a', 0.890533), ('b', 0.211334), ('v', (-0.630859)), ('h', (-0.757599)), ('d', 0.884613), ('j', 0.768127), - ('A', (-0.731262)), ('e', (-0.742523)), ('B', (-0.588959)), ('z', (-0.528870)), ('y', 0.770935), ('C', (-0.708008)), ('k', (-0.443085)), - ('l', 0.572632), ('m', (-0.782349)), ('n', (-0.797607)), ('o', (-0.579559)), ('p', 0.124908), ('r', 0.647369), ('s', 0.155640), ('D', (-0.207764)), - ('t', -0.304443), ('u', 0.718262), ('f', (-0.374359)), ('x', (-0.251160)), ('c', (-0.392365)), ('w', 0.381348), ('E', (-0.189240)), - ('F', 0.251221), ('q', 0.495483), ('i', (-0.682709)), ('g', 0.557098)] . head . convertToProperUkrainianS+str2Vol1 = getBFstLSorted' 0.06408817 [(1,0.27161466),(2,0.27192511),(3,0.28539351),(4,0.25250039),(5,0.2050935),(6,0.20026538),(7,2.218624e-2),(8,7.729654e-2),(9,7.729654e-2),(10,8.048113e-2),(11,8.048113e-2),(15,0.10977617),(16,0.10977617),(17,6.58655e-2),(18,6.58655e-2),(19,7.751571e-2),(20,7.751571e-2),(21,5.392745e-2),(22,5.392745e-2),(23,8.900757e-2),(24,8.900757e-2),(25,6.099951e-2),(26,6.099951e-2),(27,8.226452e-2),(28,0.11159399),(29,0.11159399),(30,0.14303837),(31,0.14303837),(32,5.639178e-2),(33,5.639178e-2),(34,6.354637e-2),(35,6.354637e-2),(36,8.404524e-2),(37,8.404524e-2),(38,5.616409e-2),(39,0.12541547),(40,0.12541547),(41,0.12838476),(42,0.12838476),(43,0.15776219),(44,0.15776219),(45,4.91782e-2),(46,4.91782e-2),(47,9.603085e-2),(48,9.603085e-2),(49,5.294375e-2),(50,5.047358e-2),(51,5.047358e-2),(52,7.905155e-2),(53,7.905155e-2),(54,7.512999e-2),(66,7.835033e-2)]+ . head . convertToProperUkrainianI8 -- | For the given non-existing 'FilePath' for a sound file supported by SoX generates a silence of the specified -- duration and quality (see, 'soxBasicParams').
Composition/Sound/Functional.hs view
@@ -75,7 +75,7 @@ import System.Process import EndOfExe import System.Directory-import Melodics.ByteString.Ukrainian.Arr (convertToProperUkrainianS)+import Melodics.Ukrainian.ArrInt8 (convertToProperUkrainianI8) import Composition.Sound.IntermediateF import Composition.Sound.Functional.Basics import Composition.Sound.Functional.Params@@ -84,7 +84,7 @@ -- | Similar to 'overSoXSynth2DN' but instead of 'overTones' function, it uses volatile function @f::Float -> [(Float, Float)]@ with -- somewhat sophisticated mechanism to normalize the resulting list elements @(Float, Float)@. The last one is an experimental feature, so -- it is your responsibility to provide a function so that it does not lead to clipping. In such a case, the result of application of the--- 'convertToProperUkrainianS' to the 'String' parameter must not be []. 'Int' argument is an index of the element to be taken from +-- 'convertToProperUkrainianI8' to the 'String' parameter must not be []. 'Int' argument is an index of the element to be taken from -- the 'intervalsFromString' applied to the 'String' argument. To obtain compatible with versions prior to 0.20.0.0 behaviour, use for the 'Int' 0. -- -- Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function.@@ -105,7 +105,7 @@ -- (please, see 'soxBasicParams'). Since version 0.36.0.0 the function supports generation of the pauses. overSoXSynth2FDN2G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> String -> IO () overSoXSynth2FDN2G f (x, y) j zs vdB ys- | null . convertToProperUkrainianS $ zs = overSoXSynthG f x+ | null . convertToProperUkrainianI8 $ zs = overSoXSynthG f x | otherwise = do let note0 = closestNote (if x /= 0.0 then abs x else unsafeAt notes 0) l0 = length zs@@ -164,7 +164,7 @@ -- | A variant of the 'overSoXSynth2FDN6G' where volume adjustment is obtained from a Ukrainian text. overSoXSynth2FDN6GS :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () overSoXSynth2FDN6GS f (x, y) j v5 xs vdB ys xxs - | null . convertToProperUkrainianS $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN6GS: You provided no information to obtain volume adjustment! "+ | null . convertToProperUkrainianI8 $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN6GS: You provided no information to obtain volume adjustment! " | otherwise = overSoXSynth2FDN6G f (x, y) j (intervalsFromStringG v5 xs) vdB ys (str2Vol1 xxs) {-# INLINE overSoXSynth2FDN6GS #-} @@ -187,7 +187,7 @@ -- | Similar to 'overSoXSynth2DN' but instead of 'overTones' function, it uses volatile function @f::Float -> [(Float, Float)]@ with -- somewhat sophisticated mechanism to normalize the resulting list elements @(Float, Float)@. The last one is experimental feature, so -- it is your responsibility to provide a function so that it does not lead to clipping. In such a case, the result of application of the--- 'convertToProperUkrainianS' to the 'String' parameter must not be []. The function also tries to perform filtering to avoid possible beating.+-- 'convertToProperUkrainianI8' to the 'String' parameter must not be []. The function also tries to perform filtering to avoid possible beating. -- The third 'Float' parameter in the tuple is used as a limit for frequencies difference in Hz to be filtered out from the resulting sound. It is -- considered to be from the range @[0.1..10.0]@. An 'Int' parameter is used to define the needed interval. To obtain compatible with versions prior -- to 0.20.0.0 behaviour, use for the 'Int' 0.@@ -210,7 +210,7 @@ -- argument. For more information, please, refer to 'soxBasicParams'. overSoXSynth2FDN_B2G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> Array Int Float -> String -> IO () overSoXSynth2FDN_B2G f (x, y, limB) j zs vdB ys- | null . convertToProperUkrainianS $ zs = overSoXSynthG f x+ | null . convertToProperUkrainianI8 $ zs = overSoXSynthG f x | otherwise = do let l0 = length zs note0 = closestNote (if x /= 0.0 then abs x else unsafeAt notes 0)@@ -274,7 +274,7 @@ -- | A variant of the 'overSoXSynth2FDN_B6G' where volume adjustment is obtained from a Ukrainian text. overSoXSynth2FDN_B6GS :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () overSoXSynth2FDN_B6GS f (x, y, limB) j v5 xs vdB ys xxs- | null . convertToProperUkrainianS $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_B6GS: You provided no information to obtain volume adjustment! "+ | null . convertToProperUkrainianI8 $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_B6GS: You provided no information to obtain volume adjustment! " | otherwise = overSoXSynth2FDN_B6G f (x, y, limB) j (intervalsFromStringG v5 xs) vdB ys (str2Vol1 xxs) {-# INLINE overSoXSynth2FDN_B6GS #-} @@ -304,7 +304,7 @@ -- For more information, please, refer to 'soxBasicParams'. overSoXSynth2FDN_S2G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> String -> IO () overSoXSynth2FDN_S2G f (x, y) j zs vdB ys- | null . convertToProperUkrainianS $ zs = overSoXSynthG f x+ | null . convertToProperUkrainianI8 $ zs = overSoXSynthG f x | otherwise = do let note0 = closestNote (if x /= 0.0 then abs x else unsafeAt notes 0) l0 = length zs@@ -351,7 +351,7 @@ -- | A variant of the 'overSoXSynth2FDN_S6G' where volume adjustment is obtained from a Ukrainian text. overSoXSynth2FDN_S6GS :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () overSoXSynth2FDN_S6GS f (x, y) j v5 xs vdB ys xxs- | null . convertToProperUkrainianS $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_S6GS: You provided no information to obtain volume adjustment! "+ | null . convertToProperUkrainianI8 $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_S6GS: You provided no information to obtain volume adjustment! " | otherwise = overSoXSynth2FDN_S6G f (x, y) j (intervalsFromStringG v5 xs) vdB ys (str2Vol1 xxs) {-# INLINE overSoXSynth2FDN_S6GS #-} @@ -482,7 +482,7 @@ -- | A variant of the 'overSoXSynth2FDN_Sf36G' where volume adjustment is obtained from a Ukrainian text. overSoXSynth2FDN_Sf36GS :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () overSoXSynth2FDN_Sf36GS f (x, y, t0) j v5 xs vdB ys xxs- | null . convertToProperUkrainianS $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_Sf36GS: You provided no information to obtain volume adjustment! "+ | null . convertToProperUkrainianI8 $ xxs = putStrLn "Composition.Sound.Functional.overSoXSynth2FDN_Sf36GS: You provided no information to obtain volume adjustment! " | otherwise = overSoXSynth2FDN_Sf36G f (x, y, t0) j (intervalsFromStringG v5 xs) vdB ys (str2Vol1 xxs) {-# INLINE overSoXSynth2FDN_Sf36GS #-}
Composition/Sound/Overtones.hs view
@@ -77,13 +77,12 @@ import Numeric (showFFloat) import Data.List (isPrefixOf,sort) import Data.Maybe (isNothing,fromJust,maybe)---import qualified Data.Vector as V import GHC.Arr import qualified Data.Foldable as F import System.Process import EndOfExe (showE) import System.Directory-import Melodics.ByteString.Ukrainian.Arr (convertToProperUkrainianS)+import Melodics.Ukrainian.ArrInt8 (convertToProperUkrainianI8) import Composition.Sound.Functional.Basics import Composition.Sound.Functional.Params import Composition.Sound.DIS5G6G@@ -117,7 +116,7 @@ -- it is equal to 0.5. overSoXSynth2DN :: Float -> Float -> String -> IO () overSoXSynth2DN x y zs- | null . convertToProperUkrainianS $ zs = overSoXSynth x+ | null . convertToProperUkrainianI8 $ zs = overSoXSynth x | otherwise = do let note0 = closestNote x note1 = dNote (unsafeAt (intervalsFromString zs) 0) note0
Composition/Sound/Uniq.hs view
@@ -76,16 +76,14 @@ , uniqOverSoXSynthNGen4E6GSuPar ) where ---import GHC.Int import Numeric (showFFloat) import Data.Maybe (isNothing,fromJust)---import qualified Data.Vector as V import GHC.Arr import qualified Data.Foldable as F import Data.Foldable.Ix import System.Process import EndOfExe (showE)-import Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base+import Phonetic.Languages.UniquenessPeriodsG import Composition.Sound.Functional.Basics import Composition.Sound.Functional.Params import Composition.Sound.DIS5G6G
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020-2021 OleksandrZhabenko+Copyright (c) 2020-2022 Oleksandr Zhabenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
− README.markdown
@@ -1,291 +0,0 @@-Rewritten from the dobutokO2 package on Hackage (https://hackage.haskell.org/package/dobutokO2)-using arrays and lists instead of vector-related functionality.---Helps to create experimental music from a file (or its part) and a Ukrainian text. -It can also generate a timbre for the notes. Uses SoX inside.--- ***** Usage *****- =================--You can use it as a library or as an executable.--Please, check before executing whether there is no "x.wav", "test\*.wav",-"result\*.wav" and "end.wav" files in the current directory, because they-can be overwritten. The same can be said about "nx\*.wav" files in the directory.--For the executable you enter in the terminal:--acb { 0 | 1 | 11 | 2 | 21 | 3 | 31 | 4 | 41 | 5 | 51 | 6 | 7 } {fileName} {Ukrainian text}--OR:--acb { 8 | 80 | 9 | 99 | 999 }--OR:--acb { 82 | 820 | 92 | 992 | 9992 } {volatile symbols together, e. g. "0"} {quality control, see information below}--OR:--acb { 00 | 002 } {beginning symbols for the filenames "fade" effect to be applied to} {quality control, see information below}-- where filename is:- the full name of the file to be recorded in the current directory or- the full absolute path to the sound .wav file (or other one format- that is supported by your SoX installation) to obtain sound information from.--If the first command line argument equals to one of the numbers below, then-the program behaves as follows:-- "1", or "3", or "5" -> then the executable uses the overTones functions,- so for the given parameters the overtones are the same for every call.-- "2", or "4", or "6" -> then the program uses uniqOverTones functions.-- "3", or "4", or "5", or "6" -> the program uses additional String to define- signs for the harmonics coefficients for overtones.-- "11", or "21", or "31", or "41", or "51", or "61" -> the program works as for- the respective inputs with only the first character in the option- (e. g. for "51", this is "5"), but uses not octaves, but n-th elements sets- of consequential notes consisting of 2, 3, 4, 6, or 9 elements (called- 'enky'). The usual octave is from such point of view a 12th elements set- of consequential notes. This allows to create more 'condensed' and- 'narrower' compositions that being more defined can be at the- same time more precise.-- "9" -> the program works with existing "result\*.wav" files and you can replace- some of them by other one(s) or their sequences. This allows to create files,- then edit them using this first command line option (possibly for several- times) and at last create a resulting melody file with "8" or "80" options.-- "99" -> the program takes a filename (it is a first command line argument and it is- ignored) and the rest of the command line argument (they are treated as command- line arguments to the SoX 'play' command). Then the program prompts you to- specify the needed indeces for the "result\*.wav" files in the current- directory (e. g. they can be obtained by executing the acb with- the first command line argument less than "8", or produced by some- other means). You can specify multiple lists of Int to select the- needed files to be played with effects. Afterwards, the program- just plays these selected files applying the specified SoX- effects to them consequently. For example:- acb 9 reverb -w- will play the selected (during execution) files with the- SoX "reverb -w" effect. For more information on effects,- please, refer to the SoX documentation.-- "999" -> similarly to "99", but instead of playing the files, SoX actually- applies to them these effects and overwrites the files with the obtained ones.- It is convenient way to test the sounding effects with firstly run the- acb with "99" first command line argument, and then, if suitable,- with "999" one. Be aware, that after running with the latter one, the- program cannot restore the files that were changed to their previous- state, so be careful while running.- - In more details:-- "0" -> the program just converts multiline Ukrainian text from stdin- into a String and prints it to stdout. No other arguments are used.-- "00" -> the program applies "fade q 0.01 -0.0" SoX effect to every "zs\*.wav"- (or instead of them to every "zs\*.flac") file in the current directory. - The 'zs' here is specified by the second command line argument.- This allows to avoid clipping while just simply concatenating the files into- one with SoX. The mentioned clipping can be desirable in some circumstances- but generally is not necessary or is redundant. For more information,- please, refer to the SoX documentation and to that one for 'fadeAllE'- function in the Composition.Sound.IntermediateF module of- the algorithmic-composition-basic package.- - "002" -> the program applies "fade q 0.002 -0.0" SoX effect to every "zs\*.wav"- (or instead of them to every "zs\*.flac") file in the current directory. - Works similarly to the option "00" (see above).-- "1" -> basic functionality without the possibility to define individual overtones.-- "11" -> the same as "1", but works with enky. See general information above.- - "2" -> basic functionality with the possibility to define individual overtones.- In such a case, another text gives the other overtones.-- "21" -> the same as "2", but works with enky. See general information above.-- "3" -> adittionally to basic functionality gives an opportunity - to specify the signs for the harmonics coefficients for overtones- by additional String.-- "31" -> the same as "3", but works with enky. See general information above.-- "4" -> similarly to "2" gives an opportunity to specify the signs- for the harmonics coefficients for overtones by additional String.-- "41" -> the same as "4", but works with enky. See general information above.-- "5" -> additionally to that one functionality provided by "3" gives- an opportunity to specify in how many times the amplitude for- the second lower note (if any) is greater, than the amplitude- for the main note and specify the intervals to be used- for every note.-- "51" -> the same as "5", but works with enky. See general information above.-- "6" -> the same as "5", but you can define also overtones by an additional String.-- "61" -> the same as "6", but works with enky. See general information above.-- "7" -> the program behaves like for the "5" option, but generates- overtones using additional String and allows maximum control over- the parameters. Besides, all the needed information it obtains from- the singular formatted input, which can be ended with a keyboard keys- combination that means an end of input (e. g. for Unices, that is- probably Ctrl + D). '@' are separators for the input parts- for their respective parts. For more information about the- format of the single input, see:- https://drive.google.com/open?id=10Z_GRZR4TKoL5KXfqPm-t-4humuHN0O4- The file is also provided with the package as text.dat.txt.- The last two or three inputs (an input just here means- a textual input between two '@') can be omitted, the- program will work also but with less control for- the user possible.-- "8" -> the program just creates from input "result\*" files the "end.wav" by- concatenating them into one. It is mostly useful after some processment- on the "result\*" files after previous execution with other lesser first- command line arguments to get the test final sound file. It can be then- listened to and probably remade again by editing the "result\*" files- and running the program with this option again. In such a case,- none from the other command line arguments is important for the- program running, so they all can be simply omitted.-- "80" -> the same as "8" but with one important difference that the program if- succeeded in creation of the "end.wav" file, then removes all other "result\*"- files from the current directory, so you cannot reverse the successful action- back and try again with just the same files. In such a case, you need to- repeat all the process of creation of "result\*" files. Be aware and use- with care!-- "82" -> the same as "8", but you can specify the sound quality parameters for the- resulted file and choose whether it will be in WAV or FLAC format. To specify- this additional processing information, use as a third command line argument- (after the first "82" and the volatile second one) 4 consequent symbols:- 3 digits and 1 letter ('f' -- for FLAC one and 'w' for WAV one). The first- two digits are a code for rate and the third one -- a code for bit depth- ('1' -- for 16 bit and '2' -- for 24 bit). The list of possible first- two digits and their corresponding frequency rate in Hz:-- "11" -> 11025-- "16" -> 16000-- "17" -> 176400-- "19" -> 192000-- "32" -> 32000-- "44" -> 44100-- "48" -> 48000-- "80" -> 8000-- "96" -> 96000-- The default one behaviour is equivalent to "221w".-- "820" -> the same as "80", but similarly to "82" it gives you the opportunity to- specify sound quality parameters in just the same way.-- "9", "99", or "999" -> see the information above.-- "92", "992", or "9992" -> similar to the above line, but with the opportunity to- specify sound quality parameters in just the same way as for "82" option.- These are considered still highly experimental and not well tested,- so use them not for production.- - _ -> the program behaves like for the "5" option, but generates- overtones using additional String and allows maximum control over- the parameters.--After the program executing (it takes some time) with the first command line-options except "80" there are files "result\*.wav" in the directory.-These are the resulting melody generated in their order preserved.--The program now lifts the frequencies to the octave or to the enka with the number,-which you can specify during its execution.--You can use the default values by simply pressing 'Enter' while being prompted and-the informational message contains the line about the default value.--The package extends its library functions with-the possibility to create not only single notes or intervals of sounds playing-simultaneously but also sets of three, four, five, six, seven or more sounds-played simultaneously with their overtones. For more information, please, refer-to the documentation for the Composition.Sound.Functional module.--The library functions are extended also with the-possibility to adjust volume for the overtones using generalized functions '1G'-with adjustment being represented in dB. For more information, please, refer-to the documentation for the Composition.Sound.Functional module.--The library includes functions '2G': generalized-ones in the Composition.Sound.Functional, and Composition.Sound.IntermediateF-(the last one is from the algorithmic-composition-basic package), and-Composition.Sound.Executable modules. They allow to specify sound quality-of the resulting files using additional parameter.--The library includes functions to work more explicitly-with f function in the Composition.Sound.Functional module. They are based on the-simplest (but still meaningful) multiplicative data fitting.--The library includes functions to split the sound -into several simultaneously sounding similar ones. For more information, please, -refer to the Composition.Sound.Functional module.--The library includes functions to provide your own -variants of durations, intervals and volume adjustments and the possibilities -to generate speech-like music with most of parameters obtained from the Ukrainian -language texts.--The library includes new datatype Params in the -Composition.Sound.Functional module and various functions to work with it. It -allows to use tonalities or something close to them. For more information, -please, refer to Composition.Sound.Functional submodules.--There are some additional effects and opportunities -in the Composition.Sound.Functional and Composition.Sound.IntermediateF-(the last one is from the algorithmic-composition-basic package) modules. Some -functions in the library were moved from the Composition.Sound.Executable module -to the Composition.Sound.Functional module because of logics of the module structure -and semantics.--** Note:--* Better to execute in the RAM. Need rather a lot of space on the disk for-the resulting file "end.wav" and auxiliary files (MBs) for a short sound-in the second command line arguments.-- ***** Examples *****- ====================--You can refer to examples in the GitHub special-repository (https://github.com/OleksandrZhabenko/dobutokO2-examples/) for the-previously created dobutokO2 and dobutokO3 packages. -You can also see some of the generated sounds on the YouTube list:-https://www.youtube.com/playlist?list=PLuG3zSZWV7yollV9nMPcRtm3udVuYVlFS--- ***** Support for not Sound File Variativity Sources *****- ==========================================================- -The library supports not only the sound file as a -variativity source but also other types of files. They are used through -a special reencoding using lazy bytestrings. For more information, please, -refer to Composition.Sound.Keyboard (from the algorithmic-composition-basic package)-module.--The library uses Float instead of Double where possible. Double precision -is redundant. The shift is inspired by: https://www.youtube.com/watch?v=FYTZkE5BZ-0-
+ README.md view
@@ -0,0 +1,291 @@+Rewritten from the dobutokO2 package on Hackage (https://hackage.haskell.org/package/dobutokO2)+using arrays and lists instead of vector-related functionality.+++Helps to create experimental music from a file (or its part) and a Ukrainian text. +It can also generate a timbre for the notes. Uses SoX inside.+++ ***** Usage *****+ =================++You can use it as a library or as an executable.++Please, check before executing whether there is no "x.wav", "test\*.wav",+"result\*.wav" and "end.wav" files in the current directory, because they+can be overwritten. The same can be said about "nx\*.wav" files in the directory.++For the executable you enter in the terminal:++acb { 0 | 1 | 11 | 2 | 21 | 3 | 31 | 4 | 41 | 5 | 51 | 6 | 7 } {fileName} {Ukrainian text}++OR:++acb { 8 | 80 | 9 | 99 | 999 }++OR:++acb { 82 | 820 | 92 | 992 | 9992 } {volatile symbols together, e. g. "0"} {quality control, see information below}++OR:++acb { 00 | 002 } {beginning symbols for the filenames "fade" effect to be applied to} {quality control, see information below}++ where filename is:+ the full name of the file to be recorded in the current directory or+ the full absolute path to the sound .wav file (or other one format+ that is supported by your SoX installation) to obtain sound information from.++If the first command line argument equals to one of the numbers below, then+the program behaves as follows:++ "1", or "3", or "5" -> then the executable uses the overTones functions,+ so for the given parameters the overtones are the same for every call.++ "2", or "4", or "6" -> then the program uses uniqOverTones functions.++ "3", or "4", or "5", or "6" -> the program uses additional String to define+ signs for the harmonics coefficients for overtones.++ "11", or "21", or "31", or "41", or "51", or "61" -> the program works as for+ the respective inputs with only the first character in the option+ (e. g. for "51", this is "5"), but uses not octaves, but n-th elements sets+ of consequential notes consisting of 2, 3, 4, 6, or 9 elements (called+ 'enky'). The usual octave is from such point of view a 12th elements set+ of consequential notes. This allows to create more 'condensed' and+ 'narrower' compositions that being more defined can be at the+ same time more precise.++ "9" -> the program works with existing "result\*.wav" files and you can replace+ some of them by other one(s) or their sequences. This allows to create files,+ then edit them using this first command line option (possibly for several+ times) and at last create a resulting melody file with "8" or "80" options.++ "99" -> the program takes a filename (it is a first command line argument and it is+ ignored) and the rest of the command line argument (they are treated as command+ line arguments to the SoX 'play' command). Then the program prompts you to+ specify the needed indeces for the "result\*.wav" files in the current+ directory (e. g. they can be obtained by executing the acb with+ the first command line argument less than "8", or produced by some+ other means). You can specify multiple lists of Int to select the+ needed files to be played with effects. Afterwards, the program+ just plays these selected files applying the specified SoX+ effects to them consequently. For example:+ acb 9 reverb -w+ will play the selected (during execution) files with the+ SoX "reverb -w" effect. For more information on effects,+ please, refer to the SoX documentation.++ "999" -> similarly to "99", but instead of playing the files, SoX actually+ applies to them these effects and overwrites the files with the obtained ones.+ It is convenient way to test the sounding effects with firstly run the+ acb with "99" first command line argument, and then, if suitable,+ with "999" one. Be aware, that after running with the latter one, the+ program cannot restore the files that were changed to their previous+ state, so be careful while running.+ + In more details:++ "0" -> the program just converts multiline Ukrainian text from stdin+ into a String and prints it to stdout. No other arguments are used.++ "00" -> the program applies "fade q 0.01 -0.0" SoX effect to every "zs\*.wav"+ (or instead of them to every "zs\*.flac") file in the current directory. + The 'zs' here is specified by the second command line argument.+ This allows to avoid clipping while just simply concatenating the files into+ one with SoX. The mentioned clipping can be desirable in some circumstances+ but generally is not necessary or is redundant. For more information,+ please, refer to the SoX documentation and to that one for 'fadeAllE'+ function in the Composition.Sound.IntermediateF module of+ the algorithmic-composition-basic package.+ + "002" -> the program applies "fade q 0.002 -0.0" SoX effect to every "zs\*.wav"+ (or instead of them to every "zs\*.flac") file in the current directory. + Works similarly to the option "00" (see above).++ "1" -> basic functionality without the possibility to define individual overtones.++ "11" -> the same as "1", but works with enky. See general information above.+ + "2" -> basic functionality with the possibility to define individual overtones.+ In such a case, another text gives the other overtones.++ "21" -> the same as "2", but works with enky. See general information above.++ "3" -> adittionally to basic functionality gives an opportunity + to specify the signs for the harmonics coefficients for overtones+ by additional String.++ "31" -> the same as "3", but works with enky. See general information above.++ "4" -> similarly to "2" gives an opportunity to specify the signs+ for the harmonics coefficients for overtones by additional String.++ "41" -> the same as "4", but works with enky. See general information above.++ "5" -> additionally to that one functionality provided by "3" gives+ an opportunity to specify in how many times the amplitude for+ the second lower note (if any) is greater, than the amplitude+ for the main note and specify the intervals to be used+ for every note.++ "51" -> the same as "5", but works with enky. See general information above.++ "6" -> the same as "5", but you can define also overtones by an additional String.++ "61" -> the same as "6", but works with enky. See general information above.++ "7" -> the program behaves like for the "5" option, but generates+ overtones using additional String and allows maximum control over+ the parameters. Besides, all the needed information it obtains from+ the singular formatted input, which can be ended with a keyboard keys+ combination that means an end of input (e. g. for Unices, that is+ probably Ctrl + D). '@' are separators for the input parts+ for their respective parts. For more information about the+ format of the single input, see:+ https://drive.google.com/open?id=10Z_GRZR4TKoL5KXfqPm-t-4humuHN0O4+ The file is also provided with the package as text.dat.txt.+ The last two or three inputs (an input just here means+ a textual input between two '@') can be omitted, the+ program will work also but with less control for+ the user possible.++ "8" -> the program just creates from input "result\*" files the "end.wav" by+ concatenating them into one. It is mostly useful after some processment+ on the "result\*" files after previous execution with other lesser first+ command line arguments to get the test final sound file. It can be then+ listened to and probably remade again by editing the "result\*" files+ and running the program with this option again. In such a case,+ none from the other command line arguments is important for the+ program running, so they all can be simply omitted.++ "80" -> the same as "8" but with one important difference that the program if+ succeeded in creation of the "end.wav" file, then removes all other "result\*"+ files from the current directory, so you cannot reverse the successful action+ back and try again with just the same files. In such a case, you need to+ repeat all the process of creation of "result\*" files. Be aware and use+ with care!++ "82" -> the same as "8", but you can specify the sound quality parameters for the+ resulted file and choose whether it will be in WAV or FLAC format. To specify+ this additional processing information, use as a third command line argument+ (after the first "82" and the volatile second one) 4 consequent symbols:+ 3 digits and 1 letter ('f' -- for FLAC one and 'w' for WAV one). The first+ two digits are a code for rate and the third one -- a code for bit depth+ ('1' -- for 16 bit and '2' -- for 24 bit). The list of possible first+ two digits and their corresponding frequency rate in Hz:++ "11" -> 11025++ "16" -> 16000++ "17" -> 176400++ "19" -> 192000++ "32" -> 32000++ "44" -> 44100++ "48" -> 48000++ "80" -> 8000++ "96" -> 96000++ The default one behaviour is equivalent to "221w".++ "820" -> the same as "80", but similarly to "82" it gives you the opportunity to+ specify sound quality parameters in just the same way.++ "9", "99", or "999" -> see the information above.++ "92", "992", or "9992" -> similar to the above line, but with the opportunity to+ specify sound quality parameters in just the same way as for "82" option.+ These are considered still highly experimental and not well tested,+ so use them not for production.+ + _ -> the program behaves like for the "5" option, but generates+ overtones using additional String and allows maximum control over+ the parameters.++After the program executing (it takes some time) with the first command line+options except "80" there are files "result\*.wav" in the directory.+These are the resulting melody generated in their order preserved.++The program now lifts the frequencies to the octave or to the enka with the number,+which you can specify during its execution.++You can use the default values by simply pressing 'Enter' while being prompted and+the informational message contains the line about the default value.++The package extends its library functions with+the possibility to create not only single notes or intervals of sounds playing+simultaneously but also sets of three, four, five, six, seven or more sounds+played simultaneously with their overtones. For more information, please, refer+to the documentation for the Composition.Sound.Functional module.++The library functions are extended also with the+possibility to adjust volume for the overtones using generalized functions '1G'+with adjustment being represented in dB. For more information, please, refer+to the documentation for the Composition.Sound.Functional module.++The library includes functions '2G': generalized+ones in the Composition.Sound.Functional, and Composition.Sound.IntermediateF+(the last one is from the algorithmic-composition-basic package), and+Composition.Sound.Executable modules. They allow to specify sound quality+of the resulting files using additional parameter.++The library includes functions to work more explicitly+with f function in the Composition.Sound.Functional module. They are based on the+simplest (but still meaningful) multiplicative data fitting.++The library includes functions to split the sound +into several simultaneously sounding similar ones. For more information, please, +refer to the Composition.Sound.Functional module.++The library includes functions to provide your own +variants of durations, intervals and volume adjustments and the possibilities +to generate speech-like music with most of parameters obtained from the Ukrainian +language texts.++The library includes new datatype Params in the +Composition.Sound.Functional module and various functions to work with it. It +allows to use tonalities or something close to them. For more information, +please, refer to Composition.Sound.Functional submodules.++There are some additional effects and opportunities +in the Composition.Sound.Functional and Composition.Sound.IntermediateF+(the last one is from the algorithmic-composition-basic package) modules. Some +functions in the library were moved from the Composition.Sound.Executable module +to the Composition.Sound.Functional module because of logics of the module structure +and semantics.++** Note:++* Better to execute in the RAM. Need rather a lot of space on the disk for+the resulting file "end.wav" and auxiliary files (MBs) for a short sound+in the second command line arguments.++ ***** Examples *****+ ====================++You can refer to examples in the GitHub special+repository (https://github.com/OleksandrZhabenko/dobutokO2-examples/) for the+previously created dobutokO2 and dobutokO3 packages. +You can also see some of the generated sounds on the YouTube list:+https://www.youtube.com/playlist?list=PLuG3zSZWV7yollV9nMPcRtm3udVuYVlFS+++ ***** Support for not Sound File Variativity Sources *****+ ==========================================================+ +The library supports not only the sound file as a +variativity source but also other types of files. They are used through +a special reencoding using lazy bytestrings. For more information, please, +refer to Composition.Sound.Keyboard (from the algorithmic-composition-basic package)+module.++The library uses Float instead of Double where possible. Double precision +is redundant. The shift is inspired by: https://www.youtube.com/watch?v=FYTZkE5BZ-0+
algorithmic-composition-additional.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: algorithmic-composition-additional-version: 0.1.1.0+version: 0.2.0.0 synopsis: Helps to create experimental music from a file (or its part) and a Ukrainian text. description: It can also generate a timbre for the notes. Uses SoX inside. homepage: https://hackage.haskell.org/package/algorithmic-composition-additional@@ -13,14 +13,14 @@ copyright: Oleksandr Zhabenko category: Sound, Music, Language build-type: Simple-extra-source-files: CHANGELOG.md, README.markdown, text.dat.txt+extra-source-files: CHANGELOG.md, README.md, text.dat.txt cabal-version: >=1.10 library exposed-modules: Main, Composition.Sound.Overtones, Composition.Sound.Uniq, Composition.Sound.Functional, Composition.Sound.Process, Composition.Sound.Executable, Composition.Sound.ParseList, Composition.Sound.Functional.Split, Composition.Sound.DIS5G6G, Composition.Sound.Decibel, Composition.Sound.Extended, Composition.Sound.Octaves, Composition.Sound.FunctionF -- other-modules: -- other-extensions:- build-depends: base >=4.8 && <5, bytestring >= 0.10.6 && <1, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr-common >=0.1.1 && <1, mmsyn2-array >=0.1.1 && <1, ukrainian-phonetics-basic-array >=0.1.2 && <1, mmsyn7l >=0.9 && <1, phonetic-languages-simplified-base >=0.2 && <1, foldable-ix >=0.2 && <1, algorithmic-composition-basic >=0.5 && <1+ build-depends: base >=4.8 && <5, process >=1.4 && <2, mmsyn3 ==0.1.6.0, directory >=1.2.7 && <2, mmsyn7ukr-common ==0.2.0.0, mmsyn2-array ==0.3.0.0, ukrainian-phonetics-basic-array ==0.6.0.0, mmsyn7l ==0.9.1.0, phonetic-languages-simplified-base ==0.6.0.0, foldable-ix ==0.2.1.0, algorithmic-composition-basic ==0.6.0.0, phonetic-languages-basis ==0.1.1.0 -- hs-source-dirs: default-language: Haskell2010 @@ -28,7 +28,8 @@ main-is: Main.hs other-modules: Composition.Sound.Overtones, Composition.Sound.Uniq, Composition.Sound.Functional, Composition.Sound.Process, Composition.Sound.Executable, Composition.Sound.ParseList, Composition.Sound.Functional.Split, Composition.Sound.DIS5G6G, Composition.Sound.Decibel, Composition.Sound.Extended, Composition.Sound.Octaves, Composition.Sound.FunctionF -- other-extensions:- build-depends: base >=4.8 && <5, bytestring >= 0.10.6 && <1, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr-common >=0.1.1 && <1, mmsyn2-array >=0.1.1 && <1, ukrainian-phonetics-basic-array >=0.1.2 && <1, mmsyn7l >=0.9 && <1, phonetic-languages-simplified-base >=0.2 && <1, foldable-ix >=0.2 && <1, algorithmic-composition-basic >=0.5 && <1- -- hs-source-dirs:+ build-depends: base >=4.8 && <5, process >=1.4 && <2, mmsyn3 ==0.1.6.0, directory >=1.2.7 && <2, mmsyn7ukr-common ==0.2.0.0, mmsyn2-array ==0.3.0.0, ukrainian-phonetics-basic-array ==0.6.0.0, mmsyn7l ==0.9.1.0, phonetic-languages-simplified-base ==0.6.0.0, foldable-ix ==0.2.1.0, algorithmic-composition-basic ==0.6.0.0, phonetic-languages-basis ==0.1.1.0++ -- hs-source-dirs: default-language: Haskell2010