dobutokO2 0.36.2.0 → 0.36.3.0
raw patch · 4 files changed
+153/−98 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- DobutokO/Sound.hs +128/−85
- DobutokO/Sound/Functional.hs +20/−12
- dobutokO2.cabal +1/−1
CHANGELOG.md view
@@ -331,3 +331,7 @@ * Thirty-sixth version revised B. Fixed issues with being not compiled for GHC 7.8.4 because of inappropriate some functions usage in DobutokO.Sound.Functonal module.++## 0.36.3.0 -- 2020-04-26++* Thirty-sixth version revised C. Fixed issues with zero durations for SoX "synth" effect. Some documentation improvements.
DobutokO/Sound.hs view
@@ -337,20 +337,21 @@ overSoXSynthN4G n ampL v2 vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT = let zeroN = numVZeroesPre vec0+ v21 = V.filter (/=0.0) v2 m = V.length v2 in V.imapM_ (\j x -> do let note0 = closestNote x -- zs is obtained from the command line arguments note1 = pureQuintNote note0 v0 = overTones note0 v1 = overTones note1 overSoXSynthHelpN vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec+ ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec overSoXSynthHelpN2 vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec + ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec soxSynthHelpMain note01 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++ prependZeroes zeroN "1" ++- ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "synth",- showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT + ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "synth",+ showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain note0 note1 overSoXSynthHelpN v0@@ -377,22 +378,23 @@ overSoXSynthN24G :: Int -> Double -> Durations -> String -> V.Vector Double -> IO () overSoXSynthN24G n ampL v2 tts vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT = - let zeroN = numVZeroesPre vec0- m = V.length v2 in V.imapM_ (\j x -> do + let v21 = V.filter (/= 0.0) v2+ zeroN = numVZeroesPre vec0+ m = V.length v21 in V.imapM_ (\j x -> do let note0 = closestNote x -- zs is obtained from the command line arguments note1 = pureQuintNote note0 v0 = overTones2 note0 tts v1 = overTones2 note1 tts overSoXSynthHelpN vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec+ ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec overSoXSynthHelpN2 vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec + ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec soxSynthHelpMain note01 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++ prependZeroes zeroN "1" ++- ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",- "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",- if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",+ "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",+ if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain note0 note1 overSoXSynthHelpN v0 overSoXSynthHelpN2 v1@@ -422,7 +424,8 @@ overSoXSynthN34G :: Int -> Double -> Double -> Durations -> String -> String -> V.Vector Double -> IO () overSoXSynthN34G n ampL dAmpl v2 tts vs vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT = - let m = V.length v2+ let v21 = V.filter (/= 0.0) v2+ m = V.length v21 zeroN = numVZeroesPre vec0 v3 = intervalsFromString vs l = length vs in V.imapM_ (\j x -> do @@ -432,18 +435,18 @@ v1 = if isNothing note1 then V.empty else overTones2 (fromJust note1) tts overSoXSynthHelpN vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec+ ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec overSoXSynthHelpN2 vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0+ ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0 else dAmpl * amplN * ampL) "" else "0"] "") vec soxSynthHelpMain0 note01 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++ prependZeroes zeroN "1" ++ ".wav",- "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "vol",- if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "vol",+ if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain1 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",- "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",+ "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] "" if isNothing note1 then do { soxSynthHelpMain0 note0 ; overSoXSynthHelpN v0 } else do { soxSynthHelpMain0 note0@@ -462,7 +465,8 @@ overSoXSynthN35G :: Int -> Double -> Double -> Durations -> String -> Intervals -> V.Vector Double -> IO () overSoXSynthN35G n ampL dAmpl v2 tts v3 vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT = - let m = V.length v2+ let v21 = V.filter (/=0.0) v2+ m = V.length v21 zeroN = numVZeroesPre vec0 l = V.length v3 in V.imapM_ (\j x -> do let note0 = closestNote x -- zs is obtained from the command line arguments@@ -471,18 +475,18 @@ v1 = if isNothing note1 then V.empty else overTones2 (fromJust note1) tts overSoXSynthHelpN vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec+ ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec overSoXSynthHelpN2 vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0+ ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0 else dAmpl * amplN * ampL) "" else "0"] "") vec soxSynthHelpMain0 note01 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++ prependZeroes zeroN "1" ++ ".wav",- "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "vol",- if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "vol",+ if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain1 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",- "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",+ "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] "" if isNothing note1 then do { soxSynthHelpMain0 note0 ; overSoXSynthHelpN v0 } else do { soxSynthHelpMain0 note0@@ -534,6 +538,8 @@ n <- duration1000 file nGenE4Gi n file m ku ampL (str2Durations zs time3) +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. nGenE4Gi :: Int -> FilePath -> Int -> Int -> Double -> Durations -> IO () nGenE4Gi n file m ku ampL v2 = do vecA <- freqsFromFile file n@@ -574,6 +580,8 @@ n <- duration1000 file nGen2E4Gi n file m ku ampL (str2Durations zs time3) tts +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. nGen2E4Gi :: Int -> FilePath -> Int -> Int -> Double -> Durations -> String -> IO () nGen2E4Gi n file m ku ampL v2 tts = do vecA <- freqsFromFile file n@@ -612,12 +620,15 @@ nGen3E4Gi n file m ku ampL dAmpl (str2DurationsDef n zs time3) tts vs -- | Variant of the 'overSoXSynthNGen3E4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like --- composition.+-- composition. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E4GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> IO () overSoXSynthNGen3E4GS file m ku ampL time3 dAmpl zs tts vs = do n <- duration1000 file nGen3E4Gi n file m ku ampL dAmpl (str2Durations zs time3) tts vs +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. nGen3E4Gi :: Int -> FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> IO () nGen3E4Gi n file m ku ampL dAmpl v2 tts vs = do vecA <- freqsFromFile file n@@ -625,6 +636,8 @@ overSoXSynthN34G n ampL dAmpl v2 tts vs vecB endFromResult +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. nGen3E5Gi :: Int -> FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> IO () nGen3E5Gi n file m ku ampL dAmpl v2 tts v3 = do vecA <- freqsFromFile file n@@ -632,13 +645,15 @@ overSoXSynthN35G n ampL dAmpl v2 tts v3 vecB endFromResult --- | 4G generalized function for 'overSoXSynthNGen3E' where you provide your own 'Durations'.+-- | 4G generalized function for 'overSoXSynthNGen3E' where you provide your own 'Durations'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E4G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> IO () overSoXSynthNGen3E4G file m ku ampL dAmpl v2 tts vs = do n <- duration1000 file nGen3E4Gi n file m ku ampL dAmpl v2 tts vs --- | 5G generalized function for 'overSoXSynthNGen3E4G' where you provide your own 'Intervals'.+-- | 5G generalized function for 'overSoXSynthNGen3E4G' where you provide your own 'Intervals'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E5G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> IO () overSoXSynthNGen3E5G file m ku ampL dAmpl v2 tts v3 = do n <- duration1000 file@@ -646,18 +661,21 @@ -- | Variant of the 'overSoXSynthNGen3E5G' where 'Intervals' are obtained from the basic 'Intervals' with the length no more than 29 and a Ukrainian text -- specified as the last 'String' argument so that you can produce 'Intervals' of the arbitrary length. For more information, please, refer to --- 'intervalsFromStringG' and 'strToIntG'.+-- 'intervalsFromStringG' and 'strToIntG'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E5GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> IO () overSoXSynthNGen3E5GS file m ku ampL time3 dAmpl zs tts v3 vs = do n <- duration1000 file nGen3E5Gi n file m ku ampL dAmpl (str2Durations zs time3) tts (intervalsFromStringG v3 vs) --- | 6G generalized function for 'overSoXSynthNGen3E5G' where you provide your own 'Strengths'.+-- | 6G generalized function for 'overSoXSynthNGen3E5G' where you provide your own 'Strengths'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E6G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> Strengths -> Double -> IO () overSoXSynthNGen3E6G file m ku ampL dAmpl v2 tts v3 v6 limV = overSoXSynthNGen3E5G file m ku ampL dAmpl v2 tts v3 >> apply6G2 v6 "221w" "result" limV >> endFromResult --- | A variant of 'overSoXSynthNGen3E6G' where 'Strengths' are obtained from a Ukrainian text specified as the last 'String' argument.+-- | A variant of 'overSoXSynthNGen3E6G' where 'Strengths' are obtained from a Ukrainian text specified as the last 'String' argument. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthNGen3E6GS :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> String -> Double -> IO () overSoXSynthNGen3E6GS file m ku ampL dAmpl v2 tts v3 xxs limV = overSoXSynthNGen3E6G file m ku ampL dAmpl v2 tts v3 (str2Volume xxs) limV @@ -728,23 +746,24 @@ uniqOverSoXSynthN4G :: Int -> Double -> Durations -> String -> V.Vector Double -> IO () uniqOverSoXSynthN4G n ampL v2 wws vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =- let m = V.length v2+ let v21 = V.filter (/= 0.0) v2+ m = V.length v21 zeroN = numVZeroesPre vec0 in V.imapM_ (\j x -> do let note0 = closestNote x note1 = pureQuintNote note0 v0 = uniqOvertonesV note0 wws v1 = uniqOvertonesV note1 wws uniqOverSoXSynthHelpN = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT + ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") uniqOverSoXSynthHelpN2 = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT + ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") soxSynthHelpMain note01 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",- if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",+ if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain note0 note1 uniqOverSoXSynthHelpN v0 uniqOverSoXSynthHelpN2 v1@@ -774,22 +793,23 @@ uniqOverSoXSynthN34G :: Int -> Double -> Durations -> String -> String -> V.Vector Double -> IO () uniqOverSoXSynthN34G n ampL v2 wws tts vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =- let m = V.length v2+ let v21 = V.filter (/=0.0) v2+ m = V.length v2 zeroN = numVZeroesPre vec0 in V.imapM_ (\j x -> do let note0 = closestNote x -- zs ? vec0 -- are they related to the one object? No, they are obtained from different sources. note1 = pureQuintNote note0 v0 = uniqOvertonesV2 note0 wws tts v1 = uniqOvertonesV2 note1 wws tts uniqOverSoXSynthHelpN vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec+ ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec uniqOverSoXSynthHelpN2 vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec + ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") vec soxSynthHelpMain note01 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",- "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",- if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",+ "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", "mix", showFFloat (Just 4) note02 "", "vol",+ if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain note0 note1 uniqOverSoXSynthHelpN v0 uniqOverSoXSynthHelpN2 v1@@ -827,7 +847,8 @@ uniqOverSoXSynthN45G :: Int -> Double -> Double -> Durations -> String -> String -> Intervals -> V.Vector Double -> IO () uniqOverSoXSynthN45G n ampL dAmpl v2 wws tts v3 vec0 | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =- let m = V.length v2+ let v21 = V.filter (/=0.0) v2+ m = V.length v2 zeroN = numVZeroesPre vec0 l = V.length v3 in V.imapM_ (\j x -> do let note0 = closestNote x@@ -836,18 +857,18 @@ v1 = if isNothing note1 then V.empty else uniqOvertonesV2 (fromJust note1) wws tts uniqOverSoXSynthHelpN = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") + ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") uniqOverSoXSynthHelpN2 = V.imapM_ (\i (noteN, amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0+ ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0 else dAmpl * amplN * ampL) "" else "0"] "") soxSynthHelpMain0 note01 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",- "vol",if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",+ "vol",if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain1 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",- "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",+ "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] "" if isNothing note1 then do { soxSynthHelpMain0 note0 ; uniqOverSoXSynthHelpN v0 } else do { soxSynthHelpMain0 note0@@ -865,7 +886,8 @@ uniqOverSoXSynthN46G n ampL dAmpl v2 wws tts v3 vec0 v6 limV | V.null v6 = putStrLn "You did not provide a volume adjustments vector! " | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =- let m = V.length v2+ let v21 = V.filter (/=0.0) v2+ m = V.length v2 zeroN = numVZeroesPre vec0 l = V.length v3 in V.imapM_ (\j x -> do let note0 = closestNote x@@ -874,18 +896,18 @@ v1 = if isNothing note1 then V.empty else uniqOvertonesV2 (fromJust note1) wws tts uniqOverSoXSynthHelpN = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") + ["-r22050", "-n", "test" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine",showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (amplN * ampL) "" else "0"] "") uniqOverSoXSynthHelpN2 = V.imapM_ (\i (noteN, amplN) -> readProcessWithExitCode (fromJust (showE "sox"))- ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "",- "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0+ ["-r22050", "-n", "testQ" ++ prependZeroes zeroN (show (i + 2)) ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "",+ "sine", showFFloat (Just 4) noteN "", "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl * amplN * ampL > 1.0 then 1.0 else dAmpl * amplN * ampL) "" else "0"] "") soxSynthHelpMain0 note01 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",- "vol",if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then "0.5" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note01 "",+ "vol",if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then "0.5" else "0"] "" soxSynthHelpMain1 note02 = readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB" ++- prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v2 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",- "vol", if compare (V.unsafeIndex v2 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] ""+ prependZeroes zeroN "1" ++ ".wav", "synth", showFFloat (Just 4) (V.unsafeIndex v21 (j `rem` m)) "","sine", showFFloat (Just 4) note02 "",+ "vol", if compare (V.unsafeIndex v21 (j `rem` m)) 0.0 == GT then showFFloat (Just 4) (if dAmpl > 0.5 then 0.5 else dAmpl / 2) "" else "0"] "" if isNothing note1 then do { soxSynthHelpMain0 note0 ; uniqOverSoXSynthHelpN v0 } else do { soxSynthHelpMain0 note0@@ -924,19 +946,23 @@ -- | Similar to 'uniqOverSoXSynthNGen', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained -- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'uniqOverSoXSynthNGen'. To obtain--- its modifications, please, use 2, 3, 4, 6, or 9.+-- its modifications, please, use 2, 3, 4, 6, or 9. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGenE :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () uniqOverSoXSynthNGenE file m ku ampL time3 zs wws = do n <- duration1000 file unGenNE4Gi n file m ku ampL (str2DurationsDef n zs time3) wws -- | Variant of the 'uniqOverSoXSynthNGenE4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like --- composition.+-- composition. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGenE4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () uniqOverSoXSynthNGenE4GS file m ku ampL time3 zs wws = do n <- duration1000 file unGenNE4Gi n file m ku ampL (str2Durations zs time3) wws +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. unGenNE4Gi :: Int -> FilePath -> Int -> Int -> Double -> Durations -> String -> IO () unGenNE4Gi n file m ku ampL v2 wws = do vecA <- freqsFromFile file n@@ -944,7 +970,8 @@ uniqOverSoXSynthN4G n ampL v2 wws vecB endFromResult --- | 4G genaralized version of the 'uniqOverSoXSynthNGenE' where you provide your own 'Durations'.+-- | 4G genaralized version of the 'uniqOverSoXSynthNGenE' where you provide your own 'Durations'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGenE4G :: FilePath -> Int -> Int -> Double -> Durations -> String -> IO () uniqOverSoXSynthNGenE4G file m ku ampL v2 wws = do n <- duration1000 file@@ -964,19 +991,23 @@ -- | Similar to 'uniqOverSoXSynthNGen3', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained -- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'uniqOverSoXSynthNGen3'. To obtain--- its modifications, please, use 2, 3, 4, 6, or 9.+-- its modifications, please, use 2, 3, 4, 6, or 9. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen3E :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> String -> IO () uniqOverSoXSynthNGen3E file m ku ampL time3 zs wws tts = do n <- duration1000 file unGenN3E4Gi n file m ku ampL (str2DurationsDef n zs time3) wws tts -- | Variant of the 'uniqOverSoXSynthNGen3E4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like --- composition.+-- composition. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen3E4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> String -> IO () uniqOverSoXSynthNGen3E4GS file m ku ampL time3 zs wws tts = do n <- duration1000 file unGenN3E4Gi n file m ku ampL (str2Durations zs time3) wws tts +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. unGenN3E4Gi :: Int -> FilePath -> Int -> Int -> Double -> Durations -> String -> String -> IO () unGenN3E4Gi n file m ku ampL v2 wws tts = do vecA <- freqsFromFile file n@@ -984,7 +1015,8 @@ uniqOverSoXSynthN34G n ampL v2 wws tts vecB endFromResult --- | 4G genaralized version of the 'uniqOverSoXSynthNGen3E' where you provide your own 'Durations'.+-- | 4G genaralized version of the 'uniqOverSoXSynthNGen3E' where you provide your own 'Durations'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen3E4G :: FilePath -> Int -> Int -> Double -> Durations -> String -> String -> IO () uniqOverSoXSynthNGen3E4G file m ku ampL v2 wws tts = do n <- duration1000 file@@ -1008,19 +1040,23 @@ -- | Similar to 'uniqOverSoXSynthNGen4', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained -- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'uniqOverSoXSynthNGen4'. To obtain--- its modifications, please, use 2, 3, 4, 6, or 9.+-- its modifications, please, use 2, 3, 4, 6, or 9. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () uniqOverSoXSynthNGen4E file m ku ampL time3 dAmpl zs wws tts vs = do n <- duration1000 file unGenN4E4Gi n file m ku ampL dAmpl (str2DurationsDef n zs time3) wws tts vs -- | Variant of the 'uniqOverSoXSynthNGen4E4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like --- composition.+-- composition. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E4GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () uniqOverSoXSynthNGen4E4GS file m ku ampL time3 dAmpl zs wws tts vs = do n <- duration1000 file unGenN4E4Gi n file m ku ampL dAmpl (str2Durations zs time3) wws tts vs +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. unGenN4E4Gi :: Int -> FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> String -> IO () unGenN4E4Gi n file m ku ampL dAmpl v2 wws tts vs = do vecA <- freqsFromFile file n@@ -1028,6 +1064,8 @@ uniqOverSoXSynthN44G n ampL dAmpl v2 wws tts vs vecB endFromResult +-- | Note that the last two 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The third 'Int' parameter defines that @n@. unGenN4E5Gi :: Int -> FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> Intervals -> IO () unGenN4E5Gi n file m ku ampL dAmpl v2 wws tts v3 = do vecA <- freqsFromFile file n@@ -1035,31 +1073,36 @@ uniqOverSoXSynthN45G n ampL dAmpl v2 wws tts v3 vecB endFromResult --- | 4G genaralized version of the 'uniqOverSoXSynthNGen4E' where you provide your own 'Durations'.+-- | 4G genaralized version of the 'uniqOverSoXSynthNGen4E' where you provide your own 'Durations'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E4G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> String -> IO () uniqOverSoXSynthNGen4E4G file m ku ampL dAmpl v2 wws tts vs = do n <- duration1000 file unGenN4E4Gi n file m ku ampL dAmpl v2 wws tts vs --- | 5G genaralized version of the 'uniqOverSoXSynthNGen4E' where you provide your own 'Durations' and 'Intervals'.+-- | 5G genaralized version of the 'uniqOverSoXSynthNGen4E' where you provide your own 'Durations' and 'Intervals'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E5G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> Intervals -> IO () uniqOverSoXSynthNGen4E5G file m ku ampL dAmpl v2 wws tts v3 = do n <- duration1000 file unGenN4E5Gi n file m ku ampL dAmpl v2 wws tts v3 -- | Variant of the 'uniqOverSoXSynthNGen4E5G' where 'Intervals' are obtained from the 'String' using 'intervalsFromStringG' function. Helps to create a speech-like --- composition.+-- composition. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E5GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> Intervals -> String -> IO () uniqOverSoXSynthNGen4E5GS file m ku ampL time3 dAmpl zs wws tts v3 vs = do n <- duration1000 file unGenN4E5Gi n file m ku ampL dAmpl (str2Durations zs time3) wws tts (intervalsFromStringG v3 vs) --- | 6G generalized function for 'uniqOverSoXSynthNGen3E5G' where you provide your own 'Strengths'.+-- | 6G generalized function for 'uniqOverSoXSynthNGen3E5G' where you provide your own 'Strengths'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E6G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> Intervals -> Strengths -> Double -> IO () uniqOverSoXSynthNGen4E6G file m ku ampL dAmpl v2 wws tts v3 v6 limV = uniqOverSoXSynthNGen4E5G file m ku ampL dAmpl v2 wws tts v3 >> apply6G2 v6 "221w" "result" limV >> endFromResult --- | A variant of 'uniqOverSoXSynthNGen3E6G' where 'Strengths' are obtained from a Ukrainian text specified as the last 'String' argument.+-- | A variant of 'uniqOverSoXSynthNGen3E6G' where 'Strengths' are obtained from a Ukrainian text specified as the last 'String' argument. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. uniqOverSoXSynthNGen4E6GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> Intervals -> String -> String -> Double -> IO () uniqOverSoXSynthNGen4E6GS file m ku ampL time3 dAmpl zs wws tts v5 vs xxs limV =
DobutokO/Sound/Functional.hs view
@@ -386,7 +386,7 @@ mixTest :: IO () mixTest = do paths0 <- listDirectory "."- let paths = sort . filter (isPrefixOf "test") $ paths0+ let paths = filter (isPrefixOf "test") $ paths0 _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ ["result.wav","vol","0.3"]) "" mapM_ removeFile paths @@ -395,7 +395,7 @@ mixTest2G :: String -> IO () mixTest2G ys = do paths0 <- listDirectory "."- let paths = sort . filter (isPrefixOf "test") $ paths0+ let paths = filter (isPrefixOf "test") $ paths0 _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ soxBasicParams ys ["","result.wav","vol","0.3"]) "" mapM_ removeFile paths @@ -405,7 +405,7 @@ mixTest2 :: Int -> Int -> IO () mixTest2 zeroN j = do paths0 <- listDirectory "."- let paths = sort . filter (isPrefixOf "test") $ paths0+ let paths = filter (isPrefixOf "test") $ paths0 _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ ["result" ++ prependZeroes zeroN (show j) ++ ".wav", "vol","0.3"]) "" mapM_ removeFile paths@@ -416,7 +416,7 @@ mixTest22G :: Int -> Int -> String -> IO () mixTest22G zeroN j ys = do paths0 <- listDirectory "."- let paths = sort . filter (isPrefixOf "test") $ paths0+ let paths = filter (isPrefixOf "test") $ paths0 _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ soxBasicParams ys ["","result" ++ prependZeroes zeroN (show j) ++ ".wav","vol","0.3"]) "" mapM_ removeFile paths @@ -721,7 +721,8 @@ | V.null . convertToProperUkrainian $ xxs = putStrLn "You provided no information to obtain volume adjustment! " | otherwise = overSoXSynth2FDN_S6G f (x, y) j (intervalsFromStringG v5 xs) vdB ys (str2Vol1 xxs) --- | Similar to 'overSoXSynthGen2FDN', but instead of 'overSoXSynth2FDN' uses 'overSoXSynth2FDN_S' function. +-- | Similar to 'overSoXSynthGen2FDN', but instead of 'overSoXSynth2FDN' uses 'overSoXSynth2FDN_S' function. Note that the first 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_SG :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () overSoXSynthGen2FDN_SG file m ku f y zs wws h = do@@ -732,7 +733,8 @@ -- respectively) you provide your own rhythm as 'Durations'. Positive values correspond to durations of the sounds generated -- and negative values -- to durations of the pauses respectively. Please, use a function @h :: ((Double -> OvertonesO) -> (Double, Double) -> -- Int -> String -> IO ())@ such that it can create for the given values accorgingly sounds and pauses. Otherwise, please, check whether at --- least it can deal with such arguments without errors.+-- least it can deal with such arguments without errors. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_SG4G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () overSoXSynthGen2FDN_SG4G file m ku f y v2 wws h = do@@ -757,7 +759,8 @@ ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () overSoXSynthGen2FDN_SG4GS file m ku f y zs = overSoXSynthGen2FDN_SG4G file m ku f y (str2Durations zs y) --- | 6G generalized variant of the 'overSoXSynthGen2FDN_SG4G' with volume adjustments given by 'Strengths'.+-- | 6G generalized variant of the 'overSoXSynthGen2FDN_SG4G' with volume adjustments given by 'Strengths'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_SG6G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> Strengths -> Double -> IO () overSoXSynthGen2FDN_SG6G file m ku f y v2 wws h v6 limV@@ -786,7 +789,8 @@ -- | Generalized variant of the 'overSoXSynthGen2FDN_SG' with a possibility to specify with the third 'String' argument sound quality parameters. -- Besides, the second from the end argument (a function) needs to be one more argument -- just also 'String'. --- For more information, please, refer to 'soxBasicParams'.+-- For more information, please, refer to 'soxBasicParams'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_SG2G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> String -> IO ()) -> String -> IO () overSoXSynthGen2FDN_SG2G file m ku f y zs wws h ys = do@@ -825,7 +829,8 @@ overSoXSynth2FDN_Sf2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> V.Vector Double -> String -> IO () overSoXSynth2FDN_Sf2G f (x, y) = overSoXSynth2FDN_Sf32G f (x, y, 0.001) --- | Similar to 'overSoXSynthGen2FDN_S', but instead of 'overSoXSynth2FDN_S' uses 'overSoXSynth2FDN_Sf' function. +-- | Similar to 'overSoXSynthGen2FDN_S', but instead of 'overSoXSynth2FDN_S' uses 'overSoXSynth2FDN_Sf' function. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_Sf :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> IO () overSoXSynthGen2FDN_Sf file m ku f y zs wws = do n <- duration1000 file@@ -938,7 +943,8 @@ overSoXSynthGen2FDN_Sf3 :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> IO () overSoXSynthGen2FDN_Sf3 file m ku f y t0 zs wws = overSoXSynthGen2FDN_Sf3G file m ku f y t0 zs wws overSoXSynth2FDN_Sf3 --- | Similar to 'overSoXSynthGen2FDN_S', but instead of 'overSoXSynth2FDN_S' uses 'overSoXSynth2FDN_Sf3' function. +-- | Similar to 'overSoXSynthGen2FDN_S', but instead of 'overSoXSynth2FDN_S' uses 'overSoXSynth2FDN_Sf3' function. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_Sf3G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> IO ()) -> IO () overSoXSynthGen2FDN_Sf3G file m ku f y t0 zs wws h = do@@ -953,7 +959,8 @@ -- | Generalized variant of the 'ovorSoXSynthGen2FDN_Sf3G' with a possibility to specify sound quality with the third 'String' argument. -- Besides, the second from the end argument (a function) needs to be one more argument -- just also 'String'. --- For more information, please, refer to 'soxBasicParams'.+-- For more information, please, refer to 'soxBasicParams'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT'). The second 'Int' parameter defines that @n@. overSoXSynthGen2FDN_Sf3G2G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> String -> IO ()) -> String -> IO () overSoXSynthGen2FDN_Sf3G2G file m ku f y t0 zs wws h ys = do@@ -1035,7 +1042,7 @@ liftInEnkuV n ku = V.mapMaybe (liftInEnku n ku) -- | Similarly to 'liftInOctave' returns a 'Maybe' number (actually frequency) for the n-th elements set of notes (see 'nkyT').--- A second 'Int' parameter defines that @n@.+-- A second 'Int' parameter defines that @n@. Not all pairs return 'Just' @x@. liftInEnku :: Int -> Int -> Double -> Maybe Double liftInEnku n ku x | compare n 0 == LT || compare n ((108 `quot` ku) - 1) == GT = Nothing@@ -1676,3 +1683,4 @@ -- | Concatenates a 'V.Vector' of 'OvertonesO' into a single 'OvertonesO'. Can be easily used with 'splitO'. overConcat :: V.Vector OvertonesO -> OvertonesO overConcat = V.concat . V.toList+
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: dobutokO2-version: 0.36.2.0+version: 0.36.3.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/dobutokO2