Music tends to loosen the natural creative restrictions you unknowingly put on yourself and helps you focus. It can help a lot, not only for being creative but for storming through math homework and the like.
I find the best solution is to just go with it. Don't scrutinize over mistakes, don't even correct them all the time. You don't gain experience by richarding about over the same detail over and over, and you don't learn to get things right on the first try without experience.
Natural or otherwise, depressants used in moderation can work to relax you and let you focus for a lot longer. An excited mind often jumps over and between subjects and degrades work and your motivation to do work.