From e3518588aa2d1a4e2de8f7a7e8d502e6664ea718 Mon Sep 17 00:00:00 2001 From: Stephanie Chung Date: Thu, 15 May 2014 07:49:57 -0700 Subject: [PATCH] added methods for playing minor chords --- js/main.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/js/main.js b/js/main.js index 8f06755..244d044 100644 --- a/js/main.js +++ b/js/main.js @@ -126,4 +126,43 @@ function playSecondMajorInversion(note) { MIDI.noteOn(0, root, velocity, delay); MIDI.noteOn(0, third, velocity, delay); MIDI.noteOn(0, fifth, velocity, delay); +} + +/** + * @method playRootMinor play the minor chord in the root position + * @param note + */ +function playRootMinor(note) { + var root = note; + var third = note + 3; + var fifth = note +7; + MIDI.noteOn(0, root, velocity, delay); + MIDI.noteOn(0, third, velocity, delay); + MIDI.noteOn(0, fifth, velocity, delay); +} + +/** + * @method playFirstMinorInversion play the minor chord in the 1st inversion + * @param note + */ +function playFirstMinorInversion(note) { + var root = note+3; + var third = root+4; + var fifth = root+5; + MIDI.noteOn(0, root, velocity, delay); + MIDI.noteOn(0, third, velocity, delay); + MIDI.noteOn(0, fifth, velocity, delay); +} + +/** + * @method playSecondMinorInversion play the minor chord in the 2nd inversion + * @param note + */ +function playSecondMinorInversion(note) { + var root = note+7; + var third = root+5; + var fifth = root+3; + MIDI.noteOn(0, root, velocity, delay); + MIDI.noteOn(0, third, velocity, delay); + MIDI.noteOn(0, fifth, velocity, delay); } \ No newline at end of file