If it's like 3 taps per second then it's probably your valve lifters making noise until they get some warm oil. Not terribly unusual. If it's more like marbles in a can, you could either have a worn/broken DISA flap (plugs into drivers side of the intake manifold) or a rattling vanos (front of engine, pistons that control intake and exhaust cam variability). Depends on where it's coming from.
2003 330i TiAg Sport Pkg
AA Stage I supercharger
, Meyle HD FCAs w Powerflex CABs, Bilstein shocks, Meyle HD Rtabs, Angel Eyes, Clear Corners/Markers w/ LEDs, LED tails, ZHP rims, Akebono pads, AUX input
DIY E46 Merit Badges:
Sunroof resurrection, CCV, OFHG, VCG w/ VANOS seals, DISA, Cooling Refresh I, steering giubo, window regs, Magnetic Infandibulator (see wiki)
DIY On deck:
Rear Diff bushing. UUC SSK, clutch job eventually, Wavetrac LSD