stevesims / agon-vdp

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

Support changing parameters on an active channel #10

Closed stevesims closed 1 year ago

stevesims commented 1 year ago

Further to #9 it may be useful to include commands to change parameters on an active channel, i.e. adjusting the pitch, volume, or duration for a sound that is currently playing, as well as enabling/disabling the channel.

This would potentially allow playback of a sample to be aborted, an indefinite duration sound to be stopped, and complex envelopes to be supported driven via these commands.

stevesims commented 1 year ago

On reflection, only adding commands to adjust volume and frequency.

These commands will immediately adjust the channel parameters, so therefore volume can be used for channel enable/disable. Zero volume will disable channel, anything else enables it.

stevesims commented 1 year ago

Preliminary support now added to audio-enhancements branch.

Both volume and frequency adjustment will wait for any "abort" to complete before proceeding with adjusting values.

Setting volume to zero will abort any playback and instantly silence a channel. Setting volume on a channel that had been silent will change that channel to be "playing". Right now it will play for the previously set duration, but it should really be an indefinite duration. This will change when indefinite duration is supported.

stevesims commented 1 year ago

Indefinite duration is now supported, so setting volume to a positive value when it had been zero will now result in indefinite playback

stevesims commented 1 year ago

This functionality is now all supported. Closing