Skip to content

Commit

Permalink
Update docs for fade defs and add % in mini-notation (#275)
Browse files Browse the repository at this point in the history
* Updated transitions.md (added definitions for fadeIn, fadeOut, fadeInFrom, fadeOutFrom)

* Added % in mini-notation (added the symbol in the mini-notation table and created a new section explaining it in depth. Also pointed the difference between % and / symbols)
  • Loading branch information
madamsapple authored Jun 1, 2024
1 parent 3350f3a commit 72630b0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/reference/mini_notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Learning the mini-notation is **essential** for learning how to make music with
| `:` | Selecting samples | `d1 $ s "bd:3"` | `d1 $ s "bd" # n 3` |
| `( )` | Euclidean sequences | `d1 $ s "bd(3,8)"` | `d1 $ euclid 3 8 $ s "bd"` |
| `{ }` | Polymetric sequences | `d1 $ s "{bd bd bd bd, cp cp hh}"` | 2nd pattern wraps: `d1 $ stack [ s "bd*4", s "cp cp hh cp" ]` |
| `{ }%` | Polymetric sequence subdivision | `d1 $ s "{bd cp hh}%8"` | Pattern wraps: `d1 $ s "bd cp hh bd cp hh bd cp"` |
| `%` | Indicates a numerical ratio | `d1 $ s "bd*4%2"` | `d1 $ s "bd*2"` or `d1 $ s "[bd*4]/2"` |
| `{ }%` | Polymetric sequence subdivision | `d1 $ s "{bd cp hh}%8"` | Pattern wraps: `d1 $ s "bd cp hh bd cp hh bd cp"` | |

## The mini-notation in depth

Expand Down Expand Up @@ -255,6 +256,22 @@ d1 $ s "{bd sd stab, cp arpy cr arpy}"
d1 $ s "{bd*2, hh*4, bd hh 808:4}"
```
### Ratio Shorthand
You can use % to write floating point values in patterns. The symbol divides two numbers - `6%3` would be 2.
:::caution
It is not the same as the `/` symbol for step division. `/` manipulates time and slows down a pattern using division. `%` is only used numerically to denote ratios or float values.
```c
-- Here / slows down the entire pattern by 2. A pattern originally playing the bd sample 4 times will slow it down to play it only 2 times:
d1 $ s "[bd*4]/2"
-- Below % is only used to divide 4 and 2. It doesn't influence the entire pattern itself. So 4%2 will return 2, which is the same as d1 $ s "bd*2"
d2 $ s "[bd*4%2]"
-- d2 $ s "[bd*4]%2" is invalid since % does not handle whole patterns.
```
:::

### Polymetric Sequences with Subdivision

Alternatively, you can also add the precise subdivision you are looking for by using `%` followed by the subdivision number:
Expand Down
32 changes: 32 additions & 0 deletions docs/reference/transitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,35 @@ Same thing as `xfade`, but you can specify the number of cycles that the transit
```haskell
xfadeIn 1 8 $ s "arpy*8" # n (run 8)
```

### fadeIn

```haskell
fadeIn :: Time -> Pattern a -> Pattern a
```

Undegrades a pattern over the given time.

### fadeInFrom

```haskell
fadeInFrom :: Time -> Time -> Pattern a -> Pattern a
```

Alternate version to `fadeIn` where you can provide the time from which the fade in starts.

### fadeOut

```haskell
fadeOut :: Time -> Pattern a -> Pattern a
```

Degrades a pattern over the given time.

### fadeOutFrom

```haskell
fadeOutFrom :: Time -> Time -> Pattern a -> Pattern a
```

Alternate version to `fadeOut` where you can provide the time from which the fade out starts.

0 comments on commit 72630b0

Please sign in to comment.