algorithmic-composition-basic-0.1.1.0: Helps to create experimental music from a file (or its part) and a Ukrainian text.
Copyright(c) OleksandrZhabenko 2020-2021
LicenseMIT
Maintainerolexandr543@yahoo.com
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

Composition.Sound.Functional

Description

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.

Synopsis

Use additional function as a parameter

overSoXSynth2FDN :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO () Source #

Similar to overSoXSynth2DN but instead of overTones function, it uses volatile function f::Float -> [(Float, Float)] with somewhat sophisticated mechanism to normalize the resulting list elements (Float, Float). 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 convertToProperUkrainianS to the String parameter must not be []. 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 overSoXSynth2FDN.

overSoXSynth2FDN_B :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> IO () Source #

Similar to overSoXSynth2DN but instead of overTones function, it uses volatile function f::Float -> [(Float, Float)] with somewhat sophisticated mechanism to normalize the resulting list elements (Float, Float). 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 convertToProperUkrainianS to the String parameter must not be []. The function also tries to perform filtering to avoid possible beating. The third Float 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 overSoXSynth2FDN_B.

Just simple function application

With additional filtering

Use additional function and Ukrainian texts and generates melody

overSoXSynthGen2FDN :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> 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 Float parameter is a basic sound duration, it defines tempo of the melody in general.

overSoXSynthGen2FDN_B :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> Float -> 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 Float 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].

1G generalized functions with dB volume overtones adjustments

overSoXSynth2FDN1G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> IO () Source #

Array Int of Float is a vector of dB volume adjustments for the corresponding harmonices (overtones).

overSoXSynth2FDN_B1G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> Array Int Float -> IO () Source #

Array Int of Float is a vector of dB volume adjustments for the corresponding harmonices (overtones).

overSoXSynth2FDN_S1G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> IO () Source #

Similar to overSoXSynth2FDN with the additional volume adjustment in dB for overtones given by Array Int of Float, but it does not make any normalizing transformations. To be used properly, it is needed that every second element in the tuple in the list 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 overSoXSynth2FDN_S.

overSoXSynth2FDN_Sf1G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf with a possibility to adjust volume using adjust_dbVol. Array Int of Float is used to specify adjustments in dB. For more information, please, refer to adjust_dbVol.

overSoXSynth2FDN_Sf31G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> Array Int Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf3 function with a possibility to adjust volume using adjust_dBVol. Array Int of Float specifies the needed adjustments in dB.

2G generalized functions with additional sound quality specifying

overSoXSynth2FDN2G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> String -> IO () Source #

Similar to overSoXSynth2FDN1G, but additionally allows to specify by the second String argument a quality changes to the generated files (please, see soxBasicParams). Since version 0.36.0.0 the function supports generation of the pauses.

overSoXSynth2FDN_B2G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> Array Int Float -> String -> IO () Source #

Generalized version of the overSoXSynth2FDN_B1G with a possibility to specify sound quality parameters using additional second String argument. For more information, please, refer to soxBasicParams.

overSoXSynth2FDN_S2G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> String -> IO () Source #

Generalized version of the overSoXSynth2FDN_S1G with a possibility to specify sound quality parameters using the second String argument. For more information, please, refer to soxBasicParams.

overSoXSynth2FDN_Sf2G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> String -> Array Int Float -> String -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf1G with a possibility to specify sound quality using the second String argument. For more information, please, refer to soxBasicParams.

overSoXSynth2FDN_Sf32G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> Array Int Float -> String -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf31G with a possibility to specify sound quality using the second String parameter. For more information, please, refer to soxBasicParams.

2G generalized functions for melody producing

overSoXSynthGen2FDN_SG2G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> String -> IO ()) -> String -> IO () Source #

Generalized variant of the overSoXSynthGen2FDN_SG with a possibility to specify with the third String argument sound quality parameters. Besides, the second from the end argument (a function) needs to be one more argument -- just also String. For more information, please, refer to soxBasicParams. 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.

overSoXSynthGen2FDN_Sf3G2G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> String -> IO ()) -> String -> IO () Source #

Generalized variant of the ovorSoXSynthGen2FDN_Sf3G with a possibility to specify sound quality with the third String argument. Besides, the second from the end argument (a function) needs to be one more argument -- just also String. For more information, please, refer to soxBasicParams. 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.

Generalized functions with several functional parameters

overSoXSynthGen2FDN_SG :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> IO () Source #

Similar to overSoXSynthGen2FDN, but instead of overSoXSynth2FDN uses overSoXSynth2FDN_S function. Note that the first 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.

overSoXSynthGen2FDN_Sf3G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float, Float) -> Int -> String -> IO ()) -> IO () Source #

Similar to overSoXSynthGen2FDN_S, but instead of overSoXSynth2FDN_S uses overSoXSynth2FDN_Sf3 function. 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.

1G generalized function with db volume overtones adjustments and several functional parameters

