Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : olexandr543@yahoo.com
Helps to create experimental music from a file (or its part). Uses SoX inside. Is more complicated than dobutokO2 and uses its functionality.
Synopsis
- testSoundGen2G :: FilePath -> Double -> String -> IO ()
- soundGen3G :: FilePath -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O :: Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2 :: ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2G :: ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Int -> Int -> Double -> FilePath -> Double -> String -> IO ()
- testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> Double -> String -> IO ()
- soundGen3GMN :: Int64 -> Int64 -> FilePath -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_OMN :: Int64 -> Int64 -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2MN :: Int64 -> Int64 -> ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2GMN :: Int64 -> Int64 -> ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Int -> Int -> Double -> FilePath -> Double -> String -> IO ()
- h1 :: (Double -> OvertonesO) -> (Double, Double) -> IO ()
- h2 :: OvertonesO -> (Double, Double) -> Int -> Int -> Double -> IO ()
- soundGen3G_OPar :: Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2Par :: ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2GPar :: ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Params -> Double -> FilePath -> Double -> String -> IO ()
- soundGen3G_OMNPar :: Int64 -> Int64 -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2MNPar :: Int64 -> Int64 -> ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O2GMNPar :: Int64 -> Int64 -> ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Params -> Double -> FilePath -> Double -> String -> IO ()
- h2Params :: OvertonesO -> (Double, Double) -> Params -> Double -> IO ()
Another way to generalize the simple functions of dobutokO2 package
testSoundGen2G :: FilePath -> Double -> String -> IO () Source #
Tesing variant of the soundGen3G
with predefined three last functional arguments.
soundGen3G :: FilePath -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Uses several functions as parameters.
soundGen3G_O :: Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Uses several functions as parameters. Unlike the soundGen3G
, the last two
functions as arguments for their first argument have not (Double
,Double
), but Vector
of them so are applied to OvertonesO
. To
provide a generalized functionality, it uses two additional functions freq0 :: Int -> OvertonesO
and proj :: OvertonesO -> OvertonesO
to define the first element to which are applied gAdds
and gRems
and the way to obtain a internal OvertonesO
.
Besides, it lifts notes into specified with the first two Int
arguments enku (see liftInEnku
).
The Double
argument is a average duration of the sounds.
soundGen3G_O2 :: ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Is a generalized version of the soundGen3G_O
, instead of predefined conversion function
inside, it uses a user-defined one.
soundGen3G_O = soundGen3G_O2
with the first argument
conversionFII (f0,fA1,fR1) = imap (\j r -> (unsafeIndex notes (snd r),
case fst r of
0 -> f0
1 -> fA1 j
2 -> fA1 j
3 -> fA1 j
4 -> fA1 j
_ -> fR1 j))
soundGen3G_O2G :: ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Int -> Int -> Double -> FilePath -> Double -> String -> IO () Source #
Generates a sequence of sounds with changing timbre. Is a generalized version of the soundGen3G_O2
, but for the conversion function conversionFII as its
tuple first argument uses not the tuple of the three functions, but a tuple of three Vector
of functions of the respective types, that allows to
specify more comlex behaviour and different variants inside the function itself, not its inner function parts. Vector
as a data type is used
instead of more common list because it has similar functionality and besides provides easier and quicker access to its elements. So these are the
following vectors of functions: vf :: Vector (Double -> OvertonesO)
(no changing a function for timbre generation),
vfA :: Vector (Int -> Double -> OvertonesO)
(for "adding" overtones to the function for timbre generation),
and vfR :: Vector (Int -> Double -> OvertonesO
(for "removing" overtones from the function for timbre generation).
With MN control
testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> Double -> String -> IO () Source #
Tesing variant of the soundGen3GMN
with predefined last functional arguments.
soundGen3GMN :: Int64 -> Int64 -> FilePath -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Uses several functions as parameters. To specify how many sounds the resulting files
will provide, you use first two Int64
arguments, the first of which is a number of dropped elements for readFileDoubles
and the second one
is a number of produced sounds (and, respectively, number of taken elements).
soundGen3G_OMN :: Int64 -> Int64 -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Uses several functions as parameters. To specify how many sounds the resulting files
will provide, you use first two Int64
arguments, the first of which is a number of dropped elements for readFileDoubles
and the second one
is a number of produced sounds (and, respectively, number of taken elements).
soundGen3G_O2MN :: Int64 -> Int64 -> ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Int -> Int -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generates a sequence of sounds with changing timbre. Is a generalized version of the soundGen3G_O2
. To specify how many sounds the resulting files
will provide, you use first two Int64
arguments, the first of which is a number of dropped elements for readFileDoubles
and the second one
is a number of produced sounds (and, respectively, number of taken elements).
soundGen3G_O2GMN :: Int64 -> Int64 -> ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Int -> Int -> Double -> FilePath -> Double -> String -> IO () Source #
Generates a sequence of sounds with changing timbre. Is a generalized version of the soundGen3G_O2G
. To specify how many sounds the resulting files
will provide, you use first two Int64
arguments, the first of which is a number of dropped elements for readFileDoubles
and the second one
is a number of produced sounds (and, respectively, number of taken elements).
h1 :: (Double -> OvertonesO) -> (Double, Double) -> IO () Source #
For the given parameters generates a single sound with overtones or pause depending on the sign of the second element in the tuple of Double
:
if it is greater than zero then the sound is generated, if less -- the silence (pause), if it is equal to zero then it prints an informational message
about a non-standard situation.
h2 :: OvertonesO -> (Double, Double) -> Int -> Int -> Double -> IO () Source #
For the given parameters generates a single sound with overtones or pause depending on the sign of the second element in the tuple of Double
:
if it is greater than zero then the sound is generated, if less -- the silence (pause), if it is equal to zero then it prints an informational message
about a non-standard situation. Unlike the h1
function, it lifts the frequency into the enku specified by the Int
arguments (see liftInEnku
).
With Params control
soundGen3G_OPar :: Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generalized version of the soundGen3G_O
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
soundGen3G_O2Par :: ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generalized version of the soundGen3G_O2
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
soundGen3G_O2GPar :: ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Params -> Double -> FilePath -> Double -> String -> IO () Source #
Generalized version of the soundGen3G_O2G
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
soundGen3G_OMNPar :: Int64 -> Int64 -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generalized version of the soundGen3G_OMN
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
soundGen3G_O2MNPar :: Int64 -> Int64 -> ((Double -> OvertonesO, Int -> Double -> OvertonesO, Int -> Double -> OvertonesO) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Params -> Double -> FilePath -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () Source #
Generalized version of the soundGen3G_O2MN
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
soundGen3G_O2GMNPar :: Int64 -> Int64 -> ((Vector (Double -> OvertonesO), Vector (Int -> Double -> OvertonesO), Vector (Int -> Double -> OvertonesO)) -> Vector (Int, Int) -> Vector (Double, Double -> OvertonesO)) -> Vector (Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Vector (Int -> Double -> OvertonesO) -> Params -> Double -> FilePath -> Double -> String -> IO () Source #
Generalized version of the soundGen3G_O2GMN
where liftInParams
is used instead of lifting with the liftInEnku
. This allows e. g. to
use some tonality. For more information, please, refer to filterInParams
.
h2Params :: OvertonesO -> (Double, Double) -> Params -> Double -> IO () Source #
For the given parameters generates a single sound with overtones or pause depending on the sign of the second element in a tuple of Double
:
if it is greater than zero then the sound is generated, if less -- the silence (pause), if it is equal to zero then it prints an informational message
about a non-standard situation. Unlike the h1
function, it lifts into the requency specified by the Params
argument .