-- |
-- Module      :  Composition.Sound.Overtones
-- Copyright   :  (c) OleksandrZhabenko 2020-2021
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  olexandr543@yahoo.com
--
-- Helps to create experimental music from a file (or its part) and a Ukrainian text. 
-- It can also generate a timbre for the notes. Uses SoX inside.

{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -threaded #-}

module Composition.Sound.Overtones (
  -- * Library and executable functions
  -- ** For the fixed timbre
  overSoXSynthN
  -- *** For the fixed timbre with different signs for harmonics coefficients
  , overTones2
  , overSoXSynth2
  , overSoXSynthN2
  , overSoXSynthN3
  -- *** Use additional parameters
  , overSoXSynthDN
  , overSoXSynth2DN
  -- *** Use a file for information
  , overSoXSynthNGen
  , overSoXSynthNGen2
  , overSoXSynthNGen3
  -- * Extended generation using enky functionality
  -- ** With somewhat fixed timbre
  , overSoXSynthNGenE
  , overSoXSynthNGen2E
  , overSoXSynthNGen3E
  -- * New 4G functions to work with Durations
  , overSoXSynthN4G
  , overSoXSynthN24G
  , overSoXSynthN34G
  , overSoXSynthNGenE4G
  , overSoXSynthNGen2E4G
  , overSoXSynthNGen3E4G
  -- ** 4G with speech-like composition
  , overSoXSynthN4GS
  , overSoXSynthN24GS
  , overSoXSynthN34GS
  , overSoXSynthNGenE4GS
  , overSoXSynthNGen2E4GS
  , overSoXSynthNGen3E4GS
  -- * New 5G functions to work also with Intervals
  , overSoXSynthN35G
  , overSoXSynthNGen3E5G
  -- ** 5G with obtained from the text arbitraty length Intervals
  , overSoXSynthN35GS
  , overSoXSynthNGen3E5GS
  -- * New 6G function to work also with Strengths
  , overSoXSynthNGen3E6G
  -- ** 6G with obtained from the text arbitrary length Strengths
  , overSoXSynthNGen3E6GS
  , overSoXSynthNGen3E6GSu
  -- * New generalized functions working with Params
  , overSoXSynthNGenEPar
  , overSoXSynthNGenE4GSPar
  , overSoXSynthNGenE4GPar
  , overSoXSynthNGen2EPar
  , overSoXSynthNGen2E4GSPar
  , overSoXSynthNGen2E4GPar
  , overSoXSynthNGen3EPar
  , overSoXSynthNGen3E4GSPar
  , overSoXSynthNGen3E4GPar
  , overSoXSynthNGen3E5GPar
  , overSoXSynthNGen3E5GSPar
  , overSoXSynthNGen3E6GPar
  , overSoXSynthNGen3E6GSPar
  , overSoXSynthNGen3E6GSuPar
) where

import Numeric (showFFloat)
import Data.List (isPrefixOf,sort)
import Data.Maybe (isNothing,fromJust,maybe)
import GHC.Arr
import qualified Data.Foldable as F
import System.Process
import EndOfExe (showE)
import System.Directory
import Melodics.Ukrainian.ArrInt8 (convertToProperUkrainianI8)
import Composition.Sound.Functional.Basics
import Composition.Sound.Functional.Params
import Composition.Sound.DIS5G6G

-- | For the given frequency of the note and a Ukrainian text it generates a list of the tuples, each one of which contains
-- the harmonics' frequency and amplitude. The 'String' is used to produce the signs for harmonics coefficients.
overTones2 :: Float -> String -> OvertonesO
overTones2 :: Float -> String -> OvertonesO
overTones2 Float
note String
ts =
  ((Float, Float) -> Bool) -> OvertonesO -> OvertonesO
forall a. (a -> Bool) -> [a] -> [a]
takeWhile (\(!Float
w,!Float
z) -> Float
w Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
<= Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
notes Int
107 Bool -> Bool -> Bool
&& Float -> Float
forall a. Num a => a -> a
abs Float
z Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.001) (OvertonesO -> OvertonesO)
-> ([Int] -> OvertonesO) -> [Int] -> OvertonesO
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Float, Float) -> Bool) -> OvertonesO -> OvertonesO
forall a. (a -> Bool) -> [a] -> [a]
filter (\(Float
_, Float
t4) -> Float
t4 Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
/= Float
0.0) (OvertonesO -> OvertonesO)
-> ([Int] -> OvertonesO) -> [Int] -> OvertonesO
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (Int -> (Float, Float)) -> [Int] -> OvertonesO
forall a b. (a -> b) -> [a] -> [b]
map (\Int
i -> (Float
note Float -> Float -> Float
forall a. Num a => a -> a -> a
* Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
2), Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Array Int Int -> Int -> Int
forall i e. Array i e -> Int -> e
unsafeAt (Int -> String -> Array Int Int
signsFromString Int
1024 String
ts)
      (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1)) Float -> Float -> Float
forall a. Fractional a => a -> a -> a
/ Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1)))) ([Int] -> OvertonesO) -> [Int] -> OvertonesO
forall a b. (a -> b) -> a -> b
$ [Int
0..Int
1023]

-- | Similar to 'overSoXSynth' except that takes not necessarily pure lower quint note as the second one, but the one specified by the 'String' parameter
-- 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 'OvertonesO'.
overSoXSynthDN :: Float -> String -> IO ()
overSoXSynthDN :: Float -> String -> IO ()
overSoXSynthDN Float
x = Float -> Float -> String -> IO ()
overSoXSynth2DN Float
x Float
0.5
{-# INLINE overSoXSynthDN #-}

overSoXSynthHelp :: OvertonesO -> IO ()
overSoXSynthHelp :: OvertonesO -> IO ()
overSoXSynthHelp = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
        [String
"-r22050", String
"-n", String
"test0" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", String
"0.5",String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"",
           String
"vol", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
amplN String
""] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]

overSoXSynthHelp2 :: OvertonesO -> IO ()
overSoXSynthHelp2 :: OvertonesO -> IO ()
overSoXSynthHelp2 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
        [String
"-r22050", String
"-n", String
"test1" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", String
"0.5",String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"",
           String
"vol", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
amplN String
""] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]

-- | Similar to 'overSoXSynthDN' except that the resulting duration is specified by the second 'Float' parameter in seconds. For 'overSoXSynthDN'
-- it is equal to 0.5.
overSoXSynth2DN :: Float -> Float -> String -> IO ()
overSoXSynth2DN :: Float -> Float -> String -> IO ()
overSoXSynth2DN Float
x Float
y String
zs
 | [Sound8] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([Sound8] -> Bool) -> (String -> [Sound8]) -> String -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [Sound8]
convertToProperUkrainianI8 (String -> Bool) -> String -> Bool
forall a b. (a -> b) -> a -> b
$ String
zs = Float -> IO ()
overSoXSynth Float
x
 | Bool
otherwise = do
    let note0 :: Float
note0 = Float -> Float
closestNote Float
x
        note1 :: Maybe Float
note1 = Int -> Float -> Maybe Float
dNote (Array Int Int -> Int -> Int
forall i e. Array i e -> Int -> e
unsafeAt (String -> Array Int Int
intervalsFromString String
zs) Int
0) Float
note0
        v0 :: OvertonesO
v0    = Float -> OvertonesO
overTones Float
note0
        v1 :: OvertonesO
v1    = OvertonesO -> (Float -> OvertonesO) -> Maybe Float -> OvertonesO
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] Float -> OvertonesO
overTones Maybe Float
note1
    (ExitCode, String, String)
_ <- String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testA.wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
y String
"",String
"sine",
       Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
note0 String
"", String
"vol",String
"0.5"] String
""
    if Maybe Float -> Bool
