We had the same at school with the fire alarm and the bell for end of break. There was only ever one fire while I was there. Guess when it was discovered...
The destructions for my fire alarm panel walk you through using the somewhat arcane cause-and-effect configuration system to provide exactly this functionality, so it's obviously a popular approach. As configured, you'd get a second or two burst of the sounders to denote the class change, but continuous ringing (or continuously stuttered, IYSWIM) for a fire alarm. I suppose it has the advantage that sounders get a regular test.
Our primary school had completely independent systems, with almost-but-not-quite-identical sounding mechanical bells. I was, for a time, designated swot with a digital watch who got to sneak out of class without seeking permission in order to press the button at the start of break. (12 year olds being cheaper and easier for primary school teachers to program than electronic timers.)
Secondary had independent systems with different sounding bells. We got regular practice with the fire alarm, because some genius had installed a bunsen burner storage rack next to one of those break glass manual call points, and you could guarantee one accidentally falling off its hook in a tangle of rubber hoses and hitting it every term or so.