Quantum optical waveform conversion