core

package
v0.0.0-...-075f868 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugHub = util.DebugFlags{
	MIDI:     false,
	API:      false,
	Loop:     false,
	Gen:      false,
	Realtime: true,
	OSC:      false,
	ISF:      false,
}

DebugHub controls debugging output

Functions

func NewPortmidiDevice

func NewPortmidiDevice() (util.MidiDevice, error)

NewPortmidiDevice returns a MidiDevice interface for portmidi

Types

type APIHandler

type APIHandler func(method string, paramvalues *map[string]string) error

APIHandler is an API execution func

type Command

type Command struct {
	Action string // e.g. "addmidi"
	Arg    interface{}
}

Command is sent on the control channel of the Hub

type Hub

type Hub struct {
	OSCInput        chan OSCEvent
	MIDIInput       chan util.MidiEvent
	MIDINumDown     int
	MIDIOctaveShift int
	// contains filtered or unexported fields
}

Hub is a router for devices and engines

func NewHub

func NewHub(addr string, midiin string) *Hub

NewHub returns a pointer to the one-and-only Hub

func (*Hub) ListenForever

func (hub *Hub) ListenForever()

ListenForever listens for things on its input channels

func (*Hub) Start

func (hub *Hub) Start()

Start starts listeners, etc

func (*Hub) StartMIDI

func (hub *Hub) StartMIDI()

StartMIDI listens for MIDI events and sends them to the MIDIInput chan

func (*Hub) Time

func (hub *Hub) Time() time.Time

Time returns the current time

type OSCEvent

type OSCEvent struct {
	Msg    *osc.Message
	Source string
}

OSCEvent is an OSC message

type PlaybackEvent

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

PlaybackEvent is a time-tagged cursor or API event

type PortmidiDevice

type PortmidiDevice struct {
	MidiInputs     map[string]*midiInput
	MidiInputNames []string

	MidiOutputNames []string
	// contains filtered or unexported fields
}

PortmidiDevice encapsulate everything having to do with MIDI I/O

func (*PortmidiDevice) Inputs

func (m *PortmidiDevice) Inputs() []string

Inputs returns a list of MIDI input names

func (*PortmidiDevice) Listen

func (m *PortmidiDevice) Listen(dev string) error

Listen for input on a particular MIDI device

func (*PortmidiDevice) ListeningInputs

func (m *PortmidiDevice) ListeningInputs() []string

ListeningInputs returns a list of MIDI input names that are open for listening

func (*PortmidiDevice) Outputs

func (m *PortmidiDevice) Outputs() []string

Outputs returns a list of MIDI output names

func (PortmidiDevice) Poll

func (m PortmidiDevice) Poll(inputName string) (bool, error)

Poll is

func (PortmidiDevice) ReadEvent

func (m PortmidiDevice) ReadEvent(inputName string) (util.MidiEvent, error)

ReadEvent is

func (*PortmidiDevice) SendANO

func (m *PortmidiDevice) SendANO(synth string)

SendANO sends all-notes-off

func (*PortmidiDevice) SendNote

func (m *PortmidiDevice) SendNote(n *util.Note, debug bool, callbacks []*util.NoteOutputCallback)

SendNote sends MIDI output for a Note

type PortmidiEvent

type PortmidiEvent struct {
	Event *portmidi.Event
}

PortmidiEvent is a single MIDI input event XXX - since is local, PortmidiEvent should just be portmidi.Event

type SynthDef

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

SynthDef is the port and channel for a given synth

type TuioCursor

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

TuioCursor is a TUIO cursor, the main purpose being to know when it hasn't been seen for a while, to generate an UP event

Jump to

Keyboard shortcuts

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