forall a. Maybe a -> Bool
isNothing Maybe Float
note1 then OvertonesO -> IO ()
overSoXSynthHelp OvertonesO
v0
    else do 
      (ExitCode, String, String)
_ <- String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testB.wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
y String
"",String
"sine",
         Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Maybe Float -> Float
forall a. HasCallStack => Maybe a -> a
fromJust Maybe Float
note1) String
"", String
"vol",String
"0.5"] String
""
      OvertonesO -> IO ()
overSoXSynthHelp OvertonesO
v0
      OvertonesO -> IO ()
overSoXSynthHelp2 OvertonesO
v1
    IO ()
mixTest

-- | For the given frequency it generates a musical sound with a timbre. The main component of the sound includes the lower pure quint,
-- which can be in the same octave or in the one with the number lower by one. Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" files in the current directory, because they can be overwritten.
-- The 'String' argument is used to define signs of the harmonics coefficients for Overtones.
overSoXSynth2 :: Float -> String -> IO ()
overSoXSynth2 :: Float -> String -> IO ()
overSoXSynth2 Float
x String
tts = do
  let note0 :: Float
note0 = Float -> Float
closestNote Float
x
      note1 :: Float
note1 = Float -> Float
pureQuintNote Float
note0
      v0 :: OvertonesO
v0    = Float -> String -> OvertonesO
overTones2 Float
note0 String
tts
      v1 :: OvertonesO
v1    = Float -> String -> OvertonesO
overTones2 Float
note1 String
tts
  (ExitCode, String, String)
_ <- String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"test01.wav", String
"synth", String
"0.5",String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
note0 String
"",
     String
"synth", String
"0.5",String
"sine", String
"mix", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
note1 String
"", String
"vol",String
"0.5"] String
""
  OvertonesO -> IO ()
overSoXSynthHelp OvertonesO
v0
  OvertonesO -> IO ()
overSoXSynthHelp2 OvertonesO
v1
  IO ()
mixTest 

-- | Function to create a melody for the given arguments. 'String' is used to provide a rhythm. The main component of the sound includes the lower pure quint, which
-- can be in the same octave or in the one with the number lower by one. The first 'Float' argument from the range [0.01..1.0] is used as a maximum amplitude
-- for Overtones. If it is set to 1.0 the overTones amplitudes are just the maximum ones, otherwise they are multiplied by the parameter and this results
-- in their becoming more silent ones. The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" files in the current directory, because they can be overwritten.
overSoXSynthN :: Int -> Float -> Float -> String -> [Float] -> IO ()
overSoXSynthN :: Int -> Float -> Float -> String -> [Float] -> IO ()
overSoXSynthN Int
n Float
ampL Float
time3 String
zs = Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3)
{-# INLINE overSoXSynthN #-}

overSoXSynthHelpN :: Int -> Int -> Int -> Float -> Durations -> OvertonesO -> IO ()
overSoXSynthHelpN :: Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
  [String
"-r22050", String
"-n", String
"test" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
    String
"sine",Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m)) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0
      then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]

overSoXSynthHelpN2 :: Int -> Int -> Int -> Float -> Durations -> OvertonesO -> IO ()
overSoXSynthHelpN2 :: Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN2 Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
  [String
"-r22050", String
"-n", String
"testQ" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
     String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]

soxSynthHelpMain :: Int
-> Int
-> Int
-> Array i a
-> a
-> a
-> IO (ExitCode, String, String)
soxSynthHelpMain Int
j Int
m Int
zeroN Array i a
v21 a
note01 a
note02 = String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n",
  String
"testA" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN String
"1" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (a -> a
forall a. Num a => a -> a
abs (Array i a -> Int -> a
forall i e. Array i e -> Int -> e
unsafeAt Array i a
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine",
    Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note01 String
"", String
"synth", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (a -> a
forall a. Num a => a -> a
abs (Array i a -> Int -> a
forall i e. Array i e -> Int -> e
unsafeAt Array i a
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine", String
"mix",
      Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note02 String
"", String
"vol", if Array i a -> Int -> a
forall i e. Array i e -> Int -> e
unsafeAt Array i a
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) a -> a -> Bool
forall a. Ord a => a -> a -> Bool
> a
0.0 then String
"0.5" else String
"0"] String
""

-- | Function to create a melody for the given arguments. 'Durations' is used to provide a rhythm. 
overSoXSynthN4G :: Int -> Float -> Durations -> [Float] -> IO ()
overSoXSynthN4G :: Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL Array Int Float
v2 [Float]
vec0
 | (Float -> Bool) -> Array Int Float -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
F.all (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
== Float
0.0) Array Int Float
v2 = String -> IO ()
putStrLn String
"Composition.Sound.Overtones.overSoXSynthN4G: You provided no valid durations data! "
 | Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
>= Float
0.01 Bool -> Bool -> Bool
&& Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
<= Float
1.0 = 
    let zeroN :: Int
zeroN = [Float] -> Int
forall a. [a] -> Int
numVZeroesPre [Float]
vec0
        v21 :: Array Int Float
v21 = (\[Float]
rs -> (Int, Int) -> [Float] -> Array Int Float
forall i e. Ix i => (i, i) -> [e] -> Array i e
listArray (Int
0,[Float] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Float]
rs Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) [Float]
rs) ([Float] -> Array Int Float)
-> (Array Int Float -> [Float])
-> Array Int Float
-> Array Int Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Float -> Bool) -> [Float] -> [Float]
forall a. (a -> Bool) -> [a] -> [a]
filter (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
/=Float
0.0) ([Float] -> [Float])
-> (Array Int Float -> [Float]) -> Array Int Float -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array Int Float -> [Float]
forall i e. Array i e -> [e]
elems (Array Int Float -> Array Int Float)
-> Array Int Float -> Array Int Float
forall a b. (a -> b) -> a -> b
$ Array Int Float
v2
        m :: Int
m = Array Int Float -> Int
forall i e. Array i e -> Int
numElements Array Int Float
v2 in ((Int, Float) -> IO ()) -> [(Int, Float)] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Int
j, Float
x) -> do 
          let note0 :: Float
note0 = Float -> Float
closestNote Float
x                     -- zs is obtained from the command line arguments
              note1 :: Float
note1 = Float -> Float
pureQuintNote Float
note0
              v0 :: OvertonesO
v0    = Float -> OvertonesO
overTones Float
note0
              v1 :: OvertonesO
v1    = Float -> OvertonesO
overTones Float
note1
          (ExitCode, String, String)
_ <- Int
-> Int
-> Int
-> Array Int Float
-> Float
-> Float
-> IO (ExitCode, String, String)
forall a a a i.
(RealFloat a, RealFloat a, RealFloat a) =>
Int
-> Int
-> Int
-> Array i a
-> a
-> a
-> IO (ExitCode, String, String)
soxSynthHelpMain Int
j Int
m Int
zeroN Array Int Float
v21 Float
note0 Float
note1
          Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 OvertonesO
v0
          Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN2 Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 OvertonesO
v1
          Int -> Int -> IO ()
mixTest2 Int
zeroN Int
j) ([(Int, Float)] -> IO ())
-> ([Float] -> [(Int, Float)]) -> [Float] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> [Float] -> [(Int, Float)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
0..] ([Float] -> IO ()) -> [Float] -> IO ()
forall a b. (a -> b) -> a -> b
$ [Float]
vec0
 | Bool
otherwise = let ampL1 :: Float
ampL1 = Float
ampL Float -> Float -> Float
forall a. Num a => a -> a -> a
- (Integer -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Float) -> (Float -> Integer) -> Float -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Float -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Float -> Float) -> Float -> Float
forall a b. (a -> b) -> a -> b
$ Float
ampL) in
    if Float -> Float
forall a. Num a => a -> a
abs Float
ampL1 Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
< Float
0.01 then Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
0.01 Array Int Float
v2 [Float]
vec0
    else Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL1 Array Int Float
