Discussion:
WSOLA on RealTime
(too old to reply)
Alex Dashevski
2018-09-26 19:25:19 UTC
Permalink
Can I implement WSOLA on realtime(audio buffer) ?
I need to do resampling ? Right ?

Thanks,
Alex
robert bristow-johnson
2018-09-26 20:50:21 UTC
Permalink
 
WSOLA fundamentally does time-scaling.  time compression or time stretching without changing pitch.  time-scaling is not normally thought of as real-time because your input and output buffer pointers will collide.
combining time-scaling with resampling can make a
pitch shifter (changes pitch without changing speed or tempo) and that **can** and often is real-time.  whatever stretching or compression the time-scaler does that changes the length of the sound is undone by the resampling.  it's like if you pitch it up an octave, the time-scaler (WSOLA
or phase-vocoder or whatever technique) makes your audio twice as long (and half as fast) without changing pitch.  then you play that elongated audio back at twice the speed which brings it back to the original tempo but the pitch is bumped up an octave.
for playback of audio from a hard
disk or some other mass storage, you can use WSOLA or slow down or speed up the playback (without changing pitch) but your playback device has to output more samples than normal if you're speeding it up or fewer samples than normal to slow it down.  then, in real-time, you can use the time
scaler  make the more or fewer samples per block to be the same as normal.
--
r b-j

---------------------------- Original Message ----------------------------

Subject: [music-dsp] WSOLA on RealTime

From: "Alex Dashevski" <***@gmail.com>

Date: Wed, September 26, 2018 3:25 pm

To: music-***@music.columbia.edu

--------------------------------------------------------------------------
Post by Alex Dashevski
Can I implement WSOLA on realtime(audio buffer) ?
I need to do resampling ? Right ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
 
 
 


--



r b-j                         ***@audioimagination.com



"Imagination is more important than knowledge."

 
 
 
 
Jacob Penn
2018-09-26 21:00:05 UTC
Permalink
You can indeed do it on real time audio but the tricks is like the previous
email, you’ll need to devise strategies for pitching things up, as you’ll
be lacking the necessary information to move faster across the buffer from
the write head position.

You’ll also obviously only be able to slow down a signal, and not speed it
up.

Best,

[image: insignia] <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU <http://jakemumu.github.io/>
612.388.5992

On September 26, 2018 at 1:50:37 PM, robert bristow-johnson (
***@audioimagination.com) wrote:



WSOLA fundamentally does time-scaling. time compression or time stretching
without changing pitch. time-scaling is not normally thought of as
real-time because your input and output buffer pointers will collide.

combining time-scaling with resampling can make a pitch shifter (changes
pitch without changing speed or tempo) and that **can** and often is
real-time. whatever stretching or compression the time-scaler does that
changes the length of the sound is undone by the resampling. it's like if
you pitch it up an octave, the time-scaler (WSOLA or phase-vocoder or
whatever technique) makes your audio twice as long (and half as fast)
without changing pitch. then you play that elongated audio back at twice
the speed which brings it back to the original tempo but the pitch is
bumped up an octave.

for playback of audio from a hard disk or some other mass storage, you can
use WSOLA or slow down or speed up the playback (without changing pitch)
but your playback device has to output more samples than normal if you're
speeding it up or fewer samples than normal to slow it down. then, in
real-time, you can use the time scaler make the more or fewer samples per
block to be the same as normal.

--

r b-j


---------------------------- Original Message ----------------------------
Subject: [music-dsp] WSOLA on RealTime
From: "Alex Dashevski" <***@gmail.com>
Date: Wed, September 26, 2018 3:25 pm
To: music-***@music.columbia.edu
--------------------------------------------------------------------------
Post by Alex Dashevski
Can I implement WSOLA on realtime(audio buffer) ?
I need to do resampling ? Right ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
--

r b-j ***@audioimagination.com

"Imagination is more important than knowledge."
robert bristow-johnson
2018-09-26 21:20:56 UTC
Permalink
---------------------------- Original Message ----------------------------

