HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulehosc-0.20Haskell2010

Sound.Osc.Coding.Encode.Base

Base-level encode function for Osc packets (slow). For ordinary use see Sound.Osc.Coding.Encode.Builder.

  • 6 values
  • Packagehosc-0.20
  • Exports6
  • LanguageHaskell2010
  • LicenceGPL-3.0-only
  • SourceBase.hs

Encode Osc Datum.

MidiData: Bytes from MSB to LSB are: port id, status byte, data1, data2.

encode_datum (blob [1, 2, 3, 4]) == B.pack [0, 0, 0, 4, 1, 2, 3, 4]

Encode Osc Message.

m = Message "/n_set" [int32 (-1), string "freq", float 440, string "amp", float 0.1]
e = blob_unpack (encodeMessage m)
length e == 40
e == [47,110,95,115,101,116,0,0,44,105,115,102,115,102,0,0,255,255,255,255,102,114,101,113,0,0,0,0,67,220,0,0,97,109,112,0,61,204,204,205]

Encode Osc Bundle.

b = Bundle 0.0 [m] e = blob_unpack (encodeBundle b) length e == 60 e == [35,98,117,110,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,40,47,110,95,115,101,116,0,0,44,105,115,102,115,102,0,0,255,255,255,255,102,114,101,113,0,0,0,0,67,220,0,0,97,109,112,0,61,204,204,205]