syncosc

package module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2017 License: MIT Imports: 4 Imported by: 1

README

syncosc

Tiny package that contains constants for oscsync

Documentation

Overview

Package syncosc exists to define constants used in the oscsync protocol. See http://github.com/scgolang/oscsync/README.md

Index

Constants

View Source
const (
	AddressPulse       = "/sync/pulse"
	AddressSlaveAdd    = "/sync/slave/add"
	AddressSlaveList   = "/sync/slave/list"
	AddressSlaveRemove = "/sync/slave/remove"
	AddressTempo       = "/sync/tempo"
)

OSC addresses.

View Source
const MasterPort = 5776

MasterPort is the listening port for the oscsync master.

View Source
const PulsesPerBar = 96

PulsesPerBar is the number of pulses in a bar (measure).

Variables

This section is empty.

Functions

func GetPulseDuration added in v0.1.3

func GetPulseDuration(tempo float32) time.Duration

GetPulseDuration converts the tempo in bpm to a time.Duration callers are responsible for making concurrent access safe.

func Ticker added in v0.1.7

func Ticker(ctx context.Context, slave Slave, host string) error

Ticker runs a ticker that triggers the slave. This func blocks forever.

Types

type ConnectorFunc added in v0.1.6

type ConnectorFunc func(ctx context.Context, slave Slave, host string) error

ConnectorFunc connects a slave to an oscsync server.

type Pulse added in v0.1.4

type Pulse struct {
	Tempo float32
	Count int32
}

Pulse represents the arguments in a /sync/pulse message.

func PulseFromMessage added in v0.1.4

func PulseFromMessage(m osc.Message) (Pulse, error)

PulseFromMessage gets a Pulse from an OSC message.

type Slave added in v0.1.6

type Slave interface {
	Pulse(Pulse) error
}

Slave is any type that can sync to an oscsync master. The slave's Pulse method will be invoked every time a new pulse is received from the oscsync master.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL