furnace/doc/4-instrument/lynx.md

53 lines
2.4 KiB
Markdown
Raw Normal View History

2022-02-22 12:36:21 +00:00
# Atari Lynx instrument editor
2023-09-10 04:11:43 +00:00
Atari Lynx instrument editor consists of two tabs: Sample and Macros.
2022-02-22 12:36:21 +00:00
2023-09-10 04:11:43 +00:00
## Sample
2022-02-22 12:36:21 +00:00
2023-09-10 04:11:43 +00:00
for sample settings, see [the Sample instrument editor](sample.md).
the only differences are the lack of an "Use wavetable" option, and the presence of a "Use sample" one.
note that using samples on Lynx is CPU expensive!
## Macros
- **Volume**: volume sequence.
- **Arpeggio**: pitch sequence.
- **Duty/Int**: bit pattern for LFSR taps and integration.
- **Panning (left)**: output level for left channel.
- **Panning (right)**: output level for right channel.
- **Pitch**: fine pitch.
- **Phase Reset**: trigger restart of waveform/LFSR reset.
## audio generation description
2022-02-22 12:36:21 +00:00
Atari Lynx generates sound using a 12-bit linear feedback shift register 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.
2022-02-22 12:36:21 +00:00
2024-02-03 03:36:15 +00:00
### LFSR-based synthesis
a linear-feedback shift register is one method used for random number generation.
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.
think of it as a conveyor carrying glass bottles. each bottle may be empty or carrying water.
the bottle at the end is taken. if there's water, then the output is 1. if it's empty, the output is 0.
depending on the LFSR configuration, many bottles at specific positions ("taps") are looked at. these are combined from left to right, two by two:
- if two bottles are identical, an empty bottle is pushed.
- if one bottle has water but the other is empty, a water bottle is pushed.
the process is repeated indefinitely.
unlike PowerNoise, Lynx's taps are in fixed positions, but it has many of them.
2023-09-10 04:11:43 +00:00
### square wave
2022-02-22 12:36:21 +00:00
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.
2022-02-22 12:36:21 +00:00
2023-09-10 04:11:43 +00:00
### triangle wave
2022-02-22 12:36:21 +00:00
alternatively when "int" bit is set sound wave is generated by adding or subtracting volume from output effectively producing triangle wave.
2022-02-22 12:36:21 +00:00
2023-09-10 04:11:43 +00:00
#### how triangle wave works?
2022-02-22 12:36:21 +00:00
hint: to obtain triangle set bits "int" and "11" in "Duty/Int" sequence and set volume to about 22.
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.