I mean, controlling directly in the source, not filtering the light or arranging density of the medium.
This is essentially what a tunable laser does. Internally a laser is an excited piece of matter that has optical gain between two mirrors. That gain is highest at some (usually very small) number of wavelengths, so the laser output is nearly monochromatic. Tunable lasers further include a mechanism to move where that gain maximum is. RP Photonics has an article article on the many, many ways this can be done:
https://www.rp-photonics.com/wavelength_tuning.html
Rather than repeat it here, I will give one simple example. Many laser diodes can be thermally tuned, where you heat or cool them (possibly by driving more or less current into the diode) to change the wavelength they emit. This effect has several causes, including changes in the band structure of semiconductor from temperature/current as well as changes in refractive index due to thermal expansion of the material.
Thanks to comments another question is evolved: Is it possible to control the movement of electrons between the energy levels?
The actual comment that caused you to change your question is incorrect. The band structure of a material isn't completely fixed (see temperature/current tuning), you can emit wavelengths of light that do not correspond to a energy levels in a material, and you also don't necessarily need to change energy levels in order to change the wavelengths that are emitted. Many materials are available in which the band structure spans to tens or hundreds of nanometers worth of energy levels. For example, the Ti:S laser cavity can emit light at all wavelengths from about 680nm to more than 1100nm, a range of more than 400nm. Tunable light sources using a Ti:S crystal can emit any (or all) of these wavelengths.
Then there are devices like parametric oscillators. Since they do not depend on the energy levels of a material to generate new photons, a single device can tune between thousands of nanometers worth of wavelengths, sometimes covering the UV, VIS an NIR.
So in summary, it is absolutely possible to control the frequency/wavelength of light with the right equipment.