Sample player with time-stretch /math tempo ?

For general discussion related FlowStone
Post Reply
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Sample player with time-stretch /math tempo ?

Post by lalalandsynth »

Anyone know of a simple sample loader , player that will stretch to tempo ?

Does not have to be fantastic quality though it would not hurt.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Sample player with time-stretch /math tempo ?

Post by martinvicanek »

Is the material you want to stretch monophonic?
How much (percent) do you need to stretch?
Depending on these criteria the task may be easy or hard.
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Sample player with time-stretch /math tempo ?

Post by lalalandsynth »

Mostly drums, I would think in the range from about 70 to 160 bpm and be able to load say 120 bpm and take it down to 70 or up to 160, or even the 70 to 160 .

It does not have to sound amazing and can be pitched if its simpler to do .
Mostly I just need it to fit to tempo.
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Sample player with time-stretch /math tempo ?

Post by lalalandsynth »

I was tinkering with this sampler which would be perfect if I could make it follow and match the tempo.
viewtopic.php?f=2&t=16256&p=51168&hilit=sampler#p51168

Should be possible as the counter has a sample rate input , just not sure how to do it or calculate.
I can get the BPM of the loaded wave , i got that much.
Just not sure how I can calculate the difference.

Lets say there is the DAW sample rate , say 44100 . and I load a 80 bpm Loop , how can I calculate the sample rate increase it needs to play at 120 ?

Or a simpler example perhaps , Lets say daw is at 44100 . 120 BPM , I load a 120 bpm Loop and I want to increase to 121 bpm , how much of an increase is that in sample rate ?

Maybe I am brainfarting at this point but I feel like if i could calculate that I might get this to work.
Feeling pretty stupid right now , lol
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Sample player with time-stretch /math tempo ?

Post by lalalandsynth »

I am thinking if I could use this to pitch/stretch the sample according to bpm.
From the sampler in the earlier post.
sample rate.jpg
sample rate.jpg (120.75 KiB) Viewed 17650 times
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Sample player with time-stretch /math tempo ?

Post by lalalandsynth »

lol, this was pretty simple, will post later today.
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Sample player with time-stretch /math tempo ?

Post by wlangfor@uoguelph.ca »

lalalandsynth wrote:lol, this was pretty simple, will post later today.


Damn, well allright :)
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Sample player with time-stretch /math tempo ?

Post by trogluddite »

There is a very simple time-stretch/pitch-shift algorithm in my old SK1 sampler that you can find in this post which might be worth a look. The timestretch player consists of just two modules inside the "-> Player -> Stretch Player" module of the schematic.

It doesn't save or load samples, as it's designed to capture mono samples in real-time from an audio input, but its sample input is just a regular mem link, so it should be adaptable for loaded samples quite easily. Pitch and playback speed are independent of each other, where a setting of one is the original pitch or playback speed - dividing the desired BPM by the original BPM should give you the correct value for the playback speed. The 'window' setting determines the size of 'grains' that the sample is effectively chopped into; shorter tends to work better for percussive sounds, and longer for pitched sounds; but in any case, the quality of stretching is very basic, as ideally the grain size should be matched to the incoming pitch.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Sample player with time-stretch /math tempo ?

Post by wlangfor@uoguelph.ca »

trogluddite wrote:There is a very simple time-stretch/pitch-shift algorithm in my old SK1 sampler that you can find in this post which might be worth a look. The timestretch player consists of just two modules inside the "-> Player -> Stretch Player" module of the schematic.

It doesn't save or load samples, as it's designed to capture mono samples in real-time from an audio input, but its sample input is just a regular mem link, so it should be adaptable for loaded samples quite easily. Pitch and playback speed are independent of each other, where a setting of one is the original pitch or playback speed - dividing the desired BPM by the original BPM should give you the correct value for the playback speed. The 'window' setting determines the size of 'grains' that the sample is effectively chopped into; shorter tends to work better for percussive sounds, and longer for pitched sounds; but in any case, the quality of stretching is very basic, as ideally the grain size should be matched to the incoming pitch.


You're a god of vst *bows to the vst god
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
Post Reply