fix calculation of note offset