(1) It is a positive commandment from the Torah to cry out and to sound trumpets for all troubles that come upon the community; as it is stated (Numbers 10:9), "upon an enemy who attacks you and you sound trumpets." That is to say, [with] every matter that troubles you — such as famine, a plague, locusts and that which is similar to them — cry out about them, and sound the trumpets.
(2) And this thing is from the ways of repentance. For when a trouble comes and they yell out about it and sound [trumpets], everyone will know that it was because of their evil deeds that this bad was done to them. As it is stated (Jeremiah 5:25), "It is your iniquities that have diverted, etc." And this is what will cause them to remove the trouble from upon them.