Documentation ¶
Index ¶
- Constants
- Variables
- func ClearExternalScale()
- func ConfigValue(nm string) string
- func CopyDir(src, dest string) error
- func DataDir() string
- func EngineDir(engine string) string
- func EngineFilePath(engine string, nm string) string
- func EnginePath(engineName string, nm string) string
- func ErrorResponse(err error, id string) string
- func GetBool(paramvalues map[string]string, name string) (bool, error)
- func GetFloat(paramvalues map[string]string, name string) (float32, error)
- func GetInt(paramvalues map[string]string, name string) (int, error)
- func GetRequest(conn *websocket.Conn) (method, params, id string, err error)
- func GetString(pmap map[string]string, name string) (string, error)
- func ISFFilePaths(venue string, nm string) (string, string)
- func IsTrueValue(value string) bool
- func ListenToMIDI()
- func LoadEffectsJSON(engineName string)
- func LoadImage(path string) (*image.NRGBA, error)
- func LoadParamDefs(engineName string) error
- func LoadParamEnums(engineName string)
- func MidiFilePath(venue string, nm 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 RecordingsPath(venue string, nm string) string
- func ResultResponse(resultObj interface{}, id string) string
- func RootBinPath(nm string) string
- func RootConfigFilePath(nm string) string
- func RootPath() string
- func RootTemplatePath(nm string) string
- func SendErrorResponse(conn *websocket.Conn, rpcerr error, id string) error
- func SendMail(recipient, subject, body string) error
- func SendResponse(conn *websocket.Conn, result interface{}, err error, id string) error
- func SendResultResponse(conn *websocket.Conn, result interface{}, id string) error
- func SetExternalScale(pitch int, on bool)
- func SetRootPath(path string)
- func Spawn(executable string, stdout io.Writer, stderr io.Writer, args ...string) error
- func StartDeviceInput(stdout io.Writer, stderr io.Writer) error
- func StartVizNats()
- func StringMap(params string) (map[string]string, error)
- func StringParamOfAPI(api string, pmap map[string]string, name string) (string, error)
- func VenueDir(venue string) string
- func VenueFilePath(venue string, nm string) string
- type APIEvent
- type APIHandler
- type ActivePhrase
- type ActivePhrasesManager
- func (mgr *ActivePhrasesManager) AdvanceActivePhrasesByOneStep()
- 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 Alg
- type AlgDefault
- type AlgMaze
- type CallbackID
- type Clicks
- type Command
- type CursorEvent
- type DebugFlags
- type Hub
- func (hub *Hub) AddVenue(v *Venue) error
- func (hub *Hub) BootEngine(engineName, hubAddr, engineAddr string) error
- func (hub *Hub) CreateVenue(vname string, ename string) (*Venue, error)
- func (hub *Hub) GetVenue(name string) *Venue
- func (hub *Hub) LoadConfig()
- func (hub *Hub) LoadVenues() error
- func (hub *Hub) NumUsers() int
- func (hub *Hub) NumVenues() int
- func (hub *Hub) Start()
- func (hub *Hub) VenueCheckin(venue *Venue, user *VizUser) error
- func (hub *Hub) Wait()
- type LoopEvent
- type MIDIFile
- type MidiDevice
- type MidiDeviceEvent
- type MyWriter
- type NomidiDevice
- func (m *NomidiDevice) Inputs() []string
- func (m *NomidiDevice) Listen(dev string) error
- func (m *NomidiDevice) ListeningInputs() []string
- func (m NomidiDevice) LoadSynths(path string) error
- func (m *NomidiDevice) Outputs() []string
- func (m NomidiDevice) Poll(inputName string) (bool, error)
- func (m NomidiDevice) ReadEvent(inputName string) (MidiDeviceEvent, error)
- func (m *NomidiDevice) SendANO(synth string)
- func (m *NomidiDevice) SendNote(n *Note, debug bool, callbacks []*NoteOutputCallback)
- type NomidiEvent
- type Note
- type NoteOutputCallback
- type NoteOutputCallbackFunc
- type NoteType
- type PadSetting
- 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) string
- func (vals *ParamValues) SetParamValue(nm string, v ParamValue)
- 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) 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 Recording
- type Remote
- type Scale
- type Step
- type StepLoop
- type TuioCursor
- type Venue
- type VenueEventCallback
- type VizColor
- type VizEvent
- type VizNats
- type VizOsc
- type VizUser
- func (u *VizUser) GetEmail() string
- func (u *VizUser) GetID() interface{}
- func (u *VizUser) GetPasswordHash() []byte
- func (u *VizUser) GetPasswordToken() (string, time.Time)
- func (u *VizUser) GetRoles() []string
- func (u *VizUser) GetState() int
- func (u *VizUser) GetVerificationID() (string, time.Time)
- func (u *VizUser) SetEmail(email string)
- func (u *VizUser) SetID(id interface{})
- func (u *VizUser) SetPasswordHash(hash []byte)
- func (u *VizUser) SetPasswordToken(id string, created time.Time)
- func (u *VizUser) SetState(state int)
- func (u *VizUser) SetVerificationID(id string, created time.Time)
- type VizUsersDb
- func (vu *VizUsersDb) Num() int
- func (vu *VizUsersDb) Users() map[string]users.User
- func (vu *VizUsersDb) VizLoadUserByEmail(email string) (users.User, error)
- func (vu *VizUsersDb) VizLoadUserByPasswordToken(token string) (users.User, error)
- func (vu *VizUsersDb) VizLoadUserByVerificationID(id string) (users.User, error)
- func (vu *VizUsersDb) VizSaveNewUserAtomic(user users.User) (users.User, error)
- func (vu *VizUsersDb) VizThrottleLogin(email string)
- func (vu *VizUsersDb) VizThrottleVerification()
- func (vu *VizUsersDb) VizUpdateUser(user users.User) error
- func (vu *VizUsersDb) WriteUsers() error
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 DebugHub = DebugFlags{ Realtime: true, Cursor: true, }
DebugHub controls debugging output
var DebugUtil = DebugFlags{}
DebugUtil controls debugging
var DefaultFragmentShader = `
#version 330
uniform sampler2D tex;
uniform vec2 tjt;
in vec2 fragTexCoord;
in vec4 finalcolor;
in vec2 finaldebug;
in vec2 finaltjt;
out vec4 outputColor;
void main() {
outputColor = finalcolor;
// if ( finaldebug.x < 0.5 ) {
// outputColor = texture(tex, fragTexCoord);
// } else if ( finaldebug.x > 0.5 ) {
outputColor.r = 0.0;
outputColor.g = 0.8;
outputColor.b = 0.0;
outputColor = texture(tex, fragTexCoord);
outputColor.r = 1.0;
// }
}
` + "\x00"
DefaultFragmentShader xxx
var DefaultVertexShader = `
#version 330
uniform mat4 projection;
uniform vec4 color;
uniform vec4 misc;
uniform vec2 debug;
in vec3 vert;
in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec4 finalcolor;
out vec4 finalvert;
out int finaltype;
out vec2 finaldebug;
vec3 hsl2rgb( in vec3 c )
{
vec3 rgb = clamp( abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 );
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
}
vec3 HueShift (in vec3 Color, in float Shift)
{
vec3 P = vec3(0.55735)*dot(vec3(0.55735),Color);
vec3 U = Color-P;
vec3 V = cross(vec3(0.55735),U);
Color = U*cos(Shift*6.2832) + V*sin(Shift*6.2832) + P;
return vec3(Color);
}
vec3 rgb2hsl( in vec3 c ){
float h = 0.0;
float s = 0.0;
float l = 0.0;
float r = c.r;
float g = c.g;
float b = c.b;
float cMin = min( r, min( g, b ) );
float cMax = max( r, max( g, b ) );
l = ( cMax + cMin ) / 2.0;
if ( cMax > cMin ) {
float cDelta = cMax - cMin;
//s = l < .05 ? cDelta / ( cMax + cMin ) : cDelta / ( 2.0 - ( cMax + cMin ) ); Original
s = l < .0 ? cDelta / ( cMax + cMin ) : cDelta / ( 2.0 - ( cMax + cMin ) );
if ( r == cMax ) {
h = ( g - b ) / cDelta;
} else if ( g == cMax ) {
h = 2.0 + ( b - r ) / cDelta;
} else {
h = 4.0 + ( r - g ) / cDelta;
}
if ( h < 0.0) {
h += 6.0;
}
h = h / 6.0;
}
return vec3( h, s, l );
}
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
void main() {
float angle = misc.x;
float invsize = 1.0 / misc.y;
float size = misc.y;
float x = misc.z;
float y = misc.w;
fragTexCoord = vertTexCoord;
finalvert = vec4(size*vert.x,size*vert.y,vert.z,1);
if (angle != 0.0) {
mat4 rotation = mat4(mat2(
cos(angle), -sin(angle),
sin(angle), cos(angle)));
finalvert = finalvert * rotation;
}
finalvert.x += x;
finalvert.y += y;
gl_Position = projection * finalvert;
vec4 mycolor = vec4(hsl2rgb(vec3(color.x,color.y,color.z)), color.a);
finalcolor = mycolor;
finaltype = 1;
finaldebug = debug;
}
` + "\x00"
DefaultVertexShader xxx
var EffectsJSON map[string]interface{}
EffectsJSON is an unmarshalled version of the effects.json file
var FragmentShader2 = `
#version 330
uniform sampler2D tex;
uniform vec2 tjt;
in vec2 fragTexCoord;
in vec4 finalcolor;
in vec2 finaldebug;
in vec2 finaltjt;
out vec4 outputColor;
void main() {
outputColor = finalcolor;
// if ( finaldebug.x < 0.5 ) {
// outputColor = texture(tex, fragTexCoord);
// } else if ( finaldebug.x > 0.5 ) {
outputColor.r = 0.0;
outputColor.g = 0.0;
outputColor.b = 0.8;
outputColor = texture(tex, fragTexCoord);
outputColor.g = 1.0;
// }
}
` + "\x00"
FragmentShader2 xxx
var LineVerticesForLines = []float32{
0.0, 0.0, 1.0, 0.0, 0.0,
1.0, 0.0, 1.0, 1.0, 0.0,
}
LineVerticesForLines xxx
var LineVerticesForLines2 = []float32{
0.0, 0.0, 1.0, 0.0, 0.0,
1.0, 0.0, 1.0, 1.0, 0.0,
}
LineVerticesForLines2 xxx
var PadSettings = map[string]PadSetting{
"A": {Sidmin: 11000, Sidmax: 12999},
}
PadSettings gives va;ies
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 Scales map[string]*Scale
Scales maps a name to a Scale
var SquareVerticesForLines = []float32{
-1.0, -1.0, 1.0, 0.0, 0.0,
1.0, -1.0, 1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 0.0,
}
SquareVerticesForLines xxx
var SquareVerticesForLines2 = []float32{
-1.0, -1.0, 1.0, 0.0, 0.0,
1.0, -1.0, 1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 0.0,
}
SquareVerticesForLines2 xxx
var SquareVerticiesForTriangles = []float32{
-1.0, -1.0, 1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 0.0, 0.0,
-1.0, 1.0, 1.0, 1.0, 1.0,
1.0, -1.0, 1.0, 0.0, 0.0,
1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, 1.0, 1.0, 1.0, 1.0,
}
SquareVerticiesForTriangles xxx
var SquareVerticiesForTriangles2 = []float32{
-1.0, -1.0, 1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 0.0, 0.0,
-1.0, 1.0, 1.0, 1.0, 1.0,
1.0, -1.0, 1.0, 0.0, 0.0,
1.0, 1.0, 1.0, 0.0, 1.0,
-1.0, 1.0, 1.0, 1.0, 1.0,
}
SquareVerticiesForTriangles2 xxx
var VertexShader2 = `
#version 330
uniform mat4 projection;
uniform vec4 color;
uniform vec4 misc;
uniform vec2 debug;
in vec3 vert;
in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec4 finalcolor;
out vec4 finalvert;
out int finaltype;
out vec2 finaldebug;
vec3 hsl2rgb( in vec3 c )
{
vec3 rgb = clamp( abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 );
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
}
vec3 HueShift (in vec3 Color, in float Shift)
{
vec3 P = vec3(0.55735)*dot(vec3(0.55735),Color);
vec3 U = Color-P;
vec3 V = cross(vec3(0.55735),U);
Color = U*cos(Shift*6.2832) + V*sin(Shift*6.2832) + P;
return vec3(Color);
}
vec3 rgb2hsl( in vec3 c ){
float h = 0.0;
float s = 0.0;
float l = 0.0;
float r = c.r;
float g = c.g;
float b = c.b;
float cMin = min( r, min( g, b ) );
float cMax = max( r, max( g, b ) );
l = ( cMax + cMin ) / 2.0;
if ( cMax > cMin ) {
float cDelta = cMax - cMin;
//s = l < .05 ? cDelta / ( cMax + cMin ) : cDelta / ( 2.0 - ( cMax + cMin ) ); Original
s = l < .0 ? cDelta / ( cMax + cMin ) : cDelta / ( 2.0 - ( cMax + cMin ) );
if ( r == cMax ) {
h = ( g - b ) / cDelta;
} else if ( g == cMax ) {
h = 2.0 + ( b - r ) / cDelta;
} else {
h = 4.0 + ( r - g ) / cDelta;
}
if ( h < 0.0) {
h += 6.0;
}
h = h / 6.0;
}
return vec3( h, s, l );
}
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
void main() {
float angle = misc.x;
float invsize = 1.0 / misc.y;
float size = misc.y;
float x = misc.z;
float y = misc.w;
fragTexCoord = vertTexCoord;
finalvert = vec4(size*vert.x,size*vert.y,vert.z,1);
if (angle != 0.0) {
mat4 rotation = mat4(mat2(
cos(angle), -sin(angle),
sin(angle), cos(angle)));
finalvert = finalvert * rotation;
}
finalvert.x += x;
finalvert.y += y;
gl_Position = projection * finalvert;
vec4 mycolor = vec4(hsl2rgb(vec3(color.x,color.y,color.z)), color.a);
finalcolor = mycolor;
finaltype = 1;
finaldebug = debug;
}
` + "\x00"
VertexShader2 xxx
Functions ¶
func ErrorResponse ¶
ErrorResponse return a JSON 2.0 error response
func GetRequest ¶
GetRequest reads a JSON request from a websocket
func IsTrueValue ¶
IsTrueValue returns true if the value is some version of true
func LoadEffectsJSON ¶
func LoadEffectsJSON(engineName string)
LoadEffectsJSON returns an unmarshalled version of the effects.json file
func LoadParamDefs ¶
LoadParamDefs initializes the list of parameters
func LoadParamEnums ¶
func LoadParamEnums(engineName string)
LoadParamEnums initializes the list of enumerated parameter values
func ResultResponse ¶
ResultResponse returns a JSON 2.0 result response
func SendErrorResponse ¶
SendErrorResponse sends a JSON 2.0 response
func SendResponse ¶
SendResponse sends a JSON 2.0 response
func SendResultResponse ¶
SendResultResponse sends a JSON 2.0 response
func StartDeviceInput ¶
StartDeviceInput starts anything needed to provide device inputs
func StringParamOfAPI ¶
StringParamOfAPI xxx
Types ¶
type APIEvent ¶
type APIEvent struct {
// contains filtered or unexported fields
}
APIEvent is an API invocation
type APIHandler ¶
APIHandler is an API execution func
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(midiOutput MidiDevice) *ActivePhrasesManager
NewActivePhrasesManager xxx
func (*ActivePhrasesManager) AdvanceActivePhrasesByOneStep ¶
func (mgr *ActivePhrasesManager) AdvanceActivePhrasesByOneStep()
AdvanceActivePhrasesByOneStep 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 Alg ¶
type Alg interface { // Draw(pl *Pipeline) // ID() string // State() SpriteState // Params() *SpriteParams // AdjustForAge(secs float32) CanHandleCursor(ce *CursorEvent) bool ExecuteIncomingCursor(ce *CursorEvent) }
Alg xxx
type Clicks ¶
type Clicks int64
Clicks is a time or duration value. It is NOT MIDI clock. NOTE: A Clicks value for a Note can be negative because it's relative to the starting time of a Phrase
type Command ¶
type Command struct { Action string // e.g. "addmidi" Arg interface{} }
Command is sent on the control channel of the Hub
type CursorEvent ¶
type CursorEvent struct { ID string // of the form {sessionid}@{IP} X float32 Y float32 Z float32 Downdragup string LoopsLeft int Fresh bool Quantized bool }
CursorEvent is a down, drag, or up event inside a loop step
type DebugFlags ¶
type DebugFlags struct { MIDI bool API bool Loop bool Gen bool Realtime bool OSC bool ISF bool Cursor bool Remote bool }
DebugFlags xxx
type Hub ¶
type Hub struct { // OSCInput chan oscDeviceEvent KillMe bool // set to true if Hub should be shutdown // contains filtered or unexported fields }
Hub is a router for devices and engines
func (*Hub) BootEngine ¶
BootEngine xxx
func (*Hub) CreateVenue ¶
CreateVenue xxx
func (*Hub) LoadVenues ¶
LoadVenues loads all the venues in the root/venues directory
func (*Hub) VenueCheckin ¶
VenueCheckin xxx
type LoopEvent ¶
type LoopEvent struct {
CursorEvent *CursorEvent
}
LoopEvent is what gets played back in a loop
type MIDIFile ¶
type MIDIFile struct {
// contains filtered or unexported fields
}
MIDIFile lets you read a MIDI File
type MidiDevice ¶
type MidiDevice interface { Inputs() []string ListeningInputs() []string Outputs() []string SendNote(note *Note, debug bool, callbacks []*NoteOutputCallback) SendANO(outputName string) // lame ReadEvent(inputName string) (MidiDeviceEvent, error) Poll(inputName string) (bool, error) Listen(inputName string) error LoadSynths(path string) error }
MidiDevice mediates all access to MIDI devices
func NewNomidiDevice ¶
func NewNomidiDevice() (MidiDevice, error)
NewNomidiDevice returns a MidiDevice interface for portmidi
type MidiDeviceEvent ¶
type MidiDeviceEvent struct { Timestamp int64 // milliseconds Status int64 Data1 int64 Data2 int64 }
MidiDeviceEvent is a single MIDI event
type NomidiDevice ¶
type NomidiDevice struct { }
NomidiDevice is used when you don't want to do MIDI
func (*NomidiDevice) Inputs ¶
func (m *NomidiDevice) Inputs() []string
Inputs returns a list of MIDI input names
func (*NomidiDevice) Listen ¶
func (m *NomidiDevice) Listen(dev string) error
Listen for input on a particular MIDI device
func (*NomidiDevice) ListeningInputs ¶
func (m *NomidiDevice) ListeningInputs() []string
ListeningInputs returns a list of MIDI input names that are open for listening
func (NomidiDevice) LoadSynths ¶
func (m NomidiDevice) LoadSynths(path string) error
func (*NomidiDevice) Outputs ¶
func (m *NomidiDevice) Outputs() []string
Outputs returns a list of MIDI output names
func (NomidiDevice) ReadEvent ¶
func (m NomidiDevice) ReadEvent(inputName string) (MidiDeviceEvent, error)
ReadEvent xxx
func (*NomidiDevice) SendANO ¶
func (m *NomidiDevice) SendANO(synth string)
SendANO sends all-notes-off
func (*NomidiDevice) SendNote ¶
func (m *NomidiDevice) SendNote(n *Note, debug bool, callbacks []*NoteOutputCallback)
SendNote sends MIDI output for a Note
type NomidiEvent ¶
type NomidiEvent struct { }
NomidiEvent is a single MIDI input event XXX - since is local, PortmidiEvent should just be portmidi.Event
type Note ¶
type Note struct { TypeOf NoteType // NOTE, NOTEON, NOTEOFF, NOTEBYTES Clicks Clicks // nanoseconds Duration Clicks // nanoseconds, when it's a NOTE // Channel uint8 // MIDI Channel 1-based, 0 if not set? Pitch uint8 // 0-127 Velocity uint8 // 0-127 Synth string // contains filtered or unexported fields }
Note is a single item in a Phrase
func NewNoteOff ¶
NewNoteOff creates a new NOTEOFF
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 PadSetting ¶
type PadSetting struct {
Sidmin, Sidmax int
}
PadSetting specifies a range of sid (session IDs from TUIO)
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) string
ParamStringValue xxx
func (*ParamValues) SetParamValue ¶
func (vals *ParamValues) SetParamValue(nm string, v ParamValue)
SetParamValue 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 Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote represents a remote Viz thing, either an engine or hub
func (*Remote) CheckConnection ¶
CheckConnection returns true if the connection is respondig
type Scale ¶
type Scale struct {
// contains filtered or unexported fields
}
Scale says whether a pitch is in a scale
type StepLoop ¶
StepLoop is one loop
func (*StepLoop) AddToStep ¶
func (loop *StepLoop) AddToStep(ce *CursorEvent, stepnum Clicks, debug bool)
AddToStep adds a StepItem to the loop at the current step
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
type Venue ¶
type Venue struct {
// contains filtered or unexported fields
}
Venue xxx
func (*Venue) FeedMeEventsLive ¶
func (v *Venue) FeedMeEventsLive(callback VenueEventCallback)
FeedMeEventsLive xxx
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
type VizEvent ¶
type VizEvent struct { // The EventSource is where the event originally came from EventSource string `json:"source"` EventType string `json:"eventtype"` EventVal map[string]interface{} `json:"eventval"` }
VizEvent xxx
func NewCursorVizEvent ¶
func NewCursorVizEvent(source string, ce *CursorEvent) VizEvent
NewCursorVizEvent xxx
func NewMidiInputVizEvent ¶
func NewMidiInputVizEvent(source string, midievent MidiDeviceEvent) VizEvent
NewMidiInputVizEvent xxx
type VizNats ¶
type VizNats struct {
// contains filtered or unexported fields
}
VizNats xxx
var TheVizNats *VizNats
TheVizNats is the only one
func (*VizNats) PublishRequest ¶
PublishRequest xxx
type VizOsc ¶
type VizOsc struct {
// contains filtered or unexported fields
}
VizOsc is a router for devices and engines
type VizUser ¶
type VizUser struct {
// contains filtered or unexported fields
}
VizUser xxx
func (*VizUser) GetPasswordToken ¶
GetPasswordToken xxx
func (*VizUser) GetVerificationID ¶
GetVerificationID xxx
func (*VizUser) SetPasswordHash ¶
SetPasswordHash xxx
func (*VizUser) SetPasswordToken ¶
SetPasswordToken xxx
type VizUsersDb ¶
type VizUsersDb struct {
// contains filtered or unexported fields
}
VizUsersDb xxx
func (*VizUsersDb) VizLoadUserByEmail ¶
func (vu *VizUsersDb) VizLoadUserByEmail(email string) (users.User, error)
VizLoadUserByEmail xxx
func (*VizUsersDb) VizLoadUserByPasswordToken ¶
func (vu *VizUsersDb) VizLoadUserByPasswordToken(token string) (users.User, error)
VizLoadUserByPasswordToken xxx
func (*VizUsersDb) VizLoadUserByVerificationID ¶
func (vu *VizUsersDb) VizLoadUserByVerificationID(id string) (users.User, error)
VizLoadUserByVerificationID xxx
func (*VizUsersDb) VizSaveNewUserAtomic ¶
VizSaveNewUserAtomic xxx
func (*VizUsersDb) VizThrottleLogin ¶
func (vu *VizUsersDb) VizThrottleLogin(email string)
VizThrottleLogin xxx
func (*VizUsersDb) VizThrottleVerification ¶
func (vu *VizUsersDb) VizThrottleVerification()
VizThrottleVerification xxx
func (*VizUsersDb) VizUpdateUser ¶
func (vu *VizUsersDb) VizUpdateUser(user users.User) error
VizUpdateUser xxx
func (*VizUsersDb) WriteUsers ¶
func (vu *VizUsersDb) WriteUsers() error
WriteUsers writes out all users data. Assumes the caller has done the mutex.