Better handling of <note> and <gap>