| Copyright | (c) OleksandrZhabenko 2020 |
|---|---|
| License | MIT |
| Stability | Experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
DobutokO.Sound.Keyboard
Description
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.
Synopsis
- qwerty2dvorak :: ByteString -> ByteString
- dvorak2qwerty :: ByteString -> ByteString
- input2BL :: IO ByteString
- input2BLN :: Int64 -> IO ByteString
- input2BLMN :: Int64 -> Int64 -> IO ByteString
- readFile2BL :: FilePath -> IO ByteString
- readFile2BLN :: Int64 -> FilePath -> IO ByteString
- readFile2BLMN :: Int64 -> Int64 -> FilePath -> IO ByteString
- readFile2BLGen :: String -> FilePath -> IO ByteString
- readFile2BLGenN :: Int64 -> String -> FilePath -> IO ByteString
- readFile2BLGenMN :: Int64 -> Int64 -> String -> FilePath -> IO ByteString
- readFileDoubles :: FilePath -> IO (Vector Int)
- readFileDoublesN :: Int64 -> FilePath -> IO (Vector Int)
- readFileDoublesMN :: Int64 -> Int64 -> FilePath -> IO (Vector Int)
- readFileDoublesGen :: String -> FilePath -> IO (Vector Int)
- readFileDoublesGenN :: Int64 -> String -> FilePath -> IO (Vector Int)
- readFileDoublesGenMN :: Int64 -> Int64 -> String -> FilePath -> IO (Vector Int)
- takeDoubles :: ByteString -> Vector Int
- hashStr2 :: Char -> Char -> Int
- convH :: String -> (ByteString -> ByteString) -> ByteString -> ByteString
Working with input and files
qwerty2dvorak :: ByteString -> ByteString Source #
Converts a string of lowercase ASCII letters being typed on the QWERTY keyboard layout into corresponding Dvorak keyboard layout.
dvorak2qwerty :: ByteString -> ByteString Source #
Vice versa to qwerty2dvorak.
input2BL :: IO ByteString Source #
Get contents into lazy ByteString with filtering of all characters that are not a lower case ascii letters.
input2BLMN :: Int64 -> Int64 -> IO ByteString Source #
readFile2BL :: FilePath -> IO ByteString Source #
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.
readFile2BLN :: Int64 -> FilePath -> IO ByteString Source #
Like readFile2BL, but reads only first n symbols specified with the first Int64 argument.
readFile2BLMN :: Int64 -> Int64 -> FilePath -> IO ByteString Source #
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.
readFile2BLGen :: String -> FilePath -> IO ByteString Source #
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).
readFile2BLGenN :: Int64 -> String -> FilePath -> IO ByteString Source #
Like readFile2BLGen, but reads only first n symbols specified with the first Int64 argument.
readFile2BLGenMN :: Int64 -> Int64 -> String -> FilePath -> IO ByteString Source #
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.
Conversions
readFileDoubles :: FilePath -> IO (Vector Int) Source #
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.
readFileDoublesN :: Int64 -> FilePath -> IO (Vector Int) Source #
Like readFileDoubles, but returns only first n elements of the Vector specified with the first Int64 argument.
readFileDoublesMN :: Int64 -> Int64 -> FilePath -> IO (Vector Int) Source #
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.
readFileDoublesGen :: String -> FilePath -> IO (Vector Int) Source #
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.
readFileDoublesGenN :: Int64 -> String -> FilePath -> IO (Vector Int) Source #
Like readFileDoublesGen, but returns only first n elements of the Vector specified with the first Int64 argument.
readFileDoublesGenMN :: Int64 -> Int64 -> String -> FilePath -> IO (Vector Int) Source #
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.
takeDoubles :: ByteString -> Vector Int Source #
Converts a lazy ByteString into a Vector of Int using hashStr2.
hashStr2 :: Char -> Char -> Int Source #
Hashes two lower case ascii characters. Is used for controlling frequencies and operators.
convH :: String -> (ByteString -> ByteString) -> ByteString -> ByteString Source #
Auxiliary function to define how is a ByteString treated, see readFile2BLGen.