What causes the smell of something being "musty"?
The "musty smell" is from mold, sometimes bacteria. Different compounds are responsible depending on the species. Some examples: trichloroanisole, tribromoanisole, dimethylmethoxypyrazine. Search "mold smell molecules" for many links.

Anisole is also called methoxybenzene, structure here: https://en.wikipedia.org/wiki/Anisole