public class BPM { // global variables static dur wholeNote, halfNote, quarterNote, eighthNote, sixteenthNote, thirtysecondNote; // gets a random key for the song to be played in static int randomKeyNum; // gets a random tempo for the song. static float randomBpm; Math.random2f(80.0, 150.0) => randomBpm; static float beatsPerMin; 90.0 => beatsPerMin; tempo(beatsPerMin); fun void tempo(float beat) { // beat argument is BPM, example 120 beats per minute 60.0/(beat) => float SPB; // seconds per beat SPB :: second => quarterNote; quarterNote*2.0 => halfNote; quarterNote*4.0 => wholeNote; quarterNote*0.5 => eighthNote; eighthNote*0.5 => sixteenthNote; sixteenthNote*0.5 => thirtysecondNote; } fun dur getVerseLength() { return wholeNote*16; } fun dur getChorusLength() { return wholeNote*8; } }