Skip to content

Commit

Permalink
Incorporated Chords small chords
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseallison committed Jul 12, 2016
1 parent 079fd63 commit 03849c7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,19 @@ <h1 onclick="causeSound.triggerCauseway();"><span class="mainTitle">Causeway</sp
this.currentChord = chord;
}

this.nextChord = function() {
this.currentChord = this.currentChord + 1;
if(this.currentChord > this.chords.length){
this.currentChord = 0;
}
}

this.randomChordNote = function(){
var chord = this.chords[Math.floor(Math.random() * (this.chords.length))];
var pitch = chord[Math.floor(Math.random() * (chord.length))];
return pitch;
}

// this.arpeggio = function() {
// var pattern = causeSound.chords[causeSound.currentChord];
// var pat = new Tone.Pattern(function(time, note){
Expand Down Expand Up @@ -450,7 +463,8 @@ <h1 onclick="causeSound.triggerCauseway();"><span class="mainTitle">Causeway</sp

this.playBBCollapse = function() {
this.playerBBCollapse.start();
var pitch = this.pitchCollection[Math.floor(Math.random() * (this.pitchCollection.length))];
var pitch = this.randomChordNote();
console.log("Pitch: ", pitch);
this.synth.triggerAttackRelease(this.freq(pitch), 5);
};

Expand Down

0 comments on commit 03849c7

Please sign in to comment.