There are several things to check out in your closets first. Is there a mold or mildew problem anywhere in the closet? Is there so much stuff in there none of it can breathe? Is it too humid in the closet? Too hot in the closet? Items in closets - particularly clothes or linens - need room to breathe or they will develop peculiar odours. If you have determined that there is no mold or mildew; the items in the closet are not crammed in too tightly and allow for good air circulation; the humidity if fine and the temperature is acceptable, more action is now needed.
1. Open several containers of baking soda and set them around the house near the closet(s). Baking soda is an excellent odor eliminator. You can also sprinkle some baking soda on the floors and sweep or vacuum it up the next day.
2. Pour straight vinegar in an empty spray bottle. Spray around every room that has a musty odor being careful not to spray furniture. Vinegar is another odor eliminator that has the power to get rid of even the strongest smells.
3. Sprinkle cedar chips in a few bowls and set them around the house. The cedar chips have a strong odor of their own that will overpower the musty odor.