Re: Useful list-indexing trick

The delay line implementation is include/synthizer/block_delay_line.hpp.  Example usage is in src/hrtf.cpp, starting in HRTFPanner::run, starting just above input_line.runReadLoopSplit(...).

I haven't benchmarked it against the naive implementation, but basically what's going on is that if you know the maximum amount you're going to want to delay, you can use that to know whether or not delaying by that amount can ever wrap up front.  As the lines get longer, say on the order of a second but you're only doing 100ms delay, the amount of time you spend in the modulus slow path and the modulus-specific generated code asymptotically approaches zero.  For something like reverb, delay lines on the order of a second but we only use 100ms of it are actually relatively typical: you need the extra space if we go from bathroom to cathedral.  And if you start using powers of 2, that quickly starts being a lot of wasted spaceat that size.

I haven't tested it heavily.  I know that it works, but it might very well do something stupid like "haha, I'm only ever calling the modulus version", I dunno.  But it's fast enough to get upwards of 10 HRTF sources in a debug build with like 1% CPU usage.  I'll be more scientific about it when Synthizer is further along.

as far as I know this is unique to me, I imagine because you need post-C++14 generic lambdas to even make it close to ergonomic.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to