packages feed

dobutokO2 0.34.0.0 → 0.35.0.0

raw patch · 5 files changed

+176/−236 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ DobutokO.Sound.Executable: soundGen3GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
+ DobutokO.Sound.Executable: soundGen3G_O2GMN :: Int64 -> Int64 -> ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
+ DobutokO.Sound.Executable: soundGen3G_O2MN :: Int64 -> Int64 -> ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
+ DobutokO.Sound.Executable: soundGen3G_OMN :: Int64 -> Int64 -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
+ DobutokO.Sound.Executable: testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> IO ()
+ DobutokO.Sound.Functional: splitOG12 :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> String -> Int -> OvertonesO -> Vector OvertonesO
+ DobutokO.Sound.Functional: splitOG12S :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> String -> Int -> OvertonesO -> Vector OvertonesO
+ DobutokO.Sound.Functional: splitOG22 :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> OvertonesO -> Vector OvertonesO
+ DobutokO.Sound.Functional: splitOG22S :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> OvertonesO -> Vector OvertonesO

Files

CHANGELOG.md view
@@ -301,3 +301,8 @@  * Thirty-fourth version. Fixed issues with deprecated documentation for 0.33.0.0 version. Added new functions to the DobutokO.Sound.Keyboard  module to provide more control over reading from the files and stdin. Some documentation improvements.++## 0.35.0.0 -- 2020-04-22++* Thirty-fifth version. Added generalized versions for splitting functions (library). Some code improvements (reducing duplication). Some documentation +improvements. Some descriptive changes in the dobutokO2.cabal file.
DobutokO/Sound.hs view
@@ -231,26 +231,7 @@ -- as an argument to 'dNote'. If you begin the 'String' with space characters, or \"сь\", or \"ць\", or dash, or apostrophe, or soft sign, than there will -- be no interval and the sound will be solely one with its Overtones. overSoXSynthDN :: Double -> String -> IO ()-overSoXSynthDN x zs- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-  let note0 = closestNote x-      note1 = dNote (V.unsafeIndex (intervalsFromString zs) 0) note0-      v0    = overTones note0-      v1    = maybe V.empty overTones note1-      overSoXSynthHelp vec = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-        ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", "0.5","sine", showFFloat (Just 4) noteN "", "vol",-          showFFloat (Just 4) amplN ""] "") vec-      overSoXSynthHelp2 vec = let l = V.length vec in V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-        ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", "0.5","sine", showFFloat (Just 4) noteN "", "vol",-           showFFloat (Just 4) amplN ""] "") vec-  _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA.wav", "synth", "0.5","sine", showFFloat (Just 4) note0 "", "vol","0.5"] ""-  if isNothing note1 then overSoXSynthHelp v0-  else do -    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB.wav", "synth", "0.5","sine", showFFloat (Just 4) (fromJust note1) "",   "vol","0.5"]   ""-    overSoXSynthHelp v0-    overSoXSynthHelp2 v1-  mixTest+overSoXSynthDN x = overSoXSynth2DN x 0.5  -- | Similar to 'overSoXSynthDN' except that the resulting duration is specified by the second 'Double' parameter in seconds. For 'overSoXSynthDN' -- it is equal to 0.5.
DobutokO/Sound/Executable.hs view
@@ -23,6 +23,12 @@   , soundGen3G_O   , soundGen3G_O2   , soundGen3G_O2G+  -- ** With MN control+  , testSoundGen2GMN+  , soundGen3GMN+  , soundGen3G_OMN+  , soundGen3G_O2MN+  , soundGen3G_O2GMN   , h1   , h2 ) where@@ -48,6 +54,7 @@ import DobutokO.Sound.ParseList (parseStoLInts) import DobutokO.Sound.Functional import DobutokO.Sound.Keyboard+import GHC.Int (Int64)  -- | Function that actually makes processing in the @dobutokO2@ executable. Please, check before executing -- whether there is no \"x.wav\", \"test*\", \"result*\" and \"end*\" files in the current directory, because they can be overwritten.@@ -635,8 +642,14 @@ testSoundGen2G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> IO ()                               ----------------------                           --                                    f-testSoundGen2G file f y zs = do-  vecA0 <- fmap (V.map (`quotRem` 108)) (readFileDoubles file) -- >>= print+testSoundGen2G = testSoundGen2GMN 0 0++-- | Tesing variant of the 'soundGen3GMN' with predefined three last functional arguments.+testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> IO ()+                              ----------------------                        +  --                                    f+testSoundGen2GMN m n1 file f y zs = do+  vecA0 <- fmap (V.map (`quotRem` 108)) ((if m == 0 && n1 == 0 then readFileDoubles else readFileDoublesMN m n1) file) -- >>= print   let n = V.length vecA0       freq0 j = V.unsafeIndex notes (snd . V.unsafeIndex vecA0 $ j `rem` n)       f0 t = V.fromList [(0.05763181818181818 * t, 0.3598),(1.112159090909091 * t, 0.4588962),(2 * t, 0.6853),(3 * t, 0.268),(4 * t, 0.6823),(5 * t, 0.53)]@@ -661,8 +674,15 @@ -- | Generates a sequence of sounds with changing timbre. Uses several functions as parameters.  soundGen3G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO)    -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()-soundGen3G file f y zs gAdd gRem f0 = do-  vecA0 <- fmap (V.map (`quotRem` 108)) (readFileDoubles file) -- >>= print+soundGen3G = soundGen3GMN 0 0++-- | Generates a sequence of sounds with changing timbre. Uses several functions as parameters. To specify how many sounds the resulting files +-- will provide, you use first two 'Int64' arguments, the first of which is a number of dropped elements for 'readFileDoubles' and the second one +-- is a number of produced sounds (and, respectively, number of taken elements).+soundGen3GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) +  -> ((Double,Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()+soundGen3GMN m n1 file f y zs gAdd gRem f0 = do+  vecA0 <- fmap (V.map (`quotRem` 108)) ((if m == 0 && n1 == 0 then readFileDoubles else readFileDoublesMN m n1) file) -- >>= print   let n = V.length vecA0       freq0 j = V.unsafeIndex notes (snd . V.unsafeIndex vecA0 $ j `rem` n)       fA1 j = fAddFElem (freq0 (j + 1),0.5) f0 gAdd@@ -692,8 +712,16 @@ soundGen3G_O :: Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO)    -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) ->      (Double -> OvertonesO) -> IO ()-soundGen3G_O m ku freq1 file f y zs gAdds gRems freq0 proj f0 = do-  vecA0 <- fmap (V.map (`quotRem` 108)) (readFileDoubles file) -- >>= print+soundGen3G_O = soundGen3G_OMN 0 0 ++-- | Generates a sequence of sounds with changing timbre. Uses several functions as parameters. To specify how many sounds the resulting files +-- will provide, you use first two 'Int64' arguments, the first of which is a number of dropped elements for 'readFileDoubles' and the second one +-- is a number of produced sounds (and, respectively, number of taken elements).+soundGen3G_OMN :: Int64 -> Int64 -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) +  -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> +    (Double -> OvertonesO) -> IO ()+soundGen3G_OMN m1 n1 m ku freq1 file f y zs gAdds gRems freq0 proj f0 = do+  vecA0 <- fmap (V.map (`quotRem` 108)) ((if m1 == 0 && n1 == 0 then readFileDoubles else readFileDoublesMN m1 n1) file) -- >>= print   let n = V.length vecA0       fA1 j = fAddFElems (proj . freq0 $ j) f0 gAdds       fR1 j = fRemoveFElems (proj . freq0 $ j) f0 gRems@@ -740,8 +768,17 @@   V.Vector (Double,Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String ->      (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) ->        (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()-soundGen3G_O2 conversionFII m ku freq1 file f y zs gAdds gRems freq0 proj f0 = do-  vecA0 <- fmap (V.map (`quotRem` 108)) (readFileDoubles file) -- >>= print+soundGen3G_O2 = soundGen3G_O2MN 0 0 ++-- | Generates a sequence of sounds with changing timbre. Is a generalized version of the 'soundGen3G_O2'. To specify how many sounds the resulting files +-- will provide, you use first two 'Int64' arguments, the first of which is a number of dropped elements for 'readFileDoubles' and the second one +-- is a number of produced sounds (and, respectively, number of taken elements).+soundGen3G_O2MN :: Int64 -> Int64 -> ((Double -> OvertonesO,Int -> Double -> OvertonesO,Int -> Double -> OvertonesO) -> V.Vector (Int,Int) -> +  V.Vector (Double,Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> +    (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> +      (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()+soundGen3G_O2MN m1 n1 conversionFII m ku freq1 file f y zs gAdds gRems freq0 proj f0 = do+  vecA0 <- fmap (V.map (`quotRem` 108)) ((if m1 == 0 && n1 == 0 then readFileDoubles else readFileDoublesMN m1 n1) file) -- >>= print   let n = V.length vecA0       fA1 j = fAddFElems (proj . freq0 $ j) f0 gAdds       fR1 j = fRemoveFElems (proj . freq0 $ j) f0 gRems@@ -752,7 +789,7 @@       v2    = V.map (\yy -> y * fromIntegral (yy * m0) / fromIntegral (head t)) . V.fromList $ ws in V.imapM_ (\j (x,k) -> do         h2 (k x) (x, (V.unsafeIndex v2 (j `rem` (V.length v2)))) m ku freq1         renameFile ("result.wav") $ "result0" ++ prependZeroes zeroN (show (j + 1)) ++ ".wav") vecB-  endFromResult    +  endFromResult          -- | Generates a sequence of sounds with changing timbre. Is a generalized version of the 'soundGen3G_O2', but for the conversion function conversionFII as its  -- tuple first argument uses not the tuple of the three functions, but a tuple of three 'V.Vector' of functions of the respective types, that allows to @@ -767,8 +804,18 @@     Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String ->        (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) ->          (Int -> OvertonesO) -> (Double -> OvertonesO) -> IO ()-soundGen3G_O2G conversionFII vf vfA vfR m ku freq1 file f y zs gAdds gRems freq0 f0 = do-  vecA0 <- fmap (V.map (`quotRem` 108)) (readFileDoubles file) -- >>= print+soundGen3G_O2G = soundGen3G_O2GMN 0 0  ++-- | Generates a sequence of sounds with changing timbre. Is a generalized version of the 'soundGen3G_O2G'. To specify how many sounds the resulting files +-- will provide, you use first two 'Int64' arguments, the first of which is a number of dropped elements for 'readFileDoubles' and the second one +-- is a number of produced sounds (and, respectively, number of taken elements).+soundGen3G_O2GMN :: Int64 -> Int64 -> ((V.Vector (Double -> OvertonesO),V.Vector (Int -> Double -> OvertonesO),V.Vector (Int -> Double -> OvertonesO)) -> V.Vector (Int,Int) -> +  V.Vector (Double,Double -> OvertonesO)) -> V.Vector (Double -> OvertonesO) -> V.Vector (Int -> Double -> OvertonesO) -> V.Vector (Int -> Double -> OvertonesO) -> +    Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> +      (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> +        (Int -> OvertonesO) -> (Double -> OvertonesO) -> IO ()+soundGen3G_O2GMN m1 n1 conversionFII vf vfA vfR m ku freq1 file f y zs gAdds gRems freq0 f0 = do+  vecA0 <- fmap (V.map (`quotRem` 108)) ((if m1 == 0 && n1 == 0 then readFileDoubles else readFileDoublesMN m1 n1) file) -- >>= print   let n = V.length vecA0       vecB = conversionFII (vf,vfA,vfR) vecA0       (t, ws) = splitAt 1 . syllableStr n $ zs
DobutokO/Sound/Functional.hs view
@@ -134,6 +134,10 @@   , splitHelp2   , splitOG1   , splitOG2+  , splitOG12+  , splitOG12S+  , splitOG22+  , splitOG22S ) where  import Text.Read (readMaybe)@@ -172,7 +176,8 @@ --  -- It is recommended to fully simplify the computation for \"f\" function before using it in the 'overSoXSynth2FDN'. overSoXSynth2FDN :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()-overSoXSynth2FDN f (x, y) j zs = overSoXSynth2FDN1G f (x, y) j zs (V.replicate (V.length . f . closestNote $ if x /= 0.0 then abs x else V.unsafeIndex notes 0) 0.0)+overSoXSynth2FDN f (x, y) j zs = overSoXSynth2FDN1G f (x, y) j zs (V.replicate (V.length . f . closestNote $ if x /= 0.0 +  then abs x else V.unsafeIndex notes 0) 0.0)  -- | Is used internally in the 'readProcessWithExitCode' to adjust volume for the sound with additional dB value given by 'Double' argument. adjust_dbVol :: [String] -> Double -> [String]@@ -195,34 +200,8 @@  -- | '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- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let note0 = closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)-        l0     = length zs-        note1 = dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) note0-        g0    = V.fromList . nubBy (\(!x1,_) (!x2,_) -> x1 == x2) . V.toList . V.map (\(noteX, !amplX) ->-           if noteX <= 0.0 then (2 * note0, abs (amplX - (fromIntegral . truncate $ amplX))) else (closestNote noteX,-             abs (amplX - (fromIntegral . truncate $ amplX)))) . f-        g k   = V.takeWhile (\(!w,!z) -> compare w (V.unsafeIndex notes 107) /= GT && compare (abs z) 0.001 == GT) .-                   V.imap (\i (_,!z0) -> (fromIntegral (i + 1) * (fst . V.unsafeIndex (g0 k) $ 0), z0)) . g0 $ k -        v0    = g note0-        v1    = maybe V.empty g note1-        ts = showFFloat (Just 4) (abs y) "" -        overSoXSynthHelp = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] "") -        overSoXSynthHelp2 vec vdB = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (adjust_dbVol ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i)) "") vec-    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA.wav", "synth", ts,"sine", showFFloat Nothing note0 ""] ""-    if isNothing note1 then overSoXSynthHelp v0-    else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB.wav", "synth", ts,"sine", showFFloat Nothing (fromJust note1) ""] ""-      overSoXSynthHelp v0-      overSoXSynthHelp2 v1 vdB-    mixTest-+overSoXSynth2FDN1G f (x, y) j zs vdB = overSoXSynth2FDN2G f (x, y) j zs vdB []+  -- | Similar to 'overSoXSynth2FDN1G', but additionally allows to specify by the second 'String' argument a quality changes to the generated files -- (please, see 'soxBasicParams'). overSoXSynth2FDN2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> V.Vector Double -> String -> IO ()@@ -241,20 +220,20 @@         v1    = maybe V.empty g note1         ts = showFFloat (Just 4) (abs y) ""          overSoXSynthHelp = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (soxBasicParams ys ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""]) "")+            ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", +              showFFloat Nothing noteN "", "vol", showFFloat Nothing amplN ""]) "")         overSoXSynthHelp2 vec vdB = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (soxBasicParams ys (adjust_dbVol ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i))) "") vec-    _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testA.wav", "synth", ts, "sine",-       showFFloat Nothing note0 ""]) ""+            ((if null ys then id else soxBasicParams ys) (adjust_dbVol ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", +              showFFloat Nothing noteN "","vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i))) "") vec+    _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testA.wav", "synth", ts, +       "sine", showFFloat Nothing note0 ""]) ""     if isNothing note1 then overSoXSynthHelp v0     else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testB.wav", "synth", ts, "sine",-         showFFloat Nothing (fromJust note1) ""]) ""+      _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testB.wav", "synth", ts, +         "sine",  showFFloat Nothing (fromJust note1) ""]) ""       overSoXSynthHelp v0       overSoXSynthHelp2 v1 vdB-    mixTest2G ys   +    if null ys then mixTest else mixTest2G ys     -- | Uses additional 'Int' parameters. The first one is a number of enka (see 'nkyT'). The second one defines, to which n-th elements set -- (see 'nkyT') belongs the obtained higher notes in the intervals. To obtain reasonable results, please, use for the first one 2, 3, 4, 6, 9, or 12.@@ -348,42 +327,11 @@  -- | Creates part of the needed \"test\*\.wav" files in the current directory.  partialTest_k :: OvertonesO -> Int -> String -> IO ()-partialTest_k vec k ts =-  let zeroN = numVZeroesPre vec in V.imapM_ (\i (noteN, !amplN) -> if i /= 0 && i `rem` 50 == 0-    then do-      _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav", "synth", ts,"sine",-        showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""] ""-      path1s <- listDirectory "."-      let path2s = sort . filter (isPrefixOf $ "test" ++ show k) $ path1s-      (code,_,herr0) <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ path2s ++ ["test-" ++ show k ++ prependZeroes zeroN-        (show (i `quot` 50)) ++ ".wav"]) ""-      case code of-        ExitSuccess -> mapM_ removeFile path2s-        _           -> do-          exi <- doesFileExist $ "test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ ".wav"-          if exi then putStrLn ("DobutokO.Sound.Functional.partialTest_k: " ++ herr0) >> removeFile ("test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ ".wav")-          else putStrLn $ "DobutokO.Sound.Functional.partialTest_k: " ++ herr0-    else readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav", "synth", ts,"sine",-      showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""] "" >> putStr "") vec+partialTest_k vec k ts = partialTest_k1G vec k ts V.empty  -- | Generalized version of the 'partialTest_k' with the additional volume adjustment in dB given by 'V.Vector' of 'Double'. partialTest_k1G :: OvertonesO -> Int -> String -> V.Vector Double -> IO ()-partialTest_k1G vec k ts vdB =-  let zeroN = numVZeroesPre vec in V.imapM_ (\i (noteN, !amplN) -> if i /= 0 && i `rem` 50 == 0-    then do-      _ <- readProcessWithExitCode (fromJust (showE "sox")) (adjust_dbVol ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i)) ""-      path1s <- listDirectory "."-      let path2s = sort . filter (isPrefixOf $ "test" ++ show k) $ path1s-      (code,_,herr0) <- readProcessWithExitCode (fromJust (showE "sox")) (["--combine", "mix"] ++ path2s ++ ["test-" ++ show k ++ prependZeroes zeroN-        (show (i `quot` 50)) ++ ".wav"]) ""-      case code of-        ExitSuccess -> mapM_ removeFile path2s-        _           -> do-          exi <- doesFileExist $ "test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ ".wav"-          if exi then putStrLn ("DobutokO.Sound.Functional.partialTest_k1G: " ++ herr0) >> removeFile ("test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ ".wav")-          else putStrLn $ "DobutokO.Sound.Functional.partialTest_k1G: " ++ herr0-    else readProcessWithExitCode (fromJust (showE "sox")) (adjust_dbVol ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav", "synth", ts,"sine",-      showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i)) "" >> putStr "") vec+partialTest_k1G vec k ts vdB = partialTest_k2G vec k ts vdB []  -- | Generalized version of the 'partialTest_k1G' with a possibility to change sound quality parameters using the additional second 'String' argument. -- For more information, please, refer to 'soxBasicParams'.@@ -403,11 +351,11 @@         ExitSuccess -> mapM_ removeFile path2s         _           -> do           exi <- doesFileExist $ "test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ if drop 3 ys == "f" then ".flac" else ".wav"-          if exi then putStrLn ("DobutokO.Sound.Functional.partialTest_k1G: " ++ herr0) >> removeFile ("test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ if drop 3 ys == "f" then ".flac" else ".wav")-          else putStrLn $ "DobutokO.Sound.Functional.partialTest_k1G: " ++ herr0-    else readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys (adjust_dbVol ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav",-      "synth", ts,"sine", showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""]-        (V.unsafeIndex vdB i))) "" >> putStr "") vec      +          if exi then putStrLn (herr0) >> removeFile ("test-" ++ show k ++ prependZeroes zeroN (show (i `quot` 50)) ++ if drop 3 ys == "f" then ".flac" else ".wav")+          else putStrLn herr0+    else readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ((if V.null vdB then id +      else (\wwws -> adjust_dbVol wwws (V.unsafeIndex vdB i))) ["-r22050", "-n", "test" ++ show k ++ show (i + 2) ++ ".wav",+      "synth", ts,"sine", showFFloat Nothing (abs noteN) "", "vol", showFFloat Nothing amplN ""])) "" >> putStr "") vec        -- | Generates a 'V.Vector' of 'OvertonesO' that represents the sound.  doubleVecFromVecOfDouble :: (Double -> OvertonesO) -> Double -> V.Vector (Maybe Double) -> V.Vector OvertonesO@@ -431,36 +379,7 @@  -- | 'V.Vector' of 'Double' is a vector of dB volume adjustments for the corresponding harmonices (overtones). overSoXSynth2FDN_B1G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> V.Vector Double -> IO ()-overSoXSynth2FDN_B1G f (x, y, limB) j zs vdB- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let limA0 = abs ((limB / 10) - (fromIntegral . truncate $ (limB / 10))) * 10-        limA  = if compare limA0 0.1 == LT then 0.1 else limA0-        l0    = length zs-        note0 = closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)-        note1 = dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) note0-        g0    = V.fromList . nubBy (\(!x1,_) (!x2,_) -> compare (abs (x1 - x2)) limA == LT) . V.toList . V.map (\(noteX, !amplX) ->-           if noteX <= 0.0 then (2 * note0, abs (amplX - (fromIntegral . truncate $ amplX))) else (closestNote noteX,-             abs (amplX - (fromIntegral . truncate $ amplX)))) . f-        v0    = V.takeWhile (\(!w,!z) -> compare w (V.unsafeIndex notes 107) /= GT && compare (abs z) 0.001 == GT) .-                   V.imap (\i (_,!z0) -> (fromIntegral (i + 1) * (fst . V.unsafeIndex (g0 note0) $ 0), z0)) . g0 $ note0 -        v1    = if isNothing note1 then V.empty-                else V.takeWhile (\(!w,!z) -> compare w (V.unsafeIndex notes 107) /= GT && compare (abs z) 0.001 == GT) .-                   V.imap (\i (_,!z0) -> (fromIntegral (i + 1) * (fst . V.unsafeIndex (g0 . fromJust $ note1) $ 0), z0)) . g0 . fromJust $ note1-        ts = showFFloat (Just 4) (abs y) "" -        overSoXSynthHelp = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] "")-        overSoXSynthHelp2 vec vdB = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (adjust_dbVol ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i))"") vec-    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA.wav", "synth", ts,"sine",showFFloat Nothing note0 ""] ""-    if isNothing note1 then overSoXSynthHelp v0-    else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB.wav", "synth", ts,"sine",showFFloat Nothing (fromJust note1) ""] ""-      overSoXSynthHelp v0-      overSoXSynthHelp2 v1 vdB-    mixTest    +overSoXSynth2FDN_B1G f (x, y, limB) j zs vdB = overSoXSynth2FDN_B2G f (x, y, limB) j zs vdB []  -- | Generalized version of the 'overSoXSynth2FDN_B1G' with a possibility to specify sound quality parameters using additional second 'String' -- argument. For more information, please, refer to 'soxBasicParams'.@@ -483,20 +402,21 @@                    V.imap (\i (_,!z0) -> (fromIntegral (i + 1) * (fst . V.unsafeIndex (g0 . fromJust $ note1) $ 0), z0)) . g0 . fromJust $ note1         ts = showFFloat (Just 4) (abs y) ""          overSoXSynthHelp = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (soxBasicParams ys ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""]) "")+            ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "test0" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", +              showFFloat Nothing noteN "", "vol", showFFloat Nothing amplN ""]) "")         overSoXSynthHelp2 vec vdB = V.imapM_ (\i (noteN, !amplN) -> readProcessWithExitCode (fromJust (showE "sox"))-            (soxBasicParams ys (adjust_dbVol ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "",-              "vol", showFFloat Nothing amplN ""] (V.unsafeIndex vdB i))) "") vec-    _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testA.wav", "synth", ts,"sine",+            ((if null ys then id else soxBasicParams ys) ((if V.null vdB then id else (\wwws -> adjust_dbVol wwws (V.unsafeIndex vdB i))) +              ["-r22050", "-n", "test1" ++ show (i + 2) ++ ".wav", "synth", ts,"sine", showFFloat Nothing noteN "", "vol", +                showFFloat Nothing amplN ""])) "") vec+    _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testA.wav", "synth", ts,"sine",        showFFloat Nothing note0 ""]) ""     if isNothing note1 then overSoXSynthHelp v0     else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testB.wav", "synth", ts,"sine",+      _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testB.wav", "synth", ts,"sine",          showFFloat Nothing (fromJust note1) ""]) ""       overSoXSynthHelp v0       overSoXSynthHelp2 v1 vdB-    mixTest2G ys    +    if null ys then mixTest else mixTest2G ys      -- | Uses additional 'Int' parameters. The first one is a number of enka (see 'nkyT'). The second one defines, to which n-th elements set -- (see 'nkyT') belongs the obtained higher notes in the intervals. To obtain reasonable results, please, use for the first one 2, 3, 4, 6, 9, or 12.@@ -516,42 +436,12 @@ --  -- It is recommended to fully simplify the computation for \"f\" function before using it in the 'overSoXSynth2FDN_S'. overSoXSynth2FDN_S :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()-overSoXSynth2FDN_S f (x, y) j zs- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let note0 = closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)-        l0    = length zs-        note1 = dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) note0-        v0    = f note0-        v1    = maybe V.empty f note1-        ts = showFFloat (Just 4) (abs y) ""-    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA.wav", "synth", ts,"sine",showFFloat Nothing note0 ""] ""-    if isNothing note1 then partialTest_k v0 0 ts-    else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB.wav", "synth", ts,"sine", showFFloat Nothing (fromJust note1) ""] ""-      partialTest_k v0 0 ts-      partialTest_k v1 1 ts-    mixTest+overSoXSynth2FDN_S f (x, y) j zs = overSoXSynth2FDN_S2G f (x, y) j zs V.empty []  -- | Generalized version of the 'overSoXSynth2FDN_S' with the additional volume adjustment in dB for overtones given by 'V.Vector' of 'Double'. overSoXSynth2FDN_S1G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> V.Vector Double -> IO ()-overSoXSynth2FDN_S1G f (x, y) j zs vdB- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let note0 = closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)-        l0    = length zs-        note1 = dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) note0-        v0    = f note0-        v1    = maybe V.empty f note1-        ts = showFFloat (Just 4) (abs y) ""-    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testA.wav", "synth", ts,"sine",showFFloat Nothing note0 ""] ""-    if isNothing note1 then partialTest_k1G v0 0 ts vdB-    else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "testB.wav", "synth", ts,"sine",showFFloat Nothing (fromJust note1) ""] ""-      partialTest_k1G v0 0 ts vdB-      partialTest_k1G v1 1 ts vdB-    mixTest-+overSoXSynth2FDN_S1G f (x, y) j zs vdB = overSoXSynth2FDN_S2G f (x, y) j zs vdB []+  -- | Generalized version of the 'overSoXSynth2FDN_S1G' with a possibility to specify sound quality parameters using the second 'String' argument. -- For more information, please, refer to 'soxBasicParams'. overSoXSynth2FDN_S2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> V.Vector Double -> String -> IO ()@@ -564,15 +454,15 @@         v0    = f note0         v1    = maybe V.empty f note1         ts = showFFloat (Just 4) (abs y) ""-    _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testA.wav", "synth", ts,"sine",+    _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testA.wav", "synth", ts,"sine",        showFFloat Nothing note0 ""]) ""     if isNothing note1 then partialTest_k2G v0 0 ts vdB ys     else do -      _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys ["-r22050", "-n", "testB.wav", "synth", ts,"sine",+      _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ["-r22050", "-n", "testB.wav", "synth", ts,"sine",          showFFloat Nothing (fromJust note1) ""]) ""       partialTest_k2G v0 0 ts vdB ys       partialTest_k2G v1 1 ts vdB ys-    mixTest2G ys        +    if null ys then mixTest else mixTest2G ys          -- | Similar to 'overSoXSynthGen2FDN', but instead of 'overSoXSynth2FDN' uses 'overSoXSynth2FDN_S' function.  overSoXSynthGen2FDN_SG :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO ()@@ -657,26 +547,12 @@ --  -- It is recommended to fully simplify the computation for \"f\" function before using it in the 'overSoXSynth2FDN_Sf3'. overSoXSynth2FDN_Sf3 :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> IO ()-overSoXSynth2FDN_Sf3 f (x, y, t0) j zs- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let l0    = length zs-    soundGenF3 (V.fromList [\x -> closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0),\x -> fromMaybe (V.unsafeIndex notes 0)-     (dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) (closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)))])-       (V.replicate 2 x) (V.fromList [1,V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))]) f (x, y, t0) j zs-    mixTest-+overSoXSynth2FDN_Sf3 f (x, y, t0) j zs = overSoXSynth2FDN_Sf32G f (x, y, t0) j zs V.empty []+  -- | Generalized variant of the 'overSoXSynth2FDN_Sf3' function with a possibility to adjust volume using 'adjust_dBVol'. 'V.Vector' of 'Double' -- specifies the needed adjustments in dB. overSoXSynth2FDN_Sf31G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> V.Vector Double -> IO ()-overSoXSynth2FDN_Sf31G f (x, y, t0) j zs vdB- | V.null . convertToProperUkrainian $ zs = overSoXSynth x- | otherwise = do-    let l0    = length zs-    soundGenF31G (V.fromList [\x -> closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0),\x -> fromMaybe (V.unsafeIndex notes 0)-     (dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) (closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)))])-       (V.replicate 2 x) (V.fromList [1,V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))]) f (x, y, t0) j zs vdB-    mixTest    +overSoXSynth2FDN_Sf31G f (x, y, t0) j zs vdB = overSoXSynth2FDN_Sf32G f (x, y, t0) j zs vdB []  -- | Generalized variant of the 'overSoXSynth2FDN_Sf31G' with a possibility to specify sound quality using the second 'String' parameter. -- For more information, please, refer to 'soxBasicParams'.@@ -688,7 +564,7 @@     soundGenF32G (V.fromList [\x -> closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0),\x -> fromMaybe (V.unsafeIndex notes 0)      (dNote (V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))) (closestNote (if x /= 0.0 then abs x else V.unsafeIndex notes 0)))])        (V.replicate 2 x) (V.fromList [1,V.unsafeIndex (intervalsFromString zs) (abs (j `rem` l0))]) f (x, y, t0) j zs vdB ys-    mixTest2G ys+    if null ys then mixTest else mixTest2G ys  helpF1 :: V.Vector (Double -> Double) -> V.Vector Double -> V.Vector Int -> V.Vector (Maybe Double) helpF1 vf vd =@@ -707,32 +583,12 @@ -- and rich sound. soundGenF3 :: V.Vector (Double -> Double) -> V.Vector Double -> V.Vector Int -> (Double -> OvertonesO) -> (Double, Double, Double) -> Int ->   String -> IO ()-soundGenF3 vf vd vi f (x, y, t0) j zs = do-  let vD = helpF1 vf vd vi   -- Vector of notes played simultaneously (e. g. just one, interval, accord etc.)-      vDz = V.mapMaybe id vD -- The previous one without Nothings and Justs-      ilDz = V.length vDz - 1-      vNotes = doubleVecFromVecOfDouble f t0 (V.map Just vDz) -- Vector of vectors of pairs (freq,ampl) -- notes and their absence (V.empty) with overtones-      l0 = length zs-      ts = showFFloat (Just 4) (abs y) "" -- duration of the sound to be generated-  V.imapM_ (\i note1 -> do-    _ <- readProcessWithExitCode (fromJust (showE "sox")) ["-r22050", "-n", "test" ++ helpF0 i ++ ".wav", "synth", ts,"sine",-       showFFloat Nothing (V.unsafeIndex vDz i) ""] ""-    partialTest_k (V.unsafeIndex vNotes i) i ts) vDz+soundGenF3 vf vd vi f (x, y, t0) j zs = soundGenF32G vf vd vi f (x, y, t0) j zs V.empty []  -- | Generalized variant of the 'soundGenF3' with volume adjustment in dB given by the second @Vector Double@ for the overtones. soundGenF31G :: V.Vector (Double -> Double) -> V.Vector Double -> V.Vector Int -> (Double -> OvertonesO) -> (Double, Double, Double) -> Int ->   String -> V.Vector Double -> IO ()-soundGenF31G vf vd vi f (x, y, t0) j zs vdB = do-  let vD = helpF1 vf vd vi   -- Vector of notes played simultaneously (e. g. just one, interval, accord etc.)-      vDz = V.mapMaybe id vD -- The previous one without Nothings and Justs-      ilDz = V.length vDz - 1-      vNotes = doubleVecFromVecOfDouble f t0 (V.map Just vDz) -- Vector of vectors of pairs (freq,ampl) -- notes and their absence (V.empty) with overtones-      l0 = length zs-      ts = showFFloat (Just 4) (abs y) "" -- duration of the sound to be generated-  V.imapM_ (\i note1 -> do-    _ <- readProcessWithExitCode (fromJust (showE "sox")) (adjust_dbVol ["-r22050", "-n", "test" ++ helpF0 i ++ ".wav", "synth", ts, "sine",-       showFFloat Nothing (V.unsafeIndex vDz i) ""] (V.unsafeIndex vdB i)) ""-    partialTest_k1G (V.unsafeIndex vNotes i) i ts vdB) vDz+soundGenF31G vf vd vi f (x, y, t0) j zs vdB = soundGenF32G vf vd vi f (x, y, t0) j zs vdB []   -- | Generalized variant of the 'soundGenF31G' with a possibility to specify sound quality using the second 'String' argument. For more information, -- please, refer to 'soxBasicParams'.@@ -746,8 +602,9 @@       l0 = length zs       ts = showFFloat (Just 4) (abs y) "" -- duration of the sound to be generated   V.imapM_ (\i note1 -> do-    _ <- readProcessWithExitCode (fromJust (showE "sox")) (soxBasicParams ys (adjust_dbVol ["-r22050", "-n", "test" ++ helpF0 i ++ ".wav", "synth",ts,-       "sine", showFFloat Nothing (V.unsafeIndex vDz i) ""] (V.unsafeIndex vdB i))) ""+    _ <- readProcessWithExitCode (fromJust (showE "sox")) ((if null ys then id else soxBasicParams ys) ((if V.null vdB +       then id else (\wwws -> adjust_dbVol wwws (V.unsafeIndex vdB i))) ["-r22050", "-n", "test" ++ helpF0 i ++ ".wav", "synth",ts,+         "sine", showFFloat Nothing (V.unsafeIndex vDz i) ""])) ""     partialTest_k2G (V.unsafeIndex vNotes i) i ts vdB ys) vDz              -- | Similar to 'overSoXSynthGen2FDN_S', but instead of 'overSoXSynth2FDN_S' uses 'overSoXSynth2FDN_Sf3' function. @@ -1226,16 +1083,16 @@    else v1       -- | Splits (with addition of the new overtones) a given 'OvertonesO' into a number @n@ (specified by the first 'Int' argument) of 'OvertonesO' --- (represented finally as a 'V.Vector' of them repsectively) so that all except the first @n@ greatest by the absolute value of the amplitude tuples of Doubles are --- considered overtones for the greatest by the absolute value one in the given 'OvertonesO' and all the next @n - 1@ are treated as the greatest by --- the absolute value and each of them produces the similar by the @f :: Double -> OvertonesO@ function overtones.+-- (represented finally as a 'V.Vector' of them respectively) so that all except the first @n@ greatest by the absolute value of the amplitude +-- tuples of Doubles are considered overtones for the greatest by the absolute value one in the given 'OvertonesO' and all the next @n - 1@ +-- are treated as the greatest by the absolute value and each of them produces the similar by the @f :: Double -> OvertonesO@ function overtones. --  -- It is expected to obtain by such a conversion a splitted one sound into several simultaneous similar ones with different heights.  -- To provide a rich result, the given first argument must be strictly less than the length of the given 'OvertonesO' minus one. splitO :: Int -> OvertonesO -> V.Vector OvertonesO splitO n v0   | compare (V.length v0) (n + 1) == GT = -    let v1 = V.fromList . sortBy (\(x1,y1) (x2,y2) -> compare (abs x2) (abs x1)) . V.toList $ v0+    let v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0         (x0, y0) = V.unsafeIndex v1 0         v2 = V.unsafeSlice 1 (n - 1) v1         v31 = V.map (\t -> (fst t) / x0) v2@@ -1243,7 +1100,7 @@         v3 = V.zip v31 v32         f1Tup (t1, w2) = V.imap (\ i (u1, u2) -> (fst (V.unsafeIndex v3 i) * t1, snd (V.unsafeIndex v3 i) * w2)) v3           in V.map f1Tup (V.unsafeSlice 0 n v1)-  | otherwise = V.singleton v0+ | otherwise = V.singleton v0  -- | Splits (with addition of the new overtones) a given 'OvertonesO' into a number of 'OvertonesO' (represented finally as a 'V.Vector' of them repsectively)  -- so that it intermediately uses a special function before applying the \"similarization\" splitting function. Is a generalization of the 'splitO', @@ -1254,7 +1111,7 @@ splitO2 :: (OvertonesO -> OvertonesO) -> Int -> OvertonesO -> V.Vector OvertonesO splitO2 h n v0  | compare (V.length v0) (n + 1) == GT = -    let v1 = V.fromList . sortBy (\(x1,y1) (x2,y2) -> compare (abs x2) (abs x1)) . V.toList $ v0+    let v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0         (x0, y0) = V.unsafeIndex v1 0         v2 = V.unsafeSlice 1 (n - 1) v1         v31 = V.map (\t -> (fst t) / x0) v2@@ -1262,21 +1119,21 @@         v3 = V.zip v31 v32         f1Tup (t1, w2) = V.imap (\ i (u1, u2) -> (fst (V.unsafeIndex v3 i) * t1, snd (V.unsafeIndex v3 i) * w2)) v3           in V.map f1Tup (h . V.unsafeSlice 0 n $ v1)-  | otherwise = V.singleton v0+ | otherwise = V.singleton v0 --- | -- | Generalized variant of the 'splitO' with the different splitting variants depending on the first two ASCII lower case letters in the 'String' argument.+-- | Generalized variant of the 'splitO' with the different splitting variants depending on the first two ASCII lower case letters in the 'String' argument. splitOG1 :: String -> Int -> OvertonesO -> V.Vector OvertonesO splitOG1 xs n v0   | compare (V.length v0) (n + 1) == GT =      let c1s = take 2 . filter isAsciiLower $ xs-        v1 = V.fromList . sortBy (\(x1,y1) (x2,y2) -> compare (abs x2) (abs x1)) . V.toList $ v0+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0         (x0, y0) = V.unsafeIndex v1 0 in           case c1s of             "ab" -> let (k1,k2,k3,k4) = (n - 1,V.length v0 - n,n - 1,V.length v0 - n) in splitHelp1 k1 k2 k3 k4 v1 (x0,y0)              "ac" -> let (k1,k2,k3,k4) = (1,n - 1,n - 1,V.length v0 - n) in splitHelp1 k1 k2 k3 k4 v1 (x0,y0)              "ad" -> let (k1,k2,k3,k4) = (n - 1,V.length v0 - n,0,n) in splitHelp1 k1 k2 k3 k4 v1 (x0,y0)              _    -> let (k1,k2,k3,k4) = (1,n - 1,0,n) in splitHelp1 k1 k2 k3 k4 v1 (x0,y0) -  | otherwise = V.singleton v0+ | otherwise = V.singleton v0  -- | Auxiliary function that is used inside 'innerSplit1' and also in 'splitOG1'. splitHelp1 :: Int -> Int -> Int -> Int -> OvertonesO -> (Double,Double) -> V.Vector OvertonesO@@ -1303,13 +1160,63 @@ splitOG2 h xs n v0  | compare (V.length v0) (n + 1) == GT =      let c1s = take 2 . filter isAsciiLower $ xs-        v1 = V.fromList . sortBy (\(x1,y1) (x2,y2) -> compare (abs x2) (abs x1)) . V.toList $ v0+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0         (x0, y0) = V.unsafeIndex v1 0 in           case c1s of             "ab" -> let (k1,k2,k3,k4) = (n - 1,V.length v0 - n,n - 1,V.length v0 - n) in splitHelp2 h k1 k2 k3 k4 v1 (x0,y0)              "ac" -> let (k1,k2,k3,k4) = (1,n - 1,n - 1,V.length v0 - n) in splitHelp2 h k1 k2 k3 k4 v1 (x0,y0)              "ad" -> let (k1,k2,k3,k4) = (n - 1,V.length v0 - n,0,n) in splitHelp2 h k1 k2 k3 k4 v1 (x0,y0)              _    -> let (k1,k2,k3,k4) = (1,n - 1,0,n) in splitHelp2 h k1 k2 k3 k4 v1 (x0,y0) + | otherwise = V.singleton v0    ++-- | Generalized variant of the 'splitOG1' with a possibility to specify a default value for splitting parameters as the first argument +-- @(Int,Int,Int,Int)@ and the sorted by the first element in the tuple (actually a 'String') in ascending order 'V.Vector' (the second one). +-- Each 'String' in the 'V.Vector' must be unique and consist of lowercase ASCII letters.+splitOG12 :: (Int,Int,Int,Int) -> V.Vector (String,Int -> OvertonesO -> (Int,Int,Int,Int)) -> String -> Int -> OvertonesO -> V.Vector OvertonesO+splitOG12 (x1,x2,x3,x4) vf xs n v0+ | compare (V.length v0) (n + 1) == GT && not (V.null vf) = +    let c1s = filter isAsciiLower $ xs+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0+        (x0, y0) = V.unsafeIndex v1 0 in let (k1,k2,k3,k4) = getBFst' ((x1,x2,x3,x4),V.map (\(ys,g) -> (ys,g n v1)) vf) c1s in +          splitHelp1 k1 k2 k3 k4 v1 (x0,y0) + | otherwise = V.singleton v0    ++-- | Variant of the 'splitOG12' applied to the unsorted second argument. It sorts it internally. If you specify the already sorted second argument +-- then it is better to use 'splitOG12'. Each 'String' in the 'V.Vector' must be unique and consist of lowercase ASCII letters.+splitOG12S :: (Int,Int,Int,Int) -> V.Vector (String,Int -> OvertonesO -> (Int,Int,Int,Int)) -> String -> Int -> OvertonesO -> V.Vector OvertonesO+splitOG12S (x1,x2,x3,x4) vf xs n v0+ | compare (V.length v0) (n + 1) == GT && not (V.null vf) = +    let c1s = filter isAsciiLower $ xs+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0+        v2 = V.fromList . sortBy (\(x1s,_) (x2s,_) -> compare x1s x2s) . V.toList $ vf+        (x0, y0) = V.unsafeIndex v1 0 in let (k1,k2,k3,k4) = getBFst' ((x1,x2,x3,x4),V.map (\(ys,g) -> (ys,g n v1)) v2) c1s in +          splitHelp1 k1 k2 k3 k4 v1 (x0,y0) + | otherwise = V.singleton v0    ++-- | Generalized variant of the 'splitOG2' with a possibility to specify a default value for splitting parameters as the first argument +-- @(Int,Int,Int,Int)@ and the sorted by the first element in the tuple (actually a 'String') in ascending order 'V.Vector' (the second one). +-- Each 'String' in the 'V.Vector' must be unique and consist of lowercase ASCII letters.+splitOG22 :: (Int,Int,Int,Int) -> V.Vector (String,Int -> OvertonesO -> (Int,Int,Int,Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> +  OvertonesO -> V.Vector OvertonesO+splitOG22 (x1,x2,x3,x4) vf h xs n v0+ | compare (V.length v0) (n + 1) == GT && not (V.null vf) = +    let c1s = filter isAsciiLower $ xs+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0+        (x0, y0) = V.unsafeIndex v1 0 in let (k1,k2,k3,k4) = getBFst' ((x1,x2,x3,x4),V.map (\(ys,g) -> (ys,g n v1)) vf) c1s in +          splitHelp2 h k1 k2 k3 k4 v1 (x0,y0) + | otherwise = V.singleton v0    + +-- | Variant of the 'splitOG22' applied to the unsorted second argument. It sorts it internally. If you specify the already sorted second argument +-- then it is better to use 'splitOG22'. Each 'String' in the 'V.Vector' must be unique and consist of lowercase ASCII letters.+splitOG22S :: (Int,Int,Int,Int) -> V.Vector (String,Int -> OvertonesO -> (Int,Int,Int,Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> +  OvertonesO -> V.Vector OvertonesO+splitOG22S (x1,x2,x3,x4) vf h xs n v0+ | compare (V.length v0) (n + 1) == GT && not (V.null vf) = +    let c1s = filter isAsciiLower $ xs+        v1 = V.fromList . sortBy (\(x1,_) (x2,_) -> compare (abs x2) (abs x1)) . V.toList $ v0+        v2 = V.fromList . sortBy (\(x1s,_) (x2s,_) -> compare x1s x2s) . V.toList $ vf+        (x0, y0) = V.unsafeIndex v1 0 in let (k1,k2,k3,k4) = getBFst' ((x1,x2,x3,x4),V.map (\(ys,g) -> (ys,g n v1)) v2) c1s in +          splitHelp2 h k1 k2 k3 k4 v1 (x0,y0)   | otherwise = V.singleton v0      -- | Concatenates a 'V.Vector' of 'OvertonesO' into a single 'OvertonesO'. Can be easily used with 'splitO'.
dobutokO2.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                dobutokO2-version:             0.34.0.0-synopsis:            A program and a library to create experimental music from a file and a Ukrainian text-description:         It can also create a timbre for the notes. Uses SoX inside.+version:             0.35.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 license:             MIT license-file:        LICENSE