We suggest a tunable optical device to synthesize Fock states and their sup
erpositions starting from a coherent source. The scheme involves an avalanc
he-triggering photodetector and a ring cavity coupled to a traveling wave t
hrough a cross-Kerr medium. Low quantum efficiency at the photodetector imp
roves the synthesizing quality at the expense of reducing the synthesizing
rate.