Resonance implementation in Pyretic