I finally got the composition together, and recorded a video of the thing in action.
The video starts with the fireflies calibrating themselves to a dark room. Then they start blinking randomly and find a common rythm quite quickly. When I flick the lights on, they become confused (red flashes) because they are “used” to a darker ambient light level. Finally darkness falls upon the room again and the flies synchronize, this time with a quite nice melody.