Sonic Pi - en to zh translation catalogue (162 entries)

en: 1 Welcome to Sonic Pi
zh: 1 欢迎使用 Sonic Pi

en: Welcome friend :-)
zh: 你好，朋友 :-)

en: Welcome to Sonic Pi. Hopefully you're as excited to get started making crazy sounds as I am to show you. It's going to be a really *fun* ride where you'll learn all about music, synthesis, programming, composition, performance and more.
zh: 欢迎使用 Sonic Pi。我将教你如何创作天籁之音，希望你会喜欢。接下来的学习的过程将会*非常有趣*，你将会学习音乐相关的知识，包括但不限于合成器，编程，编曲，表演等。

en: If you have any thoughts, or ideas for improving Sonic Pi - please pass them on - feedback is so helpful. You never know, your idea might be the next big feature!
zh: 如果你有任何想法，意见，想要改进 Sonic Pi，请反馈给我们。 你的反馈说不定会成为软件下一个版本中的重量级功能！

en: This tutorial is divided up into sections grouped by category. Whilst I've written it to have an easy learning progression from start to finish, feel very free just to dip in and out of sections as you see fit. If you feel that there's something missing, do let me know and I'll consider it for a future version.
zh: 本教程被划分为了好几个章节。同时每个章节我会尽量由浅入深的书写，这样学习曲线才能足够平缓， 请自由选择你感兴趣的章节学习。如果你觉得缺少某些内容，请告诉我，我将会在发布下一个版本的时候考虑补充。

en: OK, let's get started...
zh: OK，我们开始学习吧...

en: 1.1 Live Coding
zh: 1.1 Live Coding 表演

en: Live Coding
zh: Live Coding 表演

en: One of the most exciting aspects of Sonic Pi is that it enables you to write and *modify code live* to make music, just like you might perform live with a guitar. This means that given some practice you can take Sonic Pi on stage and gig with it.
zh: Sonic Pi 最NB的功能之一就是它允许你通过写代码，以及*实时修改代码*来创作音乐，就像你在用吉他表演一样。这意味着你只需要做些练习，然后就可以带着 Sonic Pi 上舞台表演了。

en: Free your mind
zh: 放飞自己

en: Before we get into the real details of how Sonic Pi works in the rest of this tutorial, I'd like to give you an experience of what it's like to live code. Don't worry if you don't understand much (or any) of this. Just try to hold onto your seats and enjoy...
zh: 在开始真正的教程之前，我想让你体验一下什么是 Live Code 。搞不明白也不用担心，坐稳扶好，我要带你装B带你飞了...

en: A live loop
zh: 一段现场循环

en: Now, press the `Run` button and you'll hear a nice fast bass drum beating away. If at any time you wish to stop the sound just hit the `Stop` button. Although don't hit it just yet... Instead, follow these steps:
zh: 现在点击`Run`按钮，你将会听到动感的低音鼓节奏。如果你想停止发声，只需要点击 `Stop` 按钮。先别点击哈，跟随下面的步骤：

en: Make sure the bass drum sound is still running
zh: 确保低音鼓声音还在

en: Change the `sleep` value from `0.5` to something higher like `1`.
zh: 修改 `sleep` 的值从 `0.5` 到更高的值，比如 `1`.

en: Press the `Run` button again
zh: 再次点击  `Run` 按钮

en: Notice how the drum speed has changed.
zh: 注意鼓的节奏的速度已经变了。

en: Finally, *remember this moment*, this is the first time you've live coded with Sonic Pi and it's unlikely to be your last...
zh: 最后，请*记住这一刻*，这是你使用 Sonic Pi 的第一次 Live Code ，期待你后续的精彩表演...

en: Ok, that was simple enough. Let's add something else into the mix. Above `sample :bd_haus` add the line `sample :ambi_choir, rate: 0.3`. Your code should look like this:
zh: 好的，是不是很简单。我们再往混音里面添加其他东西。在 `sample :bd_haus` 之上添加一行 `sample :ambi_choir, rate: 0.3`，你的代码会是下面这样子：

en: live_loop :flibble do
      sample :ambi_choir, rate: 0.3
      sample :bd_haus, rate: 1
      sleep 1
    end
zh: live_loop :flibble do 
      sample :ambi_choir, rate: 0.3 
      sample :bd_haus, rate: 1 
      sleep 1 
    end

