dobutokO2-0.17.1.0: A program and a library to create experimental music from a mono audio and a Ukrainian text

Copyright(c) OleksandrZhabenko 2020
LicenseMIT
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

DobutokO.Sound.IntermediateF

Contents

Description

Maintainer : olexandr543@yahoo.com

A program and a library to create experimental music from a mono audio and a Ukrainian text.

Synopsis

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.

pAnR_ :: IO () Source #

Marks the needed 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.

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.

thisOne :: IO Bool Source #

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.

playSeqARV :: Vector Int -> IO () Source #

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.

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.

SoX effects application

With "reverb" as the first

reverbE :: FilePath -> [String] -> IO () Source #

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"), 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.

reverbWE :: FilePath -> [String] -> IO () Source #

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"). Please, for more information, refer to SoX documentation.

reverb1E :: FilePath -> [String] -> IO () Source #

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").

reverbW1E :: FilePath -> [String] -> IO () Source #

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").

Generalized

soxE :: FilePath -> [String] -> IO () Source #

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"), 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.

soxE1 :: FilePath -> [String] -> IO () Source #

The same as soxE, but at the end file is being mixed to obtain mono audio.