packages feed

dobutokO2 0.36.3.0 → 0.37.0.0

raw patch · 7 files changed

+131/−18 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ DobutokO.Sound: overSoXSynthNGen3E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> Intervals -> String -> Double -> IO ()
+ DobutokO.Sound: uniqOverSoXSynthN46GSu :: Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> Vector Double -> String -> Double -> IO ()
+ DobutokO.Sound: uniqOverSoXSynthNGen4E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> String -> Double -> IO ()
+ DobutokO.Sound.Functional: dBOmegaRatio :: Double -> Double -> Double
+ DobutokO.Sound.Functional: overSoXSynthGen2FDN_SG4G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO ()
+ DobutokO.Sound.Functional: overSoXSynthGen2FDN_SG6GSu :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> Double -> IO ()
+ DobutokO.Sound.Functional: strength2dB_Abs :: Double -> Double
+ DobutokO.Sound.Functional: strengthdB2ampl :: Double -> Double
+ DobutokO.Sound.Functional: strengths2dB :: Strengths -> StrengthsDb
+ DobutokO.Sound.Functional: strengthsDb2ampl :: StrengthsDb -> Strengths
+ DobutokO.Sound.IntermediateF: fadeAllEMilN :: Int -> String -> String -> IO ()
+ DobutokO.Sound.IntermediateF: fadeEndsMil2 :: FilePath -> IO ()
+ DobutokO.Sound.IntermediateF: fadeEndsMilN :: Int -> FilePath -> IO ()

Files

