Page 1 of 1

Sample player with time-stretch /math tempo ?

PostPosted: Wed May 15, 2019 9:37 pm
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.

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

PostPosted: Wed May 15, 2019 10:22 pm
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.

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

PostPosted: Thu May 16, 2019 12:43 am
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.

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

PostPosted: Thu May 16, 2019 12:46 am
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

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

PostPosted: Thu May 16, 2019 1:00 am
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 13864 times

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

PostPosted: Thu May 16, 2019 5:52 pm
by lalalandsynth
lol, this was pretty simple, will post later today.

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

PostPosted: Thu May 16, 2019 7:41 pm
by wlangfor@uoguelph.ca
lalalandsynth wrote:lol, this was pretty simple, will post later today.


Damn, well allright :)

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

PostPosted: Sat May 18, 2019 1:17 pm
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.

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

PostPosted: Thu Sep 12, 2019 8:32 pm
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