Documentation
¶
Index ¶
- Constants
- Variables
- func AppendExtraValues(keysAndValues []any) []any
- func ArchiveLogs() error
- func ArgToFloat(nm string, args map[string]string) float32
- func ArgToInt(nm string, args map[string]string) int
- func BoundAndScaleController(v, vmin, vmax float32, cmin, cmax int) int
- func BoundAndScaleFloat(v, vmin, vmax, outmin, outmax float32) float32
- func BoundValueZeroToOne(v float64) float64
- func ChangeClicksPerSecond(factor float64)
- func ClearExternalScale()
- func Clicks2Seconds(clk Clicks) float64
- func CopyDir(src, dest string) error
- func CurrentMilli() int64
- func CurrentMilliOffset() int64
- func CursorToOscMsg(ce CursorEvent) *osc.Message
- func EngineApi(api string, apiargs ...string) (map[string]string, error)
- func EraeBitize7chksum(in []byte) (out []byte, chksum byte)
- func EraeUnbitize7chksum(in []byte) ([]byte, byte)
- func ErrorResponse(err error) string
- func ErrorResult(err string) string
- func ExecuteApi(api string, apiargs map[string]string) (result string, err error)
- func ExecuteApiFromJson(rawjson string) (string, error)
- func ExecuteEngineApi(api string, apiargs map[string]string) (result string, err error)
- func ExecuteSavedApi(api string, apiargs map[string]string) (result string, err error)
- func ExtractAndRemoveValueOf(valName string, argsmap map[string]string) string
- func FileExists(path string) bool
- func Float32bytes(float float32) []byte
- func Float32frombytes(bytes []byte) float32
- func GetArgsXYZ(args map[string]string) (x, y, z float32, err error)
- func GetFloat(value string, f *float64) bool
- func GetFloat32(value string, f *float32) bool
- func GetInt(value string, i *int64) bool
- func GetNUID() string
- func GetNameValue(apiargs map[string]string) (name string, value string, err error)
- func GetParam(nm string) (string, error)
- func GetParamBool(nm string) (bool, error)
- func GetParamFloat(nm string) (float64, error)
- func GetParamInt(nm string) (int, error)
- func GoroutineID() uint64
- func HandleMidiEvent(me MidiEvent)
- func HumanReadableApiOutput(apiOutput map[string]string) string
- func Init() error
- func InitParamDefs()
- func InitSynths()
- func InitializeClicksPerSecond(clkpersec Clicks)
- func IsLogging(logtype string) bool
- func IsPatchCategory(category string) bool
- func IsPerPatchParam(name string) bool
- func IsTrueValue(value string) bool
- func JsonObject(args ...string) string
- func JsonString(args ...string) string
- func LoadEngineParams(fname string)
- func LoadParamDefs() error
- func LoadParamEnums() error
- func LogError(err error, keysAndValues ...any)
- func LogIfError(err error, keysAndValues ...any)
- func LogInfo(msg string, keysAndValues ...any)
- func LogOfType(logtypes string, msg string, keysAndValues ...any)
- func LogWarn(msg string, keysAndValues ...any)
- func MapString(amap map[string]string) string
- func MidiToOscMsg(me MidiEvent) *osc.Message
- func MmttApi(api string) (map[string]string, error)
- func MyNUID() string
- func NatsHandler(msg *nats.Msg)
- 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 NeedStringArg(nm string, api string, args map[string]string) (string, error)
- func NewClickMsg(click Clicks) string
- func NewSetParamMsg(name string, value string) string
- func OkResult() string
- 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 PatchNames() []string
- func PublishCursorEvent(ce CursorEvent)
- func PublishMIDIDeviceEvent(me MidiEvent)
- func PublishSpriteEvent(x, y, z float32)
- func RegisterAndInit(h Host) error
- func RegisterHost(h Host)
- func RemoteEngineApi(api string, data string) (string, error)
- func ResultResponse(resultObj any) string
- func SavedList(apiargs map[string]string) (string, error)
- func SavedNameSplit(saved string) (string, string)
- func ScheduleAt(atClick Clicks, tag string, value any)
- func ScheduleCursorEvent(ce CursorEvent)
- func SendToOscClients(msg *osc.Message)
- func SetClicksPerSecond(cps Clicks)
- func SetCurrentClick(click Clicks)
- func SetCurrentClickOffset(click Clicks)
- func SetCurrentMilli(milli int64)
- func SetCurrentMilliOffset(milli int64)
- func SetEngineParam(name string, value string) error
- func SetExternalScale(pitch uint8, on bool)
- func SetLogTypeEnabled(dtype string, b bool)
- func SetLogTypes(logtypes string)
- func StartEngine()
- func StartTwitch()
- func String(arg any) string
- func StringMap(params string) (map[string]string, error)
- func ToBool(arg any) bool
- func TwitchLoadParams() error
- func Uptime() float64
- type ActiveCursor
- type AttractManager
- type ChanPressure
- type ClickEvent
- type Clicks
- type Cmd
- func (cmd Cmd) ValuesBool(name string, dflt bool) bool
- func (cmd Cmd) ValuesColor(dflt color.RGBA) color.RGBA
- func (cmd Cmd) ValuesFloat(name string, dflt float32) float32
- func (cmd Cmd) ValuesInt(name string, dflt int) int
- func (cmd Cmd) ValuesPos(dflt image.Point) image.Point
- func (cmd Cmd) ValuesRect(dflt image.Rectangle) image.Rectangle
- func (cmd Cmd) ValuesSetPos(pos image.Point)
- func (cmd Cmd) ValuesSetXY(key string, pos image.Point)
- func (cmd Cmd) ValuesSetXY0(pos image.Point)
- func (cmd Cmd) ValuesSetXY1(pos image.Point)
- func (cmd Cmd) ValuesSize(dflt image.Point) image.Point
- func (cmd Cmd) ValuesString(name string, dflt string) string
- func (cmd Cmd) ValuesToString() string
- func (cmd Cmd) ValuesUint8(name string, dflt uint8) uint8
- func (cmd Cmd) ValuesXY(xyname string, dflt image.Point) image.Point
- func (cmd Cmd) ValuesXY0(dflt image.Point) image.Point
- func (cmd Cmd) ValuesXY1(dflt image.Point) image.Point
- func (cmd Cmd) VerifyValues(names ...string) bool
- type Command
- type Controller
- type CursorCallbackFunc
- type CursorEvent
- type CursorHandler
- type CursorManager
- func (cm *CursorManager) AddCursorHandler(name string, handler CursorHandler, sources ...string)
- func (cm *CursorManager) CheckAutoCursorUp()
- func (cm *CursorManager) ClearAllActiveCursors(tag string)
- func (cm *CursorManager) DeleteActiveCursor(gid int)
- func (cm *CursorManager) DeleteActiveCursorIfZLessThan(gid int, threshold float32)
- func (cm *CursorManager) DeleteActiveCursorsForTag(tag string)
- func (cm *CursorManager) ExecuteCursorEvent(ce CursorEvent)
- func (cm *CursorManager) GenerateGesture(tag string, numsteps int, dur time.Duration, pos0 CursorPos, pos1 CursorPos)
- func (cm *CursorManager) GenerateRandomGesture(tag string, numsteps int, dur time.Duration)
- func (cm *CursorManager) LoopCursorEvent(ac *ActiveCursor) *SchedElement
- func (cm *CursorManager) LoopedGidFor(ce CursorEvent, warn bool) int
- func (cm *CursorManager) PlayCursor(tag string, dur time.Duration, pos CursorPos)
- func (cm *CursorManager) UniqueGid() int
- type CursorPos
- type Erae
- func (erae *Erae) EraeApiModeDisable()
- func (erae *Erae) EraeApiModeEnable()
- func (erae *Erae) EraeFingerIndicator(zone, x, y byte)
- func (erae *Erae) EraeWriteSysEx(bytes []byte)
- func (erae *Erae) EraeZoneBoundaryRequest(zone byte)
- func (erae *Erae) EraeZoneClearDisplay(zone byte)
- func (erae *Erae) EraeZoneClearPixel(zone, x, y, r, g, b byte)
- func (erae *Erae) EraeZoneRectangle(zone, x, y, w, h, r, g, b byte)
- func (erae *Erae) Start()
- type Event
- type Host
- type Kval
- type MIDIEventHandler
- type MIDIPortChannelState
- type MidiEvent
- type NoteBytes
- type NoteFull
- type NoteOff
- type NoteOn
- type NoteSystem
- type OscEvent
- type ParamDef
- type ParamDefBool
- type ParamDefFloat
- type ParamDefInt
- type ParamDefString
- type ParamValue
- type ParamValues
- func (params *ParamValues) ApplyValuesFromMap(category string, paramsmap map[string]any, setfunc func(string, string) error)
- func (vals *ParamValues) DoForAllParams(f func(string, ParamValue))
- func (vals *ParamValues) Exists(name string) bool
- func (vals *ParamValues) Get(name string) (string, error)
- func (vals *ParamValues) GetBoolValue(name string) bool
- func (vals *ParamValues) GetFloatValue(name string) float32
- func (vals *ParamValues) GetIntValue(name string) int
- func (vals *ParamValues) GetStringValue(name string, def string) string
- func (vals *ParamValues) JsonValues() string
- func (vals *ParamValues) ParamNames() []string
- func (vals *ParamValues) Save(category string, filename string) error
- func (vals *ParamValues) Set(name, value string) error
- func (vals *ParamValues) SetParamValueWithString(origname, value string) (err error)
- type ParamsMap
- type Patch
- func (patch *Patch) Api(api string, apiargs map[string]string) (string, error)
- func (patch *Patch) ApplyPatchValuesFromQuadMap(paramsmap map[string]any) error
- func (patch *Patch) CursorToQuant(ce CursorEvent) Clicks
- func (patch *Patch) Get(paramName string) string
- func (patch *Patch) GetBool(paramName string) bool
- func (patch *Patch) GetFloat(paramName string) float32
- func (patch *Patch) GetInt(paramName string) int
- func (patch *Patch) Load(category string, filename string) error
- func (patch *Patch) MIDIChannel() uint8
- func (patch *Patch) Name() string
- func (patch *Patch) ParamNames() []string
- func (patch *Patch) RefreshAllIfPortnumMatches(ffglportnum int)
- func (patch *Patch) RefreshAllPatchValues()
- func (patch *Patch) SaveAndAlert(category string, filename string) error
- func (patch *Patch) SaveQuadAndAlert() error
- func (patch *Patch) SetDefaultValues()
- func (patch *Patch) Status() string
- func (patch *Patch) Synth() *Synth
- type PatchLogic
- type Phrase
- func (p *Phrase) AdjustTimes(shift Clicks) *Phrase
- func (p *Phrase) Arpeggio() *Phrase
- func (p *Phrase) AtTime(tm Clicks) *Phrase
- func (p *Phrase) Copy() *Phrase
- func (p *Phrase) CopyAndAppend(elem *PhraseElement) *PhraseElement
- func (p *Phrase) CutSound(sound string) *Phrase
- func (p *Phrase) CutTime(fromclick, toclick Clicks) *Phrase
- func (p *Phrase) InsertElement(item *PhraseElement) *Phrase
- func (p *Phrase) InsertNoLock(pe *PhraseElement) *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) RLock()
- func (p *Phrase) RUnlock()
- func (p *Phrase) ResetLengthNoLock()
- func (p *Phrase) Step(stepsize Clicks) *Phrase
- func (p *Phrase) Transpose(delta int) *Phrase
- func (p *Phrase) Unlock()
- type PhraseElement
- type PhraseScanner
- type PitchBend
- type PlaybackEvent
- type PortChannel
- type ProgramChange
- type QuadPro
- func (quadpro *QuadPro) Api(api string, apiargs map[string]string) (result string, err error)
- func (quadpro *QuadPro) Load(bytes []byte, category string, filename string) error
- func (quadpro *QuadPro) OnClientRestart(portnum int)
- func (quadpro *QuadPro) PatchForCursorEvent(ce CursorEvent) (patch *Patch, button string)
- func (quadpro *QuadPro) Start()
- func (quadpro *QuadPro) Status(source string) string
- func (quadpro *QuadPro) Stop()
- type RecordingEvent
- type Scale
- type SchedElement
- type Scheduler
- func (sched *Scheduler) CountEventsWithTag(tag string) int
- func (sched *Scheduler) DeleteCursorEventsWhoseGidIs(gid int)
- func (sched *Scheduler) DeleteEventsWithTag(tag string)
- func (sched *Scheduler) Format(f fmt.State, c rune)
- func (sched *Scheduler) PendingToString() string
- func (sched *Scheduler) SetAutoTransposeBeats(beats int)
- func (sched *Scheduler) SetTranspose(i int)
- func (sched *Scheduler) Start()
- func (sched *Scheduler) ToString() string
- type Synth
- func (synth *Synth) Channel() uint8
- func (synth *Synth) ClearNoteDowns()
- func (synth *Synth) SendANO()
- func (synth *Synth) SendBytes(bytes []byte) error
- func (synth *Synth) SendBytesToMidiOutput(bytes []byte)
- func (synth *Synth) SendController(cnum uint8, cval uint8)
- func (synth *Synth) SendNoteToMidiOutput(value any)
- func (synth *Synth) UpdateBankProgram()
- type Token
- type VizColor
- type VizNats
Constants ¶
const ( // NoteOn 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 EventAll = EventMidiInput | EventNoteOutput | EventCursor
const EventCursor = 0x04
const EventMidiInput = 0x01
Bits for Events
const EventNoteOutput = 0x02
const PatchNameSeparator = "-"
In a quad file, the parameter names are of the form: {patchName}-{parametername}.
Variables ¶
var BugFixWarningCount = 0
var EighthNote = Clicks(12)
var FirstTime = true
var HalfNote = Clicks(48)
var LogEnabled = map[string]bool{ "*": false, "advance": false, "api": false, "attract": false, "bidule": false, "config": false, "cursor": false, "drawing": false, "erae": false, "exec": false, "ffgl": false, "freeframe": false, "gensound": false, "genvisual": false, "gesture": false, "go": false, "goroutine": false, "info": false, "patch": false, "process": false, "keykit": false, "layerapi": false, "listeners": false, "load": false, "loop": false, "midi": false, "midicontroller": false, "midiports": false, "mmtt": false, "morph": false, "mouse": false, "nats": false, "note": false, "notify": false, "osc": false, "params": false, "phrase": false, "plugin": false, "quant": false, "saved": false, "realtime": false, "resolume": false, "remote": false, "router": false, "scale": false, "scheduler": false, "task": false, "transpose": false, "value": false, }
var LogMutex sync.Mutex
var MaxClicks = Clicks(math.MaxInt64)
MaxClicks is the high-possible value for Clicks
var MidiNumDown int
var MidiOctaveShift int
var MidiThruScadjust bool
var Midisetexternalscale bool
var Midithru bool
var OneBeatMutex sync.RWMutex
var OscOutput = true
var PaletteAPISubject = "palette.api"
PaletteAPISubject 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 Patchs = map[string]*Patch{}
var PitchSets = map[string][]uint8{
"stylusrmx": {36, 37, 38, 39, 42, 43, 51, 49},
}
var PointZero image.Point = image.Point{0, 0}
var PortChannels map[PortChannel]*MIDIPortChannelState
var QuarterNote = Clicks(24)
var SixteenthNote = Clicks(6)
var Synths map[string]*Synth
var TempoFactor = float64(1.0)
TempoFactor xxx
var ThirtySecondNote = Clicks(3)
var Time0 = time.Time{}
var TwitchParams map[string]string
var WholeNote = Clicks(96)
Functions ¶
func AppendExtraValues ¶
func ArchiveLogs ¶
func ArchiveLogs() error
func BoundAndScaleController ¶
func BoundAndScaleFloat ¶
func BoundValueZeroToOne ¶
func ChangeClicksPerSecond ¶
func ChangeClicksPerSecond(factor float64)
ChangeClicksPerSecond is what you use to change the tempo
func ClearExternalScale ¶
func ClearExternalScale()
func Clicks2Seconds ¶
Clicks2Seconds converts Clicks to Time (seconds), relative
func CurrentMilli ¶
func CurrentMilli() int64
func CurrentMilliOffset ¶
func CurrentMilliOffset() int64
func CursorToOscMsg ¶
func CursorToOscMsg(ce CursorEvent) *osc.Message
func EraeBitize7chksum ¶
7-bitize an array of bytes and get the resulting checksum Algorithm taken from Erae documentation. Return value is the output bytes and checksum
func EraeUnbitize7chksum ¶
7-unbitize an array of bytes and get the incomming checksum Algorithm taken from Erae documentation. Return value is the output bytes and checksum
func ExecuteApi ¶
ExecuteApi xxx
func ExecuteApiFromJson ¶
handleRawJsonApi takes raw JSON (as a string of the form "{...}"") as an API and returns raw JSON
func ExecuteEngineApi ¶
func ExecuteSavedApi ¶
func ExtractAndRemoveValueOf ¶
ExtractAndRemoveValueOf removes a named value from a map and returns it. If the value doesn't exist, "" is returned.
func FileExists ¶
func Float32bytes ¶
func Float32frombytes ¶
func GetFloat32 ¶
func GetNameValue ¶
func GetParamBool ¶
func GetParamFloat ¶
func GetParamInt ¶
func GoroutineID ¶
func GoroutineID() uint64
func HandleMidiEvent ¶
func HandleMidiEvent(me MidiEvent)
func HumanReadableApiOutput ¶
humanReadableApiOutput takes the result of an API invocation and produces what will appear in visible output from a CLI command.
func InitParamDefs ¶
func InitParamDefs()
func InitSynths ¶
func InitSynths()
func InitializeClicksPerSecond ¶
func InitializeClicksPerSecond(clkpersec Clicks)
InitializeClicksPerSecond initializes
func IsPatchCategory ¶
func IsPerPatchParam ¶
func IsTrueValue ¶
IsTrueValue returns true if the value is some version of true, and false otherwise.
func JsonObject ¶
func JsonString ¶
func LoadEngineParams ¶
func LoadEngineParams(fname string)
func LoadParamEnums ¶
func LoadParamEnums() error
LoadParamEnums initializes the list of enumerated parameter values
func LogIfError ¶
func MidiToOscMsg ¶
func NatsHandler ¶
func NatsHandler(msg *nats.Msg)
func NeedFloatArg ¶
func NeedStringArg ¶
func NewSetParamMsg ¶
func OptionalStringArg ¶
func PatchNames ¶
func PatchNames() []string
func RegisterAndInit ¶
func RegisterHost ¶
func RegisterHost(h Host)
func ResultResponse ¶
ResultResponse returns a JSON 2.0 result response
func SavedNameSplit ¶
func ScheduleAt ¶
func ScheduleCursorEvent ¶
func ScheduleCursorEvent(ce CursorEvent)
func SendToOscClients ¶
func SetClicksPerSecond ¶
func SetClicksPerSecond(cps Clicks)
func SetCurrentClick ¶
func SetCurrentClick(click Clicks)
func SetCurrentClickOffset ¶
func SetCurrentClickOffset(click Clicks)
func SetCurrentMilli ¶
func SetCurrentMilli(milli int64)
func SetCurrentMilliOffset ¶
func SetCurrentMilliOffset(milli int64)
func SetEngineParam ¶
func SetExternalScale ¶
func SetLogTypeEnabled ¶
func SetLogTypes ¶
func SetLogTypes(logtypes string)
func StartEngine ¶
func StartEngine()
func StartTwitch ¶
func StartTwitch()
Types ¶
type ActiveCursor ¶
type ActiveCursor struct { Current CursorEvent Previous CursorEvent NoteOn *NoteOn NoteOnClick Clicks NoteOnY float32 NoteOnZ float32 Patch *Patch Button string // contains filtered or unexported fields }
OscEvent is an OSC message
func NewActiveCursor ¶
func NewActiveCursor(ce CursorEvent) *ActiveCursor
NewActiveCursor - create a new ActiveCursor for a CursorEvent An ActiveCursor can be for a Button or a Patch area.
type AttractManager ¶
type AttractManager struct { // externally controlled things AttractCheckSecs float64 AttractChangeInterval float64 AttractGestureInterval float64 AttractIdleSecs float64 // contains filtered or unexported fields }
var TheAttractManager *AttractManager
func NewAttractManager ¶
func NewAttractManager() *AttractManager
func (*AttractManager) AttractModeIsOn ¶
func (am *AttractManager) AttractModeIsOn() bool
func (*AttractManager) SetAttractEnabled ¶
func (am *AttractManager) SetAttractEnabled(b bool)
func (*AttractManager) SetAttractMode ¶
func (am *AttractManager) SetAttractMode(onoff bool)
type ChanPressure ¶
func NewChanPressure ¶
func NewChanPressure(channel, pressure uint8) *ChanPressure
func (*ChanPressure) String ¶
func (n *ChanPressure) String() string
type ClickEvent ¶
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. XXX - possiblycould have a type to distinguish Clicks that are XXX - used as absolute time versus Clicks that are step numbers
var OneBeat Clicks
func ClicksPerSecond ¶
func ClicksPerSecond() Clicks
func CurrentClick ¶
func CurrentClick() Clicks
func CurrentClickOffset ¶
func CurrentClickOffset() Clicks
func Seconds2Clicks ¶
Seconds2Clicks converts a Time value (elapsed seconds) to Clicks
type Cmd ¶
func NewSimpleCmd ¶
func (Cmd) ValuesSetPos ¶
func (Cmd) ValuesSetXY0 ¶
func (Cmd) ValuesSetXY1 ¶
func (Cmd) ValuesToString ¶
func (Cmd) VerifyValues ¶
type Controller ¶
func NewController ¶
func NewController(channel, controller, value uint8) *Controller
NewController create a new noteoff
func (*Controller) String ¶
func (n *Controller) String() string
type CursorEvent ¶
type CursorEvent struct { // Named CClick to catch everyone that accesses it CClick Clicks `json:"Click"` Gid int `json:"Gid"` Tag string `json:"Tag"` // Source string Ddu string `json:"Ddu"` // "down", "drag", "up" (sometimes "clear") Pos CursorPos `json:"Pos"` Area float32 `json:"Area"` }
CursorEvent is a single Cursor event. NOTE: it's assumed that we can copy a CursorEvent by copying the value. Do note add pointers to this struct.
func CursorEventFromString ¶
func CursorEventFromString(s string) (ce CursorEvent, err error)
func NewCursorClearEvent ¶
func NewCursorClearEvent(tag string) CursorEvent
func NewCursorEvent ¶
func NewCursorEvent(gid int, tag string, ddu string, pos CursorPos) CursorEvent
func (CursorEvent) GetClick ¶
func (ce CursorEvent) GetClick() Clicks
func (CursorEvent) IsAttractGenerated ¶
func (ce CursorEvent) IsAttractGenerated() bool
func (CursorEvent) Marshal ¶
func (ce CursorEvent) Marshal() (bytes []byte, err error)
XXX - can this make use of generics? (across all the Event types)
func (*CursorEvent) SetClick ¶
func (ce *CursorEvent) SetClick(click Clicks)
func (*CursorEvent) Source ¶
func (ce *CursorEvent) Source() string
type CursorHandler ¶
type CursorHandler interface {
// contains filtered or unexported methods
}
type CursorManager ¶
type CursorManager struct { ClickMutex sync.RWMutex GidToLoopedGidMutex sync.RWMutex GidToLoopedGid map[int]int LoopThreshold float32 // contains filtered or unexported fields }
var TheCursorManager *CursorManager
func NewCursorManager ¶
func NewCursorManager() *CursorManager
func (*CursorManager) AddCursorHandler ¶
func (cm *CursorManager) AddCursorHandler(name string, handler CursorHandler, sources ...string)
func (*CursorManager) CheckAutoCursorUp ¶
func (cm *CursorManager) CheckAutoCursorUp()
func (*CursorManager) ClearAllActiveCursors ¶
func (cm *CursorManager) ClearAllActiveCursors(tag string)
func (*CursorManager) DeleteActiveCursor ¶
func (cm *CursorManager) DeleteActiveCursor(gid int)
func (*CursorManager) DeleteActiveCursorIfZLessThan ¶
func (cm *CursorManager) DeleteActiveCursorIfZLessThan(gid int, threshold float32)
DeleteActiveCursorIfZLessThan deletes the ActiveCursor if its Z value is less than threshold.
func (*CursorManager) DeleteActiveCursorsForTag ¶
func (cm *CursorManager) DeleteActiveCursorsForTag(tag string)
func (*CursorManager) ExecuteCursorEvent ¶
func (cm *CursorManager) ExecuteCursorEvent(ce CursorEvent)
func (*CursorManager) GenerateGesture ¶
func (*CursorManager) GenerateRandomGesture ¶
func (cm *CursorManager) GenerateRandomGesture(tag string, numsteps int, dur time.Duration)
func (*CursorManager) LoopCursorEvent ¶
func (cm *CursorManager) LoopCursorEvent(ac *ActiveCursor) *SchedElement
func (*CursorManager) LoopedGidFor ¶
func (cm *CursorManager) LoopedGidFor(ce CursorEvent, warn bool) int
Keep track of names attached to each cursor "down", and use those names on subsequent "drag" and "up" events.
func (*CursorManager) PlayCursor ¶
func (cm *CursorManager) PlayCursor(tag string, dur time.Duration, pos CursorPos)
func (*CursorManager) UniqueGid ¶
func (cm *CursorManager) UniqueGid() int
type Erae ¶
type Erae struct { Output any // contains filtered or unexported fields }
var TheErae *Erae
func (*Erae) EraeApiModeDisable ¶
func (erae *Erae) EraeApiModeDisable()
func (*Erae) EraeApiModeEnable ¶
func (erae *Erae) EraeApiModeEnable()
func (*Erae) EraeFingerIndicator ¶
func (*Erae) EraeWriteSysEx ¶
func (*Erae) EraeZoneBoundaryRequest ¶
func (*Erae) EraeZoneClearDisplay ¶
func (*Erae) EraeZoneClearPixel ¶
func (*Erae) EraeZoneRectangle ¶
type Host ¶
type Host interface { Init() error Start() SayDone() LogWarn(msg string, keysAndValues ...any) LogError(err error, keysAndValues ...any) LogInfo(msg string, keysAndValues ...any) // IsLogging(name string) bool // LogOfType(logtypes string, msg string, keysAndValues ...any) ArchiveLogs() error EngineHttpApi(api string, args ...string) (map[string]string, error) MmttHttpApi(api string) (map[string]string, error) HandleIncomingMidiEvent(me MidiEvent) ResetAudio() ActivateAudio() FileExists(path string) bool SendToOscClients(msg *osc.Message) GenerateVisualsFromCursor(ce CursorEvent, patchName string) InputEventLock() InputEventUnlock() OpenFakeChannelOutput(port string, channel int) *MIDIPortChannelState OpenChannelOutput(PortChannel) *MIDIPortChannelState GetPortChannelState(PortChannel) (*MIDIPortChannelState, error) SendMIDI(output any, bytes []byte) error StartRunning(process string) error KillProcess(process string) error SetMidiInput(name string) error ShowClip(clipNum int) GetConfigFileData(filename string) ([]byte, error) SavedFileList(category string) ([]string, error) SaveDataInFile(data []byte, category string, filename string) error GetSavedData(category string, filename string) ([]byte, error) EveryTick() ToFreeFramePlugin(patchName string, msg *osc.Message) SendEffectParam(patchName string, name string, value string) PortAndLayerNumForPatch(patchName string) (portnum int, layernum int) ShowText(msg string) }
var TheHost Host
type MIDIEventHandler ¶
type MIDIEventHandler func(MidiEvent)
type MIDIPortChannelState ¶
type MIDIPortChannelState struct { Channel int // 1-based, 1-16 Bank int // 1-based, 1-whatever Program int // 1-based, 1-128 PortName string // MIDI output port Output any // was drivers.Out Isopen bool Mutex sync.Mutex }
MIDIChannelOutput is used to remember the last bank and program values for a particular output, so they're only sent out when they've changed.
func (*MIDIPortChannelState) UpdateBankProgram ¶
func (state *MIDIPortChannelState) UpdateBankProgram(synth *Synth)
type NoteBytes ¶
type NoteBytes struct {
// contains filtered or unexported fields
}
func NewNoteBytes ¶
type NoteFull ¶
type NoteFull struct { // Channel uint8 Synth *Synth Duration Clicks SynthName string Pitch uint8 Velocity uint8 }
NoteFull has a duration, i.e. it's a combination of a NoteOn and NoteOff
type NoteOff ¶
func NewNoteOff ¶
NewNoteOff create a new noteoff
func NewNoteOffFromNoteOn ¶
NewNoteOff create a new NoteOff from a NoteOn
type NoteSystem ¶
type NoteSystem struct {
// contains filtered or unexported fields
}
func NewNoteSystem ¶
func NewNoteSystem(system byte) *NoteSystem
func (*NoteSystem) String ¶
func (n *NoteSystem) String() string
type OscEvent ¶
type ParamDef ¶
type ParamDef struct { TypedParamDef any Category string Init string // contains filtered or unexported fields }
ParamDef is a single parameter definition.
type ParamDefBool ¶
type ParamDefBool struct { }
type ParamDefFloat ¶
type ParamDefFloat struct { Init string // contains filtered or unexported fields }
type ParamDefInt ¶
type ParamDefInt struct {
// contains filtered or unexported fields
}
type ParamDefString ¶
type ParamDefString struct {
// contains filtered or unexported fields
}
type ParamValue ¶
type ParamValue any
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
var EngineParams *ParamValues
These EngineParams are global to the kit package
func NewParamValues ¶
func NewParamValues() *ParamValues
func (*ParamValues) ApplyValuesFromMap ¶
func (params *ParamValues) ApplyValuesFromMap(category string, paramsmap map[string]any, setfunc func(string, string) error)
Currently, no errors are ever returned, but log messages are generated.
func (*ParamValues) DoForAllParams ¶
func (vals *ParamValues) DoForAllParams(f func(string, ParamValue))
func (*ParamValues) Exists ¶
func (vals *ParamValues) Exists(name string) bool
func (*ParamValues) Get ¶
func (vals *ParamValues) Get(name string) (string, error)
returns "" if parameter doesn't exist
func (*ParamValues) GetBoolValue ¶
func (vals *ParamValues) GetBoolValue(name string) bool
func (*ParamValues) GetFloatValue ¶
func (vals *ParamValues) GetFloatValue(name string) float32
func (*ParamValues) GetIntValue ¶
func (vals *ParamValues) GetIntValue(name string) int
func (*ParamValues) GetStringValue ¶
func (vals *ParamValues) GetStringValue(name string, def string) string
func (*ParamValues) JsonValues ¶
func (vals *ParamValues) JsonValues() string
func (*ParamValues) ParamNames ¶
func (vals *ParamValues) ParamNames() []string
func (*ParamValues) Save ¶
func (vals *ParamValues) Save(category string, filename string) error
Save parameters values to a file. If filename doesn't have a .json suffix, it's added.
func (*ParamValues) Set ¶
func (vals *ParamValues) Set(name, value string) error
func (*ParamValues) SetParamValueWithString ¶
func (vals *ParamValues) SetParamValueWithString(origname, value string) (err error)
type ParamsMap ¶
var CursorSourceToQuadPreset ParamsMap
func LoadParamsMap ¶
func OverrideMap ¶
func OverrideMap() ParamsMap
type Patch ¶
type Patch struct {
// contains filtered or unexported fields
}
func (*Patch) ApplyPatchValuesFromQuadMap ¶
func (*Patch) CursorToQuant ¶
func (patch *Patch) CursorToQuant(ce CursorEvent) Clicks
func (*Patch) MIDIChannel ¶
func (*Patch) ParamNames ¶
func (*Patch) RefreshAllIfPortnumMatches ¶
func (*Patch) RefreshAllPatchValues ¶
func (patch *Patch) RefreshAllPatchValues()
func (*Patch) SaveAndAlert ¶
func (*Patch) SaveQuadAndAlert ¶
type PatchLogic ¶
type PatchLogic struct {
// contains filtered or unexported fields
}
func NewPatchLogic ¶
func NewPatchLogic(patch *Patch) *PatchLogic
type Phrase ¶
type Phrase struct { Source string Destination string Length Clicks // contains filtered or unexported fields }
Phrase is a time-ordered list of *PhraseElements
func (*Phrase) AdjustTimes ¶
AdjustTimes returns a new Phrase shifted by shift Clicks
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 ¶
func (p *Phrase) CopyAndAppend(elem *PhraseElement) *PhraseElement
CopyAndAppend makes a copy of a Note and appends it to the Phrase
func (*Phrase) InsertElement ¶
func (p *Phrase) InsertElement(item *PhraseElement) *Phrase
InsertNote inserts a note into a Phrase
func (*Phrase) InsertNoLock ¶
func (p *Phrase) InsertNoLock(pe *PhraseElement) *Phrase
InsertNoLock adds a Note to a Phrase
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 PhraseElement ¶
type PhraseElement struct { AtClick Clicks Value any // things like *NoteFull, *NoteOn, *NoteOff, etc }
func (*PhraseElement) Copy ¶
func (pe *PhraseElement) Copy() *PhraseElement
func (*PhraseElement) EndOf ¶
func (pe *PhraseElement) EndOf() Clicks
func (*PhraseElement) IsNote ¶
func (pe *PhraseElement) IsNote() bool
type PhraseScanner ¶
type PhraseScanner struct {
// contains filtered or unexported fields
}
PhraseScanner represents a lexical scanner for phrase constants
func NewPhraseScanner ¶
func NewPhraseScanner(r io.Reader) *PhraseScanner
NewScanner returns a new instance of Scanner.
func (*PhraseScanner) ScanChar ¶
func (s *PhraseScanner) ScanChar() string
func (*PhraseScanner) ScanNumber ¶
func (s *PhraseScanner) ScanNumber() (int, error)
func (*PhraseScanner) ScanWord ¶
func (s *PhraseScanner) ScanWord() (tok Token, lit string)
Scan returns the next token and literal value.
type PitchBend ¶
type PitchBend struct {
// contains filtered or unexported fields
}
func NewPitchBend ¶
type PlaybackEvent ¶
PlaybackEvent is for start/stop
type PortChannel ¶
type ProgramChange ¶
func NewProgramChange ¶
func NewProgramChange(channel, program uint8) *ProgramChange
func (*ProgramChange) String ¶
func (n *ProgramChange) String() string
type QuadPro ¶
type QuadPro struct {
// contains filtered or unexported fields
}
var TheQuadPro *QuadPro
func NewQuadPro ¶
func NewQuadPro() *QuadPro
func (*QuadPro) OnClientRestart ¶
func (*QuadPro) PatchForCursorEvent ¶
func (quadpro *QuadPro) PatchForCursorEvent(ce CursorEvent) (patch *Patch, button string)
type RecordingEvent ¶
type SchedElement ¶
func NewSchedElement ¶
func NewSchedElement(atclick Clicks, tag string, value any) *SchedElement
func SchedElementFromString ¶
func SchedElementFromString(s string) (se *SchedElement, err error)
func (SchedElement) GetClick ¶
func (se SchedElement) GetClick() Clicks
func (*SchedElement) SetClick ¶
func (se *SchedElement) SetClick(click Clicks)
NOTE: a pointer is used so se.SetClick() can modify the value
type Scheduler ¶
type Scheduler struct { AutoTransposeOn bool // contains filtered or unexported fields }
var TheScheduler *Scheduler
func NewScheduler ¶
func NewScheduler() *Scheduler
func (*Scheduler) CountEventsWithTag ¶
func (*Scheduler) DeleteCursorEventsWhoseGidIs ¶
func (*Scheduler) DeleteEventsWithTag ¶
func (*Scheduler) PendingToString ¶
func (*Scheduler) SetAutoTransposeBeats ¶
func (*Scheduler) SetTranspose ¶
type Synth ¶
type Synth struct {
// contains filtered or unexported fields
}
func (*Synth) ClearNoteDowns ¶
func (synth *Synth) ClearNoteDowns()
func (*Synth) SendBytesToMidiOutput ¶
SendBytesToMidiOutput
func (*Synth) SendController ¶
func (*Synth) SendNoteToMidiOutput ¶
func (*Synth) UpdateBankProgram ¶
func (synth *Synth) UpdateBankProgram()
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