@@ -712,7 +712,9 @@ private ArrayList<Chord> makeChord(ArrayList<Integer> chordNotes, int start, Arr
712
712
else {
713
713
root =false ;
714
714
}
715
+
715
716
for (int count =0 ; count <strings ; count ++) {
717
+
716
718
ArrayList <Position > position =makePosition (count , start , chordNotes , up .get (count ), tuning .get (count ).getFrets (),tuning .get (count ).getStartFret (), maxFretDistance ); // calculates the positions;
717
719
notePlaces .add (position );
718
720
}
@@ -814,9 +816,12 @@ private ArrayList<Chord> makeChord(ArrayList<Integer> chordNotes, int start, Arr
814
816
previousNoteFret =noteFret ;
815
817
previousNoteNumber =noteNumber ;
816
818
}
817
- if (allChordNotes ==chordNotes .size () && stringGap ==false && sameNotes ==false && rootNote ==false && highestFret -lowestFret <=maxFretDistance - 1 ) {
819
+ if (allChordNotes ==chordNotes .size () && stringGap ==false && sameNotes ==false && rootNote ==false && ( highestFret -lowestFret <=maxFretDistance )) { // chord is playable add it to the array list for chords to display
818
820
chords .add (new Chord (chordPositions , lowestFret , lowestFret , unhitStrings , modifer , bassNoteNumber ));
821
+
822
+
819
823
}
824
+
820
825
for (int counter2 =size -1 ; counter2 >=0 ; counter2 --) {
821
826
if (counterArray [counter2 ] + 1 < sizes [counter2 ]) {
822
827
counterArray [counter2 ]++;
@@ -836,8 +841,8 @@ private ArrayList<Position> makePosition(int string, int start, ArrayList<Intege
836
841
out :
837
842
if (up ==1 ) {
838
843
for (int count =start ; count <maxFretDistance +start ; count ++) { // finds all positions that match the chord notes up the neck.
839
- if (count >=frets ) {
840
- if (positions .size ()==0 ) {
844
+ if (count >=frets - 1 ) {
845
+ if (positions .size ()==0 ) { // if not matching notes were found add unhit string position
841
846
positions .add (new Position (string , -1 , new Note (-1 ,-1 , "X" , -1 , -1 ) ));
842
847
}
843
848
break out ;
@@ -865,7 +870,7 @@ else if ( root==true){// add any note that matches the notes that make up the c
865
870
}
866
871
}
867
872
else {//does the same thing as for loop number 1 but going down the neck instead.
868
- if (start >=frets ) {
873
+ if (start >=frets - 1 ) {
869
874
positions .add (new Position (string , -1 , new Note (-1 ,-1 , "X" , -1 , -1 ) ));
870
875
return positions ;
871
876
}
@@ -923,7 +928,7 @@ public void setInstrument(Instrument instrument){ // sets new instrument and reg
923
928
tuning .get (count ).setStartFret (tuning .get (count ).getStartFret ()-minFrets +1 );
924
929
}
925
930
}
926
- instrument .setFrets (maxFrets +1 );
931
+ instrument .setFrets (maxFrets +2 );
927
932
for (int count =0 ; count <strings ; count ++) {
928
933
int note =tuning .get (count ).getStringNote ().getNoteNumber ();
929
934
int octave =tuning .get (count ).getStringNote ().getOctave ();
0 commit comments