instrument

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package instrument ships ompool's SuperCollider instrument inside the binary and runs it. The audio view starts sclang on the embedded ompool.scd so a single `go install` gives people the sound as well as the dashboard; the only thing they need installed is SuperCollider itself.

Index

Constants

View Source
const Env = "OMPOOL_INSTRUMENT"

Env is the environment variable that controls the launcher: unset or "auto" starts the embedded instrument, "off" never starts anything (use this when running the instrument yourself in SCIDE), and a path runs that .scd instead of the embedded one.

Variables

View Source
var Source string

Source is the instrument as a SuperCollider script. `ompool instrument` prints it so people can open it in SCIDE and change the tunables.

View Source
var TestSender string

TestSender is a script that fakes the live feed so the instrument can be auditioned without waiting on the network.

Functions

This section is empty.

Types

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process is a running (or finished) sclang.

func Start

func Start(oscAddr string) *Process

Start decides whether to launch sclang for the given OSC destination and does so. It never returns nil, so callers can always ask for Status. The process is detached from the terminal: its output goes to a log file under the user cache directory, and stopping it also stops the scsynth it booted.

func (*Process) Status

func (p *Process) Status() (State, string)

Status reports the process state and a short line suitable for a panel.

func (*Process) Stop

func (p *Process) Stop()

Stop ends sclang and the server it booted. Safe on nil and on a process that was never started.

type State

type State int

State describes where the launcher got to, for display in the audio view.

const (
	// Off means the launcher was disabled with OMPOOL_INSTRUMENT=off.
	Off State = iota
	// External means something already listens on the OSC port, so ompool
	// left it alone and is feeding that instead (typically SCIDE).
	External
	// Missing means sclang is not on PATH.
	Missing
	// Starting means sclang is compiling its class library and booting the
	// server, which takes a few seconds.
	Starting
	// Running means the script reported itself ready.
	Running
	// Exited means sclang stopped on its own; the log has the reason.
	Exited
	// Failed means sclang could not be started at all.
	Failed
)

Jump to

Keyboard shortcuts

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