export {gm}R Documentation

Export Object

Description

Export an object to various file formats.

Usage

export(x, dir_path, file_name, formats)

## S3 method for class 'Music'
export(x, dir_path, file_name, formats)

Arguments

x

An object.

dir_path

A single character which specifies the directory to which to export the object.

file_name

A single character which specifies the name of the exported file(s).

formats

A character vector which specifies the file formats. Supported file formats are "mscz", "mscx", "pdf", "png", "svg", "wav", "mp3", "flac", "ogg", "midi", "mid", "musicxml", "mxl", "xml", "metajson", "mlog", "mpos" and "spos".

Value

Invisible NULL.

Files with name file_name and with extensions formats are generated in dir_path.

Methods (by class)

Examples

if (interactive()) {
  m <- Music() + Meter(4, 4) + Line(list("C4"), list(4))
  export(m, tempdir(), "x", c("mp3", "png"))
}

[Package gm version 1.0.2 Index]