private void setUpChord(NoteName rootOfChord, ChordType chordType,
			ChordFunction function, Scale scale, int inversion) {
		// Check for valid input.
		if (chordType == null || function == null || rootOfChord == null ||
				scale == null) {
			throw new NullPointerException();
		}
		this.root = rootOfChord;
		this.type = chordType;
		this.function = function;
		this.scale = scale;
		this.inversion = inversion;
		
		// Determine what type of triad this chord is based on.
		Note chordRoot = new Note(rootOfChord.getLowestOctaveMidiNumber());
		Note chordThird;
		Note chordFifth;
		switch (chordType) {
		case MINOR:			// Minor triad
			chordThird = chordRoot.noteAt(3);
			chordFifth = chordRoot.noteAt(7);
			break;
		case AUGMENTED:		// Augmented triad
			chordThird = chordRoot.noteAt(4);
			chordFifth = chordRoot.noteAt(8);
			break;
		case DIMINISHED:	// Diminished triad
			chordThird = chordRoot.noteAt(3);
			chordFifth = chordRoot.noteAt(6);
			break;
		default:			// Default to major triad
			chordThird = chordRoot.noteAt(4);
			chordFifth = chordRoot.noteAt(7);
			break;
		}
		
		// Get all possible octaves of each note.
		roots = findAllOctaves(chordRoot);
		thirds = findAllOctaves(chordThird);
		fifths = findAllOctaves(chordFifth);
		notes = merge(merge(roots, thirds), fifths);
	}