engine

package
v0.0.0-...-28f6ca2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoteOnStatus       byte = 0x90
	NoteOffStatus      byte = 0x80
	PressureStatus     byte = 0xa0
	ControllerStatus   byte = 0xb0
	ProgramStatus      byte = 0xc0
	ChanPressureStatus byte = 0xd0
	PitchbendStatus    byte = 0xe0
)

These are the values of MIDI status bytes

View Source
const MaxClicks = Clicks(math.MaxInt64)

MaxClicks is the high-possible value for Clicks

View Source
const UnfinishedDuration = math.MaxInt32 - 1

UnfinishedDuration is an 'unset' value for Duration

Variables

View Source
var CurrentMilli int

CurrentMilli is the time from the start, in milliseconds

View Source
var DebugUtil = DebugFlags{}

DebugUtil controls debugging

View Source
var MONTAGE_SOURCELogged = false
View Source
var MontageAPISubject = "montage.api"

MontageAPISubject xxx

View Source
var MontageEventSubject = "montage.event"

MontageEventSubject xxx

View Source
var ParamDefs map[string]ParamDef

ParamDefs is the set of all parameter definitions

View Source
var ParamEnums map[string][]string

ParamEnums contains the lists of enumerated values for string parameters

View Source
var ResolumeJSON map[string]interface{}

ResolumeJSON is an unmarshalled version of the resolume.json file

View Source
var Scales map[string]*Scale

Scales maps a name to a Scale

View Source
var TempoFactor = float64(1.0)

TempoFactor xxx

Functions

func ArgAsFloat32

func ArgAsFloat32(msg *osc.Message, index int) (f float32, err error)

ArgAsFloat32 xxx

func ArgAsInt

func ArgAsInt(msg *osc.Message, index int) (i int, err error)

ArgAsInt xxx

func ArgAsString

func ArgAsString(msg *osc.Message, index int) (s string, err error)

ArgAsString xxx

func BinFilePath

func BinFilePath(nm string) string

BinFilePath xxx

func CallAPI

func CallAPI(method string, args []string)

CallAPI calls an API in the Montage Freeframe plugin running in Resolume

func ChangeClicksPerSecond

func ChangeClicksPerSecond(factor float64)

ChangeClicksPerSecond is what you use to change the tempo

func ConfigBool

func ConfigBool(nm string) bool

ConfigBool returns bool value of nm, or false if nm not set

func ConfigBoolWithDefault

func ConfigBoolWithDefault(nm string, dflt bool) bool

ConfigBoolWithDefault xxx

func ConfigFilePath

func ConfigFilePath(nm string) string

ConfigFilePath xxx

func ConfigValue

func ConfigValue(nm string) string

ConfigValue returns "" if there's no value

func CopyDir

func CopyDir(src, dest string) error

CopyDir xxx

func ErrorResponse

func ErrorResponse(err error) string

ErrorResponse return a JSON 2.0 error response

func GetNUID

func GetNUID() string

GetNUID xxx

func GetString

func GetString(pmap map[string]string, name string) (string, error)

GetString complains if a parameter is not there, but still returns ""

func GetXYZ

func GetXYZ(api string, args map[string]string) (x, y, z float32, err error)

GetXYZ xxx

func InitDebug

func InitDebug()

InitDebug xxx

func InitLog

func InitLog(source string)

InitLog xxx

func InitLogs

func InitLogs(logfile string)

InitLogs xxx

func InitScales

func InitScales()

InitScales xxx

func InitializeClicksPerSecond

func InitializeClicksPerSecond(clkpersec int)

InitializeClicksPerSecond initializes

func IsTrueValue

func IsTrueValue(value string) (bool, error)

IsTrueValue returns true if the value is some version of true

func KillProcess

func KillProcess(exe string)

KillProcess kills a process (synchronously)

func ListenForLocalDeviceInputsForever

func ListenForLocalDeviceInputsForever()

ListenForLocalDeviceInputsForever listens for local device inputs (OSC, MIDI)