v2 [Float]
vec0

-- | Variant of the 'overSoXSynthN4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition.
overSoXSynthN4GS :: Int -> Float -> Float -> String -> [Float] -> IO ()
overSoXSynthN4GS :: Int -> Float -> Float -> String -> [Float] -> IO ()
overSoXSynthN4GS Int
n Float
ampL Float
time3 String
zs = Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3)
{-# INLINE overSoXSynthN4GS #-}

-- | Function to create a melody for the given arguments. 'String' is used to provide a rhythm. The main component of the sound includes the lower pure quint, which
-- can be in the same octave or in the one with the number lower by one. The first 'Float' argument from the range [0.01..1.0] is used as a maximum amplitude
-- for Overtones. If it is set to 1.0 the overTones amplitudes are just the maximum ones, otherwise they are multiplied by the parameter and this results
-- in their becoming more silent ones. The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" files in the current directory, because they can be overwritten.
overSoXSynthN2 :: Int -> Float -> Float -> String -> String -> [Float] -> IO ()
overSoXSynthN2 :: Int -> Float -> Float -> String -> String -> [Float] -> IO ()
overSoXSynthN2 Int
n Float
ampL Float
time3 String
zs = Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3)
{-# INLINE overSoXSynthN2 #-}
 
-- | Function to create a melody for the given arguments. 'Durations' is used to provide a rhythm. 
overSoXSynthN24G :: Int -> Float -> Durations -> String -> [Float] -> IO ()
overSoXSynthN24G :: Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL Array Int Float
v2 String
tts [Float]
vec0
 | (Float -> Bool) -> Array Int Float -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
F.all (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
== Float
0.0) Array Int Float
v2 = String -> IO ()
putStrLn String
"Composition.Sound.Overtones.overSoXSynthN24G: You provided no valid durations data! "
 | Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
>= Float
0.01 Bool -> Bool -> Bool
&& Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
<= Float
1.0 = 
    let v21 :: Array Int Float
v21 = (\[Float]
rs -> (Int, Int) -> [Float] -> Array Int Float
forall i e. Ix i => (i, i) -> [e] -> Array i e
listArray (Int
0,[Float] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Float]
rs Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1) [Float]
rs) ([Float] -> Array Int Float)
-> (Array Int Float -> [Float])
-> Array Int Float
-> Array Int Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Float -> Bool) -> [Float] -> [Float]
forall a. (a -> Bool) -> [a] -> [a]
filter (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
/= Float
0.0) ([Float] -> [Float])
-> (Array Int Float -> [Float]) -> Array Int Float -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array Int Float -> [Float]
forall i e. Array i e -> [e]
elems (Array Int Float -> Array Int Float)
-> Array Int Float -> Array Int Float
forall a b. (a -> b) -> a -> b
$ Array Int Float
v2
        zeroN :: Int
zeroN = [Float] -> Int
forall a. [a] -> Int
numVZeroesPre [Float]
vec0
        m :: Int
m = Array Int Float -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length Array Int Float
v21 in ((Int, Float) -> IO ()) -> [(Int, Float)] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Int
j, Float
x) -> do 
          let note0 :: Float
note0 = Float -> Float
closestNote Float
x                     -- zs is obtained from the command line arguments
              note1 :: Float
note1 = Float -> Float
pureQuintNote Float
note0
              v0 :: OvertonesO
v0    = Float -> String -> OvertonesO
overTones2 Float
note0 String
tts
              v1 :: OvertonesO
v1    = Float -> String -> OvertonesO
overTones2 Float
note1 String
tts
          (ExitCode, String, String)
_ <- Int
-> Int
-> Int
-> Array Int Float
-> Float
-> Float
-> IO (ExitCode, String, String)
forall a a a i.
(RealFloat a, RealFloat a, RealFloat a) =>
Int
-> Int
-> Int
-> Array i a
-> a
-> a
-> IO (ExitCode, String, String)
soxSynthHelpMain Int
j Int
m Int
zeroN Array Int Float
v21 Float
note0 Float
note1
          Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 OvertonesO
v0
          Int
-> Int -> Int -> Float -> Array Int Float -> OvertonesO -> IO ()
overSoXSynthHelpN2 Int
j Int
m Int
zeroN Float
ampL Array Int Float
v21 OvertonesO
v1
          Int -> Int -> IO ()
mixTest2 Int
zeroN Int
j) ([(Int, Float)] -> IO ())
-> ([Float] -> [(Int, Float)]) -> [Float] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> [Float] -> [(Int, Float)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
0..] ([Float] -> IO ()) -> [Float] -> IO ()
forall a b. (a -> b) -> a -> b
$ [Float]
vec0
 | Bool
otherwise = let ampL1 :: Float
ampL1 = Float
ampL Float -> Float -> Float
forall a. Num a => a -> a -> a
- (Integer -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Float) -> (Float -> Integer) -> Float -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Float -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Float -> Float) -> Float -> Float
forall a b. (a -> b) -> a -> b
$ Float
ampL) in
    if Float -> Float
forall a. Num a => a -> a
abs Float
ampL1 Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
< Float
0.01 then Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
0.01 Array Int Float
v2 String
tts [Float]
vec0
    else Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL1 Array Int Float
v2 String
tts [Float]
vec0        

-- | Variant of the 'overSoXSynthN24G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition.
overSoXSynthN24GS :: Int -> Float -> Float -> String -> String -> [Float] -> IO ()
overSoXSynthN24GS :: Int -> Float -> Float -> String -> String -> [Float] -> IO ()
overSoXSynthN24GS Int
n Float
ampL Float
time3 String
zs = Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3)
{-# INLINE overSoXSynthN24GS #-}

-- | Function to create a melody for the given arguments. 'String' is used to provide a rhythm. The main component of the sound includes the lower pure quint, which
-- can be in the same octave or in the one with the number lower by one. The first 'Float' argument from the range [0.01..1.0] is used as a maximum amplitude
-- for Overtones. If it is set to 1.0 the overTones amplitudes are just the maximum ones, otherwise they are multiplied by the parameter and this results
-- in their becoming more silent ones. The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" files in the current directory, because they can be overwritten.
-- The third 'String' argument is used to define the intervals for the notes if any.
-- The third 'Float' parameter basically is used to define in how many times the volume for the second lower note is less than the volume of
-- the main note. If it is rather great, it can signal that the volume for the second note overTones are greater than for the main note obetones.
-- The last one is experimental feature.
overSoXSynthN3 :: Int -> Float -> Float -> Float -> String -> String -> String -> [Float] -> IO ()
overSoXSynthN3 :: Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN3 Int
n Float
ampL Float
time3 Float
dAmpl String
zs = Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL Float
dAmpl (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3)
{-# INLINE overSoXSynthN3 #-}

-- | Function to create a melody for the given arguments. 'Duraitons' is used to provide a rhythm. 
overSoXSynthN34G :: Int -> Float -> Float -> Durations -> String -> String -> [Float] -> IO ()
overSoXSynthN34G :: Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs [Float]
vec0
 | (Float -> Bool) -> Array Int Float -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
F.all (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
== Float
0.0) Array Int Float
v2 = String -> IO ()
putStrLn String
"Composition.Sound.Overtones.overSoXSynthN34G: You provided no valid durations data! "
 | Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
>= Float
0.01 Bool -> Bool -> Bool
&& Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
<= Float
1.0 = 
    let v21 :: Array Int Float
v21 = (\[Float]
rs -> (Int, Int) -> [Float] -> Array Int Float
forall i e. Ix i => (i, i) -> [e] -> Array i e
listArray (Int
0,[Float] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Float]
rs Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) [Float]
rs) ([Float] -> Array Int Float)
-> (Array Int Float -> [Float])
-> Array Int Float
-> Array Int Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Float -> Bool) -> [Float] -> [Float]
forall a. (a -> Bool) -> [a] -> [a]
filter (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
/= Float
0.0) ([Float] -> [Float])
-> (Array Int Float -> [Float]) -> Array Int Float -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array Int Float -> [Float]
forall i e. Array i e -> [e]
elems (Array Int Float -> Array Int Float)
-> Array Int Float -> Array Int Float
forall a b. (a -> b) -> a -> b
$ Array Int Float
v2
        m :: Int
