Crankcase Ventilation Valve (CCV), (PCV)
I just had the same whistling problem My crankcase ventilation valve (CCV) went bad. THis valve performs the same function as a positive crankcase ventilation (PCV) Valve on other cars. When I removed the valve, the small poppett in the middle fell out. The new valve had no loose parts and did not rattle like a traditional PCV valve.
The CCV BMW part number 11 15 7 501 567. I got mine at Bavarian Autosport and they also sell the molded hose that goes from the CCV to the crankcase vent if needed.
The CCV is on the rear top center of your engine it is round and has a hose attached that leads to the crankcase vent. The hose may be shrinkwrapped to another hose to keep it from rubbing on a bracket, so checking the hose may be difficult. I cut the shrinkwrap off. The valve is attached with two 5mm hex screws access will be tight. Remove the valve, turn it over and check the valve. It should look like the CCV on the Bavarian Autosport website. If the white plastic tri wing in the center is missing or damaged, it's bad.
It's that tri wing in the center that comes loose and causes the whistling. As it rattles about, it wears down the tri wings. Check the CCV before you spend any money. Be careful with the hoses, if the hose tears you can use a hose from you local parts store temporarily since it's not a radical bend. I don't know how a substitute hose would hold up to crankcase gases over the long term and it may rub on the top aft center engine bracket. Hope this helps.
If it whistles a any top 40 tunes, I know a good talent scout.
Take care, Pete