Neither dirt in pulleys nor tight belts will cause an alternator to make noise. The whining noise that a bad alternator makes is usually caused by blown diodes inside the alternator. There is a major chance that an alternator diode will be destroyed if you disconnect a battery cable while the motor is running. A blown diode will not necessarily stop the alternator from working, but will reduce its output by 1/3, and will cause it to whine and make noise from then on. So PLEASE do not disconnect a battery cable while the motor is running ever again. It will not tell you whether your alternator has a blown diode, and is very likely to blow a diode on a perfectly good alternator; if one is not already blown. Disconnecting a battery cable while the motor runs can blow an alternator diode in less than one second!!! Auto repair textbooks warn against doing this, alternator manufacturers put instructions about not doing this in the packaging with their remanufactured alternators, and I have repeatedly warned against this in this forum. But there will always be people out there who somehow managed to never see those warnings.
The only way to test an alternator to see if the diodes are all intact is to connect it to an oscilloscope (a test instrument that looks like a TV set). Many parts stores do not have that equipment, and few non technical people know how to use it, anyway. This is why many discount priced "rebuilt" alternators have not had their diodes checked, and why they so often do not work right. The failure rate on cheap rebuilt alternators is so high that I have vowed to never buy another cheap rebuild again. My time and sanity are worth more to me than that. NAPA parts stores sell quality remanufactured alternators; but only their premium line has this advantage.