Arbitrary optical waveforms have been successfully generated by Fourier synthesis using three independent continuous-wave semiconductor lasers. The lasers were phase-locked to each other using a nonlinear phase-locking scheme. By controlling their amplitude and phase, triangular and trapezoidal waveforms as well as ordinary pulses have been generated.