open-audiovisual
Search GitHub

oav-p5 reference · Timeline, cues and score

OAVp5.drums.cues#

variableoav-p5
OAVp5.drums.cues

The list of every cue declared so far, in the order they were declared.

Read it to show a plan on screen or to check what is declared. It is the machine's own list, so treat it as read-only; declare cues with cue().

Type
Array<Object>

Each item is { bar, name, every, at, period, key }: the values you passed, and at and period counted in steps. An empty list at the start.

Examples

jsOpenProcessing ↗
function setup() {
  createCanvas(400, 300);
  startDrums('four on floor', 120);
  cue(1, 'calm', 8);
  cue(5, 'storm', 8);
  textSize(14);
}

function draw() {
  background(20);
  fill(255);
  OAVp5.drums.cues.forEach((c, i) => {
    text('bar ' + c.bar + (c.every ? ' (every ' + c.every + ')' : '') + ': ' + c.name, 20, 30 + i * 24);
  });
}
The plan as a list: one line per cue.

Related

  • cue() Plans something for a bar: at bar bar the function cueFired(name, bar) is called and cueName becomes name; with every, again every that many bars.
  • OAVp5.drums.cue() The same as cue(bar, name, every), but it returns the cue it made (or the one that was already there), and null when bar is not valid.
  • cueName The name of the last cue that fired, or an empty string before the first one.

p5/oav-p5.js, line 1466

↑ Back to top · All names