Text-to-Music Generation Using AI: Theoretical Foundations and Practical Applications