-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | 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. @package dobutokO2 @version 0.37.1.0 -- | Maintainer : olexandr543@yahoo.com -- -- 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. module DobutokO.Sound.Keyboard -- | Converts a string of lowercase ASCII letters being typed on the QWERTY -- keyboard layout into corresponding Dvorak keyboard layout. qwerty2dvorak :: ByteString -> ByteString -- | Vice versa to qwerty2dvorak. dvorak2qwerty :: ByteString -> ByteString -- | Get contents into lazy ByteString with filtering of all -- characters that are not a lower case ascii letters. input2BL :: IO ByteString -- | Like input2BL, but takes only first n symbols -- specified with the first Int64 argument. input2BLN :: Int64 -> IO ByteString -- | Like input2BL, but takes only first n symbols -- specified with the second Int64 argument dropping before this -- the first m symbols specified with the first Int64 -- argument. input2BLMN :: Int64 -> Int64 -> IO ByteString -- | Usual way the function readFile2BLGen is used. The text in a -- file being read is treated as a properly typed (entered) one. So there -- is no keyboard layout conversion at all. readFile2BL :: FilePath -> IO ByteString -- | Like readFile2BL, but reads only first n symbols -- specified with the first Int64 argument. readFile2BLN :: Int64 -> FilePath -> IO ByteString -- | Like readFile2BL, but reads only first n symbols -- specified with the second Int64 argument dropping before this -- the first m symbols specified with the first Int64 -- argument. readFile2BLMN :: Int64 -> Int64 -> FilePath -> IO ByteString -- | Reads a given file into a lazy ByteString with filtering of all -- characters that are not a lower case ascii letters. It has additional -- first command line argument to control the way of treating letters: as -- being typed (entered) properly (null String), or needed to be -- converted from qwerty to dvorak layout ("q" String), or vice -- versa (otherwise). readFile2BLGen :: String -> FilePath -> IO ByteString -- | Like readFile2BLGen, but reads only first n symbols -- specified with the first Int64 argument. readFile2BLGenN :: Int64 -> String -> FilePath -> IO ByteString -- | Like readFile2BLGen, but reads only first n symbols -- specified with the second Int64 argument dropping before this -- the first m symbols specified with the first Int64 -- argument. readFile2BLGenMN :: Int64 -> Int64 -> String -> FilePath -> IO ByteString -- | Usual way the function readFileDoublesGen is used. The text in -- a file being read is treated as a properly typed (entered) one. So -- there is no keyboard layout conversion at all. readFileDoubles :: FilePath -> IO (Vector Int) -- | Like readFileDoubles, but returns only first n -- elements of the Vector specified with the first Int64 -- argument. readFileDoublesN :: Int64 -> FilePath -> IO (Vector Int) -- | Like readFileDoubles, but returns only first n -- elements of the Vector specified with the second Int64 -- argument dropping before this the first m elements specified -- with the first Int64 argument. readFileDoublesMN :: Int64 -> Int64 -> FilePath -> IO (Vector Int) -- | After reading a file into a filtered lazy ByteString (see, -- readFile2BLGen) converts the resulting ByteString into a -- Vector of Int. The arguments have the same meaning as -- for readFile2BLGen. readFileDoublesGen :: String -> FilePath -> IO (Vector Int) -- | Like readFileDoublesGen, but returns only first n -- elements of the Vector specified with the first Int64 -- argument. readFileDoublesGenN :: Int64 -> String -> FilePath -> IO (Vector Int) -- | Like readFileDoublesGen, but returns only first n -- symbols specified with the second Int64 argument dropping -- before this the first m symbols specified with the first -- Int64 argument. readFileDoublesGenMN :: Int64 -> Int64 -> String -> FilePath -> IO (Vector Int) -- | Converts a lazy ByteString into a Vector of Int -- using hashStr2. takeDoubles :: ByteString -> Vector Int -- | Hashes two lower case ascii characters. Is used for controlling -- frequencies and operators. hashStr2 :: Char -> Char -> Int -- | Auxiliary function to define how is a ByteString treated, see -- readFile2BLGen. convH :: String -> (ByteString -> ByteString) -> ByteString -> ByteString -- | Maintainer : olexandr543@yahoo.com -- -- 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. module DobutokO.Sound.ParseList parseTup :: String -> [String] parseTupV :: String -> Vector String containsExt :: [String] -> Bool containsExtV :: Vector String -> Bool -- | Predicate to check whether a Vector does not contain round -- parentheses or dash (a minus sign) as its elements. Is used internally -- in the parseStoLInts function to avoid lists with negative -- elements. canBePreParseV :: Vector String -> Bool -- | Notification. Uses an Int limitation to avoid infinite lists. -- All arguments must be not negative. parseV :: Int -> Vector String -> Maybe [Int] -- | From the 0.19.0.0 version. Can be used to parse also into infinite -- lists. parseVInf :: Vector String -> Maybe [Int] -- | Parses a String being a list of Ints written with Haskell -- rules, e. g. "[1..]", "[2,4..45]", "[3,5,6,7,8,3]" etc. into a list of -- Int. If it is not possible or list is empty, returns []. -- Preceding whitespaces are ignored. An Int argument is used as a -- delimiter to avoid infinite lists. parseStoLInts :: Int -> String -> [Int] -- | Maintainer : olexandr543@yahoo.com -- -- 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. module DobutokO.Sound.IntermediateF -- | Gets sizes of the "result*.wav" files in the current directory. getFileRSizes :: IO (Vector Integer) -- | Similar to getFileRSizes, but sizes are Int, not -- Integer. For most cases it is more memory efficient. getFileRSizesS :: IO (Vector Int) -- | Variant of getFileRSizes function. getFileRSizesS2 :: IO (Vector Int) -- | Gets Vector of tuples of the pairs of "result*.wav" files and -- their respective sizes. getFileRTuples :: IO (Vector (FilePath, Integer)) -- | Gets Vector of the filenames for "result*.wav" files in the -- current directory. listVDirectory :: IO (Vector FilePath) -- | Function-predicate to check whether a file corresponding to its -- String argument is considered as one of higher quality and -- therefore can be used to replace the not so suitable ones while -- processing. isHighQ :: String -> Bool -- | Function-predicate to check whether a file corresponding to its -- String argument is needed to be replaced while processing. shouldBeReplaced :: String -> Bool -- | Gets an index of the Vector element corresponding to the -- String generated by playAndMark function. indexesFromMrk :: String -> Int -- | During function evaluation you can listen to the sound files and mark -- them with "1" and "0". The first one means that the sound is -- considered of higher quality and is intended to be used as a -- replacement for the worse sounds markd by "0". The function returns a -- Vector of specially formatted String that represents -- only those files that are connected with the replacement procedure. playAndMark :: Vector FilePath -> IO (Vector String) -- | Function playAndMark applied to all the "result*.wav" files in -- the current directory. playAMrk :: IO (Vector String) -- | Process the sound corresponding to the first element in the first -- argument. Returns a tail of the first element of the first -- command line argument. Replaces (if specified) the sound with a -- sequence of (or just one, or made no replacement at all) sounds -- considered of higher quality. pAnR1 :: Vector String -> IO (Vector String) -- | Process the WAV sounds consequently corresponding to the elements in -- the first argument. Replaces (if specified) the sounds with a sequence -- of (or just one, or made no replacement at all) sounds considered of -- higher quality for every sound needed. pAnR2 :: Vector String -> IO () -- | Marks the needed WAV files as of needed to be replaced or those ones -- considered of higher quality that will replace the needed ones. Then -- actually replaces them as specified. Uses internally playAMrk -- and pAnR2 functions. pAnR_ :: IO () -- | Generalized variant of the playAMrk with a possibility to play -- and mark either FLAC or WAV files. For more information, please, refer -- to soxBasicParams. playAMrk2G :: String -> IO (Vector String) -- | Generalized variant of the pAnR1 with a possibility to work -- either with FLAC files or with WAV files. Please, use with the FLAC -- files or with the WAV files separately. Do not intend to work with -- both types of them simultaneously using this function. pAnR12G :: String -> Vector String -> IO (Vector String) -- | Generalized variant of the pAnR2 with a possibility to work -- either with FLAC files or with WAV files. Please, use with the FLAC -- files or with the WAV files separately. Do not intend to work with -- both types of them simultaneously using this function. pAnR22G :: String -> Vector String -> IO () -- | Generalized variant of the pAnR_ with a possibility to work -- either with FLAC files or with WAV files. Please, use with the FLAC -- files or with the WAV files separately. Do not intend to work with -- both types of them simultaneously using this function. pAnR_2G :: String -> IO () -- | Parser to the result of listVDirectory2G function to get the -- needed information. infoFromV :: Vector String -> [(Vector Int, Vector String)] -- | Used to obtain parameters for processment. internalConv :: ([String], [String]) -> (Vector Int, Vector String) -- | Axiliary function to get a String of consequent digits in the -- name of the "result*.wav" file. ixFromRes :: String -> String -- | Given an index of the element in the listVDirectory output -- returns a tuple of the boundaries of the indexes usable for playback. -- Note: index0 is probably from [0..], l1 is necessarily from [0..]. -- Interesting case is: 0 <= index0 < l1. ixInterv :: Int -> IO (Int, Int) -- | Given an index of the element in the listVDirectory2G (with the -- same String as the second argument) output returns a tuple of -- the boundaries of the indexes usable for playback. Note: index0 is -- probably from [0..], l1 is necessarily from [0..]. Interesting case -- is: 0 <= index0 < l1. ixInterv2G :: String -> Int -> IO (Int, Int) -- | IO checkbox whether to add the sound played to the sequence of -- sounds that will replace the needed one. thisOne :: IO Bool -- | Plays a sequence of sounds in the interval of them obtained by -- ixInterv function. playSeqAR :: Int -> IO () -- | Plays a sequence of consequential sounds in the melody in the interval -- of them obtained by ixInterv function for each element index -- from Vector of indexes. playSeqARV :: Vector Int -> IO () -- | Plays a sequence of WAV sounds considered of higher quality. playSeqARV2 :: Vector String -> IO () -- | Plays a sound file considered to be of higher quality and then you -- define whether to use the played sound to replace that one considered -- to be replaced. playCollect1Dec :: Vector String -> Int -> IO Bool -- | The same as playSeqARV2, but additionally collects the -- resulting Bool values and then returns them. It is used to -- define, which sounds from those of higher quality will replace those -- ones considered to be replaced. playCollectDec :: Vector String -> IO (Vector Bool) -- | Actually replaces the file represented by FilePath argument -- with no (then there is no replacement at all), or with just one, or -- with a sequence of sounds being considered of higher quality to form a -- new melody. If the lengths of the second and the third arguments -- differs from each other then the function uses as these arguments -- truncated vectors of the minimal of the two lengths. replaceWithHQs :: FilePath -> Vector Bool -> Vector FilePath -> IO () -- | A predicate to decide whether an element a belongs to the odd -- number of the lists of a in the Vector. isOddAsElem :: Eq a => a -> Vector [a] -> Bool -- | All [a] must be finite. To obtain Just a0 as a -- result, at least one of the [a] must be not empty and -- Vector must have finite length. If Vector is -- empty or all [a] are null (the vector has finite -- length), then the result is Nothing. Otherwise, it will run -- infinitely just until it runs over the available memory. maxLinV :: Ord a => Vector [a] -> Maybe a -- | All [a] must be finite. To obtain Just a0 as a -- result, at least one of the [a] must be not empty and -- Vector must have finite length. If Vector is -- empty or all [a] are null (the vector has finite -- length), then the result is Nothing. Otherwise, it will run -- infinitely just until it runs over the available memory. minLinV :: Ord a => Vector [a] -> Maybe a -- | Applied to list of [a] where a is an instance for Ord -- class gives a sorted in the ascending order Vector of -- a, each of them being unique. doubleLtoV :: Ord a => [[a]] -> Vector a -- | Filters Int elements in a list so that they are limited with -- the first two Int arguments of the function as a lower and a -- higher bounds. filterToBnds :: Int -> Int -> [Int] -> [Int] -- | Generalized variant of the getFileRSizes with a possibility to -- get sizes either of FLAC or of WAV files. For more information, -- please, refer to soxBasicParams. getFileRSizes2G :: String -> IO (Vector Integer) -- | Generalized variant of the getFileRSizesS with a possibility to -- get sizes either of FLAC or of WAV files. For more information, -- please, refer to soxBasicParams. getFileRSizesS2G :: String -> IO (Vector Int) -- | Generalized variant of the getFileRTuples with a possibility to -- get sizes either of FLAC or of WAV files. For more information, -- please, refer to soxBasicParams. getFileRTuples2G :: String -> IO (Vector (FilePath, Integer)) -- | Generalized variant of the listVDirectory with a possibility to -- get FilePath for either FLAC or WAV files. For more -- information, please, refer to soxBasicParams. listVDirectory2G :: String -> IO (Vector FilePath) -- | Generalized variant of the listVDirectory2G with a possibility -- to get FilePath for not only "result*" files, but to specify -- their beginning with the second String argument. For example: -- --
--   listVDirectory3G ys "result" == listVDirectory2G ys
--   
listVDirectory3G :: String -> String -> IO (Vector FilePath) -- | Generalized variant of the playSeqAR with a possibility to play -- and mark either FLAC or WAV files. For more information, please, refer -- to soxBasicParams. playSeqAR2G :: String -> Int -> IO () -- | Generalized variant of the playSeqARV with a possibility to -- play and mark either FLAC or WAV files. For more information, please, -- refer to soxBasicParams. playSeqARV2G :: String -> Vector Int -> IO () -- | Plays a sequence of sounds considered of higher quality. playSeqARV22G :: String -> Vector String -> IO () -- | Generalized variant of the playCollectDec with a possibility to -- play and mark either FLAC or WAV files. For more information, please, -- refer to soxBasicParams. playCollectDec2G :: String -> Vector String -> IO (Vector Bool) -- | Generalized variant of the replaceWithHQs with a possibility to -- work either with FLAC files or with WAV files. Please, use with the -- FLAC files or with the WAV files separately. Do not intend to work -- with both types of them simultaneously using this function. replaceWithHQs2G :: String -> FilePath -> Vector Bool -> Vector FilePath -> IO () -- | Is used internally in the functions to specify different SoX -- parameters for the sound synthesis (rate, bit depth and file -- extension). Possible file extensions are: ".wav" (a default one) and -- ".flac" (being lossless compressed); rates -- 8000, 11025, 16000, -- 22050 (a default one), 32000, 44100, 48000, 88200, 96000, 176400, -- 192000 Hz; bit depths -- 16 bits and 24 bits. The first two digits in -- a String argument encodes rate, the next one -- bit depth and -- the last symbol -- letter 'w' or 'f' -- file extension. Because of SoX -- uses FLAC optionally, before use it, please, check whether your -- installation supports it. soxBasicParams :: String -> [String] -> [String] -- | Takes a filename to be applied a SoX "reverb" effect with parameters -- of list of String (the second argument). Produces the temporary -- new file with the name ((name-of-the-file) ++ ("reverb.wav" OR -- "reverb.flac") -- the type is preserved), which then is removed. -- Please, remember that for the mono audio the after applied function -- file is stereo with 2 channels. -- -- Besides, you can specify other SoX effects after reverberation in a -- list of String. The syntaxis is that every separate literal -- must be a new element in the list. If you plan to create again mono -- audio in the end of processment, then probably use reverb1E -- funcion instead. If you would like to use instead of "reverb" its -- modification "reverb -w" effect (refer to SoX documentation), then -- probably it is more convenient to use reverbWE function. -- Please, check by yourself whether you have enough permissions to read -- and write to the FilePath-specified file and to the containing -- it directory. The function is not intended to be used in otherwise -- cases. reverbE :: FilePath -> [String] -> IO () -- | The same as reverbE, but uses "reverb -w" effect instead of -- "reverb". The name of the temporary file is ((name-of-the-file) ++ -- ("reverbW.wav" OR "reverbW.flac") -- the type is preserved). Please, -- for more information, refer to SoX documentation. Please, check by -- yourself whether you have enough permissions to read and write to the -- FilePath-specified file and to the containing it directory. The -- function is not intended to be used in otherwise cases. reverbWE :: FilePath -> [String] -> IO () -- | The same as reverbE, but at the end file is being mixed to -- obtain mono audio. The name of the temporary file is -- ((name-of-the-file) ++ ("reverb1.wav" OR "reverb1.flac") -- the type -- is preserved). Please, check by yourself whether you have enough -- permissions to read and write to the FilePath-specified file -- and to the containing it directory. The function is not intended to be -- used in otherwise cases. reverb1E :: FilePath -> [String] -> IO () -- | The same as reverbWE, but at the end file is being mixed to -- obtain mono audio. The name of the temporary file is -- ((name-of-the-file) ++ ("reverbW1.wav" OR "reverbW1.flac") -- the type -- is preserved). Please, check by yourself whether you have enough -- permissions to read and write to the FilePath-specified file -- and to the containing it directory. The function is not intended to be -- used in otherwise cases. reverbW1E :: FilePath -> [String] -> IO () -- | Similar to reverbE, but replaces the primary WAV file with the -- new FLAC file (or vice versa). So if successful the resulting file has -- another extension and type. reverbE2C :: FilePath -> [String] -> IO () -- | Similar to reverbWE, but replaces the primary WAV file with the -- new FLAC file (or vice versa). So if successful the resulting file has -- another extension and type. reverbWE2C :: FilePath -> [String] -> IO () -- | Similar to reverb1E, but replaces the primary WAV file with the -- new FLAC file (or vice versa). So if successful the resulting file has -- another extension and type. reverb1E2C :: FilePath -> [String] -> IO () -- | Similar to reverb1WE, but replaces the primary WAV file with -- the new FLAC file (or vice versa). So if successful the resulting file -- has another extension and type. reverb1WE2C :: FilePath -> [String] -> IO () -- | Takes a filename to be applied a SoX chain of effects (or just one) as -- list of String (the second argument). Produces the temporary -- new file with the name ((name-of-the-file) ++ ("effects.wav" OR -- "effects.flac") -- the type is preserved), which then is removed. -- -- The syntaxis is that every separate literal for SoX must be a new -- element in the list. If you plan to create again mono audio in the end -- of processment, then probably use soxE1 function instead. -- Please, for more information, refer to SoX documentation. Please, -- check by yourself whether you have enough permissions to read and -- write to the FilePath-specified file and to the containing it -- directory. The function is not intended to be used in otherwise cases. soxE :: FilePath -> [String] -> IO () -- | The same as soxE, but at the end file is being mixed to obtain -- mono audio. Please, check by yourself whether you have enough -- permissions to read and write to the FilePath-specified file -- and to the containing it directory. The function is not intended to be -- used in otherwise cases. soxE1 :: FilePath -> [String] -> IO () -- | Changes the volume of the given FilePath with supported by SoX -- sound file type so that it becomes 0 (zero). Makes so it a silence -- file with the same parameters for duration, rate, bit depth and file -- type. getSilenceF :: FilePath -> IO () -- | Applies "fade" effect to both ends of the supported by SoX sound file -- FilePath so that concatenating them consequently after such -- application leads to no clipping. Otherwise, the clipping exists if -- not prevented by may be some other means. For more information, -- please, refer to the SoX documentation. fadeEnds :: FilePath -> IO () -- | Applies "fade" effect to both ends of the supported by SoX sound file -- FilePath so that concatenating them consequently after such -- application leads to no clipping. Otherwise, the clipping exists if -- not prevented by may be some other means. The duration of the changes -- are in 5 times smaller than for fadeEnds function and is equal -- to 0.002 sec. For more information, please, refer to the SoX -- documentation. fadeEndsMil2 :: FilePath -> IO () -- | Applies "fade" effect to both ends of the supported by SoX sound file -- FilePath so that concatenating them consequently after such -- application leads to no clipping. Otherwise, the clipping exists if -- not prevented by may be some other means. The duration of the changes -- are usually smaller than for fadeEnds function and is equal to -- 0.001 * n sec (where n is in range [1..10]). For more information, -- please, refer to the SoX documentation. fadeEndsMilN :: Int -> FilePath -> IO () -- | Applies fadeEnds to all the "zs*.wav" (or instead all the -- "zs*.flac") files in the current directory. The file extension is -- defined by the first String argument in accordance with -- soxBasicParams. zs here is given by the second -- String argument. fadeAllE :: String -> String -> IO () -- | Applies fadeEndsMilN to all the "zs*.wav" (or instead all the -- "zs*.flac") files in the current directory. The file extension is -- defined by the first String argument in accordance with -- soxBasicParams. zs here is given by the second -- String argument. The Int argument defines a number of -- miliseconds to be under fading effect (no more than 10). fadeAllEMilN :: Int -> String -> String -> IO () -- | Similar to soxE, but replaces the primary WAV file with the new -- FLAC file (or vice versa). So if successful the resulting file has -- another extension and type. soxE2C :: FilePath -> [String] -> IO () -- | Similar to soxE1, but replaces the primary WAV file with the -- new FLAC file (or vice versa). So if successful the resulting file has -- another extension and type. soxE12C :: FilePath -> [String] -> IO () -- | Function takes a FilePath for the new recorded file (if it -- already exists then it is overwritten) and a list of String. -- The last one is sent to SoX rec or something equivalent as its -- arguments after the filename. If you plan just afterwards to produce -- mono audio, it's simpler to use rec1E function instead. Please, -- check by yourself whether you have enough permissions to read and -- write to the FilePath-specified file and to the containing it -- directory. The function is not intended to be used in otherwise cases. -- Function is adopted and changed recA function. recE :: FilePath -> [String] -> IO () -- | Function takes a FilePath for the new recorded file (if it -- already exists then it is overwritten) and a list of String. -- The last one is sent to SoX rec or something equivalent as its -- arguments after the filename. Please, check by yourself whether you -- have enough permissions to read and write to the -- FilePath-specified file and to the containing it directory. The -- function is not intended to be used in otherwise cases. Function is -- adopted and changed recA function. rec1E :: FilePath -> [String] -> IO () -- | Plays a FilePath file with a SoX further effects specified by -- the list of String. It can be e. g. used to (safely) test the -- result of applying some SoX effects and only then to use soxE -- or some similar functions to actually apply them. Please, check by -- yourself whether you have enough permissions to read the -- FilePath-specified file and the containing it directory. The -- function is not intended to be used in otherwise cases. Function is -- adopted and changed playA function. playE :: FilePath -> [String] -> IO () f2w :: FilePath -> FilePath w2f :: FilePath -> FilePath cfw2wf :: FilePath -> FilePath efw2 :: FilePath -> String efw2vv :: FilePath -> String wOrf :: FilePath -> String -- | Converts WAV file to FLAC file using SoX (please, check before whether -- your installation supports FLAC files) using possible rate and bit -- depth conversion accordingly to soxBasicParams format. If the -- conversion is successful (ExitCode is ExitSuccess) then -- removes the primary file. wavToFlac :: String -> FilePath -> IO () -- | Converts FLAC file to WAV file using SoX (please, check before whether -- your installation supports FLAC files) using possible rate and bit -- depth conversion accordingly to soxBasicParams format. If the -- conversion is successful (ExitCode is ExitSuccess) then -- removes the primary file. flacToWav :: String -> FilePath -> IO () -- | Maintainer : olexandr543@yahoo.com -- -- 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. module DobutokO.Sound.Functional -- | Is used to represent a sequence of intervals, each note being a -- Double value (its frequency in Hz). type SoundsO = Vector (Double, Double) -- | Is used to represent a set of overtones for the single sound, the -- first Double value is a frequency and the second one -- an -- amplitude. type OvertonesO = Vector (Double, Double) -- | Is used to represent a set of pairs of notes for each element of which -- the Double values (notes frequencies in Hz) are somewhat -- musically connected one with another.. type NotePairs = Vector (Double, Double) -- | Is used to represent a set of durations parameters of the sounds and -- pauses. The positive value corresponds to the sound and the negative -- one -- to the pause. type Durations = Vector Double -- | Is used to represent a set of volumes in the amplitude scale for SoX -- "vol" effect. type Strengths = Vector Double -- | Is used to represent a set of volumes in the dB scale for SoX "vol" -- effect. Usually, the zero value corresponds to the sound with volume -- level equal by absolute value to 1.0 (the extremum one). So for most -- cases, its elements are negative numbers not less than (-120). type StrengthsDb = Vector Double -- | Is used to represent a set of intervals for notes (each element is a -- number of semi-tones between parts of interval). Positive values -- corresponds to lower notes and negative to higher ones. type Intervals = Vector Int -- | 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 -- | For the given frequency of the note it generates a Vector of -- the tuples, each one of which contains the harmonics' frequency and -- amplitude. overTones :: Double -> OvertonesO -- | Returns a Vector of tuples with the lowest and highest -- frequencies for the notes in the sets consisting of n -- consequential notes (including semi-tones). An Int parameter -- defines this n. It can be 2, 3, 4, 6, 9, or 12 (the last one -- is for default octaves, see octavesT). So for different valid -- n you obtain doubles, triples and so on. The function being -- applied returns a Vector of such sets with their respective -- lowest and highest frequencies. nkyT :: Int -> NotePairs -- | Similarly to whichOctave returns a Maybe number -- (actually frequency) for the n-th elements set of notes (see -- nkyT). An Int parameter defines that n. whichEnka :: Int -> Double -> Maybe Int -- | Returns an analogous note in the higher n-th elements set (its -- frequency in Hz) (see nkyT). An Int parameter defines -- this n. enkuUp :: Int -> Double -> Double -- | Returns an analogous note in the lower n-th elements set (its -- frequency in Hz) (see nkyT). An Int parameter defines -- this n. enkuDown :: Int -> Double -> Double -- | Similarly to liftInOctaveV returns a Vector -- Double (actually frequencies) for the n-th elements set of -- notes (see nkyT) instead of octaves. A second Int -- parameter defines that n. liftInEnkuV :: Int -> Int -> Vector Double -> Vector Double -- | Similarly to liftInOctave returns a Maybe number -- (actually frequency) for the n-th elements set of notes (see -- nkyT). A second Int parameter defines that n. -- Not all pairs return Just x. liftInEnku :: Int -> Int -> Double -> Maybe Double -- | Returns a Vector of tuples with the lowest and highest -- frequencies for the notes in the octaves. octavesT :: NotePairs -- | Combines (mixes) all "test*" files in the given directory. The files -- should be similar in parameters and must be sound files for SoX to -- work on them properly. Afterwards, the function deletes these combined -- files. mixTest :: IO () -- | Combines (mixes) all "test*" files in the given directory. The files -- should be similar in parameters and must be sound files for SoX to -- work on them properly. Afterwards, the function deletes these combined -- files. The name of the resulting file depends on the first two command -- line arguments so that it is easy to produce unique names for the -- consequent call for the function. mixTest2 :: Int -> Int -> IO () -- | Gets Vector of Int frequencies from the given -- FilePath using SoX. The frequencies are "rough" according to -- the SoX documentation and the duration is too small so they can be -- definitely other than expected ones. Is used as a source of variable -- numbers (somewhat close each to another in their order but not -- neccessarily). . freqsFromFile :: FilePath -> Int -> IO (Vector Int) -- | Gets an "end.wav" file from the intermediate "result*.wav" files in -- the current directory. If it is not successful, produces the -- notification message and exits without error. If you would like to -- create the file if there are too many intermediate ones, please, run -- "dobutokO2 8" or "dobutokO2 80" in the current directory. endFromResult :: IO () -- | 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. overSoXSynth :: Double -> IO () -- | Similar to overSoXSynth2DN but instead of overTones -- 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 overSoXSynth2FDN. overSoXSynth2FDN :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO () -- | Similar to overSoXSynth2DN but instead of overTones -- 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 overSoXSynth2FDN_B. overSoXSynth2FDN_B :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> IO () -- | Similar to overSoXSynth2FDN 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 overSoXSynth2FDN_S. overSoXSynth2FDN_S :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO () -- | Similar to overSoXSynth2FDN_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 overSoXSynth2FDN_Sf. overSoXSynth2FDN_Sf :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO () -- | Similar to overSoXSynth2FDN_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 overSoXSynth2FDN_Sf3. overSoXSynth2FDN_Sf3 :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> IO () -- | 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. overSoXSynthGen2FDN :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> IO () -- | 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]. overSoXSynthGen2FDN_B :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> IO () -- | Similar to overSoXSynthGen2FDN, but instead of -- overSoXSynth2FDN uses overSoXSynth2FDN_S function. overSoXSynthGen2FDN_S :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> IO () -- | Similar to overSoXSynthGen2FDN_S, but instead of -- overSoXSynth2FDN_S uses overSoXSynth2FDN_Sf 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. overSoXSynthGen2FDN_Sf :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> IO () -- | Similar to overSoXSynthGen2FDN_S, but instead of -- overSoXSynth2FDN_S uses overSoXSynth2FDN_Sf3 function. overSoXSynthGen2FDN_Sf3 :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> IO () -- | 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 -- | Vector of Double is a vector of dB volume adjustments -- for the corresponding harmonices (overtones). overSoXSynth2FDN1G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> IO () -- | Vector of Double is a vector of dB volume adjustments -- for the corresponding harmonices (overtones). overSoXSynth2FDN_B1G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> Vector Double -> IO () -- | Generalized version of the overSoXSynth2FDN_S with the -- additional volume adjustment in dB for overtones given by -- Vector of Double. overSoXSynth2FDN_S1G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> IO () -- | Generalized variant of the overSoXSynth2FDN_Sf with a -- possibility to adjust volume using adjust_dbVol. Vector -- of Double is used to specify adjustments in dB. For more -- information, please, refer to adjust_dbVol. overSoXSynth2FDN_Sf1G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> IO () -- | Generalized variant of the overSoXSynth2FDN_Sf3 function with a -- possibility to adjust volume using adjust_dBVol. -- Vector of Double specifies the needed adjustments in dB. overSoXSynth2FDN_Sf31G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> Vector Double -> IO () -- | Generalized version of the partialTest_k with the additional -- volume adjustment in dB given by Vector of Double. partialTest_k1G :: OvertonesO -> Int -> String -> Vector Double -> IO () -- | 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. overSoXSynth2FDN2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> String -> IO () -- | 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_B2G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> Vector Double -> String -> IO () -- | 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_S2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> String -> IO () -- | 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_Sf2G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> String -> Vector Double -> String -> IO () -- | 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. overSoXSynth2FDN_Sf32G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> Vector Double -> String -> IO () -- | Generalized version of the partialTest_k1G with a possibility -- to change sound quality parameters using the additional second -- String argument. For more information, please, refer to -- soxBasicParams. partialTest_k2G :: OvertonesO -> Int -> String -> Vector Double -> String -> IO () -- | Generalized variant of the soundGenF31G with a possibility to -- specify sound quality using the String argument. For more -- information, please, refer to soxBasicParams. soundGenF32G :: Vector (Double -> Double) -> Vector Double -> Vector Int -> (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Vector Double -> String -> IO () -- | 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_SG2G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> String -> IO ()) -> String -> IO () -- | 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. overSoXSynthGen2FDN_Sf3G2G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> String -> IO ()) -> String -> IO () -- | Similar to mixTest, but allows to change the sound quality -- parameters for the resulting file. For more information, please, refer -- to soxBasicParams. mixTest2G :: String -> IO () -- | Similar to mixTest, but allows to change the sound quality -- parameters for the resulting file. For more information, please, refer -- to soxBasicParams. The name of the resulting file depends on -- the first two command line arguments so that it is easy to produce -- unique names for the consequent call for the function. mixTest22G :: Int -> Int -> String -> IO () -- | Similar to endFromResult, but uses additional String -- argument to change sound quality parameters. For more information, -- please, refer to soxBasicParams. endFromResult2G :: String -> IO () -- | 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. soundGenF3 :: Vector (Double -> Double) -> Vector Double -> Vector Int -> (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> IO () -- | 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_SG :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () -- | 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. overSoXSynthGen2FDN_Sf3G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double, Double) -> Int -> String -> IO ()) -> IO () -- | Generalized variant of the soundGenF3 with volume adjustment in -- dB given by the second Vector Double for the overtones. soundGenF31G :: Vector (Double -> Double) -> Vector Double -> Vector Int -> (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Vector Double -> IO () -- | Is used internally in the readProcessWithExitCode to adjust -- volume for the sound with additional dB value given by Double -- argument. adjust_dbVol :: [String] -> Double -> [String] -- | Creates part of the needed "test*.wav" files in the current directory. partialTest_k :: OvertonesO -> Int -> String -> IO () -- | 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 nOfZeroesLog :: Int -> Maybe Int -- | Is a minimal number of decimal places that are just enough to -- represent a length of the Vector given. For an empty -- returns 0. numVZeroesPre :: Vector a -> Int -- | 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] helpF1 :: Vector (Double -> Double) -> Vector Double -> Vector Int -> Vector (Maybe Double) helpF0 :: Int -> String -- | Generates a Vector of OvertonesO that represents the -- sound. doubleVecFromVecOfDouble :: (Double -> OvertonesO) -> Double -> Vector (Maybe Double) -> Vector OvertonesO -- | Function is used to get numbers of intervals from a Ukrainian -- String. It is used internally in the -- uniqOverSoXSynthN4 function. intervalsFromString :: String -> Intervals -- | The default way to get Intervals from a converted Ukrainian -- text. vStrToVInt :: Vector String -> Intervals -- | The default way to get number of semi-tones between notes in a single -- element of Intervals. strToInt :: String -> Int -- | Gets a function f::Double -> OvertonesO that can be used -- further. Has two variants with usage of closestNote (Int -- argument is greater than 0)v and without it (Int argument is -- less than 0). For both cases String must be in a form list of -- tuples of pairs of Double to get somewhat reasonable result. -- The function f can be shown using a special printing function -- showFFromStrVec. It is a simplest multiplicative (somewhat -- acoustically and musically reasonable) form for the function that can -- provide such a result that fits into the given data. -- --
--   let (y,f1) = fromJust (maybeFFromStrVec 1 3583.9783 "[(25.368,0.2486356),(37.259,0.6464867),(486.153,0.374618646),(789.563,0.463486461)]") in (y,f1 3583.9783)
--   
--   (3520.0,[(25.829079975681818,0.2486356),(37.936206670369316,0.6464867),(494.9891484317899,0.374618646),(803.9138234326421,0.463486461)])
--   
--   let (y,f1) = fromJust (maybeFFromStrVec (-1) 3583.9783 "[(25.368,0.2486356),(37.259,0.6464867),(486.153,0.374618646),(789.563,0.463486461)]") in (y,f1 3583.9783)
--   
--   (3583.9783,[(25.368,0.2486356),(37.259,0.6464867),(486.153,0.374618646),(789.563,0.463486461)])
--   
maybeFFromStrVec :: Int -> Double -> String -> Maybe (Double, Double -> Vector (Double, Double)) -- | Gets multiplication coefficients for f::Double -> Vector -- (Double,Double) from the maybeFFromStrVec with the same -- arguments. fVecCoefs :: Int -> Double -> String -> Vector Double -- | Experimental show for f::Double -> Vector -- (Double,Double) that is used only for visualisation. It is -- correct only with maybeFFromStrVec or equivalent function. -- Because the shape of the f is known the function can be -- defined. -- --
--   showFFromStrVec (-1) 440 "[(25.358,0.3598),(489.35,0.4588962),(795.35,0.6853)]"
--   
--   "(440.00,(\t -> <(0.05763181818181818 * t, 0.3598),(1.112159090909091 * t, 0.4588962),(1.8076136363636364 * t, 0.6853)>))"
--   
showFFromStrVec :: Int -> Double -> String -> String -- | Renormalizes amplitudes for the frequencies so that the maximum one of -- them (if OvertonesO is not empty) is equal by the -- absolute value to 1.0 and the mutual ratios of the amplitudes are -- preserved. renormF :: OvertonesO -> OvertonesO -- | Renormalizes amplitudes for the frequencies so that the maximum one of -- them (if OvertonesO is not empty) is equal by the -- absolute value to Double argument and the mutual ratios of the -- amplitudes are preserved. renormFD :: Double -> OvertonesO -> OvertonesO -- | Predicate to check whether all tuples in a Vector have the same -- first element. sameOvertone :: OvertonesO -> Bool -- | Similar to sameOvertone, except that not the Vector is -- checked but a corresponding list. sameOvertoneL :: [(Double, Double)] -> Bool -- | g :: (Double,Double) -> OvertonesO -> OvertonesO is a -- function that defines how the new element is added to the -- OvertonesO. It depends only on the element being added and the -- actual OvertonesO. It does not depend on the Double -- argument for f :: Double -> OvertonesO so for different -- Double for f it gives the same result. sameFreqF :: Double -> (Double, Double) -> (Double -> OvertonesO) -> ((Double, Double) -> OvertonesO -> OvertonesO) -> OvertonesO -- | g :: (Double,Double) -> OvertonesO -> OvertonesO is a -- function that defines how the new element is added to the -- OvertonesO. Variant of sameFreqF where g depends only on -- the elements of the OvertonesO, which first elements in the -- tuples equal to the first element in the (Double,Double). It -- does not depend on the Double argument for f :: Double -- -> OvertonesO so for different Double for f it -- gives the same result. sameFreqFI :: Double -> (Double, Double) -> (Double -> OvertonesO) -> ((Double, Double) -> OvertonesO -> OvertonesO) -> OvertonesO -- | gAdd :: (Double,Double) -> Double -> (Double -> -- OvertonesO) -> OvertonesO is a function that defines how the -- element is added to the OvertonesO. fAddFElem is -- actually a higher-order function, it changes the function f -- and returns a new one. It can be an interesting task (in general) to -- look at such a function through a prism of notion of operator -- (mathematical, for example similar to that ones that are used for -- quantum mechanics and quantum field theory). gAdd allows not -- only to insert an element if missing, but to change all the -- OvertonesO system. So depending on the complexity, it can -- produce rather complex behaviour. fAddFElem :: (Double, Double) -> (Double -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> Double -> OvertonesO -- | gRem:: (Double,Double) -> Double -> (Double -> -- OvertonesO) -> OvertonesO is a function that defines how the -- element is removed from the OvertonesO. fRemoveFElem is -- actually a higher-order function, it changes the function f -- and returns a new one. It can be an interesting task (in general) to -- look at such a function through a prism of notion of operator -- (mathematical, for example that ones that are used for quantum -- mechanics and quantum field theory). gRem allows not only to -- delete an element if existing, but to change all the OvertonesO -- system. So depending on the complexity, it can produce rather complex -- behaviour. fRemoveFElem :: (Double, Double) -> (Double -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> Double -> OvertonesO -- | Changes elements of the OvertonesO using two functions. It is a -- generalization of the fAddFElem and fRemoveFElem -- functions. For example, if the first of the two inner functional -- arguments acts as gAdd01 or similar, then it adds element to -- the OvertonesO, if it acts as gRem01, then it removes -- the element. Its behaviour is defined by the Double parameter -- (meaning frequency, probably), so you can change elements depending on -- what point it is applied. fChangeFElem :: (Double, Double) -> Double -> (Double -> (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> Double -> OvertonesO -- | Example of the function gAdd for the fAddFElem. If the -- frequency is already in the OvertonesO then the corresponding -- amplitude is divided equally between all the elements with the -- repeated given frequency from (Double, Double). Otherwise, it -- is just concatenated to the OvertonesO. gAdd01 :: (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Can be used to produce an example of the function gAdd for -- the fAddFElem. Similar to gAdd01, but uses its first -- argument to renorm the result of the gAdd01 so that its maximum -- by absolute value amplitude equals to the first argument. gAdd02 :: Double -> (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Example of the function gAdd. for the fAddFElem. If -- the frequency is not already in the OvertonesO then the -- corresponding element is added and the OvertonesO are renormed -- with renormF. Otherwise, the element is tried to be inserted -- with a new frequency between the greatest by an absolute values notes -- as an intermediate value with the respective amplitude, or if there is -- only one element, to produce two elements in the resulting -- Vector with two consequent harmonics. gAdd03 :: (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Example of the function gAdd. for the fAddFElem. It -- tries to insert the given (Double,Double) into the less -- dense frequency region. gAdd04 :: (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Example of the function gRem for the fRemoveFElem. If the -- element is already in the OvertonesO then it is removed (if -- there are more than 5 elements already) and OvertonesO are -- renormalized. Otherwise, all the same for the element already existing -- elements become less in an amlitude for a numbers that in sum equal to -- amplitude of the removed element. gRem01 :: (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Can be used to produce an example of the function gRem for -- the fRemoveFElem. Similar to gRem01, but uses its first -- argument to renorm the result of the gRem01 so that its maximum -- by absolute value amplitude equals to the first argument. gRem02 :: Double -> (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Example of the function gRem for the fRemFElem. It -- tries not to remove elements from the less than 6 elements -- OvertonesO and to remove all the elements in the given range -- with the width of the twice as many as the second Double in the -- first argument tuple and the centre in the first Double in the -- tuple. Similar to somewhat bandreject filter but with more complex -- behaviour for the sound to be more complex. gRem03 :: (Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Similar to fAddFElem, but instead of one element -- (Double,Double) it deals with a Vector of such -- elements that is OvertonesO. fAddFElems :: OvertonesO -> (Double -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> Double -> OvertonesO -- | Similar to fRemoveFElem, but instead of one element -- (Double,Double) it deals with a Vector of such -- elements that is OvertonesO. fRemoveFElems :: OvertonesO -> (Double -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> Double -> OvertonesO -- | Similar to fChangeFElem, but use another form of the changing -- function, so it can deal with not only single element of the -- OvertonesO, but also with several ones. fChangeFElems :: OvertonesO -> Double -> (Double -> OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> Double -> OvertonesO -- | Binary predicate to check whether two given OvertonesO both -- have the elements with the same first element in the tuples. If -- True then this means that OvertonesO are at least -- partially overlaped by the first elements in the tuples (meaning -- frequencies). freqsOverlapOvers :: OvertonesO -> OvertonesO -> Bool -- | Similar to freqsOverlapOvers, but checks whether the whole -- tuples are the same instead of the first elements in the tuples are -- the same. elemsOverlapOvers :: OvertonesO -> OvertonesO -> Bool -- | Example of the function gAdds for the fAddFElems. gAdds01 :: OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Can be used to produce an example of the function gAdds for -- the fAddFElems. Similar to gAdds01, but uses its first -- argument to renorm the result of the gAdds01 so that its -- maximum by absolute value amplitude equals to the first argument. gAdds02 :: Double -> OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO -- | Splits (with addition of the new overtones) a given OvertonesO -- into a number n (specified by the first Int argument) -- of OvertonesO (represented finally as a Vector of them -- respectively) so that all except the first n greatest by the -- absolute value of the amplitude tuples of Doubles are considered -- overtones for the greatest by the absolute value one in the given -- OvertonesO and all the next n - 1 are treated as the -- greatest by the absolute value and each of them produces the similar -- by the f :: Double -> OvertonesO function overtones. -- -- It is expected to obtain by such a conversion a splitted one sound -- into several simultaneous similar ones with different heights. To -- provide a rich result, the given first argument must be strictly less -- than the length of the given OvertonesO minus one. splitO :: Int -> OvertonesO -> Vector OvertonesO -- | Splits (with addition of the new overtones) a given OvertonesO -- into a number of OvertonesO (represented finally as a -- Vector of them repsectively) so that it intermediately uses a -- special function before applying the "similarization" splitting -- function. Is a generalization of the splitO, which can be -- considered a splitO2 with a first command line argument equals -- to id. -- -- It is expected to obtain by such a conversion a splitted one sound -- into several simultaneous similar (less or more, depending on h :: -- OvertonesO -> OvertonesO) ones with different heights. To -- provide a rich result, the given first argument must be strictly less -- than the length of the given OvertonesO minus one. splitO2 :: (OvertonesO -> OvertonesO) -> Int -> OvertonesO -> Vector OvertonesO -- | Concatenates a Vector of OvertonesO into a single -- OvertonesO. Can be easily used with splitO. overConcat :: Vector OvertonesO -> OvertonesO -- | Auxiliary function that is used inside splitOG1. splitHelp1 :: Int -> Int -> Int -> Int -> OvertonesO -> (Double, Double) -> Vector OvertonesO -- | Auxiliary function that is used inside splitOG2. splitHelp2 :: (OvertonesO -> OvertonesO) -> Int -> Int -> Int -> Int -> OvertonesO -> (Double, Double) -> Vector OvertonesO -- | Generalized variant of the splitO with the different splitting -- variants depending on the first two ASCII lower case letters in the -- String argument. splitOG1 :: String -> Int -> OvertonesO -> Vector OvertonesO -- | Generalized variant of the splitO2 with the different splitting -- variants depending on the first two ASCII lower case letters in the -- String argument. splitOG2 :: (OvertonesO -> OvertonesO) -> String -> Int -> OvertonesO -> Vector OvertonesO -- | Generalized variant of the splitOG1 with a possibility to -- specify a default value for splitting parameters as the first argument -- (Int,Int,Int,Int) and the sorted by the first element in the -- tuple (actually a String) in ascending order Vector (the -- second one). Each String in the Vector must be unique -- and consist of lowercase ASCII letters. splitOG12 :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> String -> Int -> OvertonesO -> Vector OvertonesO -- | Variant of the splitOG12 applied to the unsorted second -- argument. It sorts it internally. If you specify the already sorted -- second argument then it is better to use splitOG12. Each -- String in the Vector must be unique and consist of -- lowercase ASCII letters. splitOG12S :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> String -> Int -> OvertonesO -> Vector OvertonesO -- | Generalized variant of the splitOG2 with a possibility to -- specify a default value for splitting parameters as the first argument -- (Int,Int,Int,Int) and the sorted by the first element in the -- tuple (actually a String) in ascending order Vector (the -- second one). Each String in the Vector must be unique -- and consist of lowercase ASCII letters. splitOG22 :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> OvertonesO -> Vector OvertonesO -- | Variant of the splitOG22 applied to the unsorted second -- argument. It sorts it internally. If you specify the already sorted -- second argument then it is better to use splitOG22. Each -- String in the Vector must be unique and consist of -- lowercase ASCII letters. splitOG22S :: (Int, Int, Int, Int) -> Vector (String, Int -> OvertonesO -> (Int, Int, Int, Int)) -> (OvertonesO -> OvertonesO) -> String -> Int -> OvertonesO -> Vector OvertonesO -- | Auxiliary function to get from a sound file specified a duration -- parameter n that can be used further. duration1000 :: FilePath -> IO Int -- | Durations accounting the desired average duration. durationsAver :: Durations -> Double -> Durations -- | A conversion to the Double that is used inside -- str2Durations. str2Durat1 :: String -> Double -- | A full conversion to the Durations from a Ukrainian text. str2Durations :: String -> Double -> Durations -- | A default way to get Durations for the sounds up to 0.35.2.0 -- version of the package including. It is based on the number of -- Ukrainian sounds representations (see, -- convertToProperUkrainian) in a Ukrainian syllables or somewhat -- generated by the same rules as they. The rhythm using the function is -- very often not binary but its ratios are almost always a ratios of the -- small natural numbers (1, 2, 3, 4, 5, 6, 7 etc.). str2DurationsDef :: Int -> String -> Double -> Durations -- | A conversion to the Double that is used inside -- str2Volume. str2Vol1 :: String -> Double -- | A full conversion to the Strengths from a Ukrainian text. str2Volume :: String -> Strengths -- | Default values for strToInt. All the intervals are not greater -- than one full octave. defInt :: Intervals -- | Arithmetic average for the Vector is used as a weight for a -- duration. doublesAveragedA :: Vector Double -> Double -> Vector Double -- | Geometric average for the Vector is used as a weight for a -- strength. doublesAveragedG :: Vector Double -> Double -> Vector Double -- | Auxiliar function to make all vectors in a Vector equal by -- length (the minimum one). equalize2Vec :: Vector (Vector a) -> Vector (Vector a) -- | Generatlized version of the intervalsFromString with a -- possibility to specify your own Intervals. intervalsFromStringG :: Intervals -> String -> Intervals -- | 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. overSoXSynthGen2FDN4G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> IO () -- | 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 :: ((Double -> OvertonesO) -> (Double, -- Double) -> 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_SG4G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () -- | 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 :: ((Double -> -- OvertonesO) -> (Double, Double) -> 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. overSoXSynthGen2FDN_SG4GS :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> IO () -- | For the given non-existing FilePath for a sound file supported -- by SoX generates a silence of the specified duration and quality (see, -- soxBasicParams). silentSound2G :: FilePath -> Double -> String -> IO () -- | Generatlized version of the strToInt with a possibility to -- specify your own Intervals. strToIntG :: Intervals -> String -> Int -- | Strengths accounting the desired average strength. strengthsAver :: Strengths -> Double -> Strengths -- | StrengthsDb accounting the desired average strength in dB. strengthsDbAver :: StrengthsDb -> Double -> StrengthsDb -- | Generatlized version of the vStrToVInt with a possibility to -- specify your own Intervals. vStrToVIntG :: Intervals -> Vector String -> Intervals -- | Similar to overSoXSynth2FDN2G, but additionally allows to -- specify by the Intervals argument to specify your own -- intervals. For more information, please, refer to -- intervalsFromStringG. overSoXSynth2FDN5G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> Vector Double -> String -> IO () -- | Generalized version of the overSoXSynth2FDN_B2G with a -- possibility to specify your own Intervals. For more -- information, please, refer to intervalsFromStringG. overSoXSynth2FDN_B5G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> Vector Double -> String -> IO () -- | Generalized version of the overSoXSynth2FDN_S2G where you -- specify your own Intervals. For more information, please, refer -- to intervalsFromStringG. overSoXSynth2FDN_S5G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> Vector Double -> String -> IO () -- | 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. overSoXSynth2FDN_Sf35G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> Vector Double -> String -> IO () -- | Apply volume adjustment to the sound file. It must not be silent. -- Otherwise, it leads to likely noise sounding or errors. apply6Gf :: Double -> FilePath -> IO () -- | After producing sounds as WAV or FLAC files you can apply to them -- volume adjustments using Strengths. The first String is -- used accordingly to soxBasicParams and the second one -- as a -- prefix of the filenames for the files that the function is applied to. -- The files must not be silent ones. Otherwise, it leads to likely noise -- sounding or errors. apply6G :: Strengths -> String -> String -> IO () -- | Variant of the apply6G function which can be applied also to -- the silent files. Whether a file is silent is defined using the -- Double argument so that if the maximum by absolute value -- amplitude is less by absolute value than the Double argument -- then the file is not changed. apply6G2 :: Strengths -> String -> String -> Double -> IO () -- | Variant of the apply6G where you use as a Strengths -- parameter that one obtained from a Ukrainian text provided as a first -- String argument. It uses str2Volume inside. The files -- must not be silent ones. Otherwise, it leads to likely noise sounding -- or errors. apply6GS :: String -> String -> String -> IO () -- | Variant of the apply6G2 where you use as a Strengths -- parameter that one obtained from a Ukrainian text provided as the -- first String argument. It uses str2Volume inside. apply6GS2 :: String -> String -> String -> Double -> IO () apply6GSilentFile :: FilePath -> Double -> Double -> IO () -- | Generalized variant of the overSoXSynth2FDN5G with afterwards -- apply6Gf usage. overSoXSynth2FDN6G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> Vector Double -> String -> Double -> IO () -- | A variant of the overSoXSynth2FDN6G where volume adjustment is -- obtained from a Ukrainian text. overSoXSynth2FDN6GS :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> String -> Vector Double -> String -> String -> IO () -- | Generalized variant of the overSoXSynth2FDN_B5G with afterwards -- apply6G usage. overSoXSynth2FDN_B6G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> Vector Double -> String -> Double -> IO () -- | A variant of the overSoXSynth2FDN_B6G where volume adjustment -- is obtained from a Ukrainian text. overSoXSynth2FDN_B6GS :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> String -> Vector Double -> String -> String -> IO () -- | Generalized variant of the overSoXSynth2FDN_S5G with afterwards -- apply6G usage. Arguments for the latter is the three last -- function arguments. overSoXSynth2FDN_S6G :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> Vector Double -> String -> Double -> IO () -- | A variant of the overSoXSynth2FDN_S6G where volume adjustment -- is obtained from a Ukrainian text. overSoXSynth2FDN_S6GS :: (Double -> OvertonesO) -> (Double, Double) -> Int -> Intervals -> String -> Vector Double -> String -> String -> IO () -- | Generalized variant of the overSoXSynth2FDN_Sf35G with -- afterwards apply6G usage. overSoXSynth2FDN_Sf36G :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> Vector Double -> String -> Double -> IO () -- | A variant of the overSoXSynth2FDN_Sf36G where volume adjustment -- is obtained from a Ukrainian text. overSoXSynth2FDN_Sf36GS :: (Double -> OvertonesO) -> (Double, Double, Double) -> Int -> Intervals -> String -> Vector Double -> String -> String -> IO () -- | 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_SG6G :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> Durations -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> Strengths -> Double -> IO () -- | A variant of the overSoXSynthGen2FDN_SG6G where -- Strengths are obtained from a Ukrainian text and -- str2Volume. overSoXSynthGen2FDN_SG6GS :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> String -> Double -> IO () -- | 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. overSoXSynthGen2FDN_SG6GSu :: FilePath -> Int -> Int -> (Double -> OvertonesO) -> Double -> String -> String -> ((Double -> OvertonesO) -> (Double, Double) -> Int -> String -> IO ()) -> Double -> IO () -- | Returns the frequency for which its ratio with the second -- Double argument being under lg and being multiplied with 20 -- returns the first Double argument. For example, -- dBOmegaRatio 6 440 ~ 880 (actually, 877.9154185863069). dBOmegaRatio :: Double -> Double -> Double -- | Converts the absolute value of the argument to dB value compared to -- 1.0. Usually, is less than 0. The argument should not be equal to zero -- (0), otherwise, it is equal to -Infinity. strength2dB_Abs :: Double -> Double -- | Converts the absolute value of the argument from dB value to amplitude -- with 0 equivalent to amplitude of 1.0 (or -1.0 for inverted sound). -- Usually, is used for negative arguments (or at least not positive -- ones). strengthdB2ampl :: Double -> Double -- | Converts the Vector of the absolute values of the argument to -- the Vector of dB values compared to 1.0. Usually, its elements -- are less than 0. If some element in the argument is equal to zero (0), -- the corresponding resulting element is equal to -Infinity. strengths2dB :: Strengths -> StrengthsDb -- | Converts the Vector of dB values to the Vector of the -- amplitudes with 0 being equivalent to amplitude of 1.0 (or -1.0 for -- inverted sound). Usually, is used for negative elements of the first -- argument (or at least not positive ones). strengthsDb2ampl :: StrengthsDb -> Strengths -- | Maintainer : olexandr543@yahoo.com -- -- 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. module DobutokO.Sound -- | 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 Overtones. If it -- is set to 1.0 the overTones 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*" files -- in the current directory, because they can be overwritten. overSoXSynthN :: 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. overTones2 :: Double -> String -> OvertonesO -- | 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*" files in the current directory, because they can be -- overwritten. The String argument is used to define signs of the -- harmonics coefficients for Overtones. overSoXSynth2 :: 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 Overtones. If it -- is set to 1.0 the overTones 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*" files -- in the current directory, because they can be overwritten. overSoXSynthN2 :: 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 Overtones. If it -- is set to 1.0 the overTones 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*" 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 overTones are greater than for the main -- note obetones. The last one is experimental feature. overSoXSynthN3 :: Int -> Double -> Double -> Double -> String -> String -> String -> Vector Double -> IO () -- | Similar to overSoXSynth 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 OvertonesO. overSoXSynthDN :: Double -> String -> IO () -- | Similar to overSoXSynthDN except that the resulting duration is -- specified by the second Double parameter in seconds. For -- overSoXSynthDN it is equal to 0.5. overSoXSynth2DN :: Double -> Double -> String -> IO () -- | Similar to overSoXSynthN, 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 Overtones. If it is set to 1.0 the overTones -- 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. overSoXSynthNGen :: FilePath -> Int -> Double -> Double -> String -> IO () -- | Similar to overSoXSynthN2, 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 Overtones. If it is set to 1.0 the overTones -- 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. overSoXSynthNGen2 :: FilePath -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to overSoXSynthN2, 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 Overtones. If it is set to 1.0 the overTones -- 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 overTones are greater than for the main -- note obetones. The last one is experimental feature. overSoXSynthNGen3 :: 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. uniqOvertonesV :: Double -> String -> OvertonesO -- | 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*" files in the current directory, because they can be -- overwritten. uniqOverSoXSynth :: 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 Overtones. If it is set to 1.0 the overTones 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*" files in the current directory, because they can be -- overwritten. uniqOverSoXSynthN :: 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. uniqOvertonesV2 :: Double -> String -> String -> OvertonesO -- | 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*" files in the current directory, because they can be -- overwritten. The second String argument is used to define signs -- for the harmonics coefficients for Overtones. uniqOverSoXSynth2 :: 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 Overtones. If it is set to 1.0 the overTones 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*" 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. uniqOverSoXSynthN3 :: 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 Overtones. If it is set to 1.0 the overTones 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*" 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 overTones are greater than for the main -- note obetones. The last one is experimental feature. uniqOverSoXSynthN4 :: Int -> Double -> Double -> Double -> String -> String -> String -> String -> Vector Double -> IO () -- | Similar to uniqOverSoXSynthN, 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 Overtones. If it is set to 1.0 the overTones -- 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. uniqOverSoXSynthNGen :: FilePath -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to uniqOverSoXSynthN, 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 Overtones. If it is set to 1.0 the overTones -- 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. uniqOverSoXSynthNGen3 :: FilePath -> Int -> Double -> Double -> String -> String -> String -> IO () -- | Similar to uniqOverSoXSynthN, 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 Overtones. If it is set to 1.0 the overTones -- 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 overTones are greater than for the main -- note obetones. The last one is an experimental feature. uniqOverSoXSynthNGen4 :: FilePath -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () -- | 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. liftInOctave :: 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. liftInOctaveV :: Int -> Vector Double -> Vector Double dviykyTA :: NotePairs triykyTA :: NotePairs chetvirkyTA :: NotePairs p'yatirkyTA :: NotePairs shistkyTA :: NotePairs simkyTA :: NotePairs visimkyTA :: NotePairs dev'yatkyTA :: NotePairs desyatkyTA :: NotePairs odynadtsyatkyTA :: NotePairs octavesTA :: NotePairs -- | Similar to overSoXSynthNGen, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to overSoXSynthNGen. To obtain its modifications, -- please, use 2, 3, 4, 6, or 9. overSoXSynthNGenE :: FilePath -> Int -> Int -> Double -> Double -> String -> IO () -- | Similar to overSoXSynthNGen2, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to overSoXSynthNGen2. To obtain its modifications, -- please, use 2, 3, 4, 6, or 9. overSoXSynthNGen2E :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to overSoXSynthNGen3, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to overSoXSynthNGen3. To obtain its modifications, -- please, use 2, 3, 4, 6, or 9. overSoXSynthNGen3E :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> IO () -- | Similar to uniqOverSoXSynthNGen, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to uniqOverSoXSynthNGen. To obtain its -- modifications, please, use 2, 3, 4, 6, or 9. 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. uniqOverSoXSynthNGenE :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () -- | Similar to uniqOverSoXSynthNGen3, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to uniqOverSoXSynthNGen3. To obtain its -- modifications, please, use 2, 3, 4, 6, or 9. 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. uniqOverSoXSynthNGen3E :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> String -> IO () -- | Similar to uniqOverSoXSynthNGen4, but uses additional second -- Int parameter. It defines, to which n-th elements set (see -- nkyT) belongs the obtained higher notes in the intervals. If -- that parameter equals to 12, then the function is practically -- equivalent to uniqOverSoXSynthNGen4. To obtain its -- modifications, please, use 2, 3, 4, 6, or 9. 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. uniqOverSoXSynthNGen4E :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () -- | 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 -- | Function to create a melody for the given arguments. Durations -- is used to provide a rhythm. overSoXSynthN4G :: Int -> Double -> Durations -> Vector Double -> IO () -- | Function to create a melody for the given arguments. Durations -- is used to provide a rhythm. overSoXSynthN24G :: Int -> Double -> Durations -> String -> Vector Double -> IO () -- | Function to create a melody for the given arguments. -- Duraitons is used to provide a rhythm. overSoXSynthN34G :: Int -> Double -> Double -> Durations -> String -> String -> Vector Double -> IO () -- | 4G genaralized version of the overSoXSynthNGenE where you -- provide your own Durations. overSoXSynthNGenE4G :: FilePath -> Int -> Int -> Double -> Durations -> IO () -- | 4G genaralized version of the overSoXSynthNGen2E where you -- provide your own Durations. overSoXSynthNGen2E4G :: FilePath -> Int -> Int -> Double -> Durations -> String -> IO () -- | 4G generalized function for overSoXSynthNGen3E where you -- provide your own Durations. 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. overSoXSynthNGen3E4G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> IO () -- | 4G generalized variant of the uniqOverSoXSynthN where you -- specify your own Durations. uniqOverSoXSynthN4G :: Int -> Double -> Durations -> String -> Vector Double -> IO () -- | 4G generalized variant of the uniqOverSoXSynthN3 where you -- specify your own Durations. uniqOverSoXSynthN34G :: Int -> Double -> Durations -> String -> String -> Vector Double -> IO () -- | 4G generalized variant of the uniqOverSoXSynthN4 where you -- specify your own Durations. uniqOverSoXSynthN44G :: Int -> Double -> Double -> Durations -> String -> String -> String -> Vector Double -> IO () -- | 4G genaralized version of the uniqOverSoXSynthNGenE where you -- provide your own Durations. 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. uniqOverSoXSynthNGenE4G :: FilePath -> Int -> Int -> Double -> Durations -> String -> IO () -- | 4G genaralized version of the uniqOverSoXSynthNGen3E where you -- provide your own Durations. 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. uniqOverSoXSynthNGen3E4G :: FilePath -> Int -> Int -> Double -> Durations -> String -> String -> IO () -- | 4G genaralized version of the uniqOverSoXSynthNGen4E where you -- provide your own Durations. 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. uniqOverSoXSynthNGen4E4G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> String -> IO () -- | Variant of the overSoXSynthN4G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. overSoXSynthN4GS :: Int -> Double -> Double -> String -> Vector Double -> IO () -- | Variant of the overSoXSynthN24G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. overSoXSynthN24GS :: Int -> Double -> Double -> String -> String -> Vector Double -> IO () -- | Variant of the overSoXSynthN34G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. overSoXSynthN34GS :: Int -> Double -> Double -> Double -> String -> String -> String -> Vector Double -> IO () -- | Variant of the overSoXSynthNGenE4G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. overSoXSynthNGenE4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> IO () -- | Variant of the overSoXSynthNGen2E4G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. overSoXSynthNGen2E4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () -- | Variant of the overSoXSynthNGen3E4G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. 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. overSoXSynthNGen3E4GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> IO () -- | Variant of the uniqOverSoXSynthN4G function where -- Durations are obtained from the String using -- str2Durations function. Helps to create a speech-like -- composition. uniqOverSoXSynthN4GS :: Int -> Double -> Double -> String -> String -> Vector Double -> IO () -- | Variant of the uniqOverSoXSynthN34G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. uniqOverSoXSynthN34GS :: Int -> Double -> Double -> String -> String -> String -> Vector Double -> IO () -- | Variant of the uniqOverSoXSynthN44G where Durations are -- obtained from the String using str2Durations function. -- Helps to create a speech-like composition. uniqOverSoXSynthN44GS :: Int -> Double -> Double -> Double -> String -> String -> String -> String -> Vector Double -> IO () -- | Variant of the uniqOverSoXSynthNGenE4G where Durations -- are obtained from the String using str2Durations -- function. Helps to create a speech-like composition. 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. uniqOverSoXSynthNGenE4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> IO () -- | Variant of the uniqOverSoXSynthNGen3E4G where Durations -- are obtained from the String using str2Durations -- function. Helps to create a speech-like composition. 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. uniqOverSoXSynthNGen3E4GS :: FilePath -> Int -> Int -> Double -> Double -> String -> String -> String -> IO () -- | Variant of the uniqOverSoXSynthNGen4E4G where Durations -- are obtained from the String using str2Durations -- function. Helps to create a speech-like composition. 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. uniqOverSoXSynthNGen4E4GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> String -> IO () -- | Generalized variant of the overSoXSynthN34G where you specify -- your own Intervals. For more information, please, refer to -- intervalsFromStringG. overSoXSynthN35G :: Int -> Double -> Double -> Durations -> String -> Intervals -> Vector Double -> IO () -- | 5G generalized function for overSoXSynthNGen3E4G where you -- provide your own Intervals. 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. overSoXSynthNGen3E5G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> IO () -- | 5G generalized variant of the uniqOverSoXSynthN44G where you -- specify your own Intervals. uniqOverSoXSynthN45G :: Int -> Double -> Double -> Durations -> String -> String -> Intervals -> Vector Double -> IO () -- | 5G genaralized version of the uniqOverSoXSynthNGen4E where you -- provide your own Durations and Intervals. 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. uniqOverSoXSynthNGen4E5G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> Intervals -> IO () -- | Variant of the overSoXSynthN34G where intervals are obtained -- from the basic Intervals with the length no more than 29 and a -- Ukrainian text specified as the last String argument so that -- you can produce Intervals of the arbitrary length. For more -- information, please, refer to intervalsFromStringG and -- strToIntG. overSoXSynthN35GS :: Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> Vector Double -> IO () -- | Variant of the overSoXSynthNGen3E5G where Intervals are -- obtained from the basic Intervals with the length no more than -- 29 and a Ukrainian text specified as the last String argument -- so that you can produce Intervals of the arbitrary length. For -- more information, please, refer to intervalsFromStringG and -- strToIntG. 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. overSoXSynthNGen3E5GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> IO () -- | Variant of the uniqOverSoXSynthN45G where Intervals are -- obtained from the String using intervalsFromStringG -- function. Helps to create a speech-like composition. uniqOverSoXSynthN45GS :: Int -> Double -> Double -> Double -> String -> String -> String -> Intervals -> String -> Vector Double -> IO () -- | Variant of the uniqOverSoXSynthNGen4E5G where Intervals -- are obtained from the String using intervalsFromStringG -- function. Helps to create a speech-like composition. 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. uniqOverSoXSynthNGen4E5GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> Intervals -> String -> IO () -- | 6G generalized function for overSoXSynthNGen3E5G where you -- provide your own 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. overSoXSynthNGen3E6G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> Strengths -> Double -> IO () -- | 6G generalized function for uniqOverSoXSynthNGen4E5G where you -- provide your own 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. uniqOverSoXSynthNGen4E6G :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> String -> Intervals -> Strengths -> Double -> IO () -- | A variant of overSoXSynthNGen3E6G where Strengths are -- obtained from a Ukrainian text specified as the last String -- argument. 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. overSoXSynthNGen3E6GS :: FilePath -> Int -> Int -> Double -> Double -> Durations -> String -> Intervals -> String -> Double -> IO () -- | A variant of overSoXSynthNGen3E6GS where Strengths and -- Durations are obtained from the same Ukrainian text specified -- as the last String argument. The third Double argument -- is an average duration of the sounds in seconds. 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. overSoXSynthNGen3E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> Intervals -> String -> Double -> IO () -- | A variant of uniqOverSoXSynthN46GS where Strengths and -- Durations are obtained from the same Ukrainian text specified -- as the last String argument. The second Double argument -- is an average duration of the sounds in seconds. 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. uniqOverSoXSynthN46GSu :: Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> Vector Double -> String -> Double -> IO () -- | A variant of uniqOverSoXSynthNGen4E6G where Strengths -- are obtained from a Ukrainian text specified as the last String -- argument. 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. uniqOverSoXSynthNGen4E6GS :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> String -> Intervals -> String -> String -> Double -> IO () -- | A variant of uniqOverSoXSynthNGen4E6GS where Strengths -- and Durations are obtained from the same Ukrainian text -- specified as the last String argument. The second Double -- argument is an average duration of the sounds in seconds. 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. uniqOverSoXSynthNGen4E6GSu :: FilePath -> Int -> Int -> Double -> Double -> Double -> String -> String -> Intervals -> String -> String -> Double -> IO () -- | Maintainer : olexandr543@yahoo.com -- -- 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. 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*" 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 :: FilePath -> Int -> IO String -- | 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. dobutokO2H7 :: Bool -> String -> FilePath -> IO () -- | Actually works as pAnR_ function. dobutokO2H9 :: Bool -> String -> FilePath -> IO () -- | Tesing variant of the soundGen3G with predefined three last -- functional arguments. testSoundGen2G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> IO () -- | Generates a sequence of sounds with changing timbre. Uses several -- functions as parameters. soundGen3G :: FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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_O :: Int -> Int -> Double -> FilePath -> (Double -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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_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 -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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). 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) -> (Double -> OvertonesO) -> IO () -- | Tesing variant of the soundGen3GMN with predefined three last -- functional arguments. testSoundGen2GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> IO () -- | 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). soundGen3GMN :: Int64 -> Int64 -> FilePath -> (Double -> OvertonesO) -> Double -> String -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> ((Double, Double) -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (OvertonesO -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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_O2MN :: Int64 -> Int64 -> ((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 -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | 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). 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 -> OvertonesO) -> Double -> String -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (OvertonesO -> Double -> (Double -> OvertonesO) -> OvertonesO) -> (Int -> OvertonesO) -> (Double -> OvertonesO) -> IO () -- | For the given parameters generates a single sound with overtones. h1 :: (Double -> OvertonesO) -> (Double, Double) -> Int -> IO () -- | For the given parameters generates a single sound with overtones. -- Unlike the h1 function, it lifts into specified by Int -- arguments enku (see liftInEnku) the frequency. h2 :: OvertonesO -> (Double, Double) -> Int -> Int -> Double -> 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 ()