func LoadImage

func LoadImage(path string) (*image.NRGBA, error)

LoadImage reads an image file

func LoadParamDefs

func LoadParamDefs() error

LoadParamDefs initializes the list of parameters

func LoadParamEnums

func LoadParamEnums() error

LoadParamEnums initializes the list of enumerated parameter values

func LoadResolumeJSON

func LoadResolumeJSON() error

LoadResolumeJSON returns an unmarshalled version of the resolume.json file

func LocalConfigFilePath

func LocalConfigFilePath(nm string) string

LocalConfigFilePath xxx

func LocalMontageDir

func LocalMontageDir() string

LocalMontageDir xxx

func LogFilePath

func LogFilePath(nm string) string

LogFilePath xxx

func MIDIFilePath

func MIDIFilePath(nm string) string

MIDIFilePath xxx

func MyNUID

func MyNUID() string

MyNUID xxx

func NeedBoolArg

func NeedBoolArg(nm string, api string, args map[string]string) (bool, error)

NeedBoolArg xx

func NeedFloatArg

func NeedFloatArg(nm string, api string, args map[string]string) (float32, error)

NeedFloatArg xx

func NeedIntArg

func NeedIntArg(nm string, api string, args map[string]string) (int, error)

NeedIntArg xx

func NeedStringArg

func NeedStringArg(nm string, api string, args map[string]string) (string, error)

NeedStringArg xx

func OptionalStringArg

func OptionalStringArg(nm string, args map[string]string, dflt string) string

OptionalStringArg xx

func ParseBool

func ParseBool(s string, name string) (bool, error)

ParseBool xxx

func ParseFloat32

func ParseFloat32(s string, name string) (float32, error)

ParseFloat32 xxx

func ParseInt

func ParseInt(s string, name string) (int, error)

ParseInt xxx

func PublishGestureDeviceEvent

func PublishGestureDeviceEvent(ce GestureDeviceEvent) error

PublishGestureDeviceEvent xxx

func PublishMIDIDeviceEvent

func PublishMIDIDeviceEvent(me MIDIDeviceEvent) error

PublishMIDIDeviceEvent xxx

func PublishSpriteEvent

func PublishSpriteEvent(x, y, z float32) error

PublishSpriteEvent xxx

func ReadConfigFile

func ReadConfigFile(path string) (map[string]string, error)

ReadConfigFile xxx

func ResultResponse

func ResultResponse(resultObj interface{}) string

ResultResponse returns a JSON 2.0 result response

func RootPath

func RootPath() string

RootPath is the value of environment variable MONTAGE

func SendMail

func SendMail(recipient, subject, body string) error

SendMail xxx

func Spawn

func Spawn(executable string, background bool, stdout io.Writer, stderr io.Writer, args ...string) error

Spawn executes something. If background is true, it doesn't block

func StartDeviceInput

func StartDeviceInput()

StartDeviceInput starts anything needed to provide device inputs

func StartGestureInput

func StartGestureInput()

StartGestureInput xxx

func StartMIDI

func StartMIDI()

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

func StartNATSListener

func StartNATSListener()

StartNATSListener xxx

func StartNATSServer

func StartNATSServer()

StartNATSServer xxx

func StartOSCListener

func StartOSCListener(source string)

StartOSCListener xxx

func StartRealtime

func StartRealtime()

StartRealtime runs the looper and never returns

func StartVizNats

func StartVizNats()

StartVizNats xxx

func StringMap

func StringMap(params string) (map[string]string, error)

StringMap takes a JSON string and returns a map of elements

func StringParamOfAPI

func StringParamOfAPI(api string, pmap map[string]string, name string) (string, error)

StringParamOfAPI xxx

func TimeString

func TimeString() string

TimeString returns time and clicks

func VenueMidifiles

func VenueMidifiles(venue string) ([]string, error)

VenueMidifiles xxx

Types

type APIEvent

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

APIEvent is an API invocation