Subject: Re: [music-dsp] WSOLA on RealTime

From: "Jacob Penn" <***@gmail.com>

Date: Wed, September 26, 2018 5:00 pm

To: ***@audioimagination.com

music-***@music.columbia.edu

--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the previous
email, you&rsquo;ll need to devise strategies for pitching things up, as you&rsquo;ll
be lacking the necessary information to move faster across the buffer from
the write head position.
You&rsquo;ll also obviously only be able to slow down a signal, and not speed it
up.
no, even if you slow it down, any finite-sized buffer will eventually overflow.  i presume you mean time-scaling (not pitch shifting) using WSOLA.
by "real-time", i mean live samples going in and (assuming no sample rate conversion) the same number of samples
going out in a given period of time.  with an upper bound of delay (and the lower bound is imposed by causality) and the process can run indefinitely.  so if you're slowing down audio in real-time and you're running this process for a day.  or for a year.

--



r b-j                         ***@audioimagination.com



"Imagination is more important than knowledge."

 
 
 
 
Jacob Penn
2018-09-26 21:25:13 UTC
Permalink
Ahh yeah I gotcha,

Yes, in the case of slow down, there Is a finite amount you’re able to slow
down based on the size of the circular buffer of input data in use.

In my personal applications I offer users the ability to restart the
stretch from the writehead at a musical value. Conveniently the slowest
rate for this control will stop the overflow ; )

Can sound quite nice!

Best,

[image: insignia] <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU <http://jakemumu.github.io/>
612.388.5992

On September 26, 2018 at 2:21:29 PM, robert bristow-johnson (
***@audioimagination.com) wrote:



---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
From: "Jacob Penn" <***@gmail.com>
Date: Wed, September 26, 2018 5:00 pm
To: ***@audioimagination.com
music-***@music.columbia.edu
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the previous
email, you’ll need to devise strategies for pitching things up, as you’ll
be lacking the necessary information to move faster across the buffer from
the write head position.
You’ll also obviously only be able to slow down a signal, and not speed it
up.
no, even if you slow it down, any finite-sized buffer will eventually
overflow. i presume you mean time-scaling (not pitch shifting) using WSOLA.

by "real-time", i mean live samples going in and (assuming no sample rate
conversion) the same number of samples going out in a given period of
time. with an upper bound of delay (and the lower bound is imposed by
causality) and the process can run indefinitely. so if you're slowing down
audio in real-time and you're running this process for a day. or for a
year.


--

r b-j ***@audioimagination.com

"Imagination is more important than knowledge."
Alex Dashevski
2018-09-27 06:15:23 UTC
Permalink
Hi Robert,

I don't understand your last sentence:
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as normal."

In the beginning of your answer, you said that I need to use WSOLA with
resampling.

I have problem with implementation. Can you help ?

