Teensy Audio Library Scrubber Object

dangelo

Member
Heyo everyone,

So I've been working on implementing live scrubbing through audio on the teensy for a large project I'm creating. Think scratching vinyl or scrubbing through a tape machine. I was trying to implement it with the queue object, but I was running into a ton of issues with clicking and weird sound artifacts, so I decided to create an object to make it easier: AudioPlayScrub.

Basically, the object stores a pointer to an audio array (an array of 16 bit int values), which you can store in PROGMEM, and then, after being activated, you can set a target position (from 0.0 to 1.0), and the internal playhead of the object will approach that target by a rate that you can change with the setRate(float 0.0-1.0) function. It's super easy to fit into projects, and it sounds quite nice. I'm still working on smoothing out the sound a bit to get rid of some weird digital artifacts, but I'd love to let everyone take a look, get some feedback, and give it to anyone that needs a live scrubber for their next project.

Here's a GitHub link:
https://github.com/dangelo729/teensy_audio_library_scrubber

Let me know if anybody has any questions about it.
 
Well done mr. dangelo! You are wonderful and your scrubber object beautiful. I will definitely use this at some point, excited to scrub!
 
This is very cool!
Do you have a demo of it on Youtube or some other platform?
Have you tried to scrub through using a jog wheel of some sort?
 
Great!! Looking forward to try this out! Thanks for the effort and sharing.

Is it a matter of limited memory or would it somehow be possible to load files from SD card to an array to use it?

Is it possible to play reverse somehow? Would be a nice feature. Maybe with the possibility to set rate to a negative value?

Another really nice feature would be to set a length to be looped. That would make a great granular synthesis effect. (as far as I remember, with the existing granular object you have to "feed" the input first...)
 
I have a T4 dev board with SDRAM, wondering if the entire audio track can be copied to a buffer in SDRAM, then scrubbed from there.

Is there is a sample sketch I can test?
 
Great!! Looking forward to try this out! Thanks for the effort and sharing.

Is it a matter of limited memory or would it somehow be possible to load files from SD card to an array to use it?

Is it possible to play reverse somehow? Would be a nice feature. Maybe with the possibility to set rate to a negative value?

Another really nice feature would be to set a length to be looped. That would make a great granular synthesis effect. (as far as I remember, with the existing granular object you have to "feed" the input first...)
Thank you for the kind words! I actually have revamped the project entirely so it works with raw audio files from an SD card. It does it in a kind of weird way where you declare a DMAMEM array of some size and pass that as a pointer to the scrubber object, allowing you to play super long SD length audio files. It allows scrubbing and variable speed playback of RAW audio files from an SD card (the speed can be negative). This way you can use it with the queue recording object to scrub through your own recordings and such (I'm working on it for this tape scrubber sampler thing I'm creating).

The loop length is a really cool idea, I'll definitely look into incorporating that.

I should be able to update the GitHub with the new code this week, though my code, specifically the update function, is somewhat spaghetti so prepare yourself.
 
I have a T4 dev board with SDRAM, wondering if the entire audio track can be copied to a buffer in SDRAM, then scrubbed from there.

Is there is a sample sketch I can test?
I'll work on getting a simple example together sometime this week, but the new version uses a raw audio files on an SD card and a smaller DMAMEM array of uint_16 values, which sounds close to what your looking for.
 
This is very cool!
Do you have a demo of it on Youtube or some other platform?
Have you tried to scrub through using a jog wheel of some sort?
Thank you!
I don't have a demo yet, but I'm getting to a point with the project I'm working on (a multi-engine art-synth thing) where I'm excited to share it soon. I hope to put out a simple example sketch asap though.
I'm currently using a rotary encoder for the scrubbing, which works quite well, a jog wheel would work perfectly and sound great.
 
I've little experience with the Audio library, just getting into it now.
So this will scrub a raw audio file which is mono. So to support stereo, you'd need two classes and two pointers?

As mentioned, an example of implementing this would be great
 
Back
Top