m     = Array Int Float -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length Array Int Float
v21
        zeroN :: Int
zeroN = [Float] -> Int
forall a. [a] -> Int
numVZeroesPre [Float]
vec0
        v3 :: Array Int Int
v3    = String -> Array Int Int
intervalsFromString String
vs
        l :: Int
l     = String -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
vs in ((Int, Float) -> IO ()) -> [(Int, Float)] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Int
j, Float
x) -> do 
          let note0 :: Float
note0 = Float -> Float
closestNote Float
x                     -- zs is obtained from the command line arguments
              note1 :: Maybe Float
note1 = Int -> Float -> Maybe Float
dNote (Array Int Int -> Int -> Int
forall i e. Array i e -> Int -> e
unsafeAt Array Int Int
v3 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
l)) Float
note0
              v0 :: OvertonesO
v0    = Float -> String -> OvertonesO
overTones2 Float
note0 String
tts
              v1 :: OvertonesO
v1    = if Maybe Float -> Bool
forall a. Maybe a -> Bool
isNothing Maybe Float
note1 then []
                      else Float -> String -> OvertonesO
overTones2 (Maybe Float -> Float
forall a. HasCallStack => Maybe a -> a
fromJust Maybe Float
note1) String
tts
              overSoXSynthHelpN1 :: OvertonesO -> IO ()
overSoXSynthHelpN1 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
                [String
"-r22050", String
"-n", String
"test" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
                  String
"sine",Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]
              overSoXSynthHelpN22 :: OvertonesO -> IO ()
overSoXSynthHelpN22 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
                [String
"-r22050", String
"-n", String
"testQ" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
                   String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (if Float
dAmpl Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
1.0 then Float
1.0
                     else Float
dAmpl Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]
              soxSynthHelpMain0 :: a -> IO (ExitCode, String, String)
soxSynthHelpMain0 a
note01 = String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testA" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN String
"1" String -> String -> String
forall a. [a] -> [a] -> [a]
++  String
".wav",
                String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note01 String
"", String
"vol",
                  if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then String
"0.5" else String
"0"] String
""
              soxSynthHelpMain1 :: a -> IO (ExitCode, String, String)
soxSynthHelpMain1 a
note02 = String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testB" String -> String -> String
forall a. [a] -> [a] -> [a]
++
                 Int -> String -> String
prependZeroes Int
zeroN String
"1" String -> String -> String
forall a. [a] -> [a] -> [a]
++  String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note02 String
"",
                   String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (if Float
dAmpl Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.5 then Float
0.5 else Float
dAmpl Float -> Float -> Float
forall a. Fractional a => a -> a -> a
/ Float
2) String
"" else String
"0"] String
""
          if Maybe Float -> Bool
forall a. Maybe a -> Bool
isNothing Maybe Float
note1 then do { (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain0 Float
note0
                                     ; OvertonesO -> IO ()
overSoXSynthHelpN1 OvertonesO
v0 }
          else do { (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain0 Float
note0
                  ; (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain1 (Maybe Float -> Float
forall a. HasCallStack => Maybe a -> a
fromJust Maybe Float
note1)
                  ; OvertonesO -> IO ()
overSoXSynthHelpN1 OvertonesO
v0
                  ; OvertonesO -> IO ()
overSoXSynthHelpN22 OvertonesO
v1}
          [String]
paths0 <- String -> IO [String]
listDirectory String
"."
          let paths :: [String]
paths = [String] -> [String]
forall a. Ord a => [a] -> [a]
sort ([String] -> [String])
-> ([String] -> [String]) -> [String] -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter (String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
isPrefixOf String
"test") ([String] -> [String]) -> [String] -> [String]
forall a b. (a -> b) -> a -> b
$ [String]
paths0
          (ExitCode, String, String)
_ <- String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) ([String
"--combine", String
"mix"] [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
paths [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String
"result0" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Int -> String
forall a. Show a => a -> String
show Int
j) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav",String
"vol",String
"0.3"]) String
""
          (String -> IO ()) -> [String] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ String -> IO ()
removeFile [String]
paths) ([(Int, Float)] -> IO ())
-> ([Float] -> [(Int, Float)]) -> [Float] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> [Float] -> [(Int, Float)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
0..] ([Float] -> IO ()) -> [Float] -> IO ()
forall a b. (a -> b) -> a -> b
$ [Float]
vec0
 | Bool
otherwise = let ampL1 :: Float
ampL1 = Float
ampL Float -> Float -> Float
forall a. Num a => a -> a -> a
- (Integer -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Float) -> (Float -> Integer) -> Float -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Float -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Float -> Float) -> Float -> Float
forall a b. (a -> b) -> a -> b
$ Float
ampL) in
    if Float -> Float
forall a. Num a => a -> a
abs Float
ampL1 Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
< Float
0.01 then Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
0.01 Float
dAmpl Array Int Float
v2 String
tts String
vs [Float]
vec0
    else Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL1 Float
dAmpl Array Int Float
v2 String
tts String
vs [Float]
vec0

-- | Generalized variant of the 'overSoXSynthN34G' where you specify your own 'Intervals'. For more information, please, refer to 'intervalsFromStringG'.
overSoXSynthN35G :: Int -> Float -> Float -> Durations -> String -> Intervals -> [Float] -> IO ()
overSoXSynthN35G :: Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 [Float]
vec0
 | (Float -> Bool) -> Array Int Float -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
F.all (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
== Float
0.0) Array Int Float
v2 = String -> IO ()
putStrLn String
"Composition.Sound.Overtones.overSoXSynthN35G: You provided no valid durations data! "
 | Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
>= Float
0.01 Bool -> Bool -> Bool
&& Float -> Float
forall a. Num a => a -> a
abs Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
<= Float
1.0 = 
    let v21 :: Array Int Float
v21 = (\[Float]
rs -> (Int, Int) -> [Float] -> Array Int Float
forall i e. Ix i => (i, i) -> [e] -> Array i e
listArray (Int
0,[Float] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Float]
rs Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1) [Float]
rs) ([Float] -> Array Int Float)
-> (Array Int Float -> [Float])
-> Array Int Float
-> Array Int Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Float -> Bool) -> [Float] -> [Float]
forall a. (a -> Bool) -> [a] -> [a]
filter (Float -> Float -> Bool
forall a. Eq a => a -> a -> Bool
/=Float
0.0) ([Float] -> [Float])
-> (Array Int Float -> [Float]) -> Array Int Float -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array Int Float -> [Float]
forall i e. Array i e -> [e]
elems (Array Int Float -> Array Int Float)
-> Array Int Float -> Array Int Float
forall a b. (a -> b) -> a -> b
$ Array Int Float
v2
        m :: Int
m     = Array Int Float -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length Array Int Float
v21
        zeroN :: Int
zeroN = [Float] -> Int
forall a. [a] -> Int
numVZeroesPre [Float]
vec0
        l :: Int
l     = Array Int Int -> Int
forall i e. Array i e -> Int
numElements Array Int Int
v3 in ((Int, Float) -> IO ()) -> [(Int, Float)] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Int
j, Float
x) -> do 
          let note0 :: Float
note0 = Float -> Float
closestNote Float
x                     -- zs is obtained from the command line arguments
              note1 :: Maybe Float
