www.eamoncaddigan.net

Content and configuration for https://www.eamoncaddigan.net
git clone https://git.eamoncaddigan.net/www.eamoncaddigan.net.git
Log | Files | Refs | Submodules | README

commit c059aa2698934b2a6e4f98e13587be9538eefb57
parent 3911f0c12bf2a09f1ce79b579dba62ceb99be6d6
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date:   Sun, 17 Dec 2023 21:46:02 -0800

December Adventure, day 17

Diffstat:
Acontent/december-adventure/2023-17/index.md | 38++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+), 0 deletions(-)

diff --git a/content/december-adventure/2023-17/index.md b/content/december-adventure/2023-17/index.md @@ -0,0 +1,38 @@ +--- +title: "2023, Day 17" +date: 2023-12-17T14:34:38-08:00 +draft: false +--- + +Since [my last post]({{< ref "december-adventure/2023-15" >}}) about +varvara's audio device, I was told[^ref1] that it is indeed the case that +[the docs](https://wiki.xxiivv.com/site/varvara.html#audio) are lagging +behind changes to the interface. + +I took a quick look at some [up-to-date example +code](https://git.sr.ht/~rabbits/uxn/tree/main/item/projects/examples/devices/audio-tests.tal), +but then I decided to dig into [the uxn implementation +itself](https://git.sr.ht/~rabbits/uxn/tree/main/item/src/devices/audio.c). +It looks like the audio device was revamped just this October, and as far as +I can tell it was basically a total rewrite[^rewrite]! + +I was a (professional!) C programmer once, a long time ago, and although my +skills have atrophied to the point where calling them "rusty" would be +generous, I still find a clean and well-thought-out C codebase to be quite +elegant. I wish this code was commented though. + +I'm starting to get a handle on how audio works in uxn now, but I'm not +confident enough in my understanding to attempt a comprehensive write-up. +The biggest change is the introduction of a `duration` port, as seen in this +definition from `audio-test.tal`: + + |30 @Audio0 [ &vector $2 &position $2 &output $1 &duration $2 &pad $1 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] + +The ADSR values seem to be aggressively redefined but I'm still figuring out +exactly what they do now. I'll keep looking at this for a bit. + +[^ref1]: https://merveilles.town/@neauoire/111591054537679811 + +[^rewrite]: I even dug up [the thread that kicked it + off](https://merveilles.town/@bd/111211175947698996). +