type APIExecutorFunc

type APIExecutorFunc func(api string, nuid string, rawargs string) (result interface{}, err error)

APIExecutorFunc xxx

type ActiveNote

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

ActiveNote is a currently active MIDI note

type ActivePhrase

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

ActivePhrase is a currently active MIDI phrase

func NewActivePhrase

func NewActivePhrase(p *Phrase) *ActivePhrase

NewActivePhrase constructs a new ActivePhrase for a Phrase

type ActivePhrasesManager

type ActivePhrasesManager struct {
	ActivePhrasesMutex sync.RWMutex
	// contains filtered or unexported fields
}

ActivePhrasesManager manages ActivePhrases

func NewActivePhrasesManager

func NewActivePhrasesManager() *ActivePhrasesManager

NewActivePhrasesManager xxx

func (*ActivePhrasesManager) AdvanceByOneClick

func (mgr *ActivePhrasesManager) AdvanceByOneClick()

AdvanceByOneClick xxx

func (*ActivePhrasesManager) CallbackOnOutput

func (mgr *ActivePhrasesManager) CallbackOnOutput(callback NoteOutputCallbackFunc) CallbackID

CallbackOnOutput xxx

func (*ActivePhrasesManager) StartPhrase

func (mgr *ActivePhrasesManager) StartPhrase(p *Phrase, cid string)

StartPhrase xxx NOTE: startPhrase assumes that the r.activePhrasesMutex is held for writing

func (*ActivePhrasesManager) StopPhrase

func (mgr *ActivePhrasesManager) StopPhrase(cid string, active *ActivePhrase, forceDelete bool)

StopPhrase xxx NOTE: stopPhrase assumes that the r.activePhrasesMutex is held for writing

func (*ActivePhrasesManager) UncallbackOnOutput

func (mgr *ActivePhrasesManager) UncallbackOnOutput(id CallbackID)

UncallbackOnOutput xxx

type ActiveStepGesture

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

ActiveStepGesture is a currently active (i.e. down) cursor NOTE: these are the cursors caused by GestureStepEvents, not the cursors caused by GestureDeviceEvents.

type CallbackID

type CallbackID int

CallbackID xxx

type Clicks

type Clicks int64

Clicks is a time or duration value. NOTE: A Clicks value can be negative because it's sometimes relative to the starting time of a Phrase

func Seconds2Clicks

func Seconds2Clicks(tm float64) Clicks

Seconds2Clicks converts a Time value (elapsed seconds) to Clicks

type Command

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

Command is sent on the control channel of the Router

type DebugFlags

type DebugFlags struct {
	Advance   bool
	API       bool
	Gesture   bool
	GenVisual bool
	GenSound  bool
	ISF       bool
	Loop      bool
	Config    bool
	MIDI      bool
	Morph     bool
	NATS      bool
	OSC       bool
	Resolume  bool
	Notify    bool
	Realtime  bool
	Remote    bool
}

DebugFlags xxx

type DeviceGesture

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

DeviceGesture purpose is to know when it hasn't been seen for a while, in order to generate an UP event

type GestureDeviceCallbackFunc

type GestureDeviceCallbackFunc func(e GestureDeviceEvent)

GestureDeviceCallbackFunc xxx

type GestureDeviceEvent

type GestureDeviceEvent struct {
	NUID       string
	Region     string
	ID         string
	Timestamp  int64  // milliseconds
	DownDragUp string // "down", "drag", "up"
	X          float32
	Y          float32
	Z          float32
	Area       float32
}

GestureDeviceEvent is a single GestureDevice event

type GestureStepEvent

type GestureStepEvent struct {
	ID         string // globally unique of the form {nuid}.{CID}[.#{instancenum}]
	X          float32
	Y          float32
	Z          float32
	Downdragup string
	LoopsLeft  int
	Fresh      bool
	Quantized  bool
	Finished   bool
}

GestureStepEvent is a down, drag, or up event inside a loop step