note1 = Int -> Float -> Maybe Float
dNote (Array Int Int -> Int -> Int
forall i e. Array i e -> Int -> e
unsafeAt Array Int Int
v3 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
l)) Float
note0
              v0 :: OvertonesO
v0    = Float -> String -> OvertonesO
overTones2 Float
note0 String
tts
              v1 :: OvertonesO
v1    = if Maybe Float -> Bool
forall a. Maybe a -> Bool
isNothing Maybe Float
note1 then []
                      else Float -> String -> OvertonesO
overTones2 (Maybe Float -> Float
forall a. HasCallStack => Maybe a -> a
fromJust Maybe Float
note1) String
tts
              overSoXSynthHelpN1 :: OvertonesO -> IO ()
overSoXSynthHelpN1 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
                [String
"-r22050", String
"-n", String
"test" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
                  String
"sine",Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]
              overSoXSynthHelpN22 :: OvertonesO -> IO ()
overSoXSynthHelpN22 = ((Integer, (Float, Float)) -> IO (ExitCode, String, String))
-> [(Integer, (Float, Float))] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ (\(Integer
i, (Float
noteN, !Float
amplN)) -> String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox"))
                [String
"-r22050", String
"-n", String
"testQ" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Integer -> String
forall a. Show a => a -> String
show (Integer
i Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
2)) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",
                   String
"sine", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) Float
noteN String
"", String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (if Float
dAmpl Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
1.0 then Float
1.0
                     else Float
dAmpl Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
amplN Float -> Float -> Float
forall a. Num a => a -> a -> a
* Float
ampL) String
"" else String
"0"] String
"") ([(Integer, (Float, Float))] -> IO ())
-> (OvertonesO -> [(Integer, (Float, Float))])
-> OvertonesO
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Integer] -> OvertonesO -> [(Integer, (Float, Float))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Integer
0..]
              soxSynthHelpMain0 :: a -> IO (ExitCode, String, String)
soxSynthHelpMain0 a
note01 = String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testA" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN String
"1" String -> String -> String
forall a. [a] -> [a] -> [a]
++  String
".wav",
                String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note01 String
"", String
"vol",
                  if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then String
"0.5" else String
"0"] String
""
              soxSynthHelpMain1 :: a -> IO (ExitCode, String, String)
soxSynthHelpMain1 a
note02 = String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) [String
"-r22050", String
"-n", String
"testB" String -> String -> String
forall a. [a] -> [a] -> [a]
++
                 Int -> String -> String
prependZeroes Int
zeroN String
"1" String -> String -> String
forall a. [a] -> [a] -> [a]
++  String
".wav", String
"synth", Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (Float -> Float
forall a. Num a => a -> a
abs (Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m))) String
"",String
"sine", Maybe Int -> a -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) a
note02 String
"",
                   String
"vol", if Array Int Float -> Int -> Float
forall i e. Array i e -> Int -> e
unsafeAt Array Int Float
v21 (Int
j Int -> Int -> Int
forall a. Integral a => a -> a -> a
`rem` Int
m) Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.0 then Maybe Int -> Float -> String -> String
forall a. RealFloat a => Maybe Int -> a -> String -> String
showFFloat (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
4) (if Float
dAmpl Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
> Float
0.5 then Float
0.5 else Float
dAmpl Float -> Float -> Float
forall a. Fractional a => a -> a -> a
/ Float
2) String
"" else String
"0"] String
""
          if Maybe Float -> Bool
forall a. Maybe a -> Bool
isNothing Maybe Float
note1 then do { (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain0 Float
note0
                                     ; OvertonesO -> IO ()
overSoXSynthHelpN1 OvertonesO
v0 }
          else do { (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain0 Float
note0
                  ; (ExitCode, String, String)
_ <- Float -> IO (ExitCode, String, String)
forall a. RealFloat a => a -> IO (ExitCode, String, String)
soxSynthHelpMain1 (Maybe Float -> Float
forall a. HasCallStack => Maybe a -> a
fromJust Maybe Float
note1)
                  ; OvertonesO -> IO ()
overSoXSynthHelpN1 OvertonesO
v0
                  ; OvertonesO -> IO ()
overSoXSynthHelpN22 OvertonesO
v1}
          [String]
paths0 <- String -> IO [String]
listDirectory String
"."
          let paths :: [String]
paths = [String] -> [String]
forall a. Ord a => [a] -> [a]
sort ([String] -> [String])
-> ([String] -> [String]) -> [String] -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> Bool) -> [String] -> [String]
forall a. (a -> Bool) -> [a] -> [a]
filter (String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
isPrefixOf String
"test") ([String] -> [String]) -> [String] -> [String]
forall a b. (a -> b) -> a -> b
$ [String]
paths0
          (ExitCode, String, String)
_ <- String -> [String] -> String -> IO (ExitCode, String, String)
readProcessWithExitCode (Maybe String -> String
forall a. HasCallStack => Maybe a -> a
fromJust (String -> Maybe String
showE String
"sox")) ([String
"--combine", String
"mix"] [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
paths [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String
"result0" String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String -> String
prependZeroes Int
zeroN (Int -> String
forall a. Show a => a -> String
show Int
j) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".wav",String
"vol",String
"0.3"]) String
""
          (String -> IO ()) -> [String] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ String -> IO ()
removeFile [String]
paths) ([(Int, Float)] -> IO ())
-> ([Float] -> [(Int, Float)]) -> [Float] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> [Float] -> [(Int, Float)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
0..] ([Float] -> IO ()) -> [Float] -> IO ()
forall a b. (a -> b) -> a -> b
$ [Float]
vec0
 | Bool
otherwise = let ampL1 :: Float
ampL1 = Float
ampL Float -> Float -> Float
forall a. Num a => a -> a -> a
- (Integer -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Float) -> (Float -> Integer) -> Float -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Float -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate (Float -> Float) -> Float -> Float
forall a b. (a -> b) -> a -> b
$ Float
ampL) in
    if Float -> Float
forall a. Num a => a -> a
abs Float
ampL1 Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
< Float
0.01 then Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
0.01 Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 [Float]
vec0
    else Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
ampL1 Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 [Float]
vec0

-- | Variant of the 'overSoXSynthN34G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition.
overSoXSynthN34GS :: Int -> Float -> Float -> Float -> String -> String -> String -> [Float] -> IO ()
overSoXSynthN34GS :: Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34GS Int
n Float
ampL Float
time3 Float
dAmpl String
zs = Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3)
{-# INLINE overSoXSynthN34GS #-}

-- | Variant of the 'overSoXSynthN34G' where intervals are obtained from the basic 'Intervals' with the length no more than 29 and a Ukrainian text 
-- specified as the last 'String' argument so that you can produce 'Intervals' of the arbitrary length. For more information, please, refer to 
-- 'intervalsFromStringG' and 'strToIntG'.
overSoXSynthN35GS :: Int -> Float -> Float -> Float -> String -> String -> Intervals -> String -> [Float] -> IO ()
overSoXSynthN35GS :: Int
-> Float
-> Float
-> Float
-> String
-> String
-> Array Int Int
-> String
-> [Float]
-> IO ()
overSoXSynthN35GS Int
n Float
ampL Float
time3 Float
dAmpl String
zs String
tts Array Int Int
v3 String
vs = Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts (Array Int Int -> String -> Array Int Int
intervalsFromStringG Array Int Int
v3 String
vs)
{-# INLINE overSoXSynthN35GS #-}

-- | Similar to 'overSoXSynthN', but uses a sound file to obtain the information analogous to list 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]). The first 'Float' argument from
-- the range [0.01..1.0] is used as a maximum amplitude for Overtones. If it is set to 1.0 the overTones amplitudes are just maximum ones,
-- otherwise they are multiplied by the parameter and this results in their becoming more silent ones.
-- The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" and \"end.wav\" files in the current directory, because they can be overwritten.
--
-- For better usage the 'FilePath' should be a filepath for the .wav file.
overSoXSynthNGen :: FilePath -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGen :: String -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGen String
file Int
m = String -> Int -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGenE String
file Int
m Int
12
{-# INLINE overSoXSynthNGen #-}
  
-- | Similar to 'overSoXSynthNGen', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained
-- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'overSoXSynthNGen'. To obtain
-- its modifications, please, use 2, 3, 4, 6, or 9.
overSoXSynthNGenE :: FilePath -> Int -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGenE :: String -> Int -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGenE String
file Int
m Int
ku Float
ampL Float
time3 String
zs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Int -> Int -> Float -> Array Int Float -> IO ()
nGenE4Gi Int
n String
file Int
m Int
ku Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3)

