zmidi-score-0.3.0.0: Representing MIDI a simple score.

Copyright(c) 2012--2014, Utrecht University
LicenseLGPL-3
MaintainerW. Bas de Haas <w.b.dehaas@uu.nl>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

ZMidi.IO.Common

Contents

Description

Summary: Some common IO utilities

Synopsis

Mapping

mapDirInDir :: (FilePath -> IO a) -> FilePath -> IO [a] Source

Applies a function to every directory inside a specific directory

mapDir :: (FilePath -> IO a) -> FilePath -> IO [a] Source

Applies a function to every file/dir in a directory

mapDir_ :: (FilePath -> IO a) -> FilePath -> IO () Source

Applies a function to every file/dir in a directory, similar to mapDir, but it discards the result of the evaluation

Folding

foldrDirInDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b Source

Folds a function to every directory inside a specific directory

foldrDir :: (FilePath -> b -> IO b) -> b -> FilePath -> IO b Source

Folds a function to every file/dir in a directory

Reading and Writing

readMidiScoreSafe :: FilePath -> IO (Either String MidiScore) Source

Reads a MidiFile converts it into a MidiScore and checks if the MidiScore has a reasonable average quantisation deviation (see QDevPerc)

readQMidiScoreSafe :: FilePath -> IO (Either String QMidiScore) Source

Reads a MidiFile using readMidiScoreSafe, quantisees the result and checks if the MidiScore has a reasonable average quantisation deviation (see QDevPerc)

readMidiScore :: FilePath -> IO MidiScore Source

Reads a MidiFile converts it into a MidiScore and returns it

writeMidiScore :: MidiScore -> FilePath -> IO () Source

Writes a MidiScore to a file.

Utilities

logDuplicates :: FilePath -> IO () Source

Reads all midifiles at a specific location and compares all files to all files, printing the paths of the files with the same MIDI content to the user

removeTrackLabels :: FilePath -> IO () Source

Removes the Track labels from a MidiFile

putErrStrLn :: String -> IO () Source

Prints a string to the standard error stream

warning :: FilePath -> String -> IO () Source

Sends a warning about a file that cannot be read to the stderr