Reversing live audio input

Pedro Devoto's icon

Hi all there, I'm new in this forum and new to MSP. I've done a little research of reversing sound in this forum, but I haven't worked my problem out. I'm sorry if this has been already resolved in the past.

As the topic title says, what I'm trying to do is to play a 2 seconds buffer reversed. What I use for this purpose are 2 buffers (not tapin/tapout), named "reverse1" and "reverse2":

When the toggle is clicked, one of the buffers (reverse1) starts to record the input signal. After 2 seconds, reverse1 starts to be played backwards while reverse2 starts to record the input signal. After 2 seconds, the reverse2 starts to be played backwards while reverse1 starts to record the input signal again, and so on...

Hope it was clear, I'm attaching the code anyway.

The thing is that it simply doesn't work...

Any ideas?? Should it be more simple?

Thanks!

Pedro Devoto's icon

OK, so I just looked at it in just in case and I figured the problem out. I changed the size of reverse2 buffer to 2000 and fizxed the message box containing the list "2000, 0 2000".

Anyway, I'd appreciate your opinion. Could I make it simpler and/or more effective?

Thanks!

P.S: was that the right way to attach the patch? I'm afraid not, I'm sorry in that case

Tj Shredder's icon

Pedro Devoto wrote on Tue, 14 July 2009 06:52Anyway, I'd appreciate your opinion. Could I make it simpler and/or more effective?

The basic structure is fine for me. you could think about enhancing it though: At the moment there is no way to stop it, though the toggle suggest to stop, it doesn't (a zero will also trigger a 1 to start recording...)
Also you might think about a way to change the length of your recording period dynamically. You might also allow some overlap and/or add some fade-in/fade-out to avoid clicks...
Or try to look for a pause in the signal to stop recording and start reverse playback in the pause...
I'll leave all that to you as an exercise. As you found the bug yourself I bet you'll find out a lot more by just doing and experimenting. Finding solutions yourself is very rewarding in my experience...

Quote:P.S: was that the right way to attach the patch? I'm afraid not, I'm sorry in that case

Its easier to select all, copy and paste into the mail body. Obviously you are on Max 4.x. In Max 5 you would choose "copy compressed" instead of copy...