public void setLength(double length){
        if(length == 0.0625 || length == 0.125 || length == 0.25
                || length == 0.5 || length == 1)
            this.length = length;
        else
            throw new IllegalArgumentException(length + 
                    " is not a valid note length"); 
    }