---
title: "R Notebook"
output: html_notebook
---
```{r}
# 加载gm包
library(gm)
# 生成乐谱数据
# Create a flute 乐器74 长笛
flute <- Instrument(74, pan = -90)
flute
# Create a tempo
tempo <- Tempo(60, marking = "Adagio (half = 25)")
tempo
#music
music <-
Music() +
Meter(4, 4) + # 4/4拍
Line(c("E5","E5","E5","G5","A5", "G5", "c5", "D5")) + flute + tempo # 音符序列
music
# 展示乐谱(生成MP3音乐、可调用MuseScore渲染并打开)
export(music,"~/x.mp3","musescore")
export(music,"~/x.mscz","musescore")
#打开网页、musescore 编辑查看乐曲
show(music,musescore = "-r 800 -T 5")
#vignette("gm") 显示帮助信息
```