type LoopEvent

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

LoopEvent is what gets played back in a loop

type MIDIDeviceEvent

type MIDIDeviceEvent struct {
	Timestamp int64 // milliseconds
	Status    int64
	Data1     int64
	Data2     int64
}

MIDIDeviceEvent is a single MIDI event

type MIDIFile

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

MIDIFile lets you read a MIDI File

func NewMIDIFile

func NewMIDIFile(path string) (*MIDIFile, error)

NewMIDIFile creates a MIDIFile

func (*MIDIFile) Parse

func (m *MIDIFile) Parse() error

Parse reads the contents of a MIDIFile and creates Phrases for each track

func (*MIDIFile) Phrase

func (m *MIDIFile) Phrase() *Phrase

Phrase returns a single Phrase containing all tracks in the MIDIFile

type NoWriter

type NoWriter struct {
	Source string
}

NoWriter xxx

func (*NoWriter) Write

func (w *NoWriter) Write(p []byte) (n int, err error)

type Note

type Note struct {
	TypeOf   NoteType // NOTE, NOTEON, NOTEOFF, CONTROLLER, NOTEBYTES
	Clicks   Clicks   // nanoseconds
	Duration Clicks   // nanoseconds, when it's a NOTE
	Pitch    uint8    // 0-127
	Velocity uint8    // 0-127
	Sound    string
	// contains filtered or unexported fields
}

Note is a single item in a Phrase

func NewChanPressure

func NewChanPressure(data1 uint8, velocity uint8, sound string) *Note

NewChanPressure xxx

func NewController

func NewController(controller uint8, value uint8, sound string) *Note

NewController create a new NOTEOFF

func NewNote

func NewNote(pitch uint8, velocity uint8, duration Clicks, sound string) *Note

NewNote create a new Note of type NOTE, i.e. with duration

func NewNoteOff

func NewNoteOff(pitch uint8, velocity uint8, sound string) *Note

NewNoteOff create a new NOTEOFF

func NewNoteOn

func NewNoteOn(pitch uint8, velocity uint8, sound string) *Note

NewNoteOn create a new NOTEON

func NewPitchBend

func NewPitchBend(data1 uint8, data2 uint8, sound string) *Note

NewPitchBend xxx

func NewProgChange

func NewProgChange(program uint8, value uint8, sound string) *Note

NewProgChange xxx

func (*Note) Compare

func (n *Note) Compare(n2 *Note) int

Compare is used to determine Note ordering

func (*Note) Copy

func (n *Note) Copy() *Note

Copy a Note. NOTE: the next value is cleared

func (Note) Data1

func (n Note) Data1() uint8

Data1 xxx

func (Note) Data2

func (n Note) Data2() uint8

Data2 xxx

func (*Note) EndOf

func (n *Note) EndOf() Clicks

EndOf returns the ending time of a note

func (*Note) Format

func (n *Note) Format(f fmt.State, c rune)

Format xxx

func (*Note) IsNote

func (n *Note) IsNote() bool

IsNote returns true if the note is a NOTE, NOTEON, or NOTEOFF

func (*Note) ReadablePitch

func (n *Note) ReadablePitch() string

ReadablePitch returns a readable string for a note pitch Note that it also includes a + or - if it's a NOTEON or NOTEOFF. If it's not a NOTE-type note, "" is returned

func (*Note) ToString

func (n *Note) ToString() string

ToString produces a human-readable version of a Note. Note that it includes the surrounding quotes that make it look like a Phrase

type NoteOutputCallback

type NoteOutputCallback struct {
	Callback func(n *Note)
	// contains filtered or unexported fields
}

NoteOutputCallback is a call

type NoteOutputCallbackFunc

type NoteOutputCallbackFunc func(n *Note)

NoteOutputCallbackFunc xxx

type NoteType

type NoteType int

NoteType is NOTE, NOTEON, NOTEOFF, or NOTEBYTES

