nullSample {sound}R Documentation

The NULL Sample Object

Description

Create a Sample object whose waveform has length 1 and value 0. Often useful to initialize loops.

Usage

nullSample(rate=44100, bits=16, channels=1)

Arguments

rate

the sampling rate, between 1000 and 48000.

bits

the sample quality (number of bits per sample), 8 or 16.

channels

1 for mono, or 2 for stereo.

Value

a Sample object.

Note

Future versions may use a special NULLSample flag instead of using a sample of length 1.

Author(s)

Author: Matthias Heymann [aut], Stefan Langenberg [cre] (<https://orcid.org/0000-0001-5817-5469>)

Maintainer: Stefan Langenberg <langenberg@uni-bonn.de>

See Also

Silence

Examples

## Not run: 
scale <- 2^(seq(0,1,length=13))[c(1,3,5,6,8,10,12,13)]
base <- 440
s <- nullSample()
for (f in scale)
  s <- appendSample(s,Sine(f*base,1))
play(s)

## End(Not run)

[Package sound version 1.4.6 Index]