-- | Generalized version of the 'overSoXSynthNGenE' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGenEPar :: FilePath -> Params -> Float -> Float -> String -> IO ()
overSoXSynthNGenEPar :: String -> Params -> Float -> Float -> String -> IO ()
overSoXSynthNGenEPar String
file Params
params Float
ampL Float
time3 String
zs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Params -> Float -> Array Int Float -> IO ()
nGenE4GiPar Int
n String
file Params
params Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3)

-- | Variant of the 'overSoXSynthNGenE4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition.
overSoXSynthNGenE4GS :: FilePath -> Int -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGenE4GS :: String -> Int -> Int -> Float -> Float -> String -> IO ()
overSoXSynthNGenE4GS String
file Int
m Int
ku Float
ampL Float
time3 String
zs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Int -> Int -> Float -> Array Int Float -> IO ()
nGenE4Gi Int
n String
file Int
m Int
ku Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3)

-- | Generalized version of the 'overSoXSynthNGenE4GS' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGenE4GSPar :: FilePath -> Params -> Float -> Float -> String -> IO ()
overSoXSynthNGenE4GSPar :: String -> Params -> Float -> Float -> String -> IO ()
overSoXSynthNGenE4GSPar String
file Params
params Float
ampL Float
time3 String
zs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Params -> Float -> Array Int Float -> IO ()
nGenE4GiPar Int
n String
file Params
params Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3)  

-- | Note that the last two '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 third 'Int' parameter defines that @n@.
nGenE4Gi :: Int -> FilePath -> Int -> Int -> Float -> Durations -> IO ()
nGenE4Gi :: Int -> String -> Int -> Int -> Float -> Array Int Float -> IO ()
nGenE4Gi Int
n String
file Int
m Int
ku Float
ampL Array Int Float
v2 = do
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Int -> Int -> [Float] -> [Float]
liftInEnkuV Int
m Int
ku ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> ([Int] -> [Int]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Bool) -> [Int] -> [Int]
forall a. (a -> Bool) -> [a] -> [a]
filter (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= (Int
11440::Int)) ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL Array Int Float
v2 [Float]
vecB
  IO ()
endFromResult  
    
-- | Generalized version of the 'nGenE4Gi' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
nGenE4GiPar :: Int -> FilePath -> Params -> Float -> Durations -> IO ()
nGenE4GiPar :: Int -> String -> Params -> Float -> Array Int Float -> IO ()
nGenE4GiPar Int
n String
file Params
params Float
ampL Array Int Float
v2 = do
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Params -> [Float] -> [Float]
liftInParamsV Params
params ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int -> Float -> Array Int Float -> [Float] -> IO ()
overSoXSynthN4G Int
n Float
ampL Array Int Float
v2 [Float]
vecB
  IO ()
endFromResult      
       
-- | 4G genaralized version of the 'overSoXSynthNGenE' where you provide your own 'Durations'.
overSoXSynthNGenE4G :: FilePath -> Int -> Int -> Float -> Durations -> IO ()
overSoXSynthNGenE4G :: String -> Int -> Int -> Float -> Array Int Float -> IO ()
overSoXSynthNGenE4G String
file Int
m Int
ku Float
ampL Array Int Float
v2 = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Int -> Int -> Float -> Array Int Float -> IO ()
nGenE4Gi Int
n String
file Int
m Int
ku Float
ampL Array Int Float
v2

-- | Generalized version of the 'overSoXSynthNGenE4G' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGenE4GPar :: FilePath -> Params -> Float -> Durations -> IO ()
overSoXSynthNGenE4GPar :: String -> Params -> Float -> Array Int Float -> IO ()
overSoXSynthNGenE4GPar String
file Params
params Float
ampL Array Int Float
v2 = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int -> String -> Params -> Float -> Array Int Float -> IO ()
nGenE4GiPar Int
n String
file Params
params Float
ampL Array Int Float
v2  

-- | Similar to 'overSoXSynthN2', but uses a sound file to obtain the information analogous to list 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]). The first 'Float' argument from
-- the range [0.01..1.0] is used as a maximum amplitude for Overtones. If it is set to 1.0 the overTones amplitudes are just maximum ones,
-- otherwise they are multiplied by the parameter and this results in their becoming more silent ones.
-- The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" and \"end.wav\" files in the current directory, because they can be overwritten.
-- 
-- For better usage the 'FilePath' should be a filepath for the .wav file.
-- The second 'String' argument is used to define signs of the harmonics coefficients in the generated sounds.
overSoXSynthNGen2 :: FilePath -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2 :: String -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2 String
file Int
m = String -> Int -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E String
file Int
m Int
12
{-# INLINE overSoXSynthNGen2 #-}
  
-- | Similar to 'overSoXSynthNGen2', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained
-- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'overSoXSynthNGen2'. To obtain
-- its modifications, please, use 2, 3, 4, 6, or 9.
overSoXSynthNGen2E :: FilePath -> Int -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E :: String -> Int -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E String
file Int
m Int
ku Float
ampL Float
time3 String
zs String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Array Int Float
-> String
-> IO ()
nGen2E4Gi Int
n String
file Int
m Int
ku Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3) String
tts

-- | Generalized version of the 'overSoXSynthNGen2E' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen2EPar :: FilePath -> Params -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2EPar :: String -> Params -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2EPar String
file Params
params Float
ampL Float
time3 String
zs String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String -> Params -> Float -> Array Int Float -> String -> IO ()
nGen2E4GiPar Int
n String
file Params
params Float
ampL (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3) String
tts  

-- | Variant of the 'overSoXSynthNGen2E4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition.
overSoXSynthNGen2E4GS :: FilePath -> Int -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E4GS :: String -> Int -> Int -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E4GS String
file Int
m Int
ku Float
ampL Float
time3 String
zs String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Array Int Float
-> String
-> IO ()
nGen2E4Gi Int
n String
file Int
m Int
ku Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts

