Skip to content

Stroking Methods

GodDragoner edited this page Apr 9, 2018 · 1 revision

startStroking(int bpm)

Starts playing the metronome at a specific bpm.

Parameters:

bpm - The bpm you want the metronome to play at

Alias: startMetronome

Example:

startStroking(120);


startStroking(int bpm, int durationInSeconds)

Starts playing the metronome at a specific bpm for x seconds.

Parameters:

bpm - The bpm you want the metronome to play at

durationInSeconds - The amount of seconds you want this to last

Alias: startMetronome

Example:

startStroking(120, 60);


stopStroking()

Stops the current playing metronome.

Alias: stopMetronome

Example:

stopMetronome();


isStroking()

Returns whether the sub is currently stroking/whether a metronome is running right now.

Alias: isMetronomeActive

Example:

if(isStroking()) {
  sendMessage("Continue stroking!");
}

addStrokingBPM(int bpm)

Adds or subtracts (negative bpm) to/from the current metronome bpm.

Parameters:

bpm - The bpm you want to add/subtract

Alias: addMetronomeBPM

Example:

addStrokingBPM(20);
sendMessage("Speed up!");

getStrokingBPM()

Returns the current metronome's bpm.

Alias: getMetronomeBPM

Example:

if(isStroking() && getStrokingBPM() > 120) {
   addStrokingBPM(-20);
   sendMessage("You can slow down for a bit.");
}

Clone this wiki locally