stevesims / agon-vdp

Official AGON QUARK Firmware: ESP32 VDP
MIT License
0 stars 0 forks source link

Allow waveform for a channel to be changed #2

Closed stevesims closed 1 year ago

stevesims commented 1 year ago

Implement a command to allow the waveform type used by a channel to be changed, and used for all subsequent notes played on that channel until it has been changed.

The underlying audio system within FabGL provides for various different waveform generators, so we should expose them.

Changing the waveform type of a channel should abort any current sound playing on that channel. All other parameters however (such as envelopes applied to a channel) should remain unaffected.

stevesims commented 1 year ago

Preliminary support for this has been pushed to audio_enhancements branch.

Playback will be aborted when this command is called with a valid/supported waveform type. Setting to the same waveform type will replace the waveform generator, and thus still abort. If a non-supported type is given then it will be ignored and any in progress playback should continue.

stevesims commented 1 year ago

All complete, including support for selecting samples as a waveform.

Samples are given as a negative number, allowing for up to 128 samples to be supported.