const (
	NOTE         NoteType = iota // full note with duration
	NOTEON       NoteType = iota
	NOTEOFF      NoteType = iota
	CONTROLLER   NoteType = iota
	PROGCHANGE   NoteType = iota
	CHANPRESSURE NoteType = iota
	PITCHBEND    NoteType = iota
	NOTEBYTES    NoteType = iota
)

These are the constant values of NoteType

type OSCEvent

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

OSCEvent is an OSC message

type Param

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

Param is a single parameter name/value

type ParamCallback

type ParamCallback func(name string, value string) error

ParamCallback is the callback when setting parameter values

type ParamDef

type ParamDef struct {
	Category string
	Init     string
	// contains filtered or unexported fields
}

ParamDef is a single parameter definition.

type ParamValue

type ParamValue interface{}

ParamValue is a single parameter value which could be any of the param*Value types

type ParamValues

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

ParamValues is the set of all parameter values

func NewParamValues

func NewParamValues() *ParamValues

NewParamValues creates a new ParamValues

func (*ParamValues) ParamBoolValue

func (vals *ParamValues) ParamBoolValue(name string) bool

ParamBoolValue xxx

func (*ParamValues) ParamFloatValue

func (vals *ParamValues) ParamFloatValue(name string) float32

ParamFloatValue xxx

func (*ParamValues) ParamIntValue

func (vals *ParamValues) ParamIntValue(name string) int

ParamIntValue xxx

func (*ParamValues) ParamStringValue

func (vals *ParamValues) ParamStringValue(name string, def string) string

ParamStringValue xxx

func (*ParamValues) SetDefaultValues

func (vals *ParamValues) SetDefaultValues()

SetDefaultValues xxx

func (*ParamValues) SetParamValueWithString

func (vals *ParamValues) SetParamValueWithString(name, value string, callback ParamCallback) error

SetParamValueWithString xxx

type Phrase

type Phrase struct {
	Length Clicks
	// contains filtered or unexported fields
}

Phrase is a time-ordered list of Notes which are MIDI messages and other realtime events).

func NewPhrase

func NewPhrase() *Phrase

NewPhrase returns a new Phrase

func (*Phrase) AdjustTimes

func (p *Phrase) AdjustTimes(shift Clicks) *Phrase

AdjustTimes returns a new Phrase shifted by shift Clicks

func (*Phrase) Append

func (p *Phrase) Append(n *Note)

Append appends a note to the end of a Phrase, assuming that the last note in the Phrase is before or at the same time as tne appended note.

func (*Phrase) Arpeggio

func (p *Phrase) Arpeggio() *Phrase

Arpeggio returns an arpeggiated version of the phrase. One way of describing is that all the notes have been separated and then put back together, back-to-back.

func (*Phrase) AtTime

func (p *Phrase) AtTime(tm Clicks) *Phrase

AtTime returns those notes in the specified phrase that are sounding at the specified time. If a note ends exactly at the specified time, it is not included.

func (*Phrase) Copy

func (p *Phrase) Copy() *Phrase

Copy returns a copy of a Phrase

func (*Phrase) CopyAndAppend

func (p *Phrase) CopyAndAppend(n *Note) *Note

CopyAndAppend makes a copy of a Note and appends it to the Phrase

func (*Phrase) CutSound

func (p *Phrase) CutSound(sound string) *Phrase

CutSound creates a new Phrase with notes for a given sound

func (*Phrase) CutTime

func (p *Phrase) CutTime(fromclick, toclick Clicks) *Phrase

CutTime creates a new Phrase with notes in a given time range

func (*Phrase) Format

func (p *Phrase) Format(f fmt.State, c rune)

Format lets you conveniently print a Phrase with fmt functions

func (*Phrase) InsertNoLock

func (p *Phrase) InsertNoLock(note *Note) *Phrase

InsertNoLock adds a Note to a Phrase

func (*Phrase) InsertNote

func (p *Phrase) InsertNote(nt *Note) *Phrase

