Reversing Incoming Audio

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

Postby Kingston on Sat Mar 11, 2006 1:29 am

do NOT confuse the VST plugin buffers (host based) with any kind of look ahead buffering. It's (almost) a completely different thing.

You can already easily do "look ahead" buffers in synthmaker, or audio buffers in general. We already have that feature. What we do need is latency reporting to host, but I fear I'm already confusing you even further.
Kingston
essemilian
 
Posts: 209
Joined: Sat Nov 26, 2005 8:03 pm

Re:

Postby skater130 on Sun May 08, 2011 3:10 am

MyCo wrote:I just played around with the code from angstrom:
http://music-drive.com/rev_reverb.osm

BTW:
float mem[352800];// thats about 16 seconds at 120bpm.
has to be:
float mem[352800];// thats about 7 seconds at 44,1kHz samplerate.



I've been searching for hours for a practical example of exactly what I'm aiming to do, and this is it!...except the file is no longer active. If you happened to have a copy MyCo or can explain the inner workings of reversing audio (which can't be done on the fly due to latency - I guess the unprocessed signal can be delayed in order to wait for it to catch up?) It would be deeply appreciated.

(EDIT: Sorry for re-igniting an old thread...hopefully there's still people out there in the know!)
skater130
essemer
 
Posts: 2
Joined: Fri Feb 04, 2011 1:04 pm

Re: Reversing Incoming Audio

Postby trogluddite on Sun May 08, 2011 12:18 pm

Here's a little module that can do the reversing - it's really meant as a pitch shifter (from the algorithm posted HERE), but the same method has the ability to reverse its input buffer, and has crossfades to avoid any nasty clicking.
Pitch and Reverse.osm
(6.26 KiB) Downloaded 213 times

The 'Window Size' parameter in the properties sets the size of the buffer (and hence the latency).
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3024
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: Reversing Incoming Audio

Postby Leslie147 on Thu Nov 17, 2011 12:09 am

Trogluddite, thank you very much for sharing that module. I appreciate it was quite a while ago that you posted the .osm file but I hope this gets back to you.

The way you create the slopes is a lesson in compact code writing but I haven't yet managed to figure out the function of absmask=2147483647. Your advice on this would be much appreciated.

When I tried to use the shifter fourfold I spotted 'temping[1]' instead of tempind[1] in writing to the array which prevented one channel from working. Also, I noticed the window size is limited to 1 second by the Float Min 44100 even though the array is sized for a maximum of 10 seconds. Fixing this, I found a 2 second window very musical.

Having deduced and written out the mathematical basis for the way this works, I can see how you reverse time by effectively swapping the sign of t in sinw(t+T) ... given an input signal sinwt. Brilliant! The Vox Tonelab pedal board I have does a time reverse that sounds similar to this but it's good to have it in a form that can be manipulated freely.

Thanks again,

Chris
User avatar
Leslie147
essemer
 
Posts: 38
Joined: Sun Jun 24, 2007 4:34 pm
Location: West Wales

Re: Reversing Incoming Audio

Postby trogluddite on Thu Nov 17, 2011 6:09 am

No problem - I can't really take all the credit anyway, as the code was an my assembly optimisation, of another guys code, who ported an algorithm....

The ABSmask is just a very fast way to create the ABS(x) function - the integer has the lowest 31 bits all set to one, and the 32nd bit (sign bit) set to zero.
Because float numbers also use the top bit as the sign bit, when you do a bitwise ANS with any 32bit number, the sign bit will be masked out - turning negative numbers into positive ones.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3024
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Previous

Return to Sound

Who is online

Users browsing this forum: No registered users and 1 guest