Hello everyone,
Is there a way using tabplay~ to reverse the playback of an audio file?
Thanks
-H
Reverse Playback
Hello everyone,
Is there a way using tabplay~ to reverse the playback of an audio file?
Thanks
-H
Pd-extended OSX 10.5.8
No there isn't. However [tabread4~] can do it without a problem and is nearly as easy to use. You can use all audio emmitting objects to index a [tabread4~], where the most evident objects are a [line~] or a [phasor~]. Both these objects (can) go from 0 to 1 which is what you need to read the samples out of a table.
[frequency\
|
[phasor~]
|
| [tablelength] --> this is not an actual object of course
| |
[*~]
|
[tabread4~ myTable]
|
[dac~]
This player plays the sample forwards. It's not difficult to make it go backwards.
D.
|] [] |.| ][|-| -- http://soundcloud.com/domxh
@domien said:
[tabread4~] can do it without a problem and is nearly as easy to use. You can use all audio emitting objects to index a [tabread4~], where the most evident objects are a [line~] or a [phasor~]. Both these objects (can) go from 0 to 1 which is what you need to read the samples out of a table.
[frequency\
|
[phasor~]
|
| [tablelength] --> this is not an actual object of course
| |
[*~]
|
[tabread4~ myTable]
|
[dac~]This player plays the sample forwards. It's not difficult to make it go backwards.
Hi, I'm wondering, how to use this for reverse / forward playback in such a way that the soundfiler reads what the size of the file is, and these numbers are fed to a phasor~ in such a way that -1 will play the whole duration of the sample backwards and 1 will play the whole duration of the sample forwards.
I've tried to calculate like this:
soundfiler
|
numberbox (672000, for instance)
|
/ 10000000
|
numberbox (0.0672)
|
hslider
|
numberbox
|
sig~
|
phasor~
|
*~ (this receives the original number, 672000, for instance)
|
tabread4~ (arrayname)
however, when i then load a 336000 length sample, this same calculation goes completely awry and does not work properly.
sorry, it's late and i'm not reading full posts...but i GUESS that tabread~ (not tabread4~) is ok for reverse play at original speed, and would save on quite a bit of cpu.
You need to compute a few values with the output from [soundfiler].
First it’s helpful to think of how Pd stores audio files in arrays. If your sample length is 672000, [soundfiler] will, provided you use the -resize flag, fill an array with values from 0 to 671999. If the sample length is 336000, from 0 to 335999, etc.
Since [phasor~] outputs values from 0 to 1, we only need to multiply its output by the output from [soundfiler] and pass this new value into [tabread4~] to play the audio from beginning to end.
However, the frequency of [phasor~] also needs to be adjusted so that a single cycle of [phasor~] is the same duration as your audio file. This is done by dividing 44100 (assuming that’s the samplerate of your audio file) by the output of [soundfiler].
Having computed the [phasor~] frequency, you can now scale it to change the sample’s playback speed, or multiply it by -1 to reverse sample playback.
The attached patch should do what you need. You can pass messages into its inlet to control it:
1: forward, normal speed
-1: reverse, normal speed
0.5: forward, half speed
… and so on.
On doing a search this is a great patch but doesn't work doing reverse audio as suggested. Should it work using -1 ( as does for doubling or halving sample rate)?
@donnerbono Yes it does work....... try this.......
reverse.zip
open [master_patch] and then click the [-1( message.......
David.
@whale-av Thank you. That works great!
Oops! Looks like something went wrong!