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