suddenly I thought that your solution was working correctly but I then figured out that I was having the same problems. It looks like a max problem but I don’t know how to explain it.
Try to put the attached file into the buffer for example. There are some empty parts in the loop which are read from the [peek~] and the [peakamp~] as well giving really strange values that looks non sense to me.
Anyway thanks for remembering me about the [peek~]. I didn’t like to use a [groove~] for that.