A general model is introduced to describe a wave-envelope system for the situation when the linear dispersion relation has three branches, which in the absence of any coupling terms between these branches, would intersect pair-wise in three nearly-coincident points. The system contains two waves with a strong linear coupling between them, to which a third wave is then coupled. This model has two gaps in its linear spectrum. As is typical for wave-envelope systems, the model also contains a set of cubic nonlinear terms. Realizations of this model can be made in terms of temporal or spatial evolution of optical fields in, respectively, either a planar waveguide, or a bulk-layered medium resembling a photonic-crystal fiber, which carry a triple spatial Bragg grating. Another physical system described by the same general model is a set of three internal wave modes in a density-stratified fluid, whose phase speeds come into close coincidence for a certain wavenumber. A nonlinear analysis is performed for zero-velocity solitons, that is, they have zero velocity in the reference frame in which the third wave has zero group velocity. If one may disregard the self-phase modulation (SPM) term in the equation for the third wave, we find an analytical solution which shows that there simultaneously exist two different families of solitons: regular ones, which may be regarded as a smooth deformation of the usual gap solitons in a two-wave system, and cuspons, which have finite amplitude and energy, but a singularity in the first derivative at their center. Even in the limit when the linear coupling of the third wave to the first two nearly vanishes, the soliton family remains drastically different from that in the uncoupled system; in this limit, regular solitons whose amplitude exceeds a certain critical value are replaced by peakons. While the regular solitons, cuspons, and peakons are found in an exact analytical form, their stability is tested numerically, which shows that they all may be stable. If the SPM terms are retained, we find that there may again simultaneously exist two different families of generic stable soliton solutions, namely, regular ones and peakons. Direct simulations show that both types of solitons are stable in this case.