Thanks,
Alex
Post by Jacob Penn
Ahh yeah I gotcha,
Yes, in the case of slow down, there Is a finite amount you’re able to
slow down based on the size of the circular buffer of input data in use.
In my personal applications I offer users the ability to restart the
stretch from the writehead at a musical value. Conveniently the slowest
rate for this control will stop the overflow ; )
Can sound quite nice!
Best,
[image: insignia] <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU
612.388.5992
On September 26, 2018 at 2:21:29 PM, robert bristow-johnson (
---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Wed, September 26, 2018 5:00 pm
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the
previous
Post by Jacob Penn
email, you’ll need to devise strategies for pitching things up, as you’ll
be lacking the necessary information to move faster across the buffer
from
Post by Jacob Penn
the write head position.
You’ll also obviously only be able to slow down a signal, and not speed
it
Post by Jacob Penn
up.
no, even if you slow it down, any finite-sized buffer will eventually
overflow. i presume you mean time-scaling (not pitch shifting) using WSOLA.
by "real-time", i mean live samples going in and (assuming no sample rate
conversion) the same number of samples going out in a given period of
time. with an upper bound of delay (and the lower bound is imposed by
causality) and the process can run indefinitely. so if you're slowing down
audio in real-time and you're running this process for a day. or for a
year.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Spencer Jackson
2018-09-27 17:30:11 UTC
Permalink
Alex:

Any algorithm with a deterministic computation time can be applied in
real-time if latency is sufficient enough. Are you familiar with the idea
of copying the stream to a buffer then applying the algorithm and
outputting the older data which the algorithm has already been applied to?
Adding latency like this and processing in blocks is the standard method
that allows very cpu heavy processing to be applied to a real-time stream.
The only real requirement for real-time processes is to output the same
number of samples as the input (at the same sample rate).

Pitch shifting methods stretch or shrink the signal creating more or less
samples and you must figure out how to remove the extra or add samples to
be the correct number of samples in order for it to work on a real-time
audio stream. This is the resampling part and there are many ways to
address it.

I think we might be able to help more if you can ask more specific
questions about the implementation details you are struggling with.

_Spencer
Post by Alex Dashevski
Hi Robert,
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as normal."
In the beginning of your answer, you said that I need to use WSOLA with
resampling.
I have problem with implementation. Can you help ?
Thanks,
Alex
Post by Jacob Penn
Ahh yeah I gotcha,
Yes, in the case of slow down, there Is a finite amount you’re able to
slow down based on the size of the circular buffer of input data in use.
In my personal applications I offer users the ability to restart the
stretch from the writehead at a musical value. Conveniently the slowest
rate for this control will stop the overflow ; )
Can sound quite nice!
Best,
[image: insignia] <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU
612.388.5992
On September 26, 2018 at 2:21:29 PM, robert bristow-johnson (
---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Wed, September 26, 2018 5:00 pm
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the
previous
Post by Jacob Penn
email, you’ll need to devise strategies for pitching things up, as
you’ll
Post by Jacob Penn
be lacking the necessary information to move faster across the buffer
from
Post by Jacob Penn
the write head position.
You’ll also obviously only be able to slow down a signal, and not speed
it
Post by Jacob Penn
up.
no, even if you slow it down, any finite-sized buffer will eventually
overflow. i presume you mean time-scaling (not pitch shifting) using WSOLA.
by "real-time", i mean live samples going in and (assuming no sample rate
conversion) the same number of samples going out in a given period of
time. with an upper bound of delay (and the lower bound is imposed by
causality) and the process can run indefinitely. so if you're slowing down
audio in real-time and you're running this process for a day. or for a
year.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Alex Dashevski
2018-09-27 17:39:08 UTC
Permalink
Hi,
The current code has problem.
if I send you the current code, can you help me with implementation ? Are
you familiar with android ?

Thanks,
Alex
Post by Spencer Jackson
Any algorithm with a deterministic computation time can be applied in
real-time if latency is sufficient enough. Are you familiar with the idea
of copying the stream to a buffer then applying the algorithm and
outputting the older data which the algorithm has already been applied to?
Adding latency like this and processing in blocks is the standard method
that allows very cpu heavy processing to be applied to a real-time stream.
The only real requirement for real-time processes is to output the same
number of samples as the input (at the same sample rate).
Pitch shifting methods stretch or shrink the signal creating more or less
samples and you must figure out how to remove the extra or add samples to
be the correct number of samples in order for it to work on a real-time
audio stream. This is the resampling part and there are many ways to
address it.
I think we might be able to help more if you can ask more specific
questions about the implementation details you are struggling with.
_Spencer
Post by Alex Dashevski
Hi Robert,
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as normal."
In the beginning of your answer, you said that I need to use WSOLA with
resampling.
I have problem with implementation. Can you help ?
Thanks,
Alex
Post by Jacob Penn
Ahh yeah I gotcha,
Yes, in the case of slow down, there Is a finite amount you’re able to
slow down based on the size of the circular buffer of input data in use.
In my personal applications I offer users the ability to restart the
stretch from the writehead at a musical value. Conveniently the slowest
rate for this control will stop the overflow ; )
Can sound quite nice!
Best,
[image: insignia] <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU
612.388.5992
On September 26, 2018 at 2:21:29 PM, robert bristow-johnson (
---------------------------- Original Message
----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Wed, September 26, 2018 5:00 pm
------------------------------------------------------------
--------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the
previous
Post by Jacob Penn
email, you’ll need to devise strategies for pitching things up, as
you’ll
Post by Jacob Penn
be lacking the necessary information to move faster across the buffer
from
Post by Jacob Penn
the write head position.
You’ll also obviously only be able to slow down a signal, and not
speed it
Post by Jacob Penn
up.
no, even if you slow it down, any finite-sized buffer will eventually
overflow. i presume you mean time-scaling (not pitch shifting) using WSOLA.
by "real-time", i mean live samples going in and (assuming no sample
rate conversion) the same number of samples going out in a given period of
time. with an upper bound of delay (and the lower bound is imposed by
causality) and the process can run indefinitely. so if you're slowing down
audio in real-time and you're running this process for a day. or for a
year.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Vladimir Pantelic
2018-09-27 20:57:00 UTC
Permalink
Post by Alex Dashevski
Hi,
The current code has problem.
if I send you the current code, can you help me with implementation ? Are
you familiar with android ?
comp.dsp would read: "please do my homework for me"
robert bristow-johnson
2018-09-27 19:42:24 UTC
Permalink
---------------------------- Original Message ----------------------------

Subject: Re: [music-dsp] WSOLA on RealTime

From: "Alex Dashevski" <***@gmail.com>

Date: Thu, September 27, 2018 2:15 am

To: music-***@music.columbia.edu

Cc: "robert bristow-johnson" <***@audioimagination.com>

--------------------------------------------------------------------------
Post by Alex Dashevski
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as normal."
this was in my original answer and it was about an application of time-scaling to the playback of audio from a mass storage device (i think either a hard disk or a CD or an MP3 from an iPod or something) at a
faster or slower rate than was original recorded.  if you're playing it back faster, there are more samples per second than when recorded and the pitch will be raised (this is like "fast-forward" with the old analog tape technology).  if you're playing it back slower, there are
fewer samples per second than when recorded and the pitch is lowered. 


i know i have done fast-forward with a CD player and the pitch wasn't raised but the music was chopped up, so it sounded glitchy besides being fast tempo.  WSOLA could be employed in real time to make that fast forward sound less glitchy (a phase vocoder would insure no glitches), have the same
pitch as when recorded, *and* still be sped up in tempo.
Post by Alex Dashevski
In the beginning of your answer, you said that I need to use WSOLA with
resampling.
*if* you're doing pitch-shifting.  and pitch-shifting in real-time makes sense.
but time-scaling with live input in real-time does not make sense.  and it's not because of issues regarding finite computational bandwidth.  it's because we can't look into
the future (if you're speeding things up) nor indefinitely into the past (with a finite amount of memory) if you're slowing things down.
 
--


r b-j                         ***@audioimagination.com



"Imagination is more important than knowledge."

 
 
 
 
Alex Dashevski
2018-09-30 07:30:49 UTC
Permalink
I need to undrestand how implemet pitch shift on audio buffer based on
wsola and resample.
Could you help ?
Thanks,
Alex

‫בתאךיך יום ה׳, 27 בס׀ט׳ 2018 ב-22:44 מאת ‪robert bristow-johnson‬‏ <‪
Post by robert bristow-johnson
---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Thu, September 27, 2018 2:15 am
--------------------------------------------------------------------------
Post by Alex Dashevski
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as
normal."
this was in my original answer and it was about an application of
time-scaling to the playback of audio from a mass storage device (i think
either a hard disk or a CD or an MP3 from an iPod or something) at a faster
or slower rate than was original recorded. if you're playing it back
faster, there are more samples per second than when recorded and the pitch
will be raised (this is like "fast-forward" with the old analog tape
technology). if you're playing it back slower, there are fewer samples per
second than when recorded and the pitch is lowered.
i know i have done fast-forward with a CD player and the pitch wasn't
raised but the music was chopped up, so it sounded glitchy besides being
fast tempo. WSOLA could be employed in real time to make that fast forward
sound less glitchy (a phase vocoder would insure no glitches), have the
same pitch as when recorded, *and* still be sped up in tempo.
Post by Alex Dashevski
In the beginning of your answer, you said that I need to use WSOLA with
resampling.
*if* you're doing pitch-shifting. and pitch-shifting in real-time makes
sense.
but time-scaling with live input in real-time does not make sense. and
it's not because of issues regarding finite computational bandwidth. it's
because we can't look into the future (if you're speeding things up) nor
indefinitely into the past (with a finite amount of memory) if you're
slowing things down.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Alex Dashevski
2018-09-30 18:53:27 UTC
Permalink
Hi,

You said that it is impossible to change tempo of playing in real time on
audio buffer. Correct ?
It is possible only to shift pitch. Correct ?
But if I shift pitch and don't change the rate , is it the same as change
the rate and don't change the pitch ?


‫בתאךיך יום א׳, 30 בס׀ט׳ 2018 ב-10:30 מאת ‪Alex Dashevski‬‏ <‪
Post by Alex Dashevski
I need to undrestand how implemet pitch shift on audio buffer based on
wsola and resample.
Could you help ?
Thanks,
Alex
‫בתאךיך יום ה׳, 27 בס׀ט׳ 2018 ב-22:44 מאת ‪robert bristow-johnson‬‏ <‪
Post by robert bristow-johnson
---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Thu, September 27, 2018 2:15 am
--------------------------------------------------------------------------
Post by Alex Dashevski
"then, in real-time, you can use the time
scaler make the more or fewer samples per block to be the same as
normal."
this was in my original answer and it was about an application of
time-scaling to the playback of audio from a mass storage device (i think
either a hard disk or a CD or an MP3 from an iPod or something) at a faster
or slower rate than was original recorded. if you're playing it back
faster, there are more samples per second than when recorded and the pitch
will be raised (this is like "fast-forward" with the old analog tape
technology). if you're playing it back slower, there are fewer samples per
second than when recorded and the pitch is lowered.
i know i have done fast-forward with a CD player and the pitch wasn't
raised but the music was chopped up, so it sounded glitchy besides being
fast tempo. WSOLA could be employed in real time to make that fast forward
sound less glitchy (a phase vocoder would insure no glitches), have the
same pitch as when recorded, *and* still be sped up in tempo.
Post by Alex Dashevski
In the beginning of your answer, you said that I need to use WSOLA with
resampling.
*if* you're doing pitch-shifting. and pitch-shifting in real-time makes
sense.
but time-scaling with live input in real-time does not make sense. and
it's not because of issues regarding finite computational bandwidth. it's
because we can't look into the future (if you're speeding things up) nor
indefinitely into the past (with a finite amount of memory) if you're
slowing things down.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
gm
2018-09-27 13:17:24 UTC
Permalink
I had different solution, where the lag is reset to zero during a
musical period.

