Export a Music
object to a file format such as PNG or MP3.
export(x, ...)
# S3 method for Music
export(x, path, musescore = NULL, ...)
A Music
object.
Optional arguments to export()
methods. Should be
ignored by the user.
A single character, which specifies the output file path.
For example, "my/music/x.mp3"
. See the Details section for
supported file extensions.
Optional. A character vector, which represents the command line options passed to MuseScore. See MuseScore command line usage for details.
An invisible NULL
. A file is generated in the specified path.
Supported file extensions:
flac
metajson
mid
midi
mlog
mp3
mpos
mscx
mscz
musicxml
mxl
ogg
png
spos
svg
wav
xml
if (interactive()) {
music <- Music() + Meter(4, 4) + Line("C4")
export(music, tempfile(fileext = ".mp3"), "-r 200 -b 520")
}