コード例 #1
0
        public static void changeTabPitch(int chordPosition, int newPitchPosition)
        {
            Chord tempChord = chords.ElementAt(chordPosition);

            tablature.RemoveAt(chordPosition);
            tablature.Insert(chordPosition, TabChordFactory.getTabByChord(tempChord, newPitchPosition, _guitar));
        }
コード例 #2
0
        public static void changeTuning(Note six, Note five, Note four, Note three, Note two, Note one)
        {
            _guitar.changeTunning(six, five, four, three, two, one);
            TabChord tempTab;

            for (int i = 0; i < getSize(); i++)
            {
                tempTab = TabChordFactory.getTabByChord(chords.ElementAt(i), tablature.ElementAt(i).getPitch(), _guitar);
                tablature.RemoveAt(i);
                tablature.Insert(i, tempTab);
            }
        }
コード例 #3
0
 public void TabChordFactory_getNoteByChord()
 {
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("E"), 1, guitar);
     Assert.AreEqual("0", tabChord.getFretNumber(6));
     Assert.AreEqual("2", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("1", tabChord.getFretNumber(3));
     Assert.AreEqual("0", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("Am"), 1, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("0", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("2", tabChord.getFretNumber(3));
     Assert.AreEqual("1", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("C"), 1, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("3", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("0", tabChord.getFretNumber(3));
     Assert.AreEqual("1", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("G"), 1, guitar);
     Assert.AreEqual("3", tabChord.getFretNumber(6));
     Assert.AreEqual("2", tabChord.getFretNumber(5));
     Assert.AreEqual("0", tabChord.getFretNumber(4));
     Assert.AreEqual("0", tabChord.getFretNumber(3));
     Assert.AreEqual("0", tabChord.getFretNumber(2));
     Assert.AreEqual("3", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("G"), 2, guitar);
     Assert.AreEqual("3", tabChord.getFretNumber(6));
     Assert.AreEqual("5", tabChord.getFretNumber(5));
     Assert.AreEqual("5", tabChord.getFretNumber(4));
     Assert.AreEqual("4", tabChord.getFretNumber(3));
     Assert.AreEqual("3", tabChord.getFretNumber(2));
     Assert.AreEqual("3", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("E"), 2, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("X", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("4", tabChord.getFretNumber(3));
     Assert.AreEqual("5", tabChord.getFretNumber(2));
     Assert.AreEqual("4", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("E"), 3, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("7", tabChord.getFretNumber(5));
     Assert.AreEqual("6", tabChord.getFretNumber(4));
     Assert.AreEqual("4", tabChord.getFretNumber(3));
     Assert.AreEqual("5", tabChord.getFretNumber(2));
     Assert.AreEqual("4", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("C"), 1, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("3", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("0", tabChord.getFretNumber(3));
     Assert.AreEqual("1", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("Csus"), 1, guitar);
     Assert.AreEqual("1", tabChord.getFretNumber(1));
     Assert.AreEqual("1", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(3));
     Assert.AreEqual("3", tabChord.getFretNumber(4));
     Assert.AreEqual("3", tabChord.getFretNumber(5));
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("E6"), 1, guitar);
     Assert.AreEqual("0", tabChord.getFretNumber(6));
     Assert.AreEqual("2", tabChord.getFretNumber(5));
     Assert.AreEqual("2", tabChord.getFretNumber(4));
     Assert.AreEqual("1", tabChord.getFretNumber(3));
     Assert.AreEqual("2", tabChord.getFretNumber(2));
     Assert.AreEqual("0", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("Dmaj9"), 1, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("X", tabChord.getFretNumber(5));
     Assert.AreEqual("0", tabChord.getFretNumber(4));
     Assert.AreEqual("2", tabChord.getFretNumber(3));
     Assert.AreEqual("2", tabChord.getFretNumber(2));
     Assert.AreEqual("2", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("F7+"), 1, guitar);
     Assert.AreEqual("1", tabChord.getFretNumber(6));
     Assert.AreEqual("4", tabChord.getFretNumber(5));
     Assert.AreEqual("1", tabChord.getFretNumber(4));
     Assert.AreEqual("2", tabChord.getFretNumber(3));
     Assert.AreEqual("2", tabChord.getFretNumber(2));
     Assert.AreEqual("1", tabChord.getFretNumber(1));
     tabChord = TabChordFactory.getTabByChord(ChordFactory.getChordByName("Fm7(b5)"), 3, guitar);
     Assert.AreEqual("X", tabChord.getFretNumber(6));
     Assert.AreEqual("X", tabChord.getFretNumber(5));
     Assert.AreEqual("3", tabChord.getFretNumber(4));
     Assert.AreEqual("4", tabChord.getFretNumber(3));
     Assert.AreEqual("4", tabChord.getFretNumber(2));
     Assert.AreEqual("4", tabChord.getFretNumber(1));
 }
コード例 #4
0
 public static void replaceChord(int location, Chord chord)
 {
     chords.RemoveAt(location);
     chords.Insert(location, chord);
     tablature.Insert(location, TabChordFactory.getTabByChord(chord, 1, _guitar));
 }
コード例 #5
0
 public static void addChord(Chord chord)
 {
     chords.Add(chord);
     tablature.Add(TabChordFactory.getTabByChord(chord, 1, _guitar));
 }