<!-- PDF page 152 -->

with short settings, eg **X300**. *Single-shot* effects (**W0** to **W3**) need a longer period, eg **X1000**. Try changing the value after **X** in the program above to hear the difference.

### Tempo

The speed (*tempo*) at which a piece of music is played can be set with the command **T** followed by the number of *crotchet beats per minute* (bpm) in the range **60** to **240**. The command controls the speed at which all notes are played, but can only be included in *channel* **A** of *PSG1* (the first string after the **PLAY** command) otherwise it is ignored, eg:

```
10  a$="T180cdefg"
20 PLAY a$, "T120CDEFG"
```

will play *octave chords* but at **180bpm** as the second setting is ignored. If no *tempo* is specified, the music will be played at **120 bpm**.

### Repeated phrases

Any musical phrase can be repeated by enclosing the appropriate string or part of a string in parentheses. For example:

```
10 PLAY "abC(DEFG)"
```

will repeat the last four notes. If there is an unequal number of parentheses, the phrase will be repeated back to the last parenthesis. If there is only a closing parenthesis, the phrase will be repeated back to the beginning of the string. As an example:

```
10 PLAY "abCDEFG)"
```

will repeat all seven notes. Double closing parentheses:

```
10 PLAY "O2CEGA))"
```

will cause an *infinite* repeat. This is particularly useful for things like repetitive bass lines. To turn off an *infinite* repeat you will need to use the **H** command.

| Effect Value | Visual Representation | Description |
|---|---|---|
| 0 | ![Volume envelope: decay then stop](/documentation/manual/rev3/figures/p152-volume-effect-0.png) | Decay then stop |
| 1 | ![Volume envelope: attack then stop](/documentation/manual/rev3/figures/p152-volume-effect-1.png) | Attack then stop |
| 2 | ![Volume envelope: decay then hold](/documentation/manual/rev3/figures/p152-volume-effect-2.png) | Decay then hold |
| 3 | ![Volume envelope: attack then hold](/documentation/manual/rev3/figures/p152-volume-effect-3.png) | Attack then hold |
| 4 | ![Volume envelope: repeated decay](/documentation/manual/rev3/figures/p152-volume-effect-4.png) | Repeated Decay |
| 5 | ![Volume envelope: repeated attack](/documentation/manual/rev3/figures/p152-volume-effect-5.png) | Repeated Attack |
| 6 | ![Volume envelope: repeated attack-decay](/documentation/manual/rev3/figures/p152-volume-effect-6.png) | Repeated Attack-Decay |
| 7 | ![Volume envelope: repeated decay-attack](/documentation/manual/rev3/figures/p152-volume-effect-7.png) | Repeated Decay-Attack |

*Table 12 – Volume effects values*

