Sonic Pi 软件界面

Sonic Pi 有一个非常简单的界面用来编程音乐,我们花点时间来了解一下。

Sonic Pi Interface

A - 播放控制 B - 编辑器控制 C - 信息和帮助 D - 代码编辑器 E - 设置面板 F - 日志查看器 G - 帮助文档 H - 波形查看器 I - Cue Viewer

A. 播放控制

粉色的按钮是用来控制开始和停止播放声音的。Run按钮是用来运行编辑器中的代码的,Stop按钮是用来停止所有正在运行的代码的,Save按钮是用来保存代码到文件,最后 Record 按钮可以录制当前电脑正在播放的声音到WAV格式文件。

B. 编辑器控制

These orange buttons allow you to manipulate the code editor. The Size + and Size - buttons allow you to make the text bigger and smaller.

C. 信息和帮助

通过这些蓝色按钮你可以访问信息,帮助和设置窗口。Info按钮将会打开信息查看窗口,显示Sonic Pi的相关信息, 例如核心团队,开发历史,贡献者,社区等。Help 按钮是帮助系统(G)的开关,Prefs按钮是设置窗口的开关,在设置窗口你可以控制软件系统的一些基本参数。

D. 代码编辑器

这块区域是你写代码的地方,也是你表演音乐的舞台。它就是一个简单的文本编辑器,可以写代码,删除,剪切,粘贴等。你可以认为它是一个基础版本的Word或者谷歌文档。编辑器会自动对代码进行分析高亮。初看起来会很奇怪,但你随后就能体会到这很有用。例如,你会发现所有的蓝色都是数字。

E. 设置面板

Sonic Pi支持配置偏好,你可以通过信息和帮助按钮集的prefs按钮开关来显示和隐藏配置面板。例子中是mono示波器,立体声反转,显示日志输出,还有音量控制条和树莓派音频输出选择器。

F. 日志查看器

当你运行代码时,程序的当前运行状态将会输出到日志查看器。默认你将会看见每一个小样的播放时间。对于理解和调试程序,日志查看器将会非常有用。

G. 帮助系统

帮助系统是Sonic Pi最重要的部分之一,它处于窗口的底部。你可以使用Help 按钮来显示和隐藏。帮助系统包含了帮助和Sonic Pi使用的方方面面的信息,包括这个教程,内置合成器列表,小样列表,代码例子列表,效果器列表,以及Sonic Pi支持的用以编程音乐的函数列表。

H. 示波器查看器

示波器能够以可视化的方式呈现你听到的音乐。你可以从正弦波的波长非常直观的了解到当前节奏。你也可以从波的振幅上了解当前音量。有三种示波可以被选择,默认的是双声道合并显示,当然你也可以选择立体声示波器,它会分别显示各个声道的示波。最后你也可以选择Lissajous curve示波器,这个示波器会显示左右声道的相关性,你可以用这个示波器画出非常漂亮的声音。

I. Cue Viewer

All internal and external events (called cues in Sonic Pi) are automatically logged in the Cue Viewer. For example, if you have a MIDI controller connected and press one of its buttons, you’ll see a new cue event in the Cue Viewer telling you the name of the controller and which button you pressed. Once you’ve mastered the basics of making and producing sounds, you’ll start to want to cue sounds or whole sections of sounds based on events such as these. A cue event is just an indication that something happened. For example, every time a live loop spins round, it sends a cue event out which is logged in the Cue Viewer. Also, external events such as MIDI messages from connected MIDI equipment and OSC messages from other programs or computers are also displayed in the Cue Viewer. It is also possible to directly generate cue events using the cue function. Anything that appears in the Cue Viewer can be used to trigger something happening. This is covered in more detail in Sections 10 to 12 of this tutorial.