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