CHANGELOG.md view
@@ -335,3 +335,11 @@ ## 0.36.3.0 -- 2020-04-26  * Thirty-sixth version revised C. Fixed issues with zero durations for SoX "synth" effect. Some documentation improvements.++## 0.37.0.0 -- 2020-04-28++* Thirty-seventh version. Added new functions to work with dB and corresponding type synonyms StrengthsDb and Strengths to DobutokO.Sound.Functional +module. Fixed issues with being filtered to empty vector for durations. Added generalized versions for fading functions in the +DobutokO.Sound.IntermediateF module. Added the "002" option to the executable and respective functions to DobutokO.Sound.Executable module. +Added "united" variants for the '6GS' functions (where the 'Strengths' and 'Durations' are obtained from the same Ukrainian text). +Some documentation improvements.
DobutokO/Sound.hs view
@@ -110,7 +110,10 @@   , uniqOverSoXSynthNGen4E6G   -- ** 6G with obtained from the text arbitrary length Strengths   , overSoXSynthNGen3E6GS+  , overSoXSynthNGen3E6GSu+  , uniqOverSoXSynthN46GSu   , uniqOverSoXSynthNGen4E6GS+  , uniqOverSoXSynthNGen4E6GSu ) where  import CaseBi (getBFst')@@ -335,6 +338,7 @@ -- | Function to create a melody for the given arguments. 'Durations' is used to provide a rhythm.  overSoXSynthN4G :: Int -> Double -> Durations -> V.Vector Double -> IO () overSoXSynthN4G n ampL v2 vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =      let zeroN = numVZeroesPre vec0         v21 = V.filter (/=0.0) v2@@ -377,6 +381,7 @@ -- | Function to create a melody for the given arguments. 'Durations' is used to provide a rhythm.  overSoXSynthN24G :: Int -> Double -> Durations -> String -> V.Vector Double -> IO () overSoXSynthN24G n ampL v2 tts vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =      let v21 = V.filter (/= 0.0) v2         zeroN = numVZeroesPre vec0@@ -423,6 +428,7 @@ -- | Function to create a melody for the given arguments. 'Duraitons' is used to provide a rhythm.  overSoXSynthN34G :: Int -> Double -> Double -> Durations -> String -> String -> V.Vector Double -> IO () overSoXSynthN34G n ampL dAmpl v2 tts vs vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =      let v21 = V.filter (/= 0.0) v2         m     = V.length v21@@ -464,6 +470,7 @@ -- | Generalized variant of the 'overSoXSynthN34G' where you specify your own 'Intervals'. For more information, please, refer to 'intervalsFromStringG'. overSoXSynthN35G :: Int -> Double -> Double -> Durations -> String -> Intervals -> V.Vector Double -> IO () overSoXSynthN35G n ampL dAmpl v2 tts v3 vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =      let v21 = V.filter (/=0.0) v2         m     = V.length v21@@ -678,6 +685,13 @@ -- 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++-- | A variant of 'overSoXSynthNGen3E6GS' where 'Strengths' and 'Durations' are obtained from the same Ukrainian text specified as +-- the last 'String' argument. The third 'Double' argument is an average duration of the sounds in seconds. +-- 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@.+overSoXSynthNGen3E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> Intervals -> String -> Double -> IO ()+overSoXSynthNGen3E6GSu file m ku ampL dAmpl time3 tts v3 xxs = overSoXSynthNGen3E6G file m ku ampL dAmpl (str2Durations xxs time3) tts v3 (str2Volume xxs)      -- | For the given frequency and a Ukrainian text it generates a musical sound with the timbre obtained from the Ukrainian text (see the -- documentation for @mmsyn7s@ package). The timbre for another given text usually differs, but can be the same. The last one is only@@ -745,6 +759,7 @@ -- | 4G generalized variant of the 'uniqOverSoXSynthN' where you specify your own 'Durations'. uniqOverSoXSynthN4G :: Int -> Double -> Durations -> String -> V.Vector Double -> IO () uniqOverSoXSynthN4G n ampL v2 wws vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =     let v21 = V.filter (/= 0.0) v2         m     = V.length v21@@ -792,6 +807,7 @@ -- | 4G generalized variant of the 'uniqOverSoXSynthN3' where you specify your own 'Durations'.  uniqOverSoXSynthN34G :: Int -> Double -> Durations -> String -> String -> V.Vector Double -> IO () uniqOverSoXSynthN34G n ampL v2 wws tts vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =     let v21 = V.filter (/=0.0) v2         m     = V.length v2@@ -846,6 +862,7 @@ -- | 5G generalized variant of the 'uniqOverSoXSynthN44G' where you specify your own 'Intervals'.  uniqOverSoXSynthN45G :: Int -> Double -> Double -> Durations -> String -> String -> Intervals -> V.Vector Double -> IO () uniqOverSoXSynthN45G n ampL dAmpl v2 wws tts v3 vec0+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | compare (abs ampL) 0.01 /= LT && compare (abs ampL) 1.0 /= GT =     let v21 = V.filter (/=0.0) v2         m     = V.length v2@@ -884,6 +901,7 @@ -- sound files are treated as a silent ones and are not adjusted.  uniqOverSoXSynthN46G :: Int -> Double -> Double -> Durations -> String -> String -> Intervals -> V.Vector Double -> Strengths -> Double -> IO () uniqOverSoXSynthN46G n ampL dAmpl v2 wws tts v3 vec0 v6 limV+ | V.all (== 0.0) v2 = putStrLn "You provided no valid durations data! "  | 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 v21 = V.filter (/=0.0) v2@@ -932,6 +950,13 @@ uniqOverSoXSynthN46GS n ampL time3 dAmpl zs wws tts v3 vs vec0 xxs limV =   uniqOverSoXSynthN46G n ampL dAmpl (str2Durations zs time3) wws tts (intervalsFromStringG v3 vs) vec0 (str2Volume xxs) limV +-- | A variant of 'uniqOverSoXSynthN46GS' where 'Strengths' and 'Durations' are obtained from the same Ukrainian text specified as +-- the last 'String' argument. The second 'Double' argument is an average duration of the sounds in seconds. +-- 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@.+uniqOverSoXSynthN46GSu :: Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> V.Vector Double -> String -> Double -> IO ()+uniqOverSoXSynthN46GSu n ampL time3 dAmpl wws tts v5 vs vec0 xxs limV = + uniqOverSoXSynthN46G n ampL dAmpl (str2Durations xxs time3) wws tts (intervalsFromStringG v5 vs) vec0 (str2Volume xxs) limV  -- | Similar to 'uniqOverSoXSynthN', but uses a sound file to obtain the information analogous to 'V.Vector' in the latter one.  -- Besides, the function lifts the frequencies to the octave with the given by 'Int' parameter number (better to use from the range [1..8]).@@ -1095,15 +1120,24 @@   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'. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- | 6G generalized function for 'uniqOverSoXSynthNGen4E5G' 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. Note that 'Int' arguments are used by 'liftInEnku' in that order so it +-- | A variant of 'uniqOverSoXSynthNGen4E6G' 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 =   uniqOverSoXSynthNGen4E6G file m ku ampL dAmpl (str2Durations zs time3) wws tts (intervalsFromStringG v5 vs) (str2Volume xxs) limV+ +-- | A variant of 'uniqOverSoXSynthNGen4E6GS' where 'Strengths' and 'Durations' are obtained from the same Ukrainian text specified as +-- the last 'String' argument. The second 'Double' argument is an average duration of the sounds in seconds. +-- 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@.+uniqOverSoXSynthNGen4E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> String -> Double -> IO ()+uniqOverSoXSynthNGen4E6GSu file m ku ampL time3 dAmpl wws tts v5 vs xxs limV = + uniqOverSoXSynthNGen4E6G file m ku ampL dAmpl (str2Durations xxs time3) wws tts (intervalsFromStringG v5 vs) (str2Volume xxs) limV+ 
DobutokO/Sound/Executable.hs view
@@ -66,11 +66,11 @@       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),("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+  getBFst' (dobutokO2H exist2 args file, V.fromList . fmap (\(xs, f) -> (xs,f exist2 args file)) $ [("0",o2help),("00",dobutokO2H00),+    ("002",dobutokO2H002),("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 () dobutokO2H1 exist2 args file = do@@ -402,6 +402,10 @@ dobutokO2H00 exist2 = fadeAllE {-# INLINE dobutokO2H00 #-} +dobutokO2H002 :: Bool -> String -> FilePath -> IO ()+dobutokO2H002 exist2 = fadeAllEMilN 2+{-# INLINE dobutokO2H002 #-}+ ----------------------------------------------------------------------------------------------------------------------------------------------------  -- | Function records and processes the sound data needed to generate the \"end.wav\" file in the 'dobutokO2' function. Please, check before executing@@ -646,8 +650,8 @@  -- | Tesing variant of the 'soundGen3GMN' with predefined three last functional arguments. testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> IO ()-                              ----------------------                        -  --                                    f+                                                  ----------------------                        +                      --                                    f testSoundGen2GMN m n1 file f y zs = do   vecA0 <- fmap (V.map (`quotRem` 108)) ((if m == (-1) && n1 == (-1) then readFileDoubles else readFileDoublesMN m n1) file) -- >>= print   let n = V.length vecA0@@ -741,11 +745,11 @@ -- > soundGen3G_O = soundGen3G_O2  -- with the first argument  -- --- > conversionFII (f0,fA1,fR1) = V.imap (\j r -> (V.unsafeIndex notes (snd r),+-- > conversionFII (f0,fA1,fR1) = imap (\j r -> (unsafeIndex notes (snd r), --  -- >      case fst r of -- --- >        0 -> (\vv -> f0 vv)+-- >        0 -> f0 --  -- >        1 -> fA1 j -- 
DobutokO/Sound/Functional.hs view
@@ -156,6 +156,7 @@   , equalize2Vec   , intervalsFromStringG   , overSoXSynthGen2FDN4G+  , overSoXSynthGen2FDN_SG4G   , overSoXSynthGen2FDN_SG4GS   , silentSound2G   , strToIntG@@ -184,6 +185,13 @@   , overSoXSynth2FDN_Sf36GS   , overSoXSynthGen2FDN_SG6G   , overSoXSynthGen2FDN_SG6GS+  , overSoXSynthGen2FDN_SG6GSu+  -- * Working with StrengthsDb and Strengths and others+  , dBOmegaRatio+  , strength2dB_Abs+  , strengthdB2ampl+  , strengths2dB+  , strengthsDb2ampl ) where  import Text.Read (readMaybe)@@ -219,7 +227,8 @@ -- | Is used to represent a set of volumes in the amplitude scale for SoX \"vol\" effect. type Strengths = V.Vector Double --- | Is used to represent a set of volumes in the dB scale for SoX \"vol\" effect.+-- | Is used to represent a set of volumes in the dB scale for SoX \"vol\" effect. Usually, the zero value corresponds to the sound with volume +-- level equal by absolute value to 1.0 (the extremum one). So for most cases, its elements are negative numbers not less than (-120). type StrengthsDb = V.Vector Double  -- | Is used to represent a set of intervals for notes (each element is a number of semi-tones between parts of interval). @@ -246,6 +255,31 @@  | y == 0.0 = xss  | otherwise = xss ++ ["vol",showFFloat Nothing y "dB"] +-- | Returns the frequency for which its ratio with the second 'Double' argument being under lg and being multiplied with 20 returns +-- the first 'Double'  argument. For example, @dBOmegaRatio 6 440 ~ 880@ (actually, 877.9154185863069).+dBOmegaRatio :: Double -> Double -> Double+dBOmegaRatio dB omega0 = omega0 * 10 ** (dB / fromIntegral 20) ++-- | Converts the absolute value of the argument to dB value compared to 1.0. Usually, is less than 0. The argument should not be equal to zero (0), +-- otherwise, it is equal to -'Infinity'.+strength2dB_Abs :: Double -> Double+strength2dB_Abs vol = 20 * logBase 10 (abs vol)++-- | Converts the absolute value of the argument from dB value to amplitude with 0 equivalent to amplitude of 1.0 (or -1.0 for inverted sound). +-- Usually, is used for negative arguments (or at least not positive ones). +strengthdB2ampl :: Double -> Double+strengthdB2ampl dB = 10 ** (dB / fromIntegral 20)++-- | Converts the 'V.Vector' of the absolute values of the argument to the 'V.Vector' of dB values compared to 1.0. +-- Usually, its elements are less than 0. If some element in the argument is equal to zero (0), the corresponding resulting element is equal to -'Infinity'.+strengths2dB :: Strengths -> StrengthsDb+strengths2dB v = V.map strength2dB_Abs v++-- | Converts the 'V.Vector' of dB values to the 'V.Vector' of the amplitudes with 0 being equivalent to amplitude of 1.0 (or -1.0 for inverted sound). +-- Usually, is used for negative elements of the first argument (or at least not positive ones). +strengthsDb2ampl :: StrengthsDb -> Strengths+strengthsDb2ampl v = V.map strengthdB2ampl v+ -- | 'V.Vector' of 'Double' is a vector of dB volume adjustments for the corresponding harmonices (overtones). overSoXSynth2FDN1G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> V.Vector Double -> IO () overSoXSynth2FDN1G f (x, y) j zs vdB = overSoXSynth2FDN2G f (x, y) j zs vdB []@@ -778,8 +812,14 @@ -- | A variant of the 'overSoXSynthGen2FDN_SG6G' where 'Strengths' are obtained from a Ukrainian text and 'str2Volume'. overSoXSynthGen2FDN_SG6GS :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String ->    ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> String -> Double -> IO ()-overSoXSynthGen2FDN_SG6GS file m ku f y zs wws h zzs = overSoXSynthGen2FDN_SG6G file m ku f y (str2Durations zs y) wws h (str2Volume zzs)    +overSoXSynthGen2FDN_SG6GS file m ku f y zs wws h zzs = overSoXSynthGen2FDN_SG6G file m ku f y (str2Durations zs y) wws h (str2Volume zzs)   +-- | A variant of the 'overSoXSynthGen2FDN_SG6GS' where 'Strengths' are obtained from the same Ukrainian text as also 'Durations' so the last +-- 'String' argument is omitted (it is equal to the first one). Helps to create a speech-like composition.+overSoXSynthGen2FDN_SG6GSu :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> +  ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> Double -> IO ()+overSoXSynthGen2FDN_SG6GSu file m ku f y zs wws h = overSoXSynthGen2FDN_SG6G file m ku f y (str2Durations zs y) wws h (str2Volume zs)+ -- | A default way to get 'Durations' for the sounds up to 0.35.2.0 version of the package including. It is based on the number of Ukrainian  -- sounds representations (see, 'convertToProperUkrainian') in a Ukrainian syllables or somewhat generated by the same rules as they.  -- The rhythm using the function is very often not binary but its ratios are almost always a ratios of the small natural numbers (1, 2, 3, 4, 5, 6, 7 etc.).@@ -1220,7 +1260,7 @@   else apply6Gf vol file  -- | Variant of the 'apply6G' function which can be applied also to the silent files. Whether a file is silent is defined using the 'Double' argument --- so that if a maximum by absolute value amplitude is less by absolute value than the 'Double' argument then the file is not changed.+-- so that if the maximum by absolute value amplitude is less by absolute value than the 'Double' argument then the file is not changed. apply6G2 :: Strengths -> String -> String -> Double -> IO () apply6G2 v6 ys zs limV  | V.null v6 = putStrLn "Nothing changed, because the vector of volume adjustments is empty! "@@ -1228,7 +1268,7 @@      dir0v <- listVDirectory3G ys zs        V.imapM_ (\i file -> apply6GSilentFile file limV (V.unsafeIndex v6 (i `rem` V.length v6))) dir0v --- | Variant of the 'apply6G2' where you use as a 'Strengths' parameter that one obtained from a Ukrainian text provided as a first 'String' argument. +-- | Variant of the 'apply6G2' where you use as a 'Strengths' parameter that one obtained from a Ukrainian text provided as the first 'String' argument.  -- It uses 'str2Volume' inside.  apply6GS2 :: String -> String -> String -> Double -> IO () apply6GS2 xs = apply6G2 (str2Volume xs)
DobutokO/Sound/IntermediateF.hs view
@@ -84,7 +84,10 @@   , soxE1   , getSilenceF   , fadeEnds+  , fadeEndsMil2+  , fadeEndsMilN   , fadeAllE+  , fadeAllEMilN   -- *** File type changes   , soxE2C   , soxE12C@@ -103,6 +106,7 @@   , flacToWav ) where +import Numeric (showFFloat) import CaseBi (getBFst') import Control.Monad (void) import Control.Concurrent (myThreadId,forkIO,threadDelay,killThread)@@ -742,12 +746,31 @@ -- 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"]+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. fadeAllE :: String -> String -> IO () fadeAllE ys zs = listVDirectory3G ys zs >>= V.mapM_ fadeEnds++-- | Applies 'fadeEndsMilN' 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. The 'Int' argument +-- defines a number of miliseconds to be under fading effect (no more than 10).+fadeAllEMilN :: Int -> String -> String -> IO ()+fadeAllEMilN n ys zs = listVDirectory3G ys zs >>= V.mapM_ (fadeEndsMilN n)   -------------------------------------------------------------------------------------------   
README.markdown view
@@ -25,7 +25,7 @@  OR: -dobutokO2 00 {beginning symbols for the filenames "fade" effect to be applied to} {quality control, see information below}+dobutokO2 { 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@@ -93,6 +93,10 @@             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 DobutokO.Sound.IntermediateF module.+                +  "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. 
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                dobutokO2-version:             0.36.3.0+version:             0.37.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