-- | Generalized version of the 'overSoXSynthNGen2E4GS' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen2E4GSPar :: FilePath -> Params -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E4GSPar :: String -> Params -> Float -> Float -> String -> String -> IO ()
overSoXSynthNGen2E4GSPar String
file Params
params Float
ampL Float
time3 String
zs String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String -> Params -> Float -> Array Int Float -> String -> IO ()
nGen2E4GiPar Int
n String
file Params
params Float
ampL (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts

-- | Note that the last two '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 third 'Int' parameter defines that @n@.
nGen2E4Gi :: Int -> FilePath -> Int -> Int -> Float -> Durations -> String -> IO ()
nGen2E4Gi :: Int
-> String
-> Int
-> Int
-> Float
-> Array Int Float
-> String
-> IO ()
nGen2E4Gi Int
n String
file Int
m Int
ku Float
ampL Array Int Float
v2 String
tts = do
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Int -> Int -> [Float] -> [Float]
liftInEnkuV Int
m Int
ku ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> ([Int] -> [Int]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Bool) -> [Int] -> [Int]
forall a. (a -> Bool) -> [a] -> [a]
filter (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= (Int
11440::Int)) ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL Array Int Float
v2 String
tts [Float]
vecB
  IO ()
endFromResult 

-- | Generalized version of the 'nGen2E4Gi' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
nGen2E4GiPar :: Int -> FilePath -> Params -> Float -> Durations -> String -> IO ()
nGen2E4GiPar :: Int
-> String -> Params -> Float -> Array Int Float -> String -> IO ()
nGen2E4GiPar Int
n String
file Params
params Float
ampL Array Int Float
v2 String
tts = do
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Params -> [Float] -> [Float]
liftInParamsV Params
params ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int -> Float -> Array Int Float -> String -> [Float] -> IO ()
overSoXSynthN24G Int
n Float
ampL Array Int Float
v2 String
tts [Float]
vecB
  IO ()
endFromResult   
       
-- | 4G genaralized version of the 'overSoXSynthNGen2E' where you provide your own 'Durations'.
overSoXSynthNGen2E4G :: FilePath -> Int -> Int -> Float -> Durations -> String -> IO ()
overSoXSynthNGen2E4G :: String -> Int -> Int -> Float -> Array Int Float -> String -> IO ()
overSoXSynthNGen2E4G String
file Int
m Int
ku Float
ampL Array Int Float
v2 String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Array Int Float
-> String
-> IO ()
nGen2E4Gi Int
n String
file Int
m Int
ku Float
ampL Array Int Float
v2 String
tts

-- | Generalized version of the 'overSoXSynthNGen2E4G' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen2E4GPar :: FilePath -> Params -> Float -> Durations -> String -> IO ()
overSoXSynthNGen2E4GPar :: String -> Params -> Float -> Array Int Float -> String -> IO ()
overSoXSynthNGen2E4GPar String
file Params
params Float
ampL Array Int Float
v2 String
tts = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String -> Params -> Float -> Array Int Float -> String -> IO ()
nGen2E4GiPar Int
n String
file Params
params Float
ampL Array Int Float
v2 String
tts  

-- | Similar to 'overSoXSynthN2', but uses a sound file to obtain the information analogous to list 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]). The first 'Float' argument from
-- the range [0.01..1.0] is used as a maximum amplitude for overtones. If it is set to 1.0 the overTones amplitudes are just maximum ones,
-- otherwise they are multiplied by the parameter and this results in their becoming more silent ones.
-- The second 'Float' argument is a basic sound duration. The default one is 0.5 (second). Please, check before executing
-- whether there is no \"x.wav\", \"test*\", \"result*\" and \"end.wav\" files in the current directory, because they can be overwritten.
-- 
-- For better usage the 'FilePath' should be a filepath for the .wav file.
-- The second 'String' argument is used to define signs of the harmonics coefficients in the generated sounds.
-- The third 'String' argument is used to define the intervals for the notes if any.
-- The third 'Float' parameter basically is used to define in how many times the volume for the second lower note is less than the volume of
-- the main note. If it is rather great, it can signal that the volume for the second note overTones are greater than for the main note obetones.
-- The last one is experimental feature.
overSoXSynthNGen3 :: FilePath -> Int -> Float -> Float -> Float -> String -> String -> String -> IO ()
overSoXSynthNGen3 :: String
-> Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3 String
file Int
m = String
-> Int
-> Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3E String
file Int
m Int
12
{-# INLINE overSoXSynthNGen3 #-}
  
-- | Similar to 'overSoXSynthNGen3', but uses additional second 'Int' parameter. It defines, to which n-th elements set (see 'nkyT') belongs the obtained
-- higher notes in the intervals. If that parameter equals to 12, then the function is practically equivalent to 'overSoXSynthNGen3'. To obtain
-- its modifications, please, use 2, 3, 4, 6, or 9.
overSoXSynthNGen3E :: FilePath -> Int -> Int -> Float -> Float -> Float -> String -> String -> String -> IO ()
overSoXSynthNGen3E :: String
-> Int
-> Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3E String
file Int
m Int
ku Float
ampL Float
time3 Float
dAmpl String
zs String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3) String
tts String
vs

-- | Generalized version of the 'overSoXSynthNGen3E' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3EPar :: FilePath -> Params -> Float -> Float -> Float -> String -> String -> String -> IO ()
overSoXSynthNGen3EPar :: String
-> Params
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3EPar String
file Params
params Float
ampL Float
time3 Float
dAmpl String
zs String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4GiPar Int
n String
file Params
params Float
ampL Float
dAmpl (Int -> String -> Float -> Array Int Float
str2DurationsDef Int
n String
zs Float
time3) String
tts String
vs  

-- | Variant of the 'overSoXSynthNGen3E4G' where 'Durations' are obtained from the 'String' using 'str2Durations' function. Helps to create a speech-like 
-- composition. 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@.
overSoXSynthNGen3E4GS :: FilePath -> Int -> Int -> Float -> Float -> Float -> String -> String -> String -> IO ()
overSoXSynthNGen3E4GS :: String
-> Int
-> Int
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3E4GS String
file Int
m Int
ku Float
ampL Float
time3 Float
dAmpl String
zs String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts String
vs 

-- | Generalized version of the 'overSoXSynthNGen3E4GS' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E4GSPar :: FilePath -> Params -> Float -> Float -> Float -> String -> String -> String -> IO ()
overSoXSynthNGen3E4GSPar :: String
-> Params
-> Float
-> Float
-> Float
-> String
-> String
-> String
-> IO ()
overSoXSynthNGen3E4GSPar String
file Params
params Float
ampL Float
time3 Float
dAmpl String
zs String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4GiPar Int
n String
file Params
params Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts String
vs    

-- | Note that the last two '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 third 'Int' parameter defines that @n@.
nGen3E4Gi :: Int -> FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> String -> IO ()
nGen3E4Gi :: Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs = do 
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Int -> Int -> [Float] -> [Float]
liftInEnkuV Int
m Int
ku ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> ([Int] -> [Int]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Bool) -> [Int] -> [Int]
forall a. (a -> Bool) -> [a] -> [a]
filter (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= (Int
11440::Int)) ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs [Float]
vecB
  IO ()
endFromResult  

-- | Generalized version of the 'nGen3E4Gi' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
nGen3E4GiPar :: Int -> FilePath -> Params -> Float -> Float -> Durations -> String -> String -> IO ()
nGen3E4GiPar :: Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4GiPar Int
n String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs = do 
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Params -> [Float] -> [Float]
liftInParamsV Params
params ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> [Float]
-> IO ()
overSoXSynthN34G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs [Float]
vecB
  IO ()
endFromResult    

-- | Note that the last two '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 third 'Int' parameter defines that @n@.
nGen3E5Gi :: Int -> FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> Intervals -> IO ()
nGen3E5Gi :: Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 = do 
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Int -> Int -> [Float] -> [Float]
liftInEnkuV Int
m Int
ku ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> ([Int] -> [Int]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Bool) -> [Int] -> [Int]
forall a. (a -> Bool) -> [a] -> [a]
filter (Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= (Int
11440::Int)) ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 [Float]
vecB
  IO ()
endFromResult  
    
-- | Generalized version of the 'nGen3E5Gi' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
nGen3E5GiPar :: Int -> FilePath -> Params -> Float -> Float -> Durations -> String -> Intervals -> IO ()
nGen3E5GiPar :: Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5GiPar Int
n String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 = do 
  [Int]
vecA <- String -> Int -> IO [Int]
freqsFromFile String
file Int
n
  let vecB :: [Float]
vecB = Params -> [Float] -> [Float]
liftInParamsV Params
params ([Float] -> [Float]) -> ([Int] -> [Float]) -> [Int] -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> Float) -> [Int] -> [Float]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Float
forall a b. (Integral a, Num b) => a -> b
fromIntegral ([Int] -> [Float]) -> [Int] -> [Float]
forall a b. (a -> b) -> a -> b
$ [Int]
vecA
  Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> [Float]
