xxxxxxxxxx
40
var synth = new Tone.PolySynth(4, Tone.Synth).toMaster();
// Passamezzo moderno
//1)I IV I V
//2)I IV I–V I
//C F C G | C F C–G C
var C_chord = ["C3", "E3", "G3"];
var F_chord = ["F2", "C3", "A3"];
var G_chord = ["G2", "D3", "B3"];
var pianoPart = new Tone.Part(callback, [
["0:0", C_chord],
["0:2", F_chord],
["0:4", C_chord],
["0:6", G_chord],
["0:8", C_chord],
["0:10", F_chord],
["0:12", C_chord],
["0:13", G_chord],
["0:14", C_chord.concat("C4")]
]).start();
pianoPart.loop = true;
pianoPart.loopEnd = "4m";
function callback(time, chord) {
synth.triggerAttackRelease(chord, "8n", time);
}
function setup() {
pianoPart.start();
Tone.Transport.start();
}
function draw() {
}