# AY8930 instrument editor

the AY8930 instrument editor consists of two tabs.

## Sample

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 AY is CPU expensive!

## Macros

- **Volume**: volume sequence.
- **Arpeggio**: pitch sequence.
- **Noise Freq**: noise generator frequency sequence.
  - note: global!
- **Waveform**: selector of sound type - square wave tone, noise and/or envelope generator.
  - you may select more than one option.
- **Pitch**: fine pitch.
- **Phase Reset**: trigger restart of **envelope**.
- **Duty**: duty cycle sequence.
- **Envelope**: configures the hardware envelope.
  - **enable**: sets whether envelope is enabled.
  - **direction**: flips the envelope's direction.
  - **alternate**: when enabled, the envelope will change direction once it hits a boundary.
  - **hold**: sets whether the envelope should stop when hitting boundary, or loop.
- **AutoEnv Num**: sets the envelope to the channel's frequency multiplied by numerator.
- **AutoEnv Den**: sets the envelope to the channel's frequency multiplied by denominator.
  - these two must be set in order for AutoEnv to work!
- **Force Period**: sets the tone period (wavelength).
  - overrides Arpeggio and Pitch macros.
- **Env Period**: sets the envelope period.
  - ignored if both AutoEnv macros are set.
- **Noise AND Mask**: alters the shape/frequency of the noise generator, allowing to produce various interesting sound effects and even PWM phasing.
- **Noise OR Mask**: see above.
