There are two main ways of playing music through a Tesla coil:
- By processing an analog signal and converting it to a digital signal which can switch the drive transistors accordingly
- By reading a digital MIDI file with a microcontroller and using it to control the drive transistors
Neither of these are simple - they take a lot of work to design the circuitry and the coil in order to make it operate correctly and, most importantly, safely.
You don't mention what type of Tesla coil you want to build - SGTC, SSTC, or DRSSTC. It would be helpful for you to add this information in your original post. Since there is not really a practical way to play music through a SGTC (spark gap Tesla coil) I am going to assume you are building either a SSTC or a DRSSTC (solid state Tesla coil or dual-resonant solid state Tesla coil). In this case you need to post a schematic of your driver.
Here is how to achieve audio modulation using the two methods described above:
Analog: In order to convert an analog signal (like you would get from an AUX port) to something that a Tesla coil can "read", you need to design and build a zero-crossing detector. This looks at the analog waveform and switches its output on or off every time the analog waveform crosses 0V. This leads to significant distortion of the signal (since you're converting sinusoidal waves to rectangular waves), but you can usually still make out the original sound. This method has the benefit of being able to convert just about any audio signal to something that the Tesla coil can understand. There are several downsides, however. For example, there is no sort of pulse-width limiting, meaning your transistors may be operating at a high duty cycle and cause frequent failures (blown transistors, mainly). Also, the audio quality is generally degraded significantly. This may or may not be an issue, depending on what you want to do with it. Additionally, you will likely need lots of filtering and other signal processing to ensure the Tesla coil doesn't start playing noise that you don't want it to play. The analog processing option is generally only used for SSTCs, and not DRSSTCs.
MIDI: This option (which stands for Musical Instrument Digital Interface) is actually a serial interface between a computer (or MIDI-capable device) and the Tesla coil. The host device transmits digital commands to the Tesla coil, and a microcontroller decodes them and turns them into variable-frequency and variable-pulse-width signals to tell the drive transistors when to switch. This option gives you the most control over the behavior of the coil. You can adjust the pulse width to change the duty cycle, allowing you to limit the average amount of current the transistors have to handle. This increases the lifespan of the Tesla coil driver. The downside is that voice is not really an option for a MIDI interface. You can play the music, but no vocals. This option is generally preferred for DRSSTCs due to the fact that it gives you much more control, and since DRSSTCs tend to have much higher primary currents, more control is highly desirable.