Learn R Programming

sequenceR (version 1.0.1)

applyDisto: Distortion effect

Description

Apply a distortion to a sound sample

Usage

applyDisto(sample, type = c("clip", "tanh"), level = 2, ..., rescale = FALSE)

Value

The distorted sound sample

Arguments

sample

soundSample object, input sample

type

Character string, the distortion type

level

Numeric >0, distortion level

...

other parameters passed to the distortion transfer function

rescale

Logical. If TRUE, the soundSample wave is rescaled to [-1,1]

Examples

Run this code
# example code
raw=oscillator(freq=110,duration=0.5)
plot(raw)
dist=applyDisto(raw,type='tanh',level=5)
plot(dist)

Run the code above in your browser using DataLab