Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : olexandr543@yahoo.com
A program and a library to create experimental music from a mono audio and a Ukrainian text.
Synopsis
- getFileRSizes :: IO (Vector Integer)
- getFileRSizesS :: IO (Vector Int)
- getFileRSizesS2 :: IO (Vector Int)
- getFileRTuples :: IO (Vector (FilePath, Integer))
- listVDirectory :: IO (Vector FilePath)
- isHighQ :: String -> Bool
- shouldBeReplaced :: String -> Bool
- indexesFromMrk :: String -> Int
- playAndMark :: Vector FilePath -> IO (Vector String)
- playAMrk :: IO (Vector String)
- pAnR1 :: Vector String -> IO (Vector String)
- pAnR2 :: Vector String -> IO ()
- pAnR_ :: IO ()
- infoFromV :: Vector String -> [(Vector Int, Vector String)]
- internalConv :: ([String], [String]) -> (Vector Int, Vector String)
- ixFromRes :: String -> String
- ixInterv :: Int -> IO (Int, Int)
- thisOne :: IO Bool
- playSeqAR :: Int -> IO ()
- playSeqARV :: Vector Int -> IO ()
- playSeqARV2 :: Vector String -> IO ()
- playCollect1Dec :: Vector String -> Int -> IO Bool
- playCollectDec :: Vector String -> IO (Vector Bool)
- replaceWithHQs :: FilePath -> Vector Bool -> Vector FilePath -> IO ()
Basic functions to work with intermediate files "result*wav"
getFileRSizes :: IO (Vector Integer) Source #
Gets sizes of the "result*.wav" files in the current directory.
getFileRSizesS :: IO (Vector Int) Source #
Similar to getFileRSizes
, but sizes are Int
, not Integer
. For most cases it is more memory efficient.
getFileRSizesS2 :: IO (Vector Int) Source #
Variant of getFileRSizes
function.
getFileRTuples :: IO (Vector (FilePath, Integer)) Source #
Gets Vector
of tuples of the pairs of "result*.wav" files and their respective sizes.
listVDirectory :: IO (Vector FilePath) Source #
Gets Vector
of the filenames for "result*.wav" files in the current directory.
isHighQ :: String -> Bool Source #
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.
shouldBeReplaced :: String -> Bool Source #
Function-predicate to check whether a file corresponding to its String
argument is needed to be replaced while processing.
indexesFromMrk :: String -> Int Source #
Gets an index of the Vector
element corresponding to the String
generated by playAndMark
function.
Functions to edit the melody by editing the intermediate files "result*wav"
playAndMark :: Vector FilePath -> IO (Vector String) Source #
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.
playAMrk :: IO (Vector String) Source #
Function playAndMark
applied to all the "result*.wav" files in the current directory.
pAnR1 :: Vector String -> IO (Vector String) Source #
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.
pAnR2 :: Vector String -> IO () Source #
Process the 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.
Additional functions
Get information
infoFromV :: Vector String -> [(Vector Int, Vector String)] Source #
Parser to the result of listVDirectory
function to get the needed information.
internalConv :: ([String], [String]) -> (Vector Int, Vector String) Source #
Used to obtain parameters for processment.
ixFromRes :: String -> String Source #
Axiliary function to get a String
of consequent digits in the name of the "result*.wav" file.
ixInterv :: Int -> IO (Int, Int) Source #
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.
IO
checkbox whether to add the sound played to the sequence of sounds that will replace the needed one.
Process and Edit
playSeqAR :: Int -> IO () Source #
Plays a sequence of sounds in the interval of them obtained by ixInterv
function.
playSeqARV2 :: Vector String -> IO () Source #
Plays a sequence of sounds considered of higher quality.
playCollect1Dec :: Vector String -> Int -> IO Bool Source #
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.
playCollectDec :: Vector String -> IO (Vector Bool) Source #
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.
replaceWithHQs :: FilePath -> Vector Bool -> Vector FilePath -> IO () Source #
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.