◀︎ ▲︎ ▶︎︎

Simple Sequencer App
Drum

	Drum.prototype.play = function(n, tim) {
    if (n % 4 == 0) {
        var src = ctx.createBufferSource();
        src.buffer = this.kick;             // play Kick sound
        src.connect(this.vol);
        src.start(tim);
    }
    if (n % 4 == 2) {
        var src = ctx.createBufferSource();
        src.buffer = this.hat;              // play Hat sound
        src.connect(this.vol);
        src.start(tim);
    }
}