setClipper()
Purpose
Set audio clipper
Description
Any sound above the threshold will be attenuated towards it proportional to its level above it. The strength parameter affects the severity of attenuation. A high value will result in stronger attenuation towards threshold, a low value results in weaker. A Very high value will simply clip any audio above the threshold to it
Syntax
setClipper( channel, threshold, strength )
Arguments
channel audio channel from 0 to 15
threshold threshold in decibels
strength strength of attenuation to the threshold
Example
tune = loadAudio( "David Silvera/music_funky_bar" )
threshold = 1
strength = 50
playAudio( 0, tune, 1, 0.5, 1, -1 )
loop
clear()
c = controls( 0 )
threshold += c.ly * 0.1
strength += c.ry * 0.1
threshold = max( threshold, 0 )
setClipper( 0, threshold, strength )
printAt( 0, 0, "Move the left control stick up or down to control threshold" )
printAt( 0, 1, "Move the right control stick up or down to control strength" )
printAt( 0, 3, "Threshold: " + threshold )
printat( 0, 5, "Attenuation Strength: " + strength )
update()
repeat
Associated Commands
audioLength(), getChannelStatus(), loadAudio(), note2Freq(), playAudio(), playNote(), setFilter(), setPan(), setVolume(), startChannel(), stopChannel()