Learn R Programming

sequenceR (version 1.0.1)

write.instrument: Write an instrument to file

Description

Write each sound sample of the instrument as a separate .wav or .mp3 file.

Usage

write.instrument(inst, dir = tempdir(), fmt = "wav")

Value

nothing - writing function.

Arguments

inst

Instrument object.

dir

String, directory where files should be written.

fmt

String, 'wav' or 'mp3'.

Examples

Run this code
# Create an instrument
drumset <- instrument(samples=list(kick,snare,hiHat),notes=c('boom','tat','cheet'))
# Write to files (one per element)
write.instrument(drumset)

Run the code above in your browser using DataLab