Kind of a tape speed-up effekt without the pitch change.

Not always useful though.
Post by Jacob Penn
Ahh yeah I gotcha,
Yes, in the case of slow down, there Is a finite amount youb> slow down based on the size of the circular buffer of input data in use.
In my personal applications I offer users the ability to restart the
stretch from the writehead at a musical value. Conveniently the
slowest rate for this control will stop the overflow ; )
Can sound quite nice!
Best,
insignia <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU
612.388.5992
On September 26, 2018 at 2:21:29 PM, robert bristow-johnson
Post by robert bristow-johnson
---------------------------- Original Message
----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Wed, September 26, 2018 5:00 pm
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the
previous
Post by Jacob Penn
email, youb>> youb>> > be lacking the necessary information to move faster across the
buffer from
Post by Jacob Penn
the write head position.
Youb>> speed it
up.
no, even if you slow it down, any finite-sized buffer will eventually
overflow.B i presume you mean time-scaling (not pitch shifting) using
WSOLA.
by "real-time", i mean live samples going in and (assuming no sample
rate conversion) the same number of samples going out in a given
period of time.B with an upper bound of delay (and the lower bound is
imposed by causality) and the process can run indefinitely.B so if
you're slowing down audio in real-time and you're running this
process for a day.B or for a year.
--
"Imagination is more important than knowledge."
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
alex dashevski
2018-09-27 13:58:24 UTC
Permalink
Hi,

