-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A program and a library to create experimental music from a mono audio and a Ukrainian text -- -- It can also create a timbre for the notes @package dobutokO2 @version 0.10.0.0 -- | Maintainer : olexandr543@yahoo.com -- -- A program and a library to create experimental music from a mono audio -- and a Ukrainian text. module DobutokO.Sound -- | For the given frequency of the note it generates a Vector of -- the tuples, each one of which contains the harmonics' frequency and -- amplitude. oberTones :: Double -> Vector (Double, Double) -- | 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*" and "end.wav" files in the current directory, because they -- can be overwritten. oberSoXSynth :: Double -> IO () -- | 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 Double argument from the -- range [0.01..1.0] is used as a maximum amplitude for obertones. If it -- is set to 1.0 the obertones amplitudes are just the maximum ones, -- otherwise they are multiplied by the parameter and this results in -- their becoming more silent ones. The second Double 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. oberSoXSynthN :: Int -> Double -> Double -> String -> Vector Double -> IO () -- | For the given frequency of the note and a Ukrainian text it generates -- a Vector of the tuples, each one of which contains the -- harmonics' frequency and amplitude. The String is used to -- produce the signs for harmonics coefficients. oberTones2 :: Double -> String -> Vector (Double, Double) -- | 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*" and "end.wav" files in the current directory, because they -- can be overwritten. The String argument is used to define signs -- of the harmonics coefficients for obertones. oberSoXSynth2 :: Double -> String -> IO () -- | 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 Double argument from the -- range [0.01..1.0] is used as a maximum amplitude for obertones. If it -- is set to 1.0 the obertones amplitudes are just the maximum ones, -- otherwise they are multiplied by the parameter and this results in -- their becoming more silent ones. The second Double 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. oberSoXSynthN2 :: Int -> Double -> Double -> String -> String -> Vector Double -> IO () -- | 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 Double argument from the -- range [0.01..1.0] is used as a maximum amplitude for obertones. If it -- is set to 1.0 the obertones amplitudes are just the maximum ones, -- otherwise they are multiplied by the parameter and this results in -- their becoming more silent ones. The second Double 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. The third String argument is used to define the -- intervals for the notes if any. The third Double 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 -- obertones are greater than for the main note obetones. The last one is -- experimental feature. oberSoXSynthN3 :: Int -> Double -> Double -> Double -> String -> String -> String -> Vector Double -> IO () -- | Similar to oberSoXSynth 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 obertones. oberSoXSynthDN :: Double -> String -> IO () -- | Similar to oberSoXSynthDN except that the resulting duration is -- specified by the second Double parameter in seconds. For -- oberSoXSynthDN it is equal to 0.5. oberSoXSynth2DN :: Double -> Double -> String -> IO () -- | Similar to oberSoXSynthN, but uses a sound file to obtain the -- information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just maximum ones, otherwise they are multiplied by the -- parameter and this results in their becoming more silent ones. The -- second Double 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. oberSoXSynthNGen :: FilePath -> Int -> Double -> Double -> String -> IO () -- | Similar to oberSoXSynthN2, but uses a sound file to obtain the -- information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just maximum ones, otherwise they are multiplied by the -- parameter and this results in their becoming more silent ones. The -- second Double 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. oberSoXSynthNGen2 :: FilePath -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to oberSoXSynthN2, but uses a sound file to obtain the -- information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just maximum ones, otherwise they are multiplied by the -- parameter and this results in their becoming more silent ones. The -- second Double 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 Double 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 obertones are greater than for the main -- note obetones. The last one is experimental feature. oberSoXSynthNGen3 :: FilePath -> Int -> Double -> Double -> Double -> String -> String -> String -> IO () -- | For the given frequency of the note it generates a Vector of -- the tuples, each one of which contains the harmonics' frequency and -- amplitude. For every given String structure of the uniqueness -- (see the documentation for mmsyn7s package and its -- Syllable module) it produces the unique timbre. uniqOberTonesV :: Double -> String -> Vector (Double, Double) -- | For the given frequency and a Ukrainian text it generates a musical -- sound with the timbre obtained from the Ukrainian text (see the -- documentation for mmsyn7s package). The timbre for another -- given text usually differs, but can be the same. The last one is only -- if the uniqueness structure and length are the same for both -- String. Otherwise, they differs. This gives an opportunity to -- practically and quickly synthesize differently sounding intervals. 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*" and "end.wav" files in the current directory, because they -- can be overwritten. uniqOberSoXSynth :: Double -> String -> IO () -- | Function to create a melody for the given arguments. The first -- String is used to provide a rhythm. The second one -- to -- provide a timbre. The timbre for another given text usually differs, -- but can be the same. This gives an opportunity to practically and -- quickly synthesize differently sounding intervals. The first -- Double argument from the range [0.01..1.0] is used as a maximum -- amplitude for obertones. If it is set to 1.0 the obertones amplitudes -- are just maximum ones, otherwise they are multiplied by the parameter -- and this results in their becoming more silent ones. The main -- component of the sound is in the given octave with a number given by -- Int parameter. Besides, another 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 second Double -- 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. uniqOberSoXSynthN :: Int -> Double -> Double -> String -> String -> Vector Double -> IO () -- | For the given frequency of the note it generates a Vector of -- the tuples, each one of which contains the harmonics' frequency and -- amplitude. For every given first String argument structure of -- the uniqueness (see the documentation for mmsyn7s package and -- its Syllable module) it produces the unique timbre. The second -- String is used to produce the signs for harmonics coefficients. uniqOberTonesV2 :: Double -> String -> String -> Vector (Double, Double) -- | For the given frequency and a Ukrainian text it generates a musical -- sound with the timbre obtained from the Ukrainian text (see the -- documentation for mmsyn7s package). The timbre for another -- given text usually differs, but can be the same. The last one is only -- if the uniqueness structure and length are the same for both -- String. Otherwise, they differs. This gives an opportunity to -- practically and quickly synthesize differently sounding intervals. 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*" and "end.wav" files in the current directory, because they -- can be overwritten. The second String argument is used to -- define signs for the harmonics coefficients for obertones. uniqOberSoXSynth2 :: Double -> String -> String -> IO () -- | Function to create a melody for the given arguments. The first -- String is used to provide a rhythm. The second one -- to -- provide a timbre. The timbre for another given text usually differs, -- but can be the same. This gives an opportunity to practically and -- quickly synthesize differently sounding intervals. The first -- Double argument from the range [0.01..1.0] is used as a maximum -- amplitude for obertones. If it is set to 1.0 the obertones amplitudes -- are just maximum ones, otherwise they are multiplied by the parameter -- and this results in their becoming more silent ones. The main -- component of the sound is in the given octave with a number given by -- Int parameter. Besides, another 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 second Double -- 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. The third String argument is used to define -- signs of the harmonics coefficients in the generated sounds. uniqOberSoXSynthN3 :: Int -> Double -> Double -> String -> String -> String -> Vector Double -> IO () -- | Function to create a melody for the given arguments. The first -- String is used to provide a rhythm. The second one -- to -- provide a timbre. The timbre for another given text usually differs, -- but can be the same. This gives an opportunity to practically and -- quickly synthesize differently sounding intervals. The first -- Double argument from the range [0.01..1.0] is used as a maximum -- amplitude for obertones. If it is set to 1.0 the obertones amplitudes -- are just maximum ones, otherwise they are multiplied by the parameter -- and this results in their becoming more silent ones. The main -- component of the sound is in the given octave with a number given by -- Int parameter. Besides, another 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 second Double -- 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. The third String argument is used to define -- signs of the harmonics coefficients in the generated sounds. The -- fourth String argument is used to define the intervals for the -- notes if any. The third Double 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 obertones are greater than for the -- main note obetones. The last one is experimental feature. uniqOberSoXSynthN4 :: Int -> Double -> Double -> Double -> String -> String -> String -> String -> Vector Double -> IO () -- | Similar to uniqOberSoXSynthN, but uses a sound file to obtain -- the information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just the maximum ones, otherwise they are multiplied by -- the parameter and this results in their becoming more silent ones. The -- second Double 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. uniqOberSoXSynthNGen :: FilePath -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to uniqOberSoXSynthN, but uses a sound file to obtain -- the information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just the maximum ones, otherwise they are multiplied by -- the parameter and this results in their becoming more silent ones. The -- second Double 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 third String argument is used to define signs of the -- harmonics coefficients in the generated sounds. uniqOberSoXSynthNGen3 :: FilePath -> Int -> Double -> Double -> String -> String -> String -> IO () -- | Similar to uniqOberSoXSynthN, but uses a sound file to obtain -- the information analogous to Vector 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 Double argument from the range [0.01..1.0] is used as a -- maximum amplitude for obertones. If it is set to 1.0 the obertones -- amplitudes are just the maximum ones, otherwise they are multiplied by -- the parameter and this results in their becoming more silent ones. The -- second Double 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 third String argument is used to define signs of the -- harmonics coefficients in the generated sounds. The fourth -- String argument is used to define the intervals for the notes -- if any. The third Double 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 obertones are greater than for the main -- note obetones. The last one is experimental feature. uniqOberSoXSynthNGen4 :: FilePath -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () -- | Returns a Vector of tuples with the lowest and highest -- frequencies for the notes in the octaves. octavesT :: Vector (Double, Double) -- | Returns an analogous note in the higher octave (its frequency in Hz). octaveUp :: Double -> Double -- | Returns an analogous note in the lower octave (its frequency in Hz). octaveDown :: Double -> Double -- | Function can be used to determine to which octave (in the American -- notation for the notes, this is a number in the note written form, e. -- g. for C4 this is 4) the frequency belongs (to be more exact, the -- closest note for the given frequency -- see closestNote taking -- into account its lower pure quint, which can lay in the lower by 1 -- octave). If it is not practical to determine the number, then the -- function returns Nothing. whichOctave :: Double -> Maybe Int -- | Function lifts the given frequency to the given number of the octave -- (in American notation, from 0 to 8). This number is an Int -- parameter. The function also takes into account the lower pure quint -- for the closest note. If it is not practical to determine the number, -- then the function returns Nothing. putInOctave :: Int -> Double -> Maybe Double -- | Function lifts the Vector of Double representing -- frequencies to the given octave with the Int number. Better to -- use numbers in the range [1..8]. The function also takes into account -- the lower pure quint for the obtained note behaviour. If it is not -- practical to determine the octave, the resulting frequency is omitted -- from the resulting Vector. putInOctaveV :: Int -> Vector Double -> Vector Double -- | Vector of musical notes in Hz. notes :: Vector Double -- | Function returns either the nearest two musical notes if frequency is -- higher than one for C0 and lower than one for B8 or the nearest note -- duplicated in a tuple. neighbourNotes :: Double -> Vector Double -> (Double, Double) -- | Returns the closest note to the given frequency in Hz. closestNote :: Double -> Double -- | Returns a pure quint lower than the given note. pureQuintNote :: Double -> Double -- | Function is used to generate a rhythm of the resulting file 'end.wav' -- from the Ukrainian text and a number of sounds either in the syllables -- or in the words without vowels. syllableStr :: Int -> String -> [Int] -- | Additional function to produce signs from the given String of -- the Ukrainian text. Ukrainian vowels and voiced consonants gives "+" -- sign (+1), voiceless and sonorous consonants gives "-" sign (-1). -- Voiceless2 gives "0". Other symbols are not taken into account. signsFromString :: Int -> String -> Vector Int -- | Additional function to prepend zeroes to the given String. The -- number of them are just that one to fulfill the length to the given -- Int parameter. prependZeroes :: Int -> String -> String -- | Function is used to get numbers of intervals from a Ukrainian -- String. It is used internally in the uniqOberSoXSynthN4 -- function. intervalsFromString :: String -> Vector Int -- | Function to get from the number of semi-tones and a note a -- Maybe note for the second lower note in the interval if any. If -- there is no need to obtain such a note, then the result is -- Nothing. dNote :: Int -> Double -> Maybe Double -- | Maintainer : olexandr543@yahoo.com -- -- A program and a library to create experimental music from a mono audio -- and a Ukrainian text. module DobutokO.Sound.Executable -- | Function that actually makes processing in the dobutokO2 -- executable. 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. dobutokO2 :: IO () -- | 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. recAndProcess :: String -> Int -> IO String -- | Maintainer : olexandr543@yahoo.com -- -- A program and a library to create experimental music from a mono audio -- and a Ukrainian text. module DobutokO.Sound.Functional -- | 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. -- -- 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 compute the "f" function before using it in -- the oberSoXSynth2FDN. oberSoXSynth2FDN :: (Double -> Vector (Double, Double)) -> (Double, Double) -> String -> IO () -- | 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. -- -- 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 compute the "f" function before using it in -- the oberSoXSynth2FDN. oberSoXSynth2FDN_B :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> String -> IO () -- | 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). -- -- 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 compute the "f" function before using it in -- the oberSoXSynth2FDN_S. oberSoXSynth2FDN_S :: (Double -> Vector (Double, Double)) -> (Double, Double) -> String -> IO () -- | 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. -- -- 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 compute the "f" function before using it in -- the oberSoXSynth2FDN_S. oberSoXSynth2FDN_Sf :: (Double -> Vector (Double, Double)) -> (Double, Double) -> String -> IO () -- | 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. -- -- 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 compute the "f" function before using it in -- the oberSoXSynth2FDN_S. oberSoXSynth2FDN_Sf3 :: (Double -> Vector (Double, Double)) -> (Double, Double, Double) -> String -> IO () -- | Maintainer : olexandr543@yahoo.com -- -- A program and a library to create experimental music from a mono audio -- and a Ukrainian text. module Main main :: IO ()