Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to emulate Vinyl Scratch effect in Audio Processing?

I'm trying to make a simple "virtual scratcher" but I don't know the theory behind it. Since I've found nothing useful on google I'm asking it here:

  • What happen when I scratch (move the track forward)? Do I raise the pitch and/or rate of the sample?
  • How can I emulate this phenomena with audio processing algorithms?

Sample code / tutorials would be reeeally appreciated :-)

like image 734
d.lime Avatar asked May 07 '12 16:05

d.lime


1 Answers

What happen when I scratch (move the track forward)? Do I raise the pitch and/or rate of the sample?

Think about what is actually happening: A record contains audio data. The record needle reads the audio data from the record. As the record spins, the playback position changes. (It's very similar to watching the playhead move through an audio file in a digital audio editor.)

When you physically spin the record faster, you are increasing the playback rate. The audio is both quicker and higher in pitch. Increase the playback rate by two and the audio will playback an octave higher.

When you physically spin the record slower, you are decreasing the playback rate. The audio is both slower and lower in pitch. Decrease the playback rate by two and the audio will playback an octave lower.

Records can only modify the audio playback by speeding up or slowing down the physical record, this effects both pitch and playback rate together. Some audio software can change the pitch and rate independently. Record players can not.

(Get a record player and experiment to hear what it sounds like.)

How can I emulate this phenomena with audio processing algorithms?

To emulate a DJ scratching a record you need to be able to adjust the playback rate of the audio as the user is "scratching".

When the user speeds up the record, speed up the playback rate. When the user slows the record, slow the playback rate.

When the user stops the record, stop playback altogether.

When the user spins the record in reverse, reverse the playback.

You don't need to change the pitch of the audio. Changing the playback rate will do that automatically. Any further adjustments to the pitch will sound incorrect.

I don't have any advice with regard to libraries but something like this isn't too difficult to implement if you take your time.

like image 181
Shannon Matthews Avatar answered Oct 02 '22 22:10

Shannon Matthews