Quasi-periodic modulation of solar and stellar flaring emission by magnetohydrodynamic oscillations in a nearby loop | Synapse