pitchtrack-0.1.0.0: Pitch tracking library

Safe HaskellNone
LanguageHaskell2010

PitchTrack.Track

Contents

Description

This module provides a high-level interface for the most common cases.

The default number of samples used for each computation is 2048, which should be enough if you never go below 65Hz. If you need a different number, you should use the functions whose name ends with N, which take the number of samples as a first parameter.

Synopsis

Reading from a file

trackFile :: FilePath -> (Double -> PitchTrack ()) -> IO () Source

Track a file and apply a function to each computed pitch

>>> trackFile "a440.raw" $ \pitch -> liftIO $ putStr (show pitch ++ ",")
440.0,440.0,440.0,440.0,440.0,440.0,440.0,440.0,440.0,440.0,440.0,440.0,

trackFileN :: Int -> FilePath -> (Double -> PitchTrack ()) -> IO () Source

Same as trackFile, but takes the number of samples as a first parameter

trackFileToList :: FilePath -> IO [Double] Source

Track a file and return a list of all the computed pitches

Note: the whole list is loaded into memory

Reading from stdin

trackStdin :: (Double -> PitchTrack ()) -> IO () Source

Same as trackFile but reads from stdin instead of a file

trackStdinN :: Int -> (Double -> PitchTrack ()) -> IO () Source

Same as trackStdin, but takes the number of samples as a first parameter

Reading from a handle

trackHandle :: Handle -> (Double -> PitchTrack ()) -> IO () Source

Same as trackFile but reads from a handle instead of a file

trackHandleN :: Int -> Handle -> (Double -> PitchTrack ()) -> IO () Source

Same as trackHandle, but takes the number of samples as a first parameter

Reading from a lazy ByteString

trackLBS :: ByteString -> (Double -> PitchTrack ()) -> IO () Source

Track a lazy ByteString and apply a function to each computed pitch

trackLBSN :: Int -> ByteString -> (Double -> PitchTrack ()) -> IO () Source

Same as trackLBS, but takes the number of samples as a first parameter

Other definitions

defaultSampleNum :: Int Source

The default number of samples used for each computation (2048)