The new #uxn audio device supports all 4 channels now and I accidentally did a Steve Reich with the "popcorn" demo lol
Still gotta add the "wait for zero crossing" option to reduce audio clicks but this should be functional enough for some testing.
You can find this test rom here: https://badd10de.dev/share/audio-test.tal
Devine Lu Linvega
in reply to Bad Diode • • •https://wiki.xxiivv.com/site/varvara.html#audio
XXIIVV — varvara
wiki.xxiivv.comBad Diode
in reply to Devine Lu Linvega • • •sure, not a problem, note that I swapped some ports around while I was testing things (as you see on my .tal test file) but this isn't super important, we can set them up as y'all think it's best.
Before that though, if you can test the implementation in uxnpd and let me know if all works properly I would try to address the issues as soon as possible.
Remember we still have two free ports reserved for detuning, mode or midi, but let's start with what we got atm.
Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •I was about to post this, but I have an initial implementation of the wait-for-zero approach, you can pull the changes and test it out to see if it improves. If not, please record some audio samples and send them my way to take a look.
Here is an AFTER/BEFORE clip.
Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •Devine Lu Linvega
in reply to Bad Diode • • •some sounds I can't port, they just don't make any sound for some reason.
I'm very confused why it doesn't, does this looks right to you?
https://paste.sr.ht/~rabbits/b3efe74827288fabf4dd530f0555d5b85d2f49c2
b3efe74 — paste.sr.ht
paste.sr.htDevine Lu Linvega
in reply to Devine Lu Linvega • • •Bad Diode
in reply to Devine Lu Linvega • • •on mobile so not sure if I’m reading this right, but looks like you are not passing a pitch there right?
The duration is in milliseconds, in principle you don’t really need it unless you are sequencing sounds, you can just play oneshots by sending the pitch. When the time until the duration is due, the audio vector will be called.
Length is the number of bytes that the sample is using. In my example I think I used around 162 for a single cycle of a sine wave tuned at C4 (@44100hz)
Devine Lu Linvega
in reply to Bad Diode • • •line12: .Audio0/pitch DEO
Has this changed?
Devine Lu Linvega
in reply to Devine Lu Linvega • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •the pitch is passed to the play-stomp routine via the stack.
This is very strange.. I'll investigate further.
Devine Lu Linvega
in reply to Devine Lu Linvega • • •Bad Diode
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Bad Diode • • •okay that makes sense, so let's say I have a sample that I'd like to play once.
explosion.pcm
I don't want for it to loop. How do I find the duration? Right now, single-hit samples will play in a loop. Do I multiply the pitch with the length or something to find the real length of a single hit?
Bad Diode
in reply to Devine Lu Linvega • • •Bad Diode
in reply to Devine Lu Linvega • • •I think I hardcoded the looping on the audio callback for testing and forgot about it, oops!
I'm going to add the sample xfading and make sure one-shots play properly without looping.
Will keep you posted!
Bad Diode
in reply to Bad Diode • • •Ok, I added sample cross-fading for new sounds so even samples with 0 attack will properly play without clicks.
Right now the XFADING amount is of 100 samples (around 2.26ms @44100) but this can be configured at compile time.
Also fixed the looping issues and updated the demo, which now uses 3 channels for playing popcorn (via audio vectors) and 1 channel (Audio0) to play a one-shot kick sample when pressing the B button.
@neauoire make sure to check: https://badd10de.dev/share/audio-test.tal
Devine Lu Linvega
in reply to Bad Diode • • •