Safe Haskell | None |
---|
Spear PTPF
(par-text-partials-format) files.
- duples :: [t] -> [(t, t)]
- triples :: [t] -> [(t, t, t)]
- at_last :: (a -> a) -> [a] -> [a]
- mean :: Floating a => [a] -> a
- minmax :: Ord b => [b] -> (b, b)
- type N_Time = Double
- type N_Data = Double
- data Node = Node {
- n_partial_id :: Int
- n_time :: Double
- n_frequency :: N_Data
- n_amplitude :: N_Data
- n_zero_amplitude :: Node -> Node
- n_set_partial_id :: Int -> Node -> Node
- n_temporal_f :: (N_Time -> N_Time) -> Node -> Node
- data Seq = Seq {
- s_identifier :: Int
- s_start_time :: N_Time
- s_end_time :: N_Time
- s_nodes :: Int
- s_data :: [Node]
- s_map :: (Node -> Node) -> Seq -> Seq
- s_summarise :: ([a] -> b) -> (Node -> a) -> Seq -> b
- s_max_amplitude :: Seq -> N_Data
- s_min_amplitude :: Seq -> N_Data
- s_mean_amplitude :: Seq -> N_Data
- s_mean_frequency :: Seq -> N_Data
- s_duration :: Seq -> N_Time
- s_set_identifier :: Int -> Seq -> Seq
- s_eq_identifier :: Seq -> Seq -> Bool
- s_union :: [Seq] -> [Seq] -> [Seq]
- s_temporal_f :: (N_Time -> N_Time) -> Seq -> Seq
- data PTPF = PTPF {
- p_partials :: Int
- p_seq :: [Seq]
- p_start_time :: PTPF -> N_Time
- p_end_time :: PTPF -> N_Time
- p_nodes :: PTPF -> Int
- p_from_seq :: [Seq] -> PTPF
- p_temporal_f :: (N_Time -> N_Time) -> PTPF -> PTPF
- p_map :: (Seq -> Seq) -> PTPF -> PTPF
- p_filter :: (Seq -> Bool) -> PTPF -> PTPF
- p_node_map :: (Node -> Node) -> PTPF -> PTPF
- type STR = ByteString
- str_int :: ByteString -> Int
- str_double :: Floating n => ByteString -> n
- str_words :: ByteString -> [ByteString]
- str_lines :: ByteString -> [ByteString]
- ptpf_node :: Int -> (STR, STR, STR) -> Node
- ptpf_seq :: (STR, STR) -> Seq
- ptpf_header :: [STR] -> Maybe Int
- parse_ptpf :: STR -> Either String PTPF
- ptpf_time_asc :: PTPF -> [(N_Time, [Node])]
Tuple
List
mean :: Floating a => [a] -> aSource
Numerically stable mean
map mean [[1..5],[3,5,7],[7,7],[3,9,10,11,12]] == [3,5,7,9]
Node
Record to hold data for single node of a partial track.
Node | |
|
n_zero_amplitude :: Node -> NodeSource
Set n_amplitude
at Node
to 0
.
n_set_partial_id :: Int -> Node -> NodeSource
Set n_partial_id
at Node
.
Seq
s_summarise :: ([a] -> b) -> (Node -> a) -> Seq -> bSource
s_max_amplitude :: Seq -> N_DataSource
maximum
n_amplitude
at s_data
.
s_min_amplitude :: Seq -> N_DataSource
minimum
n_amplitude
at s_data
.
s_mean_amplitude :: Seq -> N_DataSource
mean
n_amplitude
at s_data
.
s_mean_frequency :: Seq -> N_DataSource
mean
n_frequency
at s_data
.
s_set_identifier :: Int -> Seq -> SeqSource
Set s_identifier
and associated n_partial_id
.
s_eq_identifier :: Seq -> Seq -> BoolSource
PTPF
p_start_time :: PTPF -> N_TimeSource
minimum
s_start_time
at p_seq
.
p_end_time :: PTPF -> N_TimeSource
maximum
s_end_time
at p_seq
.
Parser
type STR = ByteStringSource
str_int :: ByteString -> IntSource
str_double :: Floating n => ByteString -> nSource
str_words :: ByteString -> [ByteString]Source
str_lines :: ByteString -> [ByteString]Source
ptpf_header :: [STR] -> Maybe IntSource
Parse header section, result is number of partials.