| Copyright | (c) OleksandrZhabenko 2020 |
|---|---|
| License | MIT |
| Stability | Experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
DobutokO.Sound.Functional
Contents
Description
Maintainer : olexandr543@yahoo.com
A program and a library to create experimental music from a mono audio and a Ukrainian text.
Synopsis
- oberSoXSynth2FDN :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO ()
- oberSoXSynth2FDN_B :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> Int -> String -> IO ()
- oberSoXSynth2FDN_S :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO ()
- oberSoXSynth2FDN_Sf :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO ()
- oberSoXSynth2FDN_Sf3 :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> Int -> String -> IO ()
- oberSoXSynthGen2FDN :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO ()
- oberSoXSynthGen2FDN_B :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> Double -> String -> String -> IO ()
- oberSoXSynthGen2FDN_S :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO ()
- oberSoXSynthGen2FDN_Sf :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO ()
- oberSoXSynthGen2FDN_Sf3 :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> Double -> String -> String -> IO ()
Use additional function as a parameter
oberSoXSynth2FDN :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO () Source #
Similar to oberSoXSynth2DN but instead of oberTones function, it uses volatile function f::Double -> Vector (Double, Double) with
somewhat sophisticated mechanism to normalize the resulting Vector elements (Double, Double). The last one is an experimental feature, so
it is your responsibility to provide a function so that it does not lead to clipping. In such a case, the result of application of the
convertToProperUkrainian to the String parameter must not be empty. Int argument is an index of the element to be taken from
the intervalsFromString applied to the String argument. To obtain compatible with versions prior to 0.20.0.0 behaviour, use for the Int 0.
Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function. But for a lot of functions this works well.
It is recommended to fully simplify the computation for "f" function before using it in the oberSoXSynth2FDN.
oberSoXSynth2FDN_B :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> Int -> String -> IO () Source #
Similar to oberSoXSynth2DN but instead of oberTones function, it uses volatile function f::Double -> Vector (Double, Double) with
somewhat sophisticated mechanism to normalize the resulting Vector elements (Double, Double). The last one is experimental feature, so
it is your responsibility to provide a function so that it does not lead to clipping. In such a case, the result of application of the
convertToProperUkrainian to the String parameter must not be empty. The function also tries to perform filtering to avoid possible beating.
The third Double parameter in the tuple is used as a limit for frequencies difference in Hz to be filtered out from the resulting sound. It is
considered to be from the range [0.1..10.0]. An Int parameter is used to define the needed interval. To obtain compatible with versions prior
to 0.20.0.0 behaviour, use for the Int 0.
Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function. But for a lot of functions this works well.
It is recommended to fully simplify the computation for "f" function before using it in the oberSoXSynth2FDN_B.
Just simple function application
oberSoXSynth2FDN_S :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO () Source #
Similar to oberSoXSynth2FDN but it does not make any normalizing transformations with the Vector argument. To be used properly, it is needed
that every second element in the tuple in the Vector argument must be in the range [-1.0..1.0] and every first element must be in between
16.351597831287414 and 7902.132820097988 (Hz). An Int parameter is used to define an interval. To obtain compatible with versions prior to
0.20.0.0 behaviour, use for the Int 0.
Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function. But for a lot of functions this works well.
It is recommended to fully simplify the computation for "f" function before using it in the oberSoXSynth2FDN_S.
With additional filtering
oberSoXSynth2FDN_Sf :: (Double -> Vector (Double, Double)) -> (Double, Double) -> Int -> String -> IO () Source #
Similar to oberSoXSynth2FDN_S but additionally the program filters out from the resulting Vector after "f" application values that are smaller
by absolute value than 0.001. An Int parameter is used to define an interval. To obtain compatible with versions prior to
0.20.0.0 behaviour, use for the Int 0.
Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function. But for a lot of functions this works well.
It is recommended to fully simplify the computation for "f" function before using it in the oberSoXSynth2FDN_Sf.
oberSoXSynth2FDN_Sf3 :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> Int -> String -> IO () Source #
Similar to oberSoXSynth2FDN_S but additionally the program filters out from the resulting Vector after "f" application values that are smaller
than the third Double parameter by an absolute value in the triple of Double's. An Int parameter is used to define an interval. To obtain compatible
with versions prior to 0.20.0.0 behaviour, use for the Int 0.
Be aware that the result can be rather unpredictable (the program can even obtain segmentation fault) for not very suitable function. But for a lot of functions this works well.
It is recommended to fully simplify the computation for "f" function before using it in the oberSoXSynth2FDN_Sf3.
Use additional function and Ukrainian texts and generates melody
oberSoXSynthGen2FDN :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO () Source #
Uses additional Int parameters. The first one is a number of enka (see nkyT). The second one defines, to which n-th elements set
(see nkyT) belongs the obtained higher notes in the intervals. To obtain reasonable results, please, use for the first one 2, 3, 4, 6, 9, or 12.
The first String parameter is used to produce durations of the notes. The second one is used to define intervals. A Double parameter is a
basic sound duration, it defines tempo of the melody in general.
oberSoXSynthGen2FDN_B :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> Double -> String -> String -> IO () Source #
Uses additional Int parameters. The first one is a number of enka (see nkyT). The second one defines, to which n-th elements set
(see nkyT) belongs the obtained higher notes in the intervals. To obtain reasonable results, please, use for the first one 2, 3, 4, 6, 9, or 12.
The first String parameter is used to produce durations of the notes. The second one is used to define intervals. The first Double parameter is a
basic sound duration, it defines tempo of the melody in general. The second one is a limit for frequencies difference in Hz to be filtered out from the
resulting sound. It is considered to be from the range [0.1..10.0].
oberSoXSynthGen2FDN_S :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO () Source #
Similar to oberSoXSynthGen2FDN, but instead of oberSoXSynth2FDN uses oberSoXSynth2FDN_S function.
oberSoXSynthGen2FDN_Sf :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> String -> String -> IO () Source #
Similar to oberSoXSynthGen2FDN_S, but instead of oberSoXSynth2FDN_S uses oberSoXSynth2FDN_Sf function.
oberSoXSynthGen2FDN_Sf3 :: FilePath -> Int -> Int -> (Double -> Vector (Double, Double)) -> Double -> Double -> String -> String -> IO () Source #
Similar to oberSoXSynthGen2FDN_S, but instead of oberSoXSynth2FDN_S uses oberSoXSynth2FDN_Sf3 function.