Let's look at how we can use signals to generate sound. In this example, we'll generate a simple tone from a WaveformSignal.
- Let's start fresh by clicking on File menu/New
Creating the SignalAudioStream
- Undock the browser panel
- On the bottom right of the panel, click the + button
- Under Audio, select New SignalAudioStream
- Double-click the newly added SignalAudioStream from the browser. The SignalAudioStream properties are displayed.
- On the property editor panel, hover your mouse over the Signal property then click the 'new' button that appears.
- Select New WaveformSignal from the menu that appears
We've now created our SignalAudioStream and defined it to produce its audio data from a WaveformSignal. All that's left to do is create a Sound in the space so we can hear it.
- Drag-and-drop the SignalAudioStream object from the browser into the space
- Press play
You should be able to hear a tone coming from the Sound in the space. Now, let's see how we can change its frequency.
- Double-click the SignalAudioStream from the browser panel
- From the property editor panel, click the WaveformSignal link from the Signal property
- Adjust the Wavelength property
Try changing the Wave Type property for interesting results. Also, try assigning a signal to the wavelength property (via the white arrow button next to the wavelength property) to create various sound effects.