This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

This sketch demonstrates how to use the getPan and setPan methods of a Controller object. The class used here is an AudioOutput but you can also get and set the pan of AudioSample, AudioSnippet, AudioInput, and AudioPlayer objects. getPan and setPan will get and set the pan of the DataLine that is being used for input or output, but only if that line has a pan control. A DataLine is a low-level JavaSound class that is used for sending audio to, or receiving audio from, the audio system. You will notice in this sketch that you will hear the pan changing (if it's available) but you will not see any difference in the waveform being drawn. The reason for this is that what you see in the output's sample buffers is what it sends to the audio system. The system makes the pan change after receiving the samples.

Source code: getSetPan waveform

Built with Processing