waveformsampler basic code