OAVp5.drums.copyText#
variableoav-p5OAVp5.drums.copyText
The text the Copy button on the card puts on the clipboard: the rhythm that plays now as a ready startDrums("…", bpm) call.
Click cells, type a line, find a rhythm you like, and paste this into setup() to keep it. The tempo is the current one, rounded to two decimals.
- Type
String
For example startDrums("bd*4, [~ sd]*2, hh*8", 110). Read fresh each time; '' before the machine has loaded.
Examples
function setup() {
createCanvas(400, 300);
startDrums('breakbeat', 120);
textSize(12);
}
function draw() {
background(20);
fill(255);
text(OAVp5.drums.copyText, 20, 20, width - 40, 200);
}Related
OAVp5.drums.srcThe line of rhythm that plays now, such as'bd*4, [~ sd]*2, hh*8'; an empty string until the machine has loaded.OAVp5.drums.strudelUrlThe rhythm that plays now as a link that opens it at strudel.cc, or an empty string when there is none.startDrums()Starts a drum machine: a 16-step grid on the page that plays a preset, your own grid or one line of rhythm, and counts the bars for your sketch.