  Asteroseismology has proven to be a powerful method for probing stellar
interiors. Analytical descriptions of the global oscillation modes, in
combination with pulsation codes, have provided valuable help in processing and
interpreting the large amount of seismic data collected by the CoRoT, $Kepler$,
and TESS missions. These prior results have paved the way to more in-depth
analyses of the oscillation spectra of stars, which requires innovative
theoretical descriptions of stellar oscillations. In this paper, we aim to
analytically express the resonance condition of the spheroidal adiabatic
oscillation modes in a very general way, applicable at different evolutionary
stages. In the present formulation, a star is represented as an acoustic
interferometer composed of a multitude of resonant cavities where waves can
propagate and the short-wavelength JWKB approximation is met. Each cavity is
separated from the adjacent ones by barriers, which corresponds to regions
either where waves are evanescent or where the JWKB approximation fails. The
stationary modes are computed using two different physical representations: 1)
the infinite-time reflections picture 2) the linear boundary value problem
picture. Both provide the same resonance condition, which ultimately turns out
to depend on a number of parameters: the reflection and transmission phase lags
introduced by each barrier, the coupling factor associated with each barrier,
and the wave number integral over each resonant cavity. Using such a
formulation, we can retrieve the usual forms derived in previous works (e.g.,
mixed modes with two or three cavities, low- and large-amplitude glitches).
This resonance condition provides a new tool that is useful in predicting the
stellar oscillation spectra and interpret seismic observations at different
evolutionary stages. Practical applications are left to future work.