I don't understand what do you mean. Could you explain ?



2018-09-27 16:17 GMT+03:00 gm <***@voxangelica.net <mailto:***@voxangelica.net> >:



I had different solution, where the lag is reset to zero during a musical period.

Kind of a tape speed-up effekt without the pitch change.

Not always useful though.



Am 26.09.2018 um 23:25 schrieb Jacob Penn:

Ahh yeah I gotcha,B



Yes, in the case of slow down, there Is a finite amount youb to slow down based on the size of the circular buffer of input data in use.



In my personal applications I offer users the ability to restart the stretch from the writehead at a musical value. Conveniently the slowest rate for this control will stop the overflow ; )



Can sound quite nice!



Best,B



<http://jakemumu.github.io/>

JACOB PENN.MUMUKSHU
612.388.5992



On September 26, 2018 at 2:21:29 PM, robert bristow-johnson (***@audioimagination.com <mailto:***@audioimagination.com> ) wrote:



---------------------------- Original Message ----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
From: "Jacob Penn" <***@gmail.com <mailto:***@gmail.com> >
Date: Wed, September 26, 2018 5:00 pm
To: ***@audioimagination.com <mailto:***@audioimagination.com>
music-***@music.columbia.edu <mailto:music-***@music.columbia.edu>
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks is like the previous
email, youb pitching things up, as youb > be lacking the necessary information to move faster across the buffer from
the write head position.
Youb signal, and not speed it
up.
no, even if you slow it down, any finite-sized buffer will eventually overflow.B i presume you mean time-scaling (not pitch shifting) using WSOLA.

