Documentation ¶
Index ¶
- Constants
- Variables
- func ArgAsFloat32(msg *osc.Message, index int) (f float32, err error)
- func ArgAsInt(msg *osc.Message, index int) (i int, err error)
- func ArgAsString(msg *osc.Message, index int) (s string, err error)
- func BinFilePath(nm string) string
- func CallAPI(method string, args []string)
- func ChangeClicksPerSecond(factor float64)
- func ConfigBool(nm string) bool
- func ConfigBoolWithDefault(nm string, dflt bool) bool
- func ConfigFilePath(nm string) string
- func ConfigValue(nm string) string
- func CopyDir(src, dest string) error
- func ErrorResponse(err error) string
- func GetNUID() string
- func GetString(pmap map[string]string, name string) (string, error)
- func GetXYZ(api string, args map[string]string) (x, y, z float32, err error)
- func InitDebug()
- func InitLog(source string)
- func InitLogs(logfile string)
- func InitScales()
- func InitializeClicksPerSecond(clkpersec int)
- func IsTrueValue(value string) (bool, error)
- func KillProcess(exe string)
- func ListenForLocalDeviceInputsForever()
- func LoadImage(path string) (*image.NRGBA, error)
- func LoadParamDefs() error
- func LoadParamEnums() error
- func LoadResolumeJSON() error
- func LocalConfigFilePath(nm string) string
- func LocalMontageDir() string
- func LogFilePath(nm string) string
- func MIDIFilePath(nm string) string
- func MyNUID() string
- func NeedBoolArg(nm string, api string, args map[string]string) (bool, error)
- func NeedFloatArg(nm string, api string, args map[string]string) (float32, error)
- func NeedIntArg(nm string, api string, args map[string]string) (int, error)
- func NeedStringArg(nm string, api string, args map[string]string) (string, error)
- func OptionalStringArg(nm string, args map[string]string, dflt string) string
- func ParseBool(s string, name string) (bool, error)
- func ParseFloat32(s string, name string) (float32, error)
- func ParseInt(s string, name string) (int, error)
- func PublishGestureDeviceEvent(ce GestureDeviceEvent) error
- func PublishMIDIDeviceEvent(me MIDIDeviceEvent) error
- func PublishSpriteEvent(x, y, z float32) error
- func ReadConfigFile(path string) (map[string]string, error)
- func ResultResponse(resultObj interface{}) string
- func RootPath() string
- func SendMail(recipient, subject, body string) error
- func Spawn(executable string, background bool, stdout io.Writer, stderr io.Writer, ...) error
- func StartDeviceInput()
- func StartGestureInput()
- func StartMIDI()
- func StartNATSListener()
- func StartNATSServer()
- func StartOSCListener(source string)
- func StartRealtime()
- func StartVizNats()
- func StringMap(params string) (map[string]string, error)
- func StringParamOfAPI(api string, pmap map[string]string, name string) (string, error)
- func TimeString() string
- func VenueMidifiles(venue string) ([]string, error)
- type APIEvent
- type APIExecutorFunc
- type ActiveNote
- type ActivePhrase
- type ActivePhrasesManager
- func (mgr *ActivePhrasesManager) AdvanceByOneClick()
- func (mgr *ActivePhrasesManager) CallbackOnOutput(callback NoteOutputCallbackFunc) CallbackID
- func (mgr *ActivePhrasesManager) StartPhrase(p *Phrase, cid string)
- func (mgr *ActivePhrasesManager) StopPhrase(cid string, active *ActivePhrase, forceDelete bool)
- func (mgr *ActivePhrasesManager) UncallbackOnOutput(id CallbackID)
- type ActiveStepGesture
- type CallbackID
- type Clicks
- type Command
- type DebugFlags
- type DeviceGesture
- type GestureDeviceCallbackFunc
- type GestureDeviceEvent
- type GestureStepEvent
- type LoopEvent
- type MIDIDeviceEvent
- type MIDIFile
- type NoWriter
- type Note
- func NewChanPressure(data1 uint8, velocity uint8, sound string) *Note
- func NewController(controller uint8, value uint8, sound string) *Note
- func NewNote(pitch uint8, velocity uint8, duration Clicks, sound string) *Note
- func NewNoteOff(pitch uint8, velocity uint8, sound string) *Note
- func NewNoteOn(pitch uint8, velocity uint8, sound string) *Note
- func NewPitchBend(data1 uint8, data2 uint8, sound string) *Note
- func NewProgChange(program uint8, value uint8, sound string) *Note
- type NoteOutputCallback
- type NoteOutputCallbackFunc
- type NoteType
- type OSCEvent
- type Param
- type ParamCallback
- type ParamDef
- type ParamValue
- type ParamValues
- func (vals *ParamValues) ParamBoolValue(name string) bool
- func (vals *ParamValues) ParamFloatValue(name string) float32
- func (vals *ParamValues) ParamIntValue(name string) int
- func (vals *ParamValues) ParamStringValue(name string, def string) string
- func (vals *ParamValues) SetDefaultValues()
- func (vals *ParamValues) SetParamValueWithString(name, value string, callback ParamCallback) error
- type Phrase
- func (p *Phrase) AdjustTimes(shift Clicks) *Phrase
- func (p *Phrase) Append(n *Note)
- func (p *Phrase) Arpeggio() *Phrase
- func (p *Phrase) AtTime(tm Clicks) *Phrase
- func (p *Phrase) Copy() *Phrase
- func (p *Phrase) CopyAndAppend(n *Note) *Note
- func (p *Phrase) CutSound(sound string) *Phrase
- func (p *Phrase) CutTime(fromclick, toclick Clicks) *Phrase
- func (p *Phrase) Format(f fmt.State, c rune)
- func (p *Phrase) InsertNoLock(note *Note) *Phrase
- func (p *Phrase) InsertNote(nt *Note) *Phrase
- func (p *Phrase) Legato() *Phrase
- func (p *Phrase) Lock()
- func (p *Phrase) LowestPitch(delta int) uint8
- func (p *Phrase) Merge(fromPhrase *Phrase) *Phrase
- func (p *Phrase) NextTime(st Clicks) Clicks
- func (p *Phrase) NumNotes() int
- func (p *Phrase) RLock()
- func (p *Phrase) RUnlock()
- func (p *Phrase) ResetLengthNoLock()
- func (p *Phrase) Step(stepsize Clicks) *Phrase
- func (p *Phrase) ToString() string
- func (p *Phrase) Transpose(delta int) *Phrase
- func (p *Phrase) Unlock()
- type PlaybackEvent
- type Reactor
- func (r *Reactor) AdvanceByOneClick()
- func (r *Reactor) ClearExternalScale()
- func (r *Reactor) ExecuteAPI(api string, args map[string]string, rawargs string) (result string, err error)
- func (r *Reactor) HandleMIDIDeviceInput(e portmidi.Event)
- func (r *Reactor) HandleMIDITimeReset()
- func (r *Reactor) PassThruMIDI(e portmidi.Event, scadjust bool)
- func (r *Reactor) SetExternalScale(pitch int, on bool)
- func (r *Reactor) StartPhrase(p *Phrase, cid string)
- func (r *Reactor) Time() time.Time
- type Router
- func (r *Router) AddGestureDeviceCallback(f GestureDeviceCallbackFunc)
- func (r *Router) ExecuteAPI(api string, nuid string, rawargs string) (result interface{}, err error)
- func (r *Router) HandleAPIInput(executor APIExecutorFunc, data string) (response string)
- func (r *Router) HandleOSCInput(e OSCEvent)
- func (r *Router) HandleSubscribedEventArgs(args map[string]string) error
- func (r *Router) OLDgetReactorForNUID(api string, args map[string]string) (*Reactor, error)
- type Scale
- type Step
- type StepLoop
- type SynthDef
- type VizColor
- type VizLogWriter
- type VizNats
Constants ¶
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
const MaxClicks = Clicks(math.MaxInt64)
MaxClicks is the high-possible value for Clicks
const UnfinishedDuration = math.MaxInt32 - 1
UnfinishedDuration is an 'unset' value for Duration
Variables ¶
var CurrentMilli int
CurrentMilli is the time from the start, in milliseconds
var DebugUtil = DebugFlags{}
DebugUtil controls debugging
var MONTAGE_SOURCELogged = false
var MontageAPISubject = "montage.api"
MontageAPISubject xxx
var MontageEventSubject = "montage.event"
MontageEventSubject xxx
var ParamDefs map[string]ParamDef
ParamDefs is the set of all parameter definitions
var ParamEnums map[string][]string
ParamEnums contains the lists of enumerated values for string parameters
var ResolumeJSON map[string]interface{}
ResolumeJSON is an unmarshalled version of the resolume.json file
var Scales map[string]*Scale
Scales maps a name to a Scale
var TempoFactor = float64(1.0)
TempoFactor xxx
Functions ¶
func ArgAsFloat32 ¶
ArgAsFloat32 xxx
func ArgAsString ¶
ArgAsString xxx
func ChangeClicksPerSecond ¶
func ChangeClicksPerSecond(factor float64)
ChangeClicksPerSecond is what you use to change the tempo
func ConfigBool ¶
ConfigBool returns bool value of nm, or false if nm not set
func ConfigBoolWithDefault ¶
ConfigBoolWithDefault xxx
func ErrorResponse ¶
ErrorResponse return a JSON 2.0 error response
func InitializeClicksPerSecond ¶
func InitializeClicksPerSecond(clkpersec int)
InitializeClicksPerSecond initializes
func IsTrueValue ¶
IsTrueValue returns true if the value is some version of true
func ListenForLocalDeviceInputsForever ¶
func ListenForLocalDeviceInputsForever()
ListenForLocalDeviceInputsForever listens for local device inputs (OSC, MIDI)
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 NeedBoolArg ¶
NeedBoolArg xx
func NeedFloatArg ¶
NeedFloatArg xx
func NeedIntArg ¶
NeedIntArg xx
func NeedStringArg ¶
NeedStringArg xx
func OptionalStringArg ¶
OptionalStringArg xx
func PublishGestureDeviceEvent ¶
func PublishGestureDeviceEvent(ce GestureDeviceEvent) error
PublishGestureDeviceEvent xxx
func PublishMIDIDeviceEvent ¶
func PublishMIDIDeviceEvent(me MIDIDeviceEvent) error
PublishMIDIDeviceEvent xxx
func ReadConfigFile ¶
ReadConfigFile xxx
func ResultResponse ¶
func ResultResponse(resultObj interface{}) string
ResultResponse returns a JSON 2.0 result response
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 StartMIDI ¶
func StartMIDI()
StartMIDI listens for MIDI events and sends them to the MIDIInput chan
func StringParamOfAPI ¶
StringParamOfAPI xxx
Types ¶
type APIEvent ¶
type APIEvent struct {
// contains filtered or unexported fields
}
APIEvent is an API invocation
type APIExecutorFunc ¶
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 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 ¶
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
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 ¶
NewChanPressure xxx
func NewController ¶
NewController create a new NOTEOFF
func NewNoteOff ¶
NewNoteOff create a new NOTEOFF
func NewPitchBend ¶
NewPitchBend xxx
func NewProgChange ¶
NewProgChange xxx
func (*Note) ReadablePitch ¶
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
type NoteOutputCallback ¶
type NoteOutputCallback struct { Callback func(n *Note) // contains filtered or unexported fields }
NoteOutputCallback is a call
type Param ¶
type Param struct {
// contains filtered or unexported fields
}
Param is a single parameter name/value
type ParamCallback ¶
ParamCallback is the callback when setting parameter values
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 (*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 (*Phrase) AdjustTimes ¶
AdjustTimes returns a new Phrase shifted by shift Clicks
func (*Phrase) Append ¶
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 ¶
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 ¶
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) CopyAndAppend ¶
CopyAndAppend makes a copy of a Note and appends it to the Phrase
func (*Phrase) InsertNoLock ¶
InsertNoLock adds a Note to a Phrase
func (*Phrase) InsertNote ¶
InsertNote inserts a note into a Phrase NOTE: it's assumed that the Phrase is already locked for writing.
func (*Phrase) Legato ¶
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) LowestPitch ¶
LowestPitch returns the lowest pitch in a Phrase
func (*Phrase) Merge ¶
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 ¶
NextTime returns the time of the next note AFTER time st. If there are no notes after it, returns -1.
func (*Phrase) ResetLengthNoLock ¶
func (p *Phrase) ResetLengthNoLock()
ResetLengthNoLock sets the length of a Phrase to the end of the lastnote
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) ExecuteAPI ¶
func (r *Reactor) ExecuteAPI(api string, args map[string]string, rawargs string) (result string, err error)
ExecuteAPI xxx
func (*Reactor) HandleMIDIDeviceInput ¶
HandleMIDIDeviceInput xxx
func (*Reactor) HandleMIDITimeReset ¶
func (r *Reactor) HandleMIDITimeReset()
HandleMIDITimeReset xxx
func (*Reactor) PassThruMIDI ¶
PassThruMIDI xxx
func (*Reactor) SetExternalScale ¶
SetExternalScale xxx
type Router ¶
type Router struct { OSCInput chan OSCEvent MIDIInput chan portmidi.Event // contains filtered or unexported fields }
Router takes events and routes them
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) HandleSubscribedEventArgs ¶
HandleSubscribedEventArgs xxx
func (*Router) OLDgetReactorForNUID ¶
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 (*Scale) ClosestToOriginal ¶
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 (*StepLoop) AddToStep ¶
func (loop *StepLoop) AddToStep(ce GestureStepEvent, stepnum Clicks)
AddToStep adds a StepItem to the loop at the current step
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 ¶
ColorFromHLS creates a color from hue, luminance, and saturation
func ColorFromRGB ¶
ColorFromRGB creates a VizColor from red, green, blue