packages feed

dobutokO2 0.39.1.0 → 0.40.0.0

raw patch · 4 files changed

+11/−106 lines, 4 filesdep +mmsyn7lPVP ok

version bump matches the API change (PVP)

Dependencies added: mmsyn7l

API changes (from Hackage documentation)

- DobutokO.Sound.IntermediateF: fadeEnds :: FilePath -> IO ()
- DobutokO.Sound.IntermediateF: fadeEndsMil2 :: FilePath -> IO ()
- DobutokO.Sound.IntermediateF: fadeEndsMilN :: Int -> FilePath -> IO ()
- DobutokO.Sound.IntermediateF: soxE :: FilePath -> [String] -> IO ()

Files

CHANGELOG.md view
@@ -370,7 +370,12 @@  ## 0.39.1.0 -- 2020-05-14 -* Fortieth version. Changed bounds for the dependencies so that now also GHC 8.10* series are supported. Added new predicates to work with Params +* Thirty-ninth version revised B. Changed bounds for the dependencies so that now also GHC 8.10* series are supported. Added new predicates to work with Params  to DobutokO.Sound.Functional module for better access to inner structure of it. Changed also a volume and durations of the sounds taken from  the loudness and durations respectively of the Ukrainian sounds representations in the mmsyn6ukr package accordingly to that ones of the new.  Some documentation improvements. ++## 0.40.0.0 -- 2020-05-19++* Fourtieth version. Added mmsyn7l as a dependency. Moved some functions from DobutokO.Sound.IntermediateF module to MMSyn7l module. This +allows to use their functionality without necessary installation of the dobutokO2 package (only mmsyn7* series using).
DobutokO/Sound/Functional.hs view
@@ -254,6 +254,7 @@ import System.Directory import Melodics.Ukrainian (convertToProperUkrainian) import SoXBasics (durationA,upperBnd,selMaxAbs)+import MMSyn7l import MMSyn7.Syllable  import DobutokO.Sound.IntermediateF import GHC.Int (Int64)
DobutokO/Sound/IntermediateF.hs view
@@ -80,12 +80,8 @@   , reverb1WE2C   -- ** Generalized   -- *** No file type changes-  , soxE   , soxE1   , getSilenceF-  , fadeEnds-  , fadeEndsMil2-  , fadeEndsMilN   , fadeAllE   , fadeAllEMilN   -- *** File type changes@@ -122,6 +118,7 @@ import qualified Data.Vector as V  import System.Directory import SoXBasics (playA,durationA,recA)+import MMSyn7l import EndOfExe (showE) import System.Process (readProcessWithExitCode) import Data.Maybe (fromJust,isJust)@@ -425,70 +422,7 @@   vec <- playAMrk2G ys   pAnR22G ys vec --- | Converts WAV file to FLAC file using SoX (please, check before whether your installation supports FLAC files) using possible rate and bit depth--- conversion accordingly to 'soxBasicParams' format. If the conversion is successful ('ExitCode' is 'ExitSuccess') then removes the primary file.-wavToFlac :: String -> FilePath -> IO ()-wavToFlac ys file = do-  let (ts,zs) = splitAt 2 . init $ ys-  (code,_,herr) <- readProcessWithExitCode (fromJust (showE "sox")) [file,getBFst' ("-r22050",V.fromList . zip ["11","16", "17", "19", "32", "44", "48",-     "80", "96"] $ ["-r11025","-r16000","-r176400","-r192000","-r32000","-r44100","-r48000","-r8000","-r96000"]) ts, if zs == "2" then "-b24"-       else "-b16",take (length file - 3) file ++ "flac"] ""-  case code of-    ExitSuccess -> removeFile file-    _           -> do-      putStrLn $ "DobutokO.Sound.IntermediateF.wavToFlac: " ++ herr-      exi <- doesFileExist $ take (length file - 3) file ++ "flac"-      if exi then removeFile (take (length file - 3) file ++ "flac") >> error ""-      else error "" --- | Converts FLAC file to WAV file using SoX (please, check before whether your installation supports FLAC files) using possible rate and bit depth--- conversion accordingly to 'soxBasicParams' format. If the conversion is successful ('ExitCode' is 'ExitSuccess') then removes the primary file.-flacToWav :: String -> FilePath -> IO ()-flacToWav ys file = do-  let (ts,zs) = splitAt 2 . init $ ys-  (code,_,herr) <- readProcessWithExitCode (fromJust (showE "sox")) [file,getBFst' ("-r22050",V.fromList . zip ["11","16", "17", "19", "32", "44", "48",-     "80", "96"] $ ["-r11025","-r16000","-r176400","-r192000","-r32000","-r44100","-r48000","-r8000","-r96000"]) ts, if zs == "2" then "-b24"-       else "-b16",take (length file - 4) file ++ "wav"] ""-  case code of-    ExitSuccess -> removeFile file-    _           -> do-      putStrLn $ "DobutokO.Sound.IntermediateF.flacToWav: " ++ herr-      exi <- doesFileExist $ take (length file - 4) file ++ "wav"-      if exi then removeFile (take (length file - 4) file ++ "wav") >> error ""-      else error ""      --w2f :: FilePath -> FilePath-w2f file = let (zs,ts) = splitAt (length file - 4) file in if ts == ".wav" then zs ++ ".flac" else error "You give not a WAV file! "-     -f2w :: FilePath -> FilePath-f2w file = let (zs,ts) = splitAt (length file - 5) file in if ts == ".flac" then zs ++ ".wav" else error "You give not a FLAC file! "--wOrf :: FilePath -> String-wOrf file =-  let (_,us) = splitAt (length file - 4) file in-    case us of-     ".wav" -> "w"-     "flac" -> "f"-     _      -> error "You give neither a WAV nor a FLAC file! "--cfw2wf :: FilePath -> FilePath-cfw2wf file- | wOrf file == "w" = w2f file- | wOrf file == "f" = f2w file- | otherwise = error "You give neither a WAV nor a FLAC file! "--efw2 :: FilePath -> String-efw2 file- | wOrf file == "w" = ".wav"- | wOrf file == "f" = ".flac"- | otherwise = error "You give neither a WAV nor a FLAC file! "--efw2vv :: FilePath -> String-efw2vv file- | wOrf file == "w" = ".flac"- | wOrf file == "f" = ".wav"- | otherwise = error "You give neither a WAV nor a FLAC file! "-  ----------------------------------------------------------------------------------------------------------------  -- | Takes a filename to be applied a SoX \"reverb" effect with parameters of list of 'String' (the second argument). Produces the temporary@@ -589,22 +523,6 @@        removeFile $ file ++ "reverbW1" ++ efw2vv file        putStrLn $ "DobutokO.Sound.IntermediateF.reverb1WE2C \"" ++ file ++ "\" has not been successful. The file has not been changed at all. "        --- | Takes a filename to be applied a SoX chain of effects (or just one) as list of 'String' (the second argument). Produces the temporary--- new file with the name ((name-of-the-file) ++ (\"effects.wav\"  OR \"effects.flac\") -- the type is preserved), which then is removed. ------ The syntaxis is that every separate literal for SoX must be a new element in the list. If you plan to create again mono audio in the end of processment, --- then probably use 'soxE1' function instead. Please, for more information, refer to SoX documentation.--- Please, check by yourself whether you have enough permissions to read and write to the 'FilePath'-specified--- file and to the containing it directory. The function is not intended to be used in otherwise cases.-soxE :: FilePath -> [String] -> IO ()-soxE file arggs = do-  (code,_,_) <- readProcessWithExitCode (fromJust (showE "sox")) ([file,file ++ "effects" ++ efw2 file] ++ arggs) ""-  case code of-    ExitSuccess -> renameFile (file ++ "effects" ++ efw2 file) file-    _ -> do-       removeFile $ file ++ "effects" ++ efw2 file-       putStrLn $ "DobutokO.Sound.IntermediateF.soxE \"" ++ file ++ "\" has not been successful. The file has not been changed at all. "- -- | Is used internally in the functions to specify different SoX parameters for the sound synthesis (rate, bit depth and file extension). Possible -- file extensions are: ".wav" (a default one) and ".flac" (being lossless compressed); rates -- 8000, 11025, 16000, 22050 (a default one), 32000, --  44100, 48000, 88200, 96000, 176400, 192000 Hz; bit depths -- 16 bits and 24 bits. The first two digits in a 'String' argument encodes rate,@@ -745,25 +663,6 @@ -- same parameters for duration, rate, bit depth and file type. getSilenceF :: FilePath -> IO () getSilenceF file = soxE file ["vol","0"]---- | Applies \"fade\" effect to both ends of the supported by SoX sound file 'FilePath' so that concatenating them consequently after such application --- leads to no clipping. Otherwise, the clipping exists if not prevented by may be some other means. For more information, please, refer to the--- SoX documentation.-fadeEnds :: FilePath -> IO ()-fadeEnds = fadeEndsMilN 10---- | Applies \"fade\" effect to both ends of the supported by SoX sound file 'FilePath' so that concatenating them consequently after such application --- leads to no clipping. Otherwise, the clipping exists if not prevented by may be some other means. The duration of the changes are in 5 times --- smaller than for 'fadeEnds' function and is equal to 0.002 sec. For more information, please, refer to the SoX documentation.-fadeEndsMil2 :: FilePath -> IO ()-fadeEndsMil2 = fadeEndsMilN 2---- | Applies \"fade\" effect to both ends of the supported by SoX sound file 'FilePath' so that concatenating them consequently after such application --- leads to no clipping. Otherwise, the clipping exists if not prevented by may be some other means. The duration of the changes are usually --- smaller than for 'fadeEnds' function and is equal to 0.001 \* n sec (where n is in range [1..10]). --- For more information, please, refer to the SoX documentation.-fadeEndsMilN :: Int -> FilePath -> IO ()-fadeEndsMilN n file = soxE file ["fade","q", showFFloat (Just 4) (if (n `rem` 11) /= 0 then 0.001 * fromIntegral (n `rem` 11) else 0.002) "","-0.0"]  -- | Applies 'fadeEnds' to all the \"zs*.wav\" (or instead all the \"zs*.flac\") files in the current directory. The file extension -- is defined by the first 'String' argument in accordance with 'soxBasicParams'. @zs@ here is given by the second 'String' argument.
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                dobutokO2-version:             0.39.1.0+version:             0.40.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/dobutokO2@@ -20,7 +20,7 @@   exposed-modules:     Main, DobutokO.Sound, DobutokO.Sound.Functional, DobutokO.Sound.Executable, DobutokO.Sound.IntermediateF, DobutokO.Sound.ParseList, DobutokO.Sound.Keyboard   -- other-modules:   -- other-extensions:-  build-depends:       base >=4.7 && <4.15, bytestring >= 0.10.6 && <1, vector >=0.11 && <0.14, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, mmsyn7s >=0.6.7 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr >=0.15.4 && <1, mmsyn2 >=0.1.8 && <1, mmsyn6ukr >=0.7.2 && <1+  build-depends:       base >=4.7 && <4.15, bytestring >= 0.10.6 && <1, vector >=0.11 && <0.14, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, mmsyn7s >=0.6.7 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr >=0.15.4 && <1, mmsyn2 >=0.1.8 && <1, mmsyn6ukr >=0.7.2 && <1, mmsyn7l >=0.5 && <1   -- hs-source-dirs:   default-language:    Haskell2010 @@ -28,7 +28,7 @@   main-is:             Main.hs   -- other-modules:   -- other-extensions:-  build-depends:       base >=4.7 && <4.15, bytestring >= 0.10.6 && <1, vector >=0.11 && <0.14, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, mmsyn7s >=0.6.7 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr >=0.15.4 && <1, mmsyn2 >=0.1.8 && <1, mmsyn6ukr >=0.7.2 && <1+  build-depends:       base >=4.7 && <4.15, bytestring >= 0.10.6 && <1, vector >=0.11 && <0.14, process >=1.4 && <1.9, mmsyn3 >=0.1.5 && <1, mmsyn7s >=0.6.7 && <1, directory >=1.2.7 && <1.7, mmsyn7ukr >=0.15.4 && <1, mmsyn2 >=0.1.8 && <1, mmsyn6ukr >=0.7.2 && <1, mmsyn7l >=0.5 && <1   -- hs-source-dirs:   default-language:    Haskell2010