OAVp5.drums.strudelUrl#
variableoav-p5OAVp5.drums.strudelUrl
The rhythm that plays now as a link that opens it at strudel.cc, or an empty string when there is none.
It holds the line as s("…") with setcpm(bpm/4) (one bar here is one Strudel cycle of four beats), the same thing the "Open in Strudel" link on the card opens. Open it in a new tab: window.open(OAVp5.drums.strudelUrl) from a click handler.
- Type
String
A https://strudel.cc/#… address, read fresh each time. '' before the machine has loaded.
Examples
function setup() {
createCanvas(400, 300);
startDrums('bd*4, [~ sd]*2, hh*8', 110);
textAlign(CENTER, CENTER);
}
function mousePressed() {
if (OAVp5.drums.strudelUrl) window.open(OAVp5.drums.strudelUrl, '_blank');
}
function draw() {
background(20);
fill(255);
text('click to open this rhythm in strudel.cc', width / 2, height / 2 - 15);
text(OAVp5.drums.strudelUrl.slice(0, 40) + '…', width / 2, height / 2 + 15);
}To be confirmed
Not tried: whether the sketch frame of OpenProcessing lets window.open open the link.
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.copyTextThe text the Copy button on the card puts on the clipboard: the rhythm that plays now as a readystartDrums("…", bpm)call.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.