p1.get('hihat').start();
if ([0,4,8,1].indexOf(idx) >= 0)
p1.get('kick').start();
if ([2,6,10,14].indexOf(idx) >= 0)
p1.get('snare').start();
//synth ---------------------------
var chords = [
['C3','F3','A#3'],
['F#3','B3','E4'],
['A#3','C#3','F4'],
['E3','A3','D#4']
];
var chordIndex = -1;
if (idx == 0) chordIndex = 0;
if (idx == 4) chordIndex = 1;
if (idx == 8) chordIndex = 2;
if (idx == 12) chordIndex = 3;
if (chordIndex >= 0)
{
polySynth.triggerAttackRelease(chords[chordIndex][0], '16n','+8n');
polySynth.triggerAttackRelease(chords[chordIndex][1], '16n','+8n');
polySynth.triggerAttackRelease(chords[chordIndex][2], '32n.');
}