InsertNote inserts a note into a Phrase NOTE: it's assumed that the Phrase is already locked for writing.

func (*Phrase) Legato

func (p *Phrase) Legato() *Phrase

Legato extends the duration of each note to abutt the start of the next note. Doesn't modify the duration of the last note.

func (*Phrase) Lock

func (p *Phrase) Lock()

Lock for writing

func (*Phrase) LowestPitch

func (p *Phrase) LowestPitch(delta int) uint8

LowestPitch returns the lowest pitch in a Phrase

func (*Phrase) Merge

func (p *Phrase) Merge(fromPhrase *Phrase) *Phrase

Merge merges a second Phrase into a Phrase NOTE: we get a Write lock on the Phrase, since we're actually changing it.

func (*Phrase) NextTime

func (p *Phrase) NextTime(st Clicks) Clicks

NextTime returns the time of the next note AFTER time st. If there are no notes after it, returns -1.

func (*Phrase) NumNotes

func (p *Phrase) NumNotes() int

NumNotes returns the number of notes in a Phrase

func (*Phrase) RLock

func (p *Phrase) RLock()

RLock for reading

func (*Phrase) RUnlock

func (p *Phrase) RUnlock()

RUnlock for reading

func (*Phrase) ResetLengthNoLock

func (p *Phrase) ResetLengthNoLock()

ResetLengthNoLock sets the length of a Phrase to the end of the lastnote

func (*Phrase) Step

func (p *Phrase) Step(stepsize Clicks) *Phrase

Step returns a stepped version of the Phrase.

func (*Phrase) ToString

func (p *Phrase) ToString() string

ToString returns a human-readable version of a Phrase

func (*Phrase) Transpose

func (p *Phrase) Transpose(delta int) *Phrase

Transpose returns a Phrase whose pitch is transposed.

func (*Phrase) Unlock

func (p *Phrase) Unlock()

Unlock for writing

type PlaybackEvent

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

PlaybackEvent is a time-tagged cursor or API event

type Reactor

type Reactor struct {

	// Things moved over from Router
	MIDINumDown     int
	MIDIOctaveShift int
	MIDIThru        string // "disabled", "thru", etc
	MIDIQuantized   bool

	TransposePitch int
	// contains filtered or unexported fields
}

Reactor is an entity that that reacts to things (cursor events, apis) and generates output (midi, graphics)

func NewReactor

func NewReactor(pad string, resolumeLayer int, freeframeClient *osc.Client, resolumeClient *osc.Client, guiClient *osc.Client) *Reactor

NewReactor makes a new Reactor

func (*Reactor) AdvanceByOneClick

func (r *Reactor) AdvanceByOneClick()

AdvanceByOneClick advances time by 1 click in a StepLoop

func (*Reactor) ClearExternalScale

func (r *Reactor) ClearExternalScale()

ClearExternalScale xxx

func (*Reactor) ExecuteAPI

func (r *Reactor) ExecuteAPI(api string, args map[string]string, rawargs string) (result string, err error)

ExecuteAPI xxx

func (*Reactor) HandleMIDIDeviceInput

func (r *Reactor) HandleMIDIDeviceInput(e portmidi.Event)

HandleMIDIDeviceInput xxx

func (*Reactor) HandleMIDITimeReset

func (r *Reactor) HandleMIDITimeReset()

HandleMIDITimeReset xxx

func (*Reactor) PassThruMIDI

func (r *Reactor) PassThruMIDI(e portmidi.Event, scadjust bool)

PassThruMIDI xxx

func (*Reactor) SetExternalScale

func (r *Reactor) SetExternalScale(pitch int, on bool)

SetExternalScale xxx

func (*Reactor) StartPhrase

func (r *Reactor) StartPhrase(p *Phrase, cid string)

StartPhrase xxx

func (*Reactor) Time

func (r *Reactor) Time() time.Time

Time returns the current time

type Router

type Router struct {
	OSCInput  chan OSCEvent
	MIDIInput chan portmidi.Event
	// contains filtered or unexported fields
}

