https://github.com/hypebeast/go-osc
Open Sound Control (OSC) library for Golang. Implemented in pure Go.
https://github.com/hypebeast/go-osc
go golang golang-library opensoundcontrol osc
Last synced: 12 months ago
JSON representation
Open Sound Control (OSC) library for Golang. Implemented in pure Go.
- Host: GitHub
- URL: https://github.com/hypebeast/go-osc
- Owner: hypebeast
- License: mit
- Created: 2013-08-26T14:10:42.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-01-15T23:19:26.000Z (about 3 years ago)
- Last Synced: 2024-07-31T20:51:57.624Z (over 1 year ago)
- Topics: go, golang, golang-library, opensoundcontrol, osc
- Language: Go
- Homepage:
- Size: 214 KB
- Stars: 197
- Watchers: 12
- Forks: 46
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- fucking-awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- awesome-go-info - go-osc
- awesome-go-cn - go-osc - osc) (硬件 / 检索及分析资料库)
- awesome-go-extra - go-osc - 08-26T14:10:42Z|2022-03-08T23:43:04Z| (Hardware / Tutorials)
- awesome-go-with-stars - go-osc - 03-08 | (Hardware / Search and Analytic Databases)
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- awesome-go-cn - go-osc - osc) [![godoc][D]](https://godoc.org/github.com/hypebeast/go-osc) (硬件 / 检索及分析资料库)
- awesome-go-plus - go-osc - Open Sound Control (OSC) bindings for Go.  (Hardware / Search and Analytic Databases)
- awesome-go - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Search and Analytic Databases)
- go-awesome-with-star-updatetime - go-osc - Open Sound Control (OSC) bindings for Go. (Hardware / Advanced Console UIs)
README
# GoOSC
 [](https://godoc.org/github.com/hypebeast/go-osc/osc) [](https://coveralls.io/github/hypebeast/go-osc?branch=master)
[](https://goreportcard.com/report/github.com/hypebeast/go-osc)
[Open Sound Control (OSC)](http://opensoundcontrol.org) 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
```shell
go get github.com/hypebeast/go-osc
```
## Usage
### Client
```go
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
```go
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
```shell
make test
```