en: Now, play around. Change the rates - what happens when you use high values, or small values or negative values? See what happens when you change the `rate:` value for the `:ambi_choir` sample just slightly (say to `0.29`). What happens if you choose a really small `sleep` value? See if you can make it go so fast your computer will stop with an error because it can't keep up (if that happens, just choose a bigger `sleep` time and hit `Run` again).
zh: 现在，请随意玩耍。试着改变一下速率(rates)，试试更大或更小的数，甚至负数，听听有什么不同？
    例如修改一下`:ambi_choir` 的 `rate:`值，微调一下改为 `0.29`。
    例如修改`sleep`的值为很小的数。你可以测试一下，看看你的电脑能支持的最快的速度是多少？再快电脑就会报错了（如果真的发生了，那就把`sleep`的值增大一点，重新点击`Run`即可）。

en: Try commenting one of the `sample` lines out by adding a `#` to the beginning:
zh: 试一下通过在行首添加一个字符 `#` 来注释掉任意一 `sample` 行：

en: Notice how it tells the computer to ignore it, so we don't hear it. This is called a comment. In Sonic Pi we can use comments to remove and add things into the mix.
zh: 敲黑板，通过这种方式就可以让电脑忽略播放小样声音，所以我们就听不到了。这叫注释。在 Sonic Pi 中我们可以通过注释来在混音中去掉某些小样。

en: Finally, let me leave you something fun to play with. Take the code below, and copy it into a spare buffer. Now, don't try to understand it too much other than see that there are two loops - so two things going round at the same time. Now, do what you do best - experiment and play around. Here are some suggestions:
zh: 最后，我给你时间你自己再玩一会。体验一下下面的代码，现在先不要尝试理解代码的含义，你只需要明白代码里有两个循环就可以了。两个循环会同时运行。
    现在，按照之前的方式体验和玩耍吧。另外我有一些建议：

en: Try changing the blue `rate:` values to hear the sample sound change.
zh: 尝试修改蓝色的`rate:`值，听听小样音量改变的效果。

en: Try changing the `sleep` times and hear that both loops can spin round at different rates.
zh: 尝试修改 `sleep`的值，听听两个循环中的声音以不同速度播放的效果。

en: Try uncommenting the sample line (remove the `#`) and enjoy the sound of the guitar played backwards.
zh: 尝试取消掉小样的注释（删除 `#`），体会有吉他小样播放的效果。

en: Try changing any of the blue `mix:` values to numbers between `0` (not in the mix) and `1` (fully in the mix).
zh: 尝试修改蓝色 `mix:`的值，在`0` (不参与混音) 和 `1` (完全参与混音)之间。

en: Remember to press `Run` and you'll hear the change next time the loop goes round. If you end up in a pickle, don't worry - hit `Stop`, delete the code in the buffer and paste a fresh copy in and you're ready to jam again. Making mistakes is how you'll learn the quickest...
zh: 记着点击`Run`按钮，下一次循环你就能听到你所做的改变。如果你觉得音乐很混乱，不要担心，点击`Stop`按钮，删除掉代码，重新粘贴一份干净的拷贝，然后再修改，再玩。失败是成功之母，加油。

en: Now, keep playing and experimenting until your curiosity about how this all actually works kicks in and you start wondering what else you can do with this. You're now ready to read the rest of the tutorial.
zh: 现在，继续玩耍，体验。当你开始好奇这一切到底是怎么发生的时候，好奇还能干点别的事情不的时候，就可以开始读剩下的教程了。

en: So what are you waiting for...
zh: 往下看吧。

en: 1.2 Exploring the Interface
zh: 1.2 了解软件界面

en: The Sonic Pi Interface
zh: Sonic Pi 软件界面

en: Sonic Pi has a very simple interface for coding music. Let's spend a little time exploring it.
zh: Sonic Pi 有一个非常简单的界面用来编程音乐，我们花点时间来了解一下。

en: *A* - Play Controls
zh: *A* - 播放控制

en: *B* - Editor Controls
zh: *B* - 编辑器控制

en: *C* - Info and Help
zh: *C* - 信息和帮助

en: *D* - Code Editor
zh: *D* - 代码编辑器

en: *E* - Prefs Panel
zh: *E* - 设置面板

en: *F* - Log Viewer
zh: *F* - 日志查看器

en: *G* - Help System
zh: *G* - 帮助文档

en: *H* - Scope Viewer
zh: *H* - 波形查看器

en: A. Play Controls
zh: A. 播放控制

