function withinKey(input) {
    // first check if a natural is in the key
    if (input.accidental == undefined) {
        if (getKeyAccidentals().includes(input.note + "#")) {
            return false;
        }
        if (getKeyAccidentals().includes(input.note + "b")) {
            return false;
        }
        return true; // example: the note D is in the key if D# and Db are not in the key
    } else {
        return getKeyAccidentals().includes(input.note + input.accidental);
    }
}
/**
 * @param  input [a note object]
 * @return true if the given note is within the set key
 */
@param  input [a note object]
@return true if the given note is within the set key
@param input [ a note object ] @return true if the given note is within the set key
function withinKey(input) {
    if (input.accidental == undefined) {
        if (getKeyAccidentals().includes(input.note + "#")) {
            return false;
        }
        if (getKeyAccidentals().includes(input.note + "b")) {
            return false;
        }
        return true; 
    } else {
        return getKeyAccidentals().includes(input.note + input.accidental);
    }
}
function withinKey ( input ) { if ( input . accidental == undefined ) { if ( getKeyAccidentals ( ) . includes ( input . note + "#" ) ) { return false ; } if ( getKeyAccidentals ( ) . includes ( input . note + "b" ) ) { return false ; } return true ; } else { return getKeyAccidentals ( ) . includes ( input . note + input . accidental ) ; } }
@param  input [a note object]
 @return true if the given note is within the set key
@param input [ a note object ] @return true if the given note is within the set key
// first check if a natural is in the key // example: the note D is in the key if D# and Db are not in the key