Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Functions for reading midi note data (MND) from CSV files.
This is not a generic text midi notation.
The defined commands are on
and off
, but others may be present.
Non-integral note number and key velocity data are allowed.
- data_value_pp :: Real t => Int -> t -> String
- type Channel = Word8
- csv_mnd_hdr :: [String]
- type Param = (String, Double)
- param_parse :: String -> [Param]
- param_pp :: Int -> [Param] -> String
- type MND t n = (t, String, n, n, Channel, [Param])
- csv_mnd_parse :: (Read t, Real t, Read n, Real n) => CSV_Table String -> [MND t n]
- load_csv :: FilePath -> IO (CSV_Table String)
- csv_mnd_read :: (Read t, Real t, Read n, Real n) => FilePath -> IO [MND t n]
- csv_mnd_write :: (Real t, Real n) => Int -> FilePath -> [MND t n] -> IO ()
- type Event n = (n, n, Channel, [Param])
- midi_tseq_to_midi_wseq :: (Num t, Eq n) => Tseq t (Begin_End (Event n)) -> Wseq t (Event n)
- midi_wseq_to_midi_tseq :: (Num t, Ord t) => Wseq t x -> Tseq t (Begin_End x)
- mnd_to_tseq :: Num n => [MND t n] -> Tseq t (Begin_End (Event n))
- csv_mnd_read_tseq :: (Read t, Real t, Read n, Real n) => FilePath -> IO (Tseq t (Begin_End (Event n)))
- csv_mnd_write_tseq :: (Real t, Real n) => Int -> FilePath -> Tseq t (Begin_End (Event n)) -> IO ()
- csv_mndd_hdr :: [String]
- type MNDD t n = (t, t, String, n, n, Channel, [Param])
- csv_mndd_parse :: (Read t, Real t, Read n, Real n) => CSV_Table String -> [MNDD t n]
- csv_mndd_read :: (Read t, Real t, Read n, Real n) => FilePath -> IO [MNDD t n]
- csv_mndd_write :: (Real t, Real n) => Int -> FilePath -> [MNDD t n] -> IO ()
- mndd_to_wseq :: [MNDD t n] -> Wseq t (Event n)
- csv_mndd_read_wseq :: (Read t, Real t, Read n, Real n) => FilePath -> IO (Wseq t (Event n))
- csv_mndd_write_wseq :: (Real t, Real n) => Int -> FilePath -> Wseq t (Event n) -> IO ()
- csv_midi_parse_wseq :: (Read t, Real t, Read n, Real n) => CSV_Table String -> Wseq t (Event n)
- csv_midi_read_wseq :: (Read t, Real t, Read n, Real n) => FilePath -> IO (Wseq t (Event n))
Documentation
data_value_pp :: Real t => Int -> t -> String Source #
If r is whole to k places then show as integer, else as float to k places.
csv_mnd_hdr :: [String] Source #
The required header field.
param_parse :: String -> [Param] Source #
type MND t n = (t, String, n, n, Channel, [Param]) Source #
Midi note data, the type parameters are to allow for fractional note & velocity values.
The command is a string, on
and off
are standard, other commands may be present.
unwords csv_mnd_hdr == "time on/off note velocity channel param"
csv_mnd_read :: (Read t, Real t, Read n, Real n) => FilePath -> IO [MND t n] Source #
Midi note data.
let fn = "/home/rohan/cvs/uc/uc-26/daily-practice/2014-08-13.1.csv" m <- csv_mnd_read fn :: IO [MND Double Double] length m == 17655 csv_mnd_write 4 "/tmp/t.csv" m
MND Seq forms
midi_tseq_to_midi_wseq :: (Num t, Eq n) => Tseq t (Begin_End (Event n)) -> Wseq t (Event n) Source #
Translate from Tseq
form to Wseq
form.
mnd_to_tseq :: Num n => [MND t n] -> Tseq t (Begin_End (Event n)) Source #
Ignores non on/off messages.
csv_mnd_read_tseq :: (Read t, Real t, Read n, Real n) => FilePath -> IO (Tseq t (Begin_End (Event n))) Source #
Tseq
form of csv_mnd_read
, channel information is retained, off-velocity is zero.
csv_mnd_write_tseq :: (Real t, Real n) => Int -> FilePath -> Tseq t (Begin_End (Event n)) -> IO () Source #
Tseq
form of csv_mnd_write
, data is .
MNDD (simplifies cases where overlaps on the same channel are allowed).
csv_mndd_hdr :: [String] Source #
Message should be note
for note data.
csv_mndd_read :: (Read t, Real t, Read n, Real n) => FilePath -> IO [MNDD t n] Source #
Midi note/duration data.
MNDD Seq forms
csv_mndd_read_wseq :: (Read t, Real t, Read n, Real n) => FilePath -> IO (Wseq t (Event n)) Source #
Wseq
form of csv_mndd_read
.
csv_mndd_write_wseq :: (Real t, Real n) => Int -> FilePath -> Wseq t (Event n) -> IO () Source #
Wseq
form of csv_mndd_write
.