Router takes events and routes them

func TheRouter

func TheRouter() *Router

TheRouter returns a pointer to the one-and-only Router

func (*Router) AddGestureDeviceCallback

func (r *Router) AddGestureDeviceCallback(f GestureDeviceCallbackFunc)

AddGestureDeviceCallback xxx

func (*Router) ExecuteAPI

func (r *Router) ExecuteAPI(api string, nuid string, rawargs string) (result interface{}, err error)

ExecuteAPI xxx

func (*Router) HandleAPIInput

func (r *Router) HandleAPIInput(executor APIExecutorFunc, data string) (response string)

HandleAPIInput xxx

func (*Router) HandleOSCInput

func (r *Router) HandleOSCInput(e OSCEvent)

HandleOSCInput xxx

func (*Router) HandleSubscribedEventArgs

func (r *Router) HandleSubscribedEventArgs(args map[string]string) error

HandleSubscribedEventArgs xxx

func (*Router) OLDgetReactorForNUID

func (r *Router) OLDgetReactorForNUID(api string, args map[string]string) (*Reactor, error)

OLDgetReactorForNUID - NOTE, this removes the "nuid" argument from the map, partially to avoid (at least until there's a reason for) letting Reactor APIs know what source is calling them. I.e. all source-depdendent behaviour is determined in Router.

type Scale

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

Scale says whether a pitch is in a scale

func GlobalScale

func GlobalScale(name string) *Scale

GlobalScale xxx

func (*Scale) ClosestTo

func (s *Scale) ClosestTo(pitch uint8) uint8

ClosestTo xxx New version, faster

func (*Scale) ClosestToOriginal

func (s *Scale) ClosestToOriginal(pitch uint8) uint8

ClosestToOriginal xxx

type Step

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

Step is one step of one loop in the looper

type StepLoop

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

StepLoop is one loop

func NewLoop

func NewLoop(nclicks Clicks) *StepLoop

NewLoop allocates and adds a new steploop

func (*StepLoop) AddToStep

func (loop *StepLoop) AddToStep(ce GestureStepEvent, stepnum Clicks)

AddToStep adds a StepItem to the loop at the current step

func (*StepLoop) Clear

func (loop *StepLoop) Clear()

Clear removes everything from Loop

func (*StepLoop) ClearID

func (loop *StepLoop) ClearID(id string)

ClearID removes all gestureStepEvents with a given id

func (*StepLoop) SetLength

func (loop *StepLoop) SetLength(nclicks Clicks)

SetLength changesthe length of a loop

type SynthDef

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

SynthDef is the port and channel for a given synth

type VizColor

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

VizColor xxx

func ColorFromHLS

func ColorFromHLS(hue, luminance, saturation float32) VizColor

ColorFromHLS creates a color from hue, luminance, and saturation

func ColorFromRGB

func ColorFromRGB(red, green, blue float32) VizColor

ColorFromRGB creates a VizColor from red, green, blue

type VizLogWriter

type VizLogWriter struct {
	Source string
}

VizLogWriter xxx

func (*VizLogWriter) Write

func (w *VizLogWriter) Write(p []byte) (n int, err error)

type VizNats

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

VizNats xxx

var TheVizNats *VizNats

TheVizNats is the only one

func NewVizNats

func NewVizNats() *VizNats

NewVizNats xxx

func (*VizNats) Connect

func (vn *VizNats) Connect() error

Connect xxx

func (*VizNats) Publish

func (vn *VizNats) Publish(subj string, msg string) error

Publish xxx

func (*VizNats) Request

func (vn *VizNats) Request(subj, data string, timeout time.Duration) (retdata string, err error)

Request is used for APIs - it blocks waiting for a response and returns the response

func (*VizNats) Subscribe

func (vn *VizNats) Subscribe(subj string, callback nats.MsgHandler) error

Subscribe xxx

Jump to

Keyboard shortcuts

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