To set one's teeth on edge

I think I understand the meaning of this expression but what does it refer to. Here's a sentence. Mildred's singing set his teeth on edge.

I construe it as meaning to cause one to make, literally or figuratively, an "Eww, yuck!" grimace in which, in particular, the tips of the upper and lower incisors meet--a pickle face. The Bible has "The fathers have eaten sour grapes, and the children's teeth are set on edge" (approx. wording, from memory).

Replies