-> IO ()
overSoXSynthN35G Int
n Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 [Float]
vecB
  IO ()
endFromResult      

-- | 4G generalized function for 'overSoXSynthNGen3E' where you provide your own 'Durations'. 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@.
overSoXSynthNGen3E4G :: FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> String -> IO ()
overSoXSynthNGen3E4G :: String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
overSoXSynthNGen3E4G String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs

-- | Generalized version of the 'overSoXSynthNGen3E4G' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E4GPar :: FilePath -> Params -> Float -> Float -> Durations -> String -> String -> IO ()
overSoXSynthNGen3E4GPar :: String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
overSoXSynthNGen3E4GPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> String
-> IO ()
nGen3E4GiPar Int
n String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts String
vs  

-- | 5G generalized function for 'overSoXSynthNGen3E4G' where you provide your own 'Intervals'. 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@.
overSoXSynthNGen3E5G :: FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> Intervals -> IO ()
overSoXSynthNGen3E5G :: String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
overSoXSynthNGen3E5G String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 

-- | Generalized version of the 'overSoXSynthNGen3E5G' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E5GPar :: FilePath -> Params -> Float -> Float -> Durations -> String -> Intervals -> IO ()
overSoXSynthNGen3E5GPar :: String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
overSoXSynthNGen3E5GPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5GiPar Int
n String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3    

-- | Variant of the 'overSoXSynthNGen3E5G' where 'Intervals' are obtained from the basic 'Intervals' with the length no more than 29 and a Ukrainian text 
-- specified as the last 'String' argument so that you can produce 'Intervals' of the arbitrary length. For more information, please, refer to 
-- 'intervalsFromStringG' and 'strToIntG'. 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@.
overSoXSynthNGen3E5GS :: FilePath -> Int -> Int -> Float -> Float -> Float -> String -> String -> Intervals -> String -> IO ()
overSoXSynthNGen3E5GS :: String
-> Int
-> Int
-> Float
-> Float
-> Float
-> String
-> String
-> Array Int Int
-> String
-> IO ()
overSoXSynthNGen3E5GS String
file Int
m Int
ku Float
ampL Float
time3 Float
dAmpl String
zs String
tts Array Int Int
v3 String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5Gi Int
n String
file Int
m Int
ku Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts (Array Int Int -> String -> Array Int Int
intervalsFromStringG Array Int Int
v3 String
vs)

-- | Generalized version of the 'overSoXSynthNGen3E5GS' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E5GSPar :: FilePath -> Params -> Float -> Float -> Float -> String -> String -> Intervals -> String -> IO ()
overSoXSynthNGen3E5GSPar :: String
-> Params
-> Float
-> Float
-> Float
-> String
-> String
-> Array Int Int
-> String
-> IO ()
overSoXSynthNGen3E5GSPar String
file Params
params Float
ampL Float
time3 Float
dAmpl String
zs String
tts Array Int Int
v3 String
vs = do
  Int
n <- String -> IO Int
duration1000 String
file
  Int
-> String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
nGen3E5GiPar Int
n String
file Params
params Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
zs Float
time3) String
tts (Array Int Int -> String -> Array Int Int
intervalsFromStringG Array Int Int
v3 String
vs)  
  
-- | 6G generalized function for 'overSoXSynthNGen3E5G' 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@.
overSoXSynthNGen3E6G :: FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> Intervals -> Strengths -> Float -> IO ()
overSoXSynthNGen3E6G :: String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6G String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 Array Int Float
v6 Float
limV = 
 String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
overSoXSynthNGen3E5G String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 IO () -> IO () -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Array Int Float -> String -> String -> Float -> IO ()
apply6G2 Array Int Float
v6 String
"221w" String
"result" Float
limV IO () -> IO () -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> IO ()
endFromResult

-- | Generalized version of the 'overSoXSynthNGen3E6G' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E6GPar :: FilePath -> Params -> Float -> Float -> Durations -> String -> Intervals -> Strengths -> Float -> IO ()
overSoXSynthNGen3E6GPar :: String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6GPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 Array Int Float
v6 Float
limV = 
 String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> IO ()
overSoXSynthNGen3E5GPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 IO () -> IO () -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Array Int Float -> String -> String -> Float -> IO ()
apply6G2 Array Int Float
v6 String
"221w" String
"result" Float
limV IO () -> IO () -> IO ()
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> IO ()
endFromResult 

-- | A variant of 'overSoXSynthNGen3E6G' 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@.
overSoXSynthNGen3E6GS :: FilePath -> Int -> Int -> Float -> Float -> Durations -> String -> Intervals -> String -> Float -> IO ()
overSoXSynthNGen3E6GS :: String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> String
-> Float
-> IO ()
overSoXSynthNGen3E6GS String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 String
xxs Float
limV = String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6G String
file Int
m Int
ku Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 (String -> Array Int Float
str2Volume String
xxs) Float
limV
{-# INLINE overSoXSynthNGen3E6GS #-}

-- | Generalized version of the 'overSoXSynthNGen3E6GS' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E6GSPar :: FilePath -> Params -> Float -> Float -> Durations -> String -> Intervals -> String -> Float -> IO ()
overSoXSynthNGen3E6GSPar :: String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> String
-> Float
-> IO ()
overSoXSynthNGen3E6GSPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 String
xxs Float
limV = String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6GPar String
file Params
params Float
ampL Float
dAmpl Array Int Float
v2 String
tts Array Int Int
v3 (String -> Array Int Float
str2Volume String
xxs) Float
limV
{-# INLINE overSoXSynthNGen3E6GSPar #-}

-- | A variant of 'overSoXSynthNGen3E6GS' where 'Strengths' and 'Durations' are obtained from the same Ukrainian text specified as 
-- the last 'String' argument. The third 'Float' 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 -> Float -> Float -> Float -> String -> Intervals -> String -> Float -> IO ()
overSoXSynthNGen3E6GSu :: String
-> Int
-> Int
-> Float
-> Float
-> Float
-> String
-> Array Int Int
-> String
-> Float
-> IO ()
overSoXSynthNGen3E6GSu String
file Int
m Int
ku Float
ampL Float
dAmpl Float
time3 String
tts Array Int Int
v3 String
xxs = String
-> Int
-> Int
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6G String
file Int
m Int
ku Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
xxs Float
time3) String
tts Array Int Int
v3 (String -> Array Int Float
str2Volume String
xxs)
{-# INLINE overSoXSynthNGen3E6GSu #-}

-- | Generalized version of the 'overSoXSynthNGen3E6GSu' where instead of lifting with 'liftInEnkuV' 'liftInParamsV' is used. It allows e. g. to 
-- use some tonality. For more information, please, refer to 'filterInParams'.
overSoXSynthNGen3E6GSuPar :: FilePath -> Params -> Float -> Float -> Float -> String -> Intervals -> String -> Float -> IO ()
overSoXSynthNGen3E6GSuPar :: String
-> Params
-> Float
-> Float
-> Float
-> String
-> Array Int Int
-> String
-> Float
-> IO ()
overSoXSynthNGen3E6GSuPar String
file Params
params Float
ampL Float
dAmpl Float
time3 String
tts Array Int Int
v3 String
xxs = String
-> Params
-> Float
-> Float
-> Array Int Float
-> String
-> Array Int Int
-> Array Int Float
-> Float
-> IO ()
overSoXSynthNGen3E6GPar String
file Params
params Float
ampL Float
dAmpl (String -> Float -> Array Int Float
str2Durations String
xxs Float
time3) String
tts Array Int Int
v3 (String -> Array Int Float
str2Volume String
xxs)
{-# INLINE overSoXSynthNGen3E6GSuPar #-}