en: These pink buttons are the main controls for starting and stopping sounds. There's the *Run* button for running the code in the editor, *Stop* for stopping all running code, *Save* for saving the code to an external file and *Record* to create a recording (a WAV file) of the sound playing.
zh: 粉色的按钮是用来控制开始和停止播放声音的。*Run*按钮是用来运行编辑器中的代码的，*Stop*按钮是用来停止所有正在运行的代码的，*Save*按钮是用来保存代码到文件，最后 *Record* 按钮可以录制当前电脑正在播放的声音到WAV格式文件。

en: B. Editor Controls
zh: B. 编辑器控制

en: C. Info and Help
zh: C. 信息和帮助

en: These blue buttons give you access to information, help and preferences. The *Info* button will open up the information window which contains information about Sonic Pi itself - the core team, history, contributors and community. The *Help* button toggles the help system (*G*) and the *Prefs* button toggles the preferences window which allows you to control some basic system parameters.
zh: 通过这些蓝色按钮你可以访问信息，帮助和设置窗口。*Info*按钮将会打开信息查看窗口，显示Sonic Pi的相关信息， 例如核心团队，开发历史，贡献者，社区等。*Help* 按钮是帮助系统(*G*)的开关，*Prefs*按钮是设置窗口的开关，在设置窗口你可以控制软件系统的一些基本参数。

en: D. Code Editor
zh: D. 代码编辑器

en: This is the area where you'll write your code and compose/perform music. It's a simple text editor where you can write code, delete it, cut and paste, etc. Think of it like a very basic version of Word or Google Docs. The editor will automatically colour words based on their meaning in the code. This may seem strange at first, but you'll soon find it very useful. For example, you'll know something is a number because it is blue.
zh: 这块区域是你写代码的地方，也是你表演音乐的舞台。它就是一个简单的文本编辑器，可以写代码，删除，剪切，粘贴等。你可以认为它是一个基础版本的Word或者谷歌文档。编辑器会自动对代码进行分析高亮。初看起来会很奇怪，但你随后就能体会到这很有用。例如，你会发现所有的蓝色都是数字。

en: E. Prefs Panel
zh: E. 设置面板

en: Sonic Pi supports a number of tweakable preferences which can be accessed by toggling the *prefs* button in the Info and Help button set. This will toggle the visibility of the Prefs Panel which includes a number of options to be changed. Examples are forcing mono mode, inverting stereo, toggling log output verbosity and also a volume slider and audio selector on the Raspberry Pi.
zh: Sonic Pi支持配置偏好，你可以通过信息和帮助按钮集的*prefs*按钮开关来显示和隐藏配置面板。例子中是mono示波器，立体声反转，显示日志输出，还有音量控制条和树莓派音频输出选择器。

en: F. Log Viewer
zh: F. 日志查看器

en: When you run your code, information about what the program is doing will be displayed in the log viewer. By default, you'll see a message for every sound you create with the exact time the sound was triggered. This is very useful for debugging your code and understanding what your code is doing.
zh: 当你运行代码时，程序的当前运行状态将会输出到日志查看器。默认你将会看见每一个小样的播放时间。对于理解和调试程序，日志查看器将会非常有用。

en: G. Help System
zh: G. 帮助系统

en: One of the most important parts of the Sonic Pi interface is the help system which appears at the bottom of the window. This can be toggled on and off by clicking on the blue *Help* button. The help system contains help and information about all aspects of Sonic Pi including this tutorial, a list of available synths, samples, examples, FX and a full list of all the functions Sonic Pi provides for coding music.
zh: 帮助系统是Sonic Pi最重要的部分之一，它处于窗口的底部。你可以使用*Help* 按钮来显示和隐藏。帮助系统包含了帮助和Sonic Pi使用的方方面面的信息，包括这个教程，内置合成器列表，小样列表，代码例子列表，效果器列表，以及Sonic Pi支持的用以编程音乐的函数列表。

en: H. Scope Viewer
zh: H. 示波器查看器

