added samples_to_onset variable.