gm 轻松创建音乐,并在R Markdown文档,R Jupyter Notebook和RStudio中显示乐谱和音频文件。 你好! 世界 library( gm ) m <- # initialize a Music object Music() + # add a 4/4 time signature Meter( 4 , 4 ) + # add a musical line of four quarter notes Line( list ( " C5 " , " D5 " , " E5 " , " F5 " ), list ( 1 , 1 , 1 , 1 )) show( m , to = c( " score " , " audio " )) 安装 安装gm: install.packages( " gm " ) 或来自GitHub的开发版本: