OSCFoundation

OSCFoundation

A complete OSC 1.0 implementation in pure Swift, now open source.

I released OSCFoundation, an MIT-licensed OSC 1.0 implementation written entirely in Swift. Zero external dependencies – just Foundation and Network.

Why

The existing Swift OSC libraries are either GPL-licensed, abandoned, or missing critical features like TCP transport and pattern matching. I needed something I could use in my own apps without licensing headaches, so I built one from scratch.

Features

  • Full OSC 1.0 spec – messages, bundles, all standard type tags plus extended types (int64, float64, char, color, MIDI, symbol, arrays)
  • TCP and UDP transports – client, server, peer, and multicast actors ready to use
  • PLH and SLIP framing – Packet Length Header (ETC Eos default) and SLIP for TCP streams
  • Pattern matching – full OSC address pattern matching with wildcards (*, ?, [chars], {alt,alt})
  • Address space – register handlers and dispatch incoming messages with O(1) exact-match lookup
  • Swift 6 strict concurrency – all types are Sendable, transports are actor-isolated
  • Async/awaitAsyncStream-based packet and connection state delivery
  • Zero dependencies – Foundation + Network only, no third-party packages

macOS 15+, Swift 6.0. 95% code coverage.

Check it out on GitHub.