powered by
Create a Sample object with a sine, sawtooth, or square waveform, silence, or noise.
Sine(freq, dur, rate=44100, bits=16, channels=1) Sawtooth(freq, dur, rate=44100, bits=16, channels=1, reverse=FALSE) Square(freq, dur, rate=44100, bits=16, channels=1, upPerc=50) Silence(dur, rate=8000, bits=8, channels=1) Noise(dur, rate=44100, bits=16, channels=1)
a Sample object.
the frequency (a double).
the duration in seconds (a double).
the sampling rate, an integer between 1000 and 48000.
the sampling quality in bits per sample, 8 or 16.
1 for mono, or 2 for stereo.
logical. If TRUE, the waveform will be mirrored vertically.
TRUE
a number between 0 and 100 giving the percentage of the waveform with value +1.
Author: tools:::Rd_package_author("sound")
Maintainer: tools:::Rd_package_maintainer("sound")
If channels=2, left and right side of the sample will be the same for Sine, Sawtooth and Square. For Noise, both sides will be generated separately, using runif.
channels=2
Sine
Sawtooth
Square
Noise
runif
as.Sample, loadSample, nullSample
as.Sample
loadSample
nullSample
if (FALSE) { s1 <- Sine(440,1) play(s1) s2 <- Sawtooth(440,1) play(s2) play(Noise(1)) }
Run the code above in your browser using DataLab