dobutokO2 0.26.0.0 → 0.27.0.0
raw patch · 6 files changed
+48/−11 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ DobutokO.Sound.IntermediateF: fadeAllE :: String -> IO ()
+ DobutokO.Sound.IntermediateF: fadeEnds :: FilePath -> IO ()
+ DobutokO.Sound.IntermediateF: getSilenceF :: FilePath -> IO ()
Files
- CHANGELOG.md +6/−0
- DobutokO/Sound/Executable.hs +8/−4
- DobutokO/Sound/Functional.hs +5/−5
- DobutokO/Sound/IntermediateF.hs +19/−0
- README.markdown +9/−1
- dobutokO2.cabal +1/−1
CHANGELOG.md view
@@ -255,3 +255,9 @@ * Twenty-sixth version. Added more possibilities to edit function f from the DobutokO.Sound.Functional module. Now they include also gRem functions and possibilities to work with two OvertonesO. Some code and documentation improvements in the DobutokO.Sound.Functional module. ++## 0.27.0.0 -- 2020-04-10++* Twenty-seventh version. Added more possibilities to edit intermediate sound files with silence and fading to avoid clipping while concatenating them+with SoX by default. Extended also the possibilities of the dobutokO2 executable with fading for "00" first command line option. Some documentation and+code improvements.
DobutokO/Sound/Executable.hs view
@@ -50,10 +50,10 @@ args = unwords . drop 2 $ arggs argss = drop 1 arggs exist2 <- doesFileExist file- getBFst' (dobutokO2H exist2 args file, V.fromList . fmap (\(xs, f) -> (xs,f exist2 args file)) $ [("0",o2help),("1",dobutokO2H1),("11",dobutokO2H11),- ("2",dobutokO2H2),("21",dobutokO2H21),("3",dobutokO2H3),("31",dobutokO2H31),("4",dobutokO2H4),("41",dobutokO2H41),("5",dobutokO2H5),- ("51",dobutokO2H51),("61",dobutokO2H61),("7",dobutokO2H7),("8",dobutokO2H8),("80",dobutokO2H80),("82",dobutokO2H82),("820",dobutokO2H820),- ("9",dobutokO2H9),("92",dobutokO2H92),("99",dobutokO2H99 argss),("992",dobutokO2H992G argss),("999",dobutokO2H999 argss),+ getBFst' (dobutokO2H exist2 args file, V.fromList . fmap (\(xs, f) -> (xs,f exist2 args file)) $ [("0",o2help),("00",dobutokO2H00),("1",dobutokO2H1),+ ("11",dobutokO2H11),("2",dobutokO2H2),("21",dobutokO2H21),("3",dobutokO2H3),("31",dobutokO2H31),("4",dobutokO2H4),("41",dobutokO2H41),+ ("5",dobutokO2H5),("51",dobutokO2H51),("61",dobutokO2H61),("7",dobutokO2H7),("8",dobutokO2H8),("80",dobutokO2H80),("82",dobutokO2H82),+ ("820",dobutokO2H820),("9",dobutokO2H9),("92",dobutokO2H92),("99",dobutokO2H99 argss),("992",dobutokO2H992G argss),("999",dobutokO2H999 argss), ("9992",dobutokO2H9992G argss)]) arg1 dobutokO2H1 :: Bool -> String -> FilePath -> IO ()@@ -381,6 +381,10 @@ putStrLn "" putStrLn "-------------------------------------------------------------------------------------------------------------" putStrLn ys++dobutokO2H00 :: Bool -> String -> FilePath -> IO ()+dobutokO2H00 _ _ = fadeAllE+{-# INLINE dobutokO2H00 #-} ----------------------------------------------------------------------------------------------------------------------------------------------------
DobutokO/Sound/Functional.hs view
@@ -1056,16 +1056,16 @@ -- to the 'OvertonesO'. Unlike for 'sameFreqF', it depends also on the 'Double' argument for @f :: Double -> OvertonesO@. 'fAddFElem' is -- actually a functional or operator (in mathematical sense), it changes the function @f@ (in some point) and returns the new one. -- @gAdd@ allows not only to insert an element if missing, but to change all the 'OvertonesO' system. So depending on the complexity,--- it can reproduce rather comlex behaviour.+-- it can reproduce rather complex behaviour. fAddFElem :: (Double, Double) -> Double -> (Double -> OvertonesO) -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) fAddFElem (noteN,amplN) freq f gAdd = \t -> gAdd (noteN,amplN) t f -- | @gRem:: (Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO@ is a function that defines how the element is removed -- from the 'OvertonesO'. Unlike for 'sameFreqF', it depends also on the 'Double' argument for @f :: Double -> OvertonesO@. 'fRemoveFElem' is--- actually a functional or operator (in mathematical sense), it changes the function @f@ (in some point) and returns the new one.--- @gRem@ allows not only to delet an element if existing, but to change all the 'OvertonesO' system. So depending on the complexity,--- it can reproduce rather comlex behaviour.+-- actually an operator (in mathematical sense), it changes the function @f@ (in some point) and returns the new one.+-- @gRem@ allows not only to delete an element if existing, but to change all the 'OvertonesO' system. So depending on the complexity,+-- it can reproduce rather complex behaviour. fRemoveFElem :: (Double, Double) -> Double -> (Double -> OvertonesO) -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) fRemoveFElem (noteN,amplN) freq f gRem = \t -> gRem (noteN,amplN) t f@@ -1087,7 +1087,7 @@ gAdd02 amplMax (note,ampl) freq f = renormFD amplMax . gAdd01 (note,ampl) freq $ f -- | Example of the function @gAdd@. for the 'fAddFElem'. If the frequency is not already in the 'OvertonesO' then the corresponding element is added and--- the 'OvertonesO' are renormed with 'renormF'. Otherwise, the element is tried to be inserted with a new frequency between the greatest by an absulute+-- the 'OvertonesO' are renormed with 'renormF'. Otherwise, the element is tried to be inserted with a new frequency between the greatest by an absolute -- values notes as an intermediate value with the respective amplitude, or if there is only one element, to produce two elements in -- the resulting 'V.Vector' with two consequent harmonics. gAdd03 :: (Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO
DobutokO/Sound/IntermediateF.hs view
@@ -79,6 +79,9 @@ -- *** No file type changes , soxE , soxE1+ , getSilenceF+ , fadeEnds+ , fadeAllE -- *** File type changes , soxE2C , soxE12C@@ -703,6 +706,22 @@ | otherwise = if isJust (showE "play") then void (readProcessWithExitCode (fromJust (showE "play")) ([file] ++ arggs) "") else catchEnd ExecutableNotProperlyInstalled++-- | Changes the volume of the given 'FilePath' with supported by SoX sound file type so that it becomes 0 (zero). Makes so it a silence file with the+-- 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 file = soxE file ["fade","q","0.01","-0.0"]++-- | Applies 'fadeEnds' to all the \"result*.wav\" (or instead all the \"result*.flac\") files in the current directory. The file extension+-- is defined by the 'String' argument in accordance with 'soxBasicParams'.+fadeAllE :: String -> IO ()+fadeAllE ys = listVDirectory2G ys >>= V.mapM_ fadeEnds -------------------------------------------------------------------------------------------
README.markdown view
@@ -21,7 +21,7 @@ OR: -dobutokO2 { 82 | 820 | 92 | 992 | 9992 } {volatile symbols together, e. g. "0"} {quality control, see information below}+dobutokO2 { 00 | 82 | 820 | 92 | 992 | 9992 } {volatile symbols together, e. g. "0"} {quality control, see information below} where filename is: the full name of the file to be recorded in the current directory or@@ -80,6 +80,14 @@ "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 "result*.wav"+ (or instead of them to every "result*.flac") file in the current directory.+ 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 neccessary or is redundant. For more information,+ please, refer to the SoX documentation and to that one for 'fadeAllE'+ function in the DobutokO.Sound.IntermediateF module. "1" -> basic functionality without the possibility to define individual overtones.
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: dobutokO2-version: 0.26.0.0+version: 0.27.0.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