Thierry, thanks for pointing out that the IC draws too much current in this circuit and for suggesting a voltage divider. How about a voltage divider where one of the resistors is a CdS photoresistor and the other is a potentiometer? The photoresistor would be the volume control. The potentiometer would adjust the sensitivity of the volume control to compensate for different lighting conditions. Should I put a 0.22 uF capacitor between the chip and the voltage divider as suggested in a previous post?
I had also thought of using colored LEDs with a colored filter over the chip, but I was thinking of using red LEDs, since the TSL230R is more sensitive to red than green or other colors. Ideally, the filter should be a narrow bandpass filter that only passes the wavelength generated by the LEDs, but those are very expensive. Combining several cheap filters might work.
It should be possible to use LEDs and filters of a different color for the volume control. That would allow the volume control and pitch control to be close together with little interference between them.
Gordon, the divide by 2 circuit is very intriguing. It would be interesting to use its output as the fundamental note, and mix it with the output of the TSL230R as the second order harmonic. Square waves contain only the odd harmonics of the fundamental note. That is why they sound harsh. Including the second order harmonic should make the tone more mellow and richer sounding. You could even have separate side-by-side volume controls for the divide-by-2 output and the TSL230R output. That would allow you to change the timbre of the instrument during a performance.