hosc-0.14: Haskell Open Sound Control

Safe HaskellSafe-Inferred

Sound.OSC.Normalise

Contents

Description

Datum normalisation.

Synopsis

Documentation

normalise_datum :: Datum -> DatumSource

Lift Int32 to Int64 and Float to Double.

 map normalise_datum [Int32 1,Float 1] == [Int64 1,Double 1]

normalise_message :: Message -> MessageSource

A normalised Message has only Int64 and Double numerical values.

 let m = message "/m" [Int32 0,Float 0]
 in normalise_message m == message "/m" [Int64 0,Double 0]

normalise_bundle :: Bundle -> BundleSource

A normalised Bundle has only Int64 and Double numerical values.

Coercion

message_coerce :: (Datum -> Datum) -> Message -> MessageSource

Map a normalising function over datum at an OSC Message.

bundle_coerce :: (Datum -> Datum) -> Bundle -> BundleSource

Map a normalising function over datum at an OSC Bundle.

Promotion

datum_promote :: Datum -> DatumSource

Coerce Int32, Int64 and Float to Double.

 map datum_promote [Int32 5,Float 5] == [Double 5,Double 5]

datum_floor :: Datum -> DatumSource

Datum as Int64 if Int32, Int64, Float or Double.

 let d = [Int32 5,Int64 5,Float 5.5,Double 5.5,string "5"]
 in map datum_floor d == [Int64 5,Int64 5,Int64 5,Int64 5,string "5"]