Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : olexandr543@yahoo.com
A program and a library to create experimental music from a mono audio and a Ukrainian text.
Synopsis
- dobutokO2 :: IO ()
- recAndProcess :: FilePath -> Int -> IO String
- dobutokO2H7 :: Bool -> String -> FilePath -> IO ()
- dobutokO2H9 :: Bool -> String -> FilePath -> IO ()
- testSoundGen2G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> IO ()
- soundGen3G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO ()
- soundGen3G_O :: Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (Double -> OvertonesO) -> IO ()
- h1 :: (Double -> OvertonesO) -> (Double, Double) -> Int -> IO ()
- h2 :: OvertonesO -> (Double, Double) -> Int -> Int -> Double -> IO ()
Basic functions for the executable
Function that actually makes processing in the dobutokO2
executable. Please, check before executing
whether there is no "x.wav", "test*", "result*" and "end*" files in the current directory, because they can be overwritten.
recAndProcess :: FilePath -> Int -> IO String Source #
Function records and processes the sound data needed to generate the "end.wav" file in the dobutokO2
function. Please, check before executing
whether there is no "x.wav" file in the current directory, because it can be overwritten.
dobutokO2H7 :: Bool -> String -> FilePath -> IO () Source #
Used to obtain one multiline specially formatted textual input and do the full processment for the sound.
The function generates overtones using additional String
and allows maximum control over the parameters.
Besides, all the needed information it obtains from the singular formatted input, which can be ended
with a keyboard keys combination that means an end of input (e. g. for Unices, that is probably Ctrl + D).
'@' are separators for the input parts for their respective parts. For more information about the
format of the single input, see:
'https://drive.google.com/open?id=10Z_GRZR4TKoL5KXfqPm-t-4humuHN0O4'
The file is also provided with the package as text.dat.txt. The last two or three inputs (an input just here means a textual input between two '@') can be omitted, the program will work also but with less control for the user possible.
Library functions
testSoundGen2G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> IO () Source #
Tesing variant of the soundGen3G
with predefined three last functional arguments.
soundGen3G :: FilePath -> (Double -> OvertonesO) -> 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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (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 -> (Double,Double)
to define the first element to which are applied gAdds
and gRems
and the way to obtain a one tuple from the Vector
of them (probably, each
element of which differs from the result). 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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (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) = V.imap (\j r -> (V.unsafeIndex notes (snd r),
case fst r of
0 -> (\vv -> f0 vv)
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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> (Double, Double)) -> (Double -> OvertonesO) -> 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).