en: The scope viewer allows you to see the sound you're hearing. You can easily see that the saw wave looks like a saw and that the basic beep is a curvey sine wave. You can also see the difference between loud and quiet sounds by the size of the lines. There are 3 scopes to play with - the default is a combined scope for the left and right channels, there is a stereo scope which draws a separate scope for each channel. Finally there is a Lissajous curve scope which will show the phase relationship between the left and right channels and allows you to draw pretty pictures with sound (https://en.wikipedia.org/wiki/Lissajous_curve).
zh: 示波器能够以可视化的方式呈现你听到的音乐。你可以从正弦波的波长非常直观的了解到当前节奏。你也可以从波的振幅上了解当前音量。有三种示波可以被选择，默认的是双声道合并显示，当然你也可以选择立体声示波器，它会分别显示各个声道的示波。最后你也可以选择[Lissajous curve](https://en.wikipedia.org/wiki/Lissajous_curve)示波器，这个示波器会显示左右声道的相关性，你可以用这个示波器画出非常漂亮的声音。

en: 1.3 Learning through Play
zh: 1.3 通过玩耍学习

en: Learning through Play
zh: 通过玩耍学习

en: Sonic Pi encourages you to learn about both computing and music through play and experimentation. The most important thing is that you're having fun, and before you know it you'll have accidentally learned how to code, compose and perform.
zh: Sonic Pi鼓励你通过玩耍和体验来学习电脑和音乐。最重要的事就是你能开心，最终你就会偶然发现自己会写代码和表演了。

en: There are no mistakes
zh: 这里不存在失误

en: Start Simple
zh: 从简单的开始

en: When you're learning, it's tempting to want to do amazing things *now*. However, just hold that thought and see it as a distant goal to reach *later*. For now, instead think of the *simplest* thing you could write which would be fun and rewarding that's a small step towards the amazing thing you have in your head. Once you have an idea about that simple step, then try and build it, play with it and then see what new ideas it gives you. Before long you'll be too busy having fun and making real progress.
zh: 当你学习的时候，最诱人的就是想*立刻*做一个非常牛逼的音乐出来。但是，请保持那个渴望作为一个遥远的目标，你 *稍后*实现的目标。现在，请思考 *最简单*的目标是你能够写出有趣的音乐，并持续激励自己抵达最终的目标。只要你有一个简单的想法，就请尝试并实现它。然后看看这个简单的想法会给你带来什么。在抵达最终目标之前，你都会乐不思蜀的实践着简单目标。

en: Just make sure to share your work with others!
zh: 请和朋友分享你获得的快乐！

en: 2 Synths
zh: 2 合成器

en: Synths
zh: 合成器

en: OK, enough of the intros - let's get into some sound.
zh: OK，概念介绍得够多了，让我们玩一下声音。

en: In this section we'll cover the basics of triggering and manipulating synths. Synth is short for synthesiser which is a fancy word for something which creates sounds. Typically synths are quite complicated to use - especially analog synths such as Eurorack modules connected together by a mess of wires. However, Sonic Pi gives you much of that power in a very simple and approachable manner.
zh: 在这一章，我们将会学习基本的触发和操作合成器。合成器就是用来创作声音的。通常真实的合成器是非常难使用的，特别是你需要组合几种相似的东西在一起，例如Eurorack模块连接上一些电线。然而Sonic Pi提供了一个非常简单的使用方式。

en: Don't be fooled by the immediate simplicity of Sonic Pi's interface. You can get very deep into very sophisticated sound manipulation if that's your thing. Hold on to your hats...
zh: 不要被Sonic Pi界面的简单性所迷惑。如果你愿意，你可以深入到非常复杂的声音操纵。请继续...

en: 2.1 Your First Beeps
zh: 2.1 你的第一声

en: Your First Beeps
zh: 你的第一声

en: Take a look at the following code:
zh: 参见下面的代码：

en: This is where it all starts. Go ahead, copy and paste it into the code window at the top of the app (the big white space under the Run button). Now, press Run...
zh: 这是一切开始的地方。继续，将其复制并粘贴到应用程序顶部的代码窗口中（“Run”按钮下的编辑框）。现在，按下“Run”按钮...

en: Beep!
zh: 嘟！

en: Intense. Press it again. And again. *And again...*
zh: 好。再按一次。然后再次。 *然后再次...*

en: Woah, crazy, I'm sure you could keep doing that all day. But wait, before you lose yourself in an infinite stream of beeps, try changing the number:
zh: 哇，太疯狂了，我相信你可以一直这样做下去。但是，等等，沉浸于无尽的嘟嘟声中之前，请尝试更改下数字：

en: Can you hear the difference? Try a lower number:
zh: 你能听到区别吗？尝试一个较低的数字：

en: *Don't worry* if this means nothing to you - it didn't to me when I first started. All that matters right now is that you know that *low numbers make lower beeps* and *high numbers make higher beeps*.
zh: *不要慌* 如果你还没明白这些东西有什么用处的话不要紧，我一开始也不懂。现在你只要明白 * 数字越小，声音越低 * * 数字越大，声音越高 * 就OK了。

en: Chords
zh: 和弦

en: Playing a note is quite fun, but playing many at the same time can be even better. Try it:
zh: 演奏音符非常有趣，但同时演奏好几个音符更棒！试试看：

en: Jazzy! So, when you write multiple `play`s, they all play at the same time. Try it for yourself - which numbers sound good together? Which sound terrible? Experiment, explore and find out for yourself.
zh: 嗯，有点儿意思了，当你写多个`play`时，它们会同时播放。你觉得哪些数字听起来很悦耳？哪些听着想去死？多试一下不会怀孕的。

en: Melody
zh: 旋律

en: So, playing notes and chords is fun - but how about a melody? What if you wanted to play one note after another and not at the same time? Well, that's easy, you just need to `sleep` between the notes:
zh: 嗯，演奏音符与和弦很有意思——那旋律呢？要是你想一个音符接着一个音符、不同时演奏它们，怎么办？其实很简单的，你只需要再音符之间“睡”一会：

en: play 72
    sleep 1
    play 75
    sleep 1
    play 79
zh: play 72 
    sleep 1 
    play 75 
    sleep 1 
    play 79

en: How lovely, a little arpeggio. So what does the `1` mean in `sleep 1`? Well it means the *duration of the sleep*. It actually means sleep for one beat, but for now we can think about it as sleeping for 1 second. So, what if we wanted to make our arpeggio a little faster? Well, we need to use shorter sleep values. What about a half i.e. `0.5`:
zh: 多妙的一个小琶音。那在`sleep 1`里面那个`1`是什么意思呢？它是指*睡眠时长*。实际上它意味着等待一拍再演奏，不过现在我们可以认为它是指等1秒钟：

en: play 72
    sleep 0.5
    play 75
    sleep 0.5
    play 79
zh: play 72 
    sleep 0.5 
    play 75 
    sleep 0.5 
    play 79

en: Notice how it plays faster. Now, try for yourself, change the times - use different times and notes.
zh: 发现了没有，我们的旋律变快了!  现在你可以使用不同的时间和音符自行尝试一下。

en: One thing to try is in-between notes such as `play 52.3` and `play 52.63`. There's absolutely no need to stick to standard whole notes. Play around and have fun.
zh: 还有一件事：记得试试`play 52.3` 和 `play 52.63`这种中间音符。完全没有必要拘束于标准的音高。尽管放开了玩。

en: Traditional Note Names
zh: 传统音名

en: For those of you that already know some musical notation (don't worry if you don't - you don't need it to have fun) you might want to write a melody using note names such as C and F# rather than numbers. Sonic Pi has you covered. You can do the following:
zh: 对于已经了解一点记谱法的人（即便你不会也不用担心——你去耍不需要它）你们可能更想用音名写旋律而不是数字，比如C和F#。Sonic Pi考虑到了你们。你可以这么做：

en: play :C
    sleep 0.5
    play :D
    sleep 0.5
    play :E
zh: play :C 
    sleep 0.5 
    play :D 
    sleep 0.5 
    play :E

en: Remember to put the colon `:` in front of your note name so that it goes pink. Also, you can specify the octave by adding a number after the note name:
zh: 记住在音名前加冒号`:`，它会闪成粉色。还有，你可以在音名后边加数字表明音组：

en: play :C3
    sleep 0.5
    play :D3
    sleep 0.5
    play :E4
zh: play :C3 
    sleep 0.5 
    play :D3 
    sleep 0.5 
    play :E4

en: If you want to make a note sharp, add an `s` after the note name such as `play :Fs3` and if you want to make a note flat, add a `b` such as `play :Eb3`.
zh: 要想给音符加一个升调，像`play :Fs3`一样在音名后加一个`s`，而想给音符一个降调，像`play :Eb3`一样加一个`b`。

en: Now go *crazy* and have fun making your own tunes.
zh: *噪*起来玩起来。

en: 2.2 Synth Options
zh: 2.2 合成器设置

en: Synth Options: Amp and Pan
zh: 合成器设置: 振幅和声道平衡

en: As well as allowing you to control which note to play or which sample to trigger, Sonic Pi provides a whole range of options to craft and control the sounds. We'll be covering many of these in this tutorial and there's extensive documentation for each in the help system. However, for now we'll introduce two of the most useful: *amplitude* and *pan*. First, let's look at what options actually are.
zh: 随你控制演奏哪个音符或调出哪个样本，Sonic Pi还提供大量可以制作和控制声音的设置选项。我们会在这个教程里说到许多这里的设置，在帮助系统里每一个设置都有详尽的资料。但是现在我们要介绍其中最有用的两个设置：*振幅*和*声道平衡*。首先我们看看传说中的设置到底是些什么。

en: Options
zh: 设置

en: Opts have two major parts, their name (the name of the control) and their value (the value you want to set the control at). For example, you might have a opt called `cheese:` and want to set it with a value of `1`.
zh: 设置选项有两个主要部分，它们的名称（控制选项的名称）和它们的值（你希望控制选项所在的数值）。举个例子，你或许有一个叫做`cheese:`的设置选项而你想设置它的值为`1`。

en: (Note that `cheese:` isn't a valid opt, we're just using it as an example).
zh: （别傻了，`cheese:`不是一个有效值，只是拿他举个例子而已）。

en: You can pass multiple opts by separating them with a comma:
zh: 你可以用逗号分隔并且调用多个设置选项：

en: The order of the opts doesn't matter, so the following is identical:
zh: 选项的顺序无关紧要，所以下面也是那一回事：

en: Opts that aren't recognised by the synth are just ignored (like `cheese` and `beans` which are clearly ridiculous opt names!)
zh: 不能被合成器识别的设置选项直接被忽略（像`cheese`还有`beans`这种明显恶搞的选项名称！）

en: If you accidentally use the same opt twice with different values, the last one wins. For example, `beans:` here will have the value 2 rather than 0.5:
zh: 要是你一不小心把不同的数值给了同一个选项，后一个有效。譬如，`beans:`在这里的值为2而不是0.5：

en: Many things in Sonic Pi accept opts, so just spend a little time learning how to use them and you'll be set! Let's play with our first opt: `amp:`.
zh: Sonic Pi里的很多东西都接受设置选项，那就花点时间学习怎么使用它们就行了！玩玩我们的第一个设置选项：`amp:`。

en: Amplitude
zh: 振幅

en: Amplitude is a computer representation of the loudness of a sound. A *high amplitude produces a loud sound* and a *low amplitude produces a quiet sound*. Just as Sonic Pi uses numbers to represent time and notes, it uses numbers to represent amplitude. An amplitude of 0 is silent (you'll hear nothing) whereas an amplitude of 1 is normal volume. You can even crank up the amplitude higher to 2, 10, 100. However, you should note that when the overall amplitude of all the sounds gets too high, Sonic Pi uses what's called a compressor to squash them all to make sure things aren't too loud for your ears. This can often make the sound muddy and strange. So try to use low amplitudes, i.e. in the range 0 to 0.5 to avoid compression.
zh: 振幅是计算机表达方式里声音响度的说法。一个*大的振幅产生较响亮的声音*，一个*小的振幅产生较安静的声音*。就在Sonic Pi用数字代表时间和音符的同时，它用数字表示振幅。值为0的振幅是指无声（你听不到任何东西）而值为1的振幅是正常音量。你甚至可以把音量调高到2，10，100。但是你得注意这里所有声音的整体振幅太高时，Sonic Pi用一个叫压缩器的玩意把它们压扁，确保声音不会大到让你耳朵受不了。这种操作通常让声音又浑浊又奇怪。就尽量用低振幅吧，换句话说，在0到0.5之间取值避免压缩。

en: Amp it up
zh: 振幅调大

en: To change the amplitude of a sound, you can use the `amp:` opt. For example, to play at half amplitude pass 0.5:
zh: 要改变声音的振幅，你可以用`amp:`选项。例如，用0.5这个值以一半的振幅放音：

en: To play at double amplitude pass 2:
zh: 用2这个值以双倍振幅放音：

en: The `amp:` opt only modifies the call to `play` it's associated with. So, in this example, the first call to play is at half volume and the second is back to the default (1):
zh: `amp:`选项只能调整对相关`play`的命令。在这个例子里，第一个指定的演奏内容以一半音量进行，第二个回到默认的音量（值为1时的状态）：

en: play 60, amp: 0.5
    sleep 0.5
    play 65
zh: play 60, amp: 0.5 
    sleep 0.5 
    play 65

en: Of course, you can use different `amp:` values for each call to play:
zh: 当然，你可以给不同演奏命令使用不同的`amp:`值：

en: play 50, amp: 0.1
    sleep 0.25
    play 55, amp: 0.2
    sleep 0.25
    play 57, amp: 0.4
    sleep 0.25
    play 62, amp: 1
zh: play 50, amp: 0.1 
    sleep 0.25 
    play 55, amp: 0.2 
    sleep 0.25 
    play 57, amp: 0.4 
    sleep 0.25 
    play 62, amp: 1

en: Panning
zh: 声道平衡

en: Another fun opt to use is `pan:` which controls the panning of a sound in stereo. Panning a sound to the left means that you hear it out of the left speaker, and panning it to the right means you hear it out of your right speaker. For our values, we use a -1 to represent fully left, 0 to represent center and 1 to represent fully right in the stereo field. Of course, we're free to use any value between -1 and 1 to control the exact positioning of our sound.
zh: 另一个可以用的好玩的选项是`pan:`，它控制着声音音响的声道。把一个声音的声道平衡调至左边意味着你听到声音从左扬声器发出，调至右边是指你听到声音从右扬声器发出。至于我们的值，我们用-1表示平衡完全调满到左边，0表示中央，1表示完全调满到右声道。当然，我们可以随意用任何-1和1之间的值控制我们声音的准确位置。

en: Let's play a beep out of the left speaker:
zh: 我们从左扬声器播放哔声：

en: Now, let's play it out of the right speaker:
zh: 现在，我们从右扬声器播放：

en: Finally let's play it back out of the center of both (the default position):
zh: 最后我们回到两个声道的中央播放声音（默认位置）：

en: Now, go and have fun changing the amplitude and panning of your sounds!
zh: 好嘞，开始愉快地和变换的振幅和声道平衡玩耍吧！

en: 2.3 Switching Synths
zh: 2.3 切换合成器

en: Switching Synths
zh: 切换合成器

en: Buzzy saws and prophets
zh: “锯子”和“先知”

en: A fun sound is the *saw wave* - let's give it a try:
zh: 有一个有趣的声音，*锯波*——让我们来试试：

en: Let's try another sound - the *prophet*:
zh: 我们试试另一个声音——*prophet*：

en: How about combining two sounds. First one after another:
zh: 两个声音写在起来会怎样。先是一个接着一个演奏：

en: Notice that the `use_synth` command only affects the following calls to `play`. Think of it like a *big switch* - new calls to `play` will play whatever synth it's currently pointing to. You can move the switch to a new synth with `use_synth`.
zh: 这里要马克一下：`use_synth`命令只影响下面对`play`的调用。把它当成*大调换*——对`play`的新调用会播放出来，不管现在点的是哪个合成器。

en: Discovering Synths
zh: 挖掘合成器

en: `:prophet`
zh: “:prophet”

en: `:dsaw`
zh: “:dsaw”

en: `:fm`
zh: “:fm“

en: `:tb303`
zh: “:tb303”

en: `:pulse`
zh: “:pulse”

en: Now play around with *switching synths during your music*. Have fun combining synths to make new sounds as well as using different synths for different sections of your music.
zh: 现在开始与“切换各种合成器”玩吧。结合合成器来制作新的声音以及为音乐的不同部分使用不同的合成器。

en: 2.4 Duration with Envelopes
zh: 2.4 持续时间

en: Duration with Envelopes
zh: 2.4 持续时间

en: In an earlier section, we looked at how we can use the `sleep` command to control when to trigger our sounds. However, we haven't yet been able to control the duration of our sounds.
zh: 在前面的部分中，我们学习了如何使用“sleep”指令来控制何时触发我们的声音。

en: In order to give us a simple, yet powerful means of *controlling the duration* of our sounds, Sonic Pi provides the notion of an *ADSR amplitude envelope* (we'll cover what ADSR means later in this section). An amplitude envelope offers two useful aspects of control:
zh: 为了给我们一个简单但强大的“控制声音持续时间”的方法，Sonic Pi提供了“ADSR振幅包络”的概念（我们将在本节后面介绍ADSR的含义）。幅度包络提供了两个有用的控制方面：

en: control over the duration of a sound
zh: 控制声音的持续时间

en: control over the amplitude of a sound
zh: 控制声音的幅度

en: Duration
zh: 持续时间

en: The duration is the length the sound lasts for. A longer duration means that you hear the sound for longer. Sonic Pi's sounds all have a controllable amplitude envelope, and the total duration of that envelope is the duration of the sound. Therefore, by controlling the envelope you control the duration.
zh: 持续时间是声音持续的长度。一个长的持续时间意味着你会更长的听到你的声音。Sonic Pi的声音都具有可控制的幅度包络，该包络的总持续时间是声音的持续时间。因此，通过控制包络，您可以控制持续时间。

en: The ADSR envelope not only controls duration, it also gives you *fine control over the amplitude of the sound*. All audible sounds start and end silent and contain some non-silent part in-between. Envelopes allow you to slide and hold the amplitude of non-silent parts of the sound. It's like giving someone instructions on how to turn up and down the volume of a guitar amplifier. For example you might ask someone to "start at silence, slowly move up to full volume, hold it for a bit, then quickly fall back to silence." Sonic Pi allows you to program exactly this behaviour with envelopes.
zh: ADSR包络不仅可以控制持续时间，还可以“精确控制声音的振幅”。所有可听声音开始和结束都是静音，并且中间包含一些非静音部分。信封允许您滑动并保持声音的非静音部分的振幅。这就像给某人指示如何调高吉他放大器的音量。例如，你可能会要求某人“从沉默开始，慢慢向上移动到最大音量，保持一段时间，然后迅速回到沉默状态。” Sonic Pi允许您使用信封准确编程此行为。

en: Just to recap, as we have seen before, an amplitude of 0 is silence and an amplitude of 1 is normal volume.
zh: 回顾一下，正如我们之前看到的，振幅为0是静音，幅度为1是正常音量。

en: Now, let us look at each of the parts of the envelopes in turn.
zh: 现在, 让我们依次查看信封的各个部分。

en: Release Phase
zh: 释放阶段

en: The only part of the envelope that's used by default is the release time. This is the time it takes for the synth's sound to fade out. All synths have a release time of 1 which means that by default they have a duration of 1 beat (which at the default BPM of 60 is 1 second):
zh: 默认情况下使用的信封的唯一部分是淡出时间。这是合成器声音淡出所需的时间。所有合成器的释放时间均为1，这意味着默认情况下它们的持续时间为1拍（默认BPM为60时为1秒）：

en: Notice how this sounds exactly the same (the sound lasts for one second). However, it's now very easy to change the duration by modifying the value of the `release:` opt:
zh: 注意这听起来完全一样（声音持续一秒钟）。但是，现在很容易通过修改“release：opt”的值来改变持续时间：

en: We can make the synth sound for a very short amount of time by using a very small release time:
zh: 通过使用非常短的释放时间，我们可以在很短的时间内完成播放声音：

en: The duration of the release of the sound is called the *release phase* and by default is a linear transition (i.e. a straight line). The following diagram illustrates this transition:
zh: 释放声音的持续时间称为“释放阶段”，默认情况下是线性过渡（即直线）。下图说明了这种转变：

en: You can therefore change the duration of your sound by changing the release time. Have a play adding release times to your music.
zh: 因此，您可以通过更改减弱时间来更改声音的持续时间。播放时为您的音乐添加减弱时间。

en: Attack Phase
zh: 渐强阶段

en: By default, the *attack phase* is 0 for all synths which means they move from 0 amplitude to 1 immediately. This gives the synth an initial percussive sound. However, you may wish to fade your sound in. This can be achieved with the `attack:` opt. Try fading in some sounds:
zh: 默认情况下，所有合成器的“渐强阶段”为0，这意味着它们立即从0幅度移动到1。这为合成器提供了初始的打击声。但是，您可能希望淡入您的声音。这可以通过“attack:opt”来实现。尝试淡化一些声音：

en: play 60, attack: 2
    sleep 3
    play 65, attack: 0.5
zh: play 60, attack: 2
    sleep 3 
    play 65, attack: 0.5

en: You may use multiple opts at the same time. For example for a short attack and a long release try:
zh: 您可以同时使用多个参数。例如，对于短渐强和长释放尝试：

en: This short attack and long release envelope is illustrated in the following diagram:
zh: 这个短渐强和长释放包络如下图所示：

en: Of course, you may switch things around. Try a long attack and a short release:
zh: 当然，你可以随意的改变这些。试试长的渐强和短淡出：

en: Let's look at one last thing before we move onto something a bit more involved. Given a set of coordinates we can ask Minecraft what the type of a specific block is. Let's try it with the diamond block you just created:
zh: 在我们接触更相关一点的内容之前，来看最后一件事。给一组坐标我们就可以询问Minecraft『我的世界』某一个特定方块的类型。我们用你刚才创建的钻石方块试试：

en: Yey! It's `:diamond`. Try changing it back to glass and asking again - does it now say `:glass`? I'm sure it does :-)
zh: 对！是":diamond"（钻石）。试着把它再变回玻璃然后再询问一遍——它现在说是":glass"（玻璃）吗？我肯定它一定这么说 :-)

en: Available block types
zh: 可用的方块类型

en: Before you go on a Minecraft Pi coding rampage, you might find this list of available block types useful:
zh: 在你开始狂热编码Minecraft Pi之前，也许这个可用方块类型列表会对你有帮助：
