| 1 |
# Atari Lynx instrument editor |
| 2 |
|
| 3 |
Atari Lynx instrument editor consists of two tabs: Sample and Macros. |
| 4 |
|
| 5 |
## Sample |
| 6 |
|
| 7 |
for sample settings, see [the Sample instrument editor](sample.md). |
| 8 |
|
| 9 |
the only differences are the lack of an "Use wavetable" option, and the presence of a "Use sample" one. |
| 10 |
|
| 11 |
note that using samples on Lynx is CPU expensive! |
| 12 |
|
| 13 |
## Macros |
| 14 |
|
| 15 |
- **Volume**: volume sequence. |
| 16 |
- **Arpeggio**: pitch sequence. |
| 17 |
- **Duty/Int**: bit pattern for LFSR taps and integration. |
| 18 |
- **Panning (left)**: output level for left channel. |
| 19 |
- **Panning (right)**: output level for right channel. |
| 20 |
- **Pitch**: fine pitch. |
| 21 |
- **Phase Reset**: trigger restart of waveform/LFSR reset. |
| 22 |
- **Load LFSR**: load a value to the LFSR. |
| 23 |
|
| 24 |
## audio generation description |
| 25 |
|
| 26 |
Atari Lynx generates sound using a 12-bit linear feedback shift register (LFSR) with configurable tap. nine separate bits can be enabled to be the source of feedback: 0, 1, 2, 3, 4, 5, 7, 10 and 11. to generate _any_ sound at least one bit _must_ be enabled. |
| 27 |
|
| 28 |
### LFSR-based synthesis |
| 29 |
|
| 30 |
a linear-feedback shift register is one method used for random number generation. |
| 31 |
it works by shifting a sequence of binary numbers (bits), taking the last bit into the output. then some of the bits are combined with others, doing a XOR (exclusive or) operation and then being pushed back. |
| 32 |
|
| 33 |
think of it as a conveyor carrying glass bottles. each bottle may be empty or carrying water. |
| 34 |
the bottle at the end is taken. if there's water, then the output is 1. if it's empty, the output is 0. |
| 35 |
depending on the LFSR configuration, many bottles at specific positions ("taps") are looked at. these are combined from left to right, two by two: |
| 36 |
- if two bottles are identical, an empty bottle is pushed. |
| 37 |
- if one bottle has water but the other is empty, a water bottle is pushed. |
| 38 |
the process is repeated indefinitely. |
| 39 |
|
| 40 |
unlike PowerNoise, Lynx's taps are in fixed positions, but it has many of them. |
| 41 |
|
| 42 |
### square wave |
| 43 |
|
| 44 |
the LFSR is shifted at the rate define by sound pitch and generates square wave by setting channel output value to +volume or -volume, depending on the bit shifted in. |
| 45 |
|
| 46 |
### triangle wave |
| 47 |
|
| 48 |
alternatively when "int" bit is set sound wave is generated by adding or subtracting volume from output effectively producing triangle wave. |
| 49 |
|
| 50 |
#### how triangle wave works? |
| 51 |
|
| 52 |
hint: to obtain triangle set bits "int" and "11" in "Duty/Int" sequence and set volume to about 22. |
| 53 |
by enabling 11th tap bit the value shifted in is negated after 11 bit is shifted in hence the volume is added for 11 cycles and then subtracted for 11 cycles. |