How do you make music?

Hardware - you have infrared transmitters, and detectors that sense when the IR is blocked?
Then you will create a midi command to send out?
You have a midi sound module to receive that midi command and make the actual notes?