by "real-time", i mean live samples going in and (assuming no sample rate conversion) the same number of samples going out in a given period of time.B with an upper bound of delay (and the lower bound is imposed by causality) and the process can run indefinitely.B so if you're slowing down audio in real-time and you're running this process for a day.B or for a year.


--

r b-jB B B B B B B B B B B B B ***@audioimagination.com <mailto:***@audioimagination.com>

"Imagination is more important than knowledge."
B

B

B

B

_______________________________________________
dupswapdrop: music-dsp mailing list
music-***@music.columbia.edu <mailto:music-***@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp
gm
2018-09-27 14:20:41 UTC
Permalink
when you slow the resynth signal down (time stretch)

you will eventually run out of buffer memory.

In this case I reduce the lag of the signal (the time stretch) to 0

within a certain time, which is determined by the bpm of the host and

a given time measured in beats, for instance, 1 quarter or one 1/16.

This gives an inverse time stretch (time compression) which is similar

effekt to a tape speeding up, but with a fixed pitch.

This is an implementation detail which is not relevant to your basic
question,

and it's probabaly not the best solution either.

Your question was, do you need resampling, and my answer to that is

you do *not* need *proper* resampling with filtering etc, you just play

your grains at different speeds like in a sampler, so you need interpolation

between samples. HTH

I found a very efficient implementation for WSOLA, that is,

for the similarity problem, which works without correlation in my case,

and is very well suited for real time implemantation,

