dobutokO2 0.24.3.0 → 0.24.4.0
raw patch · 4 files changed
+36/−12 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ DobutokO.Sound.Functional: mixTest2 :: Int -> Int -> IO ()
+ DobutokO.Sound.Functional: mixTest22G :: Int -> Int -> String -> IO ()
Files
- CHANGELOG.md +5/−0
- DobutokO/Sound.hs +5/−10
- DobutokO/Sound/Functional.hs +25/−1
- dobutokO2.cabal +1/−1
CHANGELOG.md view
@@ -232,3 +232,8 @@ ## 0.24.3.0 -- 2020-04-06 * Twenty-fourth version revised C. Fixed issue with being not compiled code because of the wrong type signature. ++## 0.24.4.0 -- 2020-04-07++* Twenty-fourth version revised D. Fixed issues with segmentation faults in some functions. Added two new functions to the DobutokO.Sound.Functional+module. Improved stability.
DobutokO/Sound.hs view
@@ -327,8 +327,7 @@ soxSynthHelpMain note0 note1 overSoXSynthHelpN v0 overSoXSynthHelpN2 v1- mixTest- renameFile "result.wav" $ "result" ++ prependZeroes zeroN (show j) ++ ".wav") vec0+ mixTest2 zeroN j) vec0 | otherwise = let ampL1 = ampL - (fromIntegral . truncate $ ampL) in if abs ampL1 < 0.01 then overSoXSynthN n 0.01 time3 zs vec0 else overSoXSynthN n ampL1 time3 zs vec0@@ -361,8 +360,7 @@ soxSynthHelpMain note0 note1 overSoXSynthHelpN v0 overSoXSynthHelpN2 v1- mixTest- renameFile "result.wav" $ "result" ++ prependZeroes zeroN (show j) ++ ".wav") vec0+ mixTest2 zeroN j) vec0 | otherwise = let ampL1 = ampL - (fromIntegral . truncate $ ampL) in if abs ampL1 < 0.01 then overSoXSynthN2 n 0.01 time3 zs tts vec0 else overSoXSynthN2 n ampL1 time3 zs tts vec0 @@ -570,8 +568,7 @@ soxSynthHelpMain note0 note1 uniqOverSoXSynthHelpN v0 uniqOverSoXSynthHelpN2 v1- mixTest- renameFile "result.wav" $ "result" ++ prependZeroes zeroN (show j) ++ ".wav") vec0+ mixTest2 zeroN j) vec0 | otherwise = let ampL1 = ampL - (fromIntegral . truncate $ ampL) in if abs ampL1 < 0.01 then uniqOverSoXSynthN n 0.01 time3 zs wws vec0 else uniqOverSoXSynthN n ampL1 time3 zs wws vec0@@ -608,8 +605,7 @@ soxSynthHelpMain note0 note1 uniqOverSoXSynthHelpN v0 uniqOverSoXSynthHelpN2 v1- mixTest- renameFile "result.wav" $ "result" ++ prependZeroes zeroN (show j) ++ ".wav") vec0+ mixTest2 zeroN j) vec0 | otherwise = let ampL1 = ampL - (fromIntegral . truncate $ ampL) in if abs ampL1 < 0.01 then uniqOverSoXSynthN3 n 0.01 time3 zs wws tts vec0 else uniqOverSoXSynthN3 n ampL1 time3 zs wws tts vec0 @@ -660,8 +656,7 @@ ; soxSynthHelpMain1 (fromJust note1) ; uniqOverSoXSynthHelpN v0 ; uniqOverSoXSynthHelpN2 v1}- mixTest- renameFile "result.wav" $ "result" ++ prependZeroes zeroN (show j) ++ ".wav") vec0+ mixTest2 zeroN j) vec0 | otherwise = let ampL1 = ampL - (fromIntegral . truncate $ ampL) in if abs ampL1 < 0.01 then uniqOverSoXSynthN4 n 0.01 time3 dAmpl zs wws tts vs vec0 else uniqOverSoXSynthN4 n ampL1 time3 dAmpl zs wws tts vs vec0
DobutokO/Sound/Functional.hs view
@@ -33,6 +33,7 @@ , octavesT -- * Combining intermediate files , mixTest+ , mixTest2 -- * Working with files , freqsFromFile , endFromResult@@ -73,6 +74,7 @@ , overSoXSynthGen2FDN_Sf3G2G -- ** 2G generalized auxiliary functions , mixTest2G+ , mixTest22G , endFromResult2G -- * Generalized functions with several functional parameters , soundGenF3@@ -260,8 +262,30 @@ mixTest2G ys = do paths0 <- listDirectory "." let paths = sort . filter (isPrefixOf "test") $ paths0- _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ soxBasicParams ys ["result.wav","vol","0.3"]) ""+ _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ soxBasicParams ys ["","result.wav","vol","0.3"]) "" mapM_ removeFile paths++-- | Combines (mixes) all \"test\*" files in the given directory. The files should be similar in parameters and must be sound files for SoX to work+-- on them properly. Afterwards, the function deletes these combined files. The name of the resulting file depends on the first two command line+-- arguments so that it is easy to produce unique names for the consequent call for the function.+mixTest2 :: Int -> Int -> IO ()+mixTest2 zeroN j = do+ paths0 <- listDirectory "."+ let paths = sort . filter (isPrefixOf "test") $ paths0+ _ <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ paths ++ ["result" ++ prependZeroes zeroN (show j) ++ ".wav",+ "vol","0.3"]) ""+ mapM_ removeFile paths++-- | Similar to 'mixTest', but allows to change the sound quality parameters for the resulting file. For more information, please, refer to+-- 'soxBasicParams'. The name of the resulting file depends on the first two command line+-- arguments so that it is easy to produce unique names for the consequent call for the function.+mixTest22G :: Int -> Int -> String -> IO ()+mixTest22G zeroN j ys = do+ paths0 <- listDirectory "."+ let paths = sort . 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 -- | Gets an \"end.wav\" file from the intermediate \"result\*.wav\" files in the current directory. If it is not successful, produces the notification -- message and exits without error. If you would like to create the file if there are too many intermediate ones, please, run
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: dobutokO2-version: 0.24.3.0+version: 0.24.4.0 synopsis: A program and a library to create experimental music from a mono audio and a Ukrainian text description: It can also create a timbre for the notes. Uses SoX inside. homepage: https://hackage.haskell.org/package/dobutokO2