  We present a detailed study of the circumstellar envelope of the
post-asymptotic giant branch ``21 micron object'' HD 56126. We build a detailed
dust radiative transfer model of the circumstellar envelope in order to derive
the dust composition and mass, and the mass-loss history of the star. To model
the emission of the dust we use amorphous carbon, hydrogenated amorphous
carbon, magnesium sulfide and titanium carbide. We present a detailed
parametrisation of the optical properties of hydrogenated amorphous carbon as a
function of H/C content. The mid-infrared imaging and spectroscopy is best
reproduced by a single dust shell from 1.2 to 2.6 arcsec radius around the
central star. This shell originates from a short period during which the
mass-loss rate exceeded 10^(-4) M_sun/yr. We find that the strength of the
``21'' micron feature poses a problem for the TiC identification. The low
abundance of Ti requires very high absorption cross-sections in the ultraviolet
and visible wavelength range to explain the strength of the feature. Other
nano-crystalline metal carbides should be considered as well. We find that
hydrogenated amorphous carbon in radiative equilibrium with the local radiation
field does not reach a high enough temperature to explain the strength of the
3.3-3.4 and 6-9 micron hydrocarbon features relative to the 11-17 micron
hydrocarbon features. We propose that the carriers of these hydrocarbon
features are not in radiative equilibrium but are transiently heated to high
temperature. We find that 2 per cent of the dust mass is required to explain
the strength of the ``30'' micron feature, which fits well within the measured
atmospheric abundance of Mg and S. This further strengthens the MgS
identification of the ``30'' micron feature.
