Adding delay lines

Captain's Log: Stardate 77508.3

I've been working for a couple of days now on adding delay lines. The work is going faster than I expected, largely because I realized that there was a much simpler way to design them than I had previously come up with.

The new idea is that the AudioSignal Exciters that already exist to pipe in audio data from an external signal are actually perfect for piping in internal signals. So instead of having to create an entirely new entity type for delay, I just added a new DelayLine Link type that can attach Microphones to AudioSignal Exciters. The AudioSignal exciters will then be able to excite masses via external audio signals, or internal signals. And both types of signals will have a configurable delay.

Most of the work is now done. All the GUI stuff is working, and I've reworked all the GPU simulation code to keep audio data in ring buffers, which was not needed before. The ring buffers were a bit tricky, since now that the audio buffers are much larger (we only needed enough samples for the user's audio buffer size before), it's too slow to map the entire buffer on the CPU to read/write. So I had to implement some slightly tricky logic to map the ring buffer in one part (if the region being read is in the middle of the buffer), or in two parts (if the region wraps over the end of the ring buffer). This is all hidden behind a nice operator[] that magically does what you want.

Delay for external audio signals works. Now it's just a simple matter of writing the simulation code that reads the delayed audio data from internal microphones, and I should be able to do a demo for the new delay lines!


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal