go-osc
Open Sound Control (OSC) bindings for Go
About go-osc
GoOSC
Open Sound Control (OSC) library for Golang. Implemented in pure Go.
Features
- OSC Bundles, including timetags
- OSC Messages
- OSC Client
- OSC Server
- Supports the following OSC argument types:
- 'i' (Int32)
- 'f' (Float32)
- 's' (string)
- 'b' (blob / binary data)
- 'h' (Int64)
- 't' (OSC timetag)
- 'd' (Double/int64)
- 'T' (True)
- 'F' (False)
- 'N' (Nil)
- Support for OSC address pattern including '*', '?', '{,}' and '[]' wildcards
Install
go get github.com/hypebeast/go-osc
Usage
Client
import "github.com/hypebeast/go-osc/osc"
func main() {
client := osc.NewClient("localhost", 8765)
msg := osc.NewMessage("/osc/address")
msg.Append(int32(111))
msg.Append(true)
msg.Append("hello")
client.Send(msg)
}
Server
package main
import "github.com/hypebeast/go-osc/osc"
func main() {
addr := "127.0.0.1:8765"
d := osc.NewStandardDispatcher()
d.AddMsgHandler("/message/address", func(msg *osc.Message) {
osc.PrintMessage(msg)
})
server := &osc.Server{
Addr: addr,
Dispatcher:d,
}
server.ListenAndServe()
}
Tests
make test
Frequently Asked Questions
What is go-osc?
go-osc is a Hardware library for the Go programming language. Open Sound Control (OSC) bindings for Go
How do I install go-osc?
Install go-osc with the Go module system using `go get hypebeast/go-osc`. Check the repository for the current installation instructions.
What category does go-osc belong to?
go-osc is listed under Hardware, specifically Hardware.