Performers

barryvan edited this page Dec 31, 2011 · 4 revisions
Clone this wiki locally

Performers all extend barryvan.tp.performer.Base. This provides the "filterNote" method, which allows band pass and band cut filters to be applied to the note. Performers are in the "barryvan.tp.performer" namespace.

Available performers:

  • Morse
  • Oscillator
  • ShimmerGrid
  • SignalTracker
  • Swarm
  • Thumper
  • Tracer
  • Transformer

barryvan.tp.performer.Morse

Akin to an oscilloscope: a dot moves across the screen, rapidly moving up or down from its baseline in response to note events, and returning more gradually to the baseline.

colour The colour of the dot.

middle The "middle" note -- notes above this will cause the dot to jump up; notes below will cause it to jump down.

position The vertical position of the baseline. If this is negative, it is the distance from the bottom of the screen; otherwise, it is the distance from the top.

thickness The thickness of the dot.

length The length of the dot: narrow dots move more slowly.

size The vertical displacement each note event will cause.

slope A factor which determines the speed at which the dot returns to its baseline.

cutPower When a Note Cut or Note Off event is received, the dot will return to its baseline at the slope factor raised to the power of this value.

barryvan.tp.performer.Oscillator

Draws a rectangle on-screen for each note event; the vertical position is determined by the pitch.

colour The colour of the performer.

vertical The vertical padding.

horizontal The horizontal position. If this is negative, the performer will be positioned from the right-hand side of the canvas; otherwise, it will be positioned from the left.

length The length (width) of the rectangle drawn for each note event.

middle The "middle" note -- this is the note at which the rectangle will be drawn in the vertical centre of the screen.

thickness The height of the rectangle.

stepSize The number of pixels moved per semitone.

barryvan.tp.performer.ShimmerGrid

Draws a series of dots (or squares) at grid intersection points, which "shimmer" according to the recency of a note event.

colour The colour of the rendered dots/squares.

spacing The distance between points on the grid. Only square grids are currently supported.

size The size of the intersection point. Only squares are currently supported.

probability The likelihood that a particular point will be "lit up".

vitalisation The amount of energy each note event injects into the grid. The energy of the grid decays over time; the lower the energy, the more transparent the points in the grid.

opacity The maximum possible opacity level for points in the grid.

jitter The distance that points may move from their "home" location.

barryvan.tp.performer.SignalTracker

Similar to Morse, the SignalTracker moves horizontally across the canvas. Its vertical position, however, is dictated by the pitch of the notes it receives. Additionally, it offers jitter and glissando facilities.

colour The colour of the performer.

middle The "middle" note -- this is the note at which the performer will be drawn on its baseline.

position The vertical position of the baseline. If this is negative, it is the distance from the bottom of the screen; otherwise, it is the distance from the top.

length The length of the tracker: narrow dots move more slowly.

knots The number of lines to draw at each step. When used with jitter, this can produce interesting visual effects.

stepSize The number of pixels moved per semitone.

glissLength The amount of time taken to move from one pitch to another.

transition A function or string determining how the performer moves from one pitch to another. Built-in transitions are "sine" and "ease" (the default).

jitter The amount of noise to introduce at each step/knot.

vitalisation The amount of energy each note event injects into the performer. The energy of the performer decays over time; the lower the energy, the more transparent the performer's rendering.

barryvan.tp.performer.Swarm

Draws a swarm of particles, which move towards and around a common centre of gravity, which itself is in motion (but invisible). On note events, the particles slow down, swell, and the centre of gravity jumps to a random position on-screen.

particleCount The number of particles in the swarm.

colours The colour of each of the particles in the swarm.

maxParticleVelocity The maximum number of pixels a particle may move per frame horizontally or vertically.

maxSwarmVelocity The maximim number of pixels that the centre of gravity may move per frame horizontally or vertically.

size The size of the particles.

vitalisation The amount of energy each note event injects into the particles. The energy of the particles decays over time; the lower the energy, the more transparent the particles in the swarm.

barryvan.tp.performer.Thumper

Fills the screen with a colour on note events.

colour The colour of the performer.

opacity The maximum opacity of the colour used to fill the screen.

barryvan.tp.performer.Tracer

Multiple particles traverse the canvas, potentially changing direction at grid intersections.

particleCount The number of particles.

colour The colour of the particles

speed The speed (and length) of the particles.

decisions Defines the grid intersections at which a change in direction may occur.

vitalisation The amount of energy each note event injects into the particles. The energy of the particles decays over time; the lower the energy, the more transparent the particles.

tailSegments The number of tail segments to render (tail segments are rendered with decreasing opacity).

thickness The thickness of the particles.

probability The likelihood that when an intersection point is reached, a particle will change direction.

opacity The global opacity of the particles.

barryvan.tp.performer.Transformer

Adds a CSS transformation to the entire canvas element in response to a note event. Useful for kick drums and the like.

transform The transformation to apply in response to note events. Bear in mind that multiple Transformer performers do not stack their transformations, and using this performer will override any CSS transformations you may already have defined on the canvas element.