zwirn-0.2.3.1: docs/tutorial/start.md
**First Sounds with Zwirn**
This tutorial will slowly walk you through how to make sounds with zwirn.
The code blocks in this tutorial are all runnable by clicking them.
You can also copy the code with **Ctrl+C**, or by right clicking the code block.
To run some code in the editor you navigate with the cursor to the code you want to run and press **Ctrl+ENTER** - if that doesn't seem to do anything try **Alt+ENTER**!
Let's try it out with the following code
```
1 $: s "kick"
```
By clicking the code block, you should be able to hear a kick drum sound looping.
To stop the sound you can run
```
hush
```
For convenience, hush has its own shortcut - by default Alt+.
Try it out for yourself by running the kick drum again!
Let's break down what the code is actually doing:
- the *1* stands for the channel that is in charge of playing the sound,
- the *s* stands for sound and expects a text as input, which in this case is `"kick"`
to switch the kick drum sound with a snare drum sound we can write `"snare"` instead of `"kick"`
What sounds are available depends on the underlying sound engine, called doux. For now, here are some sources you can try out: `"kick"`, `"snare"`, `"hat"`, `"tom"`, `"clap"`, `"rim"`, `"sine"`, `"tri"`, `"saw"`
We will see how to load our own samples into doux later.
There are also shorthands for these predefined that allow you to write
```
1 $: tom
```
Now let's make a more complex rhythm. We use `[` `]` to write down sequences, for example
```
1 $: [tom tom snare]
```
Notice how this led to the rhythm speeding up. This is because sequences are always relative tothe main unit called a *cycle*. To illustrate, we can play a sequence of three against four:
```
1 $: [tom tom snare]
2 $: [hat hat hat hat]
```
So the more things we put into a sequence, the faster it gets. To leave some space in rhythms we can use a silence, notated as `~`
```
1 $: [tom tom snare]
2 $: [hat hat ~ hat]
```
Sequences can also be nested in eachother:
```
1 $: [tom [clap tom] snare]
2 $: [hat hat ~ hat]
```
[link](reference/time.md)