soundGenF31G :: [Float -> Float] -> [Float] -> [Int] -> (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Array Int Float -> IO () Source #

Can generate multiple notes with their respective overtones that are played simultaneously (e. g. it can be just one note with overtones, an interval with overtones, an accord with overtones etc.). This allows to get a rather complex or even complicated behaviour to obtain expressive and rich sound. It uses volume adjustment in dB given by the second [Float] for the overtones.

New functions for the version 0.36.0.0

overSoXSynthGen2FDN4G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Durations -> String -> IO () Source #

Generalized variant of the overSoXSynthGen2FDN with your own specified Durations for the sounds and pauses. Instead of using a Ukrainian text to specify a durations for the sounds (and a rhythm respectively) you provide your own rhythm as Durations. Positive values correspond to durations of the sounds generated and negative values -- to durations of the pauses respectively.

overSoXSynthGen2FDN_SG4G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Durations -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> IO () Source #

Generalized version of the overSoXSynthGen2FDN_SG where instead of using a Ukrainian text to specify a durations for the sounds (and a rhythm respectively) you provide your own rhythm as Durations. Positive values correspond to durations of the sounds generated and negative values -- to durations of the pauses respectively. Please, use a function h :: ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) such that it can create for the given values accorgingly sounds and pauses. Otherwise, please, check whether at least it can deal with such arguments without errors. 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.

overSoXSynthGen2FDN_SG4GS :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> IO () Source #

A variant of the overSoXSynthGen2FDN_SG4G where instead of providing your own durations as Durations you use a Ukrainian text and a function treats each symbol in it as a duration parameter with its sign. Positive values correspond to durations of the sounds generated and negative values -- to durations of the pauses respectively. Please, use a function h :: ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) such that it can create for the given values accorgingly sounds and pauses. Otherwise, please, check whether at least it can deal with such arguments without errors.

New generalized 5G functions that works with Intervals

overSoXSynth2FDN5G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> Array Int Float -> String -> IO () Source #

Similar to overSoXSynth2FDN2G, but additionally allows to specify by the Intervals argument to specify your own intervals. For more information, please, refer to intervalsFromStringG.

overSoXSynth2FDN_B5G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> Array Int Float -> String -> IO () Source #

Generalized version of the overSoXSynth2FDN_B2G with a possibility to specify your own Intervals. For more information, please, refer to intervalsFromStringG.

overSoXSynth2FDN_S5G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> Array Int Float -> String -> IO () Source #

Generalized version of the overSoXSynth2FDN_S2G where you specify your own Intervals. For more information, please, refer to intervalsFromStringG.

overSoXSynth2FDN_Sf35G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> Array Int Float -> String -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf31G with a possibility to specify sound quality using the second String parameter. For more information, please, refer to soxBasicParams.

New generalized 6G functions that works with Strengths

overSoXSynth2FDN6G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> Array Int Float -> String -> Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN5G with afterwards apply6Gf usage.

overSoXSynth2FDN6GS :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () Source #

A variant of the overSoXSynth2FDN6G where volume adjustment is obtained from a Ukrainian text.

overSoXSynth2FDN_B6G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> Array Int Float -> String -> Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN_B5G with afterwards apply6G usage.

overSoXSynth2FDN_B6GS :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () Source #

A variant of the overSoXSynth2FDN_B6G where volume adjustment is obtained from a Ukrainian text.

overSoXSynth2FDN_S6G :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> Array Int Float -> String -> Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN_S5G with afterwards apply6G usage. Arguments for the latter is the three last function arguments.

overSoXSynth2FDN_S6GS :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () Source #

A variant of the overSoXSynth2FDN_S6G where volume adjustment is obtained from a Ukrainian text.

overSoXSynth2FDN_Sf36G :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> Array Int Float -> String -> Float -> IO () Source #

Generalized variant of the overSoXSynth2FDN_Sf35G with afterwards apply6G usage.

overSoXSynth2FDN_Sf36GS :: (Float -> OvertonesO) -> (Float, Float, Float) -> Int -> Intervals -> String -> Array Int Float -> String -> String -> IO () Source #

A variant of the overSoXSynth2FDN_Sf36G where volume adjustment is obtained from a Ukrainian text.

overSoXSynthGen2FDN_SG6G :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Durations -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> Strengths -> Float -> IO () Source #

6G generalized variant of the overSoXSynthGen2FDN_SG4G with volume adjustments given by 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.

overSoXSynthGen2FDN_SG6GS :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> String -> Float -> IO () Source #

A variant of the overSoXSynthGen2FDN_SG6G where Strengths are obtained from a Ukrainian text and str2Volume.

overSoXSynthGen2FDN_SG6GSu :: FilePath -> Int -> Int -> (Float -> OvertonesO) -> Float -> String -> String -> ((Float -> OvertonesO) -> (Float, Float) -> Int -> String -> IO ()) -> Float -> IO () Source #

A variant of the overSoXSynthGen2FDN_SG6GS where Strengths are obtained from the same Ukrainian text as also Durations so the last String argument is omitted (it is equal to the first one). Helps to create a speech-like composition.

Auxiliar functions

help11 :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Array Int Float -> String -> Int -> Maybe Float -> Float -> IO () Source #

help13 :: (Float -> OvertonesO) -> (Float, Float) -> Int -> Array Int Float -> String -> Int -> Maybe Float -> Float -> IO () Source #