expand

Reference > div

Wave
Spectrum

    

div is a function associated with the Wave class that lets you divide a wave by a number, or divide a wave by another wave.

wave.div(10) creates a new wave whose entries are those of the first wave divided by 10. You can use this at the end of loop to scale down the amplitude (gain) of the output wave, so that it isn’t too loud.

You can find the code for div in the synthesine library.