Skip to content
SwiftOSC is an Open Sound Control client and server framework written in Swift.
Branch: master
Clone or download
devinroth and Devin Roth Update podspec
Latest commit 49967c1 Apr 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Examples Update to Swift 4.2 Mar 22, 2019
Framework Enable broadcasting. Feb 17, 2019
Playgrounds.playground Add SwiftOSC.podspec Nov 20, 2017
SwiftOSC.xcworkspace Update Dec 28, 2018
.gitignore Update .gitignore Nov 10, 2017
.swift-version Update .swift-version Oct 30, 2018
CHANGELOG.md Update CHANGELOG.md Apr 2, 2019
LICENSE Add SwiftOSC.podspec Nov 20, 2017
README.md Update README.md Dec 21, 2018
SwiftOSC.podspec Update podspec Apr 2, 2019

README.md

SwiftOSC v1.2

Version License Platform

SwiftOSC is a Swift Open Sound Control (OSC) 1.1 client and server framework.

Installation

pod 'SwiftOSC', '~> 1.2'

OR

Step 1

Clone or download repository from Github.

Step 2

Open SwiftOSC.xcworkspace and build SwiftOSC frameworks.

Step 3

Embed SwiftOSC into project.

Quick Start

OSC Server

Step 1

Import SwiftOSC framework into your project

import SwiftOSC

Step 2

Create Server

var server = OSCServer(address: "", port: 8080)

Step 3

Start server

server.start()

Step 4

Setup server delegate to handle incoming OSC Data

class OSCHandler: OSCServerDelegate {
    
    func didReceive(_ message: OSCMessage){
        if let integer = message.arguments[0] as? Int {
            print("Received int \(integer)")
        } else {
            print(message)
        }
    }
}
server.delegate =  OSCHandler()

OSC Client

Step 1

Import SwiftOSC framework into your project

import SwiftOSC

Step 2

Create client

var client = OSCClient(address: "localhost", port: 8080)

Step 3

Create a message

var message = OSCMessage(
    OSCAddressPattern("/"), 
    100, 
    5.0, 
    "Hello World", 
    Blob(), 
    true, 
    false, 
    nil, 
    impulse, 
    Timetag(1)
)

Step 4

Send message

client.send(message)

Known Issues

  • All OSC messages are delivered immediately. Timetags are ignored.

About

Devin Roth is a composer and programmer. When not composing, teaching, or being a dad, Devin attempts to make his life more efficient by writing programs.

For additional information on Open Sound Control visit http://opensoundcontrol.org/.

You can’t perform that action at this time.