but unfortunately I can not discuss it in detail at the moment.
Post by alex dashevski
Hi,
I don't understand what do you mean. Could you explain ?
I had different solution, where the lag is reset to zero during a musical period.
Kind of a tape speed-up effekt without the pitch change.
Not always useful though.
Ahh yeah I gotcha,B
Yes, in the case of slow down, there Is a finite amount youb
to slow down based on the size of the circular buffer of input
data in use.
In my personal applications I offer users the ability to
restart the stretch from the writehead at a musical value.
Conveniently the slowest rate for this control will stop the
overflow ; )
Can sound quite nice!
Best,B
insignia <http://jakemumu.github.io/>
JACOB PENN.MUMUKSHU
612.388.5992
On September 26, 2018 at 2:21:29 PM, robert bristow-johnson
---------------------------- Original Message
----------------------------
Subject: Re: [music-dsp] WSOLA on RealTime
Date: Wed, September 26, 2018 5:00 pm
--------------------------------------------------------------------------
Post by Jacob Penn
You can indeed do it on real time audio but the tricks
is like the previous
Post by Jacob Penn
email, youb pitching things up, as youb > be lacking the
necessary information to move faster across the buffer from
Post by Jacob Penn
the write head position.
Youb signal, and not speed it
up.
no, even if you slow it down, any finite-sized buffer will
eventually overflow.B i presume you mean time-scaling (not
pitch shifting) using WSOLA.
by "real-time", i mean live samples going in and (assuming
no sample rate conversion) the same number of samples
going out in a given period of time.B with an upper bound
of delay (and the lower bound is imposed by causality) and
the process can run indefinitely.B so if you're slowing
down audio in real-time and you're running this process
for a day.B or for a year.
--
"Imagination is more important than knowledge."
B
B
B
B
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Alex Dashevski
2018-10-01 16:30:19 UTC
Permalink
Hi,

I got this answer from Robert:
WSOLA fundamentally does time-scaling. time compression or time stretching
without changing pitch. time-scaling is not normally thought of as
real-time because your input and output buffer pointers will collide.


My question is:
Why buffers will collide ?

Thanks,
Alex
Nuno Santos
2018-10-01 16:42:55 UTC
Permalink
Hey Alex,

Have you seen this article before?

https://www.surina.net/article/time-and-pitch-scaling.html <https://www.surina.net/article/time-and-pitch-scaling.html>

It has a complete and detailed description on how time and pitch scaling works.

Hope it helps!

Best regards,

Nuno
Hi,
WSOLA fundamentally does time-scaling. time compression or time stretching without changing pitch. time-scaling is not normally thought of as real-time because your input and output buffer pointers will collide.
Why buffers will collide ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Alex Dashevski
2018-10-01 17:00:57 UTC
Permalink
Hi,
Yes. I have seen it but I didn't find the answer on my question.

Thanks,
Alex

‫בתאךיך יום ב׳, 1 באוק׳ 2018 ב-19:46 מאת ‪Nuno Santos‬‏ <‪
Post by Nuno Santos
Hey Alex,
Have you seen this article before?
https://www.surina.net/article/time-and-pitch-scaling.html
It has a complete and detailed description on how time and pitch scaling works.
Hope it helps!
Best regards,
Nuno
Hi,
WSOLA fundamentally does time-scaling. time compression or time
stretching without changing pitch. time-scaling is not normally thought of
as real-time because your input and output buffer pointers will collide.
Why buffers will collide ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Nigel Redmon
2018-10-01 17:44:25 UTC
Permalink
I think if you try to code up a simple pitch shifter—say, with linear interpolation—you’ll figure it out pretty quickly. You have to write a sample before you read it, obviously, and to pitch up, the read pointer is moving faster than the write pointer—or slower to pitch down. The faster one will overtake the slower in a circular buffer. The bigger the buffer (and more initial delay to pitch up), the longer you can go before the collision, but the farther you get from anything resembling real time.

Depending on the circumstances, you can do tricks like resetting the read pointer (like a ramp waveform), relative to write, and chop up the audio. For instance, I did that in Echo Farm for the reverse echos. But as Robert said, if you stretch/compress time, and do pitch shifting up/down but he same factor, your position doesn’t grow or shrink over time. You just have a constant delay.
Post by Alex Dashevski
Hi,
Yes. I have seen it but I didn't find the answer on my question.
Thanks,
Alex
Hey Alex,
Have you seen this article before?
https://www.surina.net/article/time-and-pitch-scaling.html <https://www.surina.net/article/time-and-pitch-scaling.html>
It has a complete and detailed description on how time and pitch scaling works.
Hope it helps!
Best regards,
Nuno
Hi,
WSOLA fundamentally does time-scaling. time compression or time stretching without changing pitch. time-scaling is not normally thought of as real-time because your input and output buffer pointers will collide.
Why buffers will collide ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp <https://lists.columbia.edu/mailman/listinfo/music-dsp>
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp <https://lists.columbia.edu/mailman/listinfo/music-dsp>_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Eugene Cherny
2018-10-01 18:17:53 UTC
Permalink
_______________________________________________
dupswapdrop: music-dsp mailing list
music-***@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp
Alex Dashevski
2018-10-03 20:55:37 UTC
Permalink
Hi,
Could you tell me how to use soundTouch API if I want only to do resampling
?
I mean: convert from 48Khz to 8Khz or 8Khz to 48Khz
I guess that setRate with SETTING_USE_AA_FILTER. What length should put ?

I talk about
https://gitlab.com/soundtouch/soundtouch/tree/master/source/SoundTouch

Thanks,
Alex

‫בתאךיך יום ב׳, 1 באוק׳ 2018 ב-19:46 מאת ‪Nuno Santos‬‏ <‪
Post by Nuno Santos
Hey Alex,
Have you seen this article before?
https://www.surina.net/article/time-and-pitch-scaling.html
It has a complete and detailed description on how time and pitch scaling works.
Hope it helps!
Best regards,
Nuno
Hi,
WSOLA fundamentally does time-scaling. time compression or time
stretching without changing pitch. time-scaling is not normally thought of
as real-time because your input and output buffer pointers will collide.
Why buffers will collide ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Evan Balster
2018-10-04 21:52:51 UTC
Permalink
A simpler answer:

You can't double the speed of the audio coming from a microphone as you
play it out the speaker, because the microphone only provides 1 second of
audio every second. If you doubled the speed you would only have 1/2
second of audio output every second.

You can *totally *double the speed of a sound file, synthesizer or some
other non-realtime sound source. You just need to grab twice as much audio
before you use your speed-changing algorithm to "resize" to the necessary
amount.

If you're doing the latter, just ignore all the confusing "it can't be
done" responses. If you're trying to change the pitch on mic input, what
you need to do is time-stretch (or time-squish) the audio and then use
resampling to resize it back to the original length. That will leave you
with 1 second per second of audio, just at a different pitch. Make sure
the length comes out *exactly *the same or you'll get crackles!

– Evan Balster
creator of imitone <http://imitone.com>
Post by Alex Dashevski
Hi,
Could you tell me how to use soundTouch API if I want only to do
resampling ?
I mean: convert from 48Khz to 8Khz or 8Khz to 48Khz
I guess that setRate with SETTING_USE_AA_FILTER. What length should put ?
I talk about
https://gitlab.com/soundtouch/soundtouch/tree/master/source/SoundTouch
Thanks,
Alex
‫בתאךיך יום ב׳, 1 באוק׳ 2018 ב-19:46 מאת ‪Nuno Santos‬‏ <‪
Post by Nuno Santos
Hey Alex,
Have you seen this article before?
https://www.surina.net/article/time-and-pitch-scaling.html
It has a complete and detailed description on how time and pitch scaling works.
Hope it helps!
Best regards,
Nuno
Hi,
WSOLA fundamentally does time-scaling. time compression or time
stretching without changing pitch. time-scaling is not normally thought of
as real-time because your input and output buffer pointers will collide.
Why buffers will collide ?
Thanks,
Alex
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
_______________________________________________
dupswapdrop: music-dsp mailing list
https://lists.columbia.edu/mailman/listinfo/music-dsp
Continue reading on narkive:
Loading...