Re: [music-dsp] glitch free looping

2017-02-10 Thread Bjorn Roche
On Fri, Feb 10, 2017 at 11:16 AM, Martin Hermant
 wrote:

> @bjorn :
> if i use some fading i think leaning toward crossfading to avoid audio 
> silences part
> these 1/60th of second « gap » is audible right?

I believe I made an assumption that you were talking about looping
rhythms and now I'm not sure if that's true. The solution I described
is something that I found worked well for many sources and was very
simple, but it does depend a lot on what you are trying to do. As r
b-j alluded, the rabbit hole can get very deep, especially if you are
talking about loop points for notes or something like that. If the
1/60th second dropout is likely to matter for your application, then
my solution is useless :(

bjorn
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] glitch free looping

2017-02-10 Thread robert bristow-johnson



hi Martin,
i dunno how deep you wanna get into this. �a few years ago, Olli and i were 
discussing how to define optimal crossfades with constant-voltage crossfade 
between perfectly correlated audio and constant-power crossfades for 
zero-correlated audio and the optimal crossfade for
every correlation in between. �it's 
at�http://music.columbia.edu/pipermail/music-dsp/2011-July/069971.html .
whether you're looping in realtime (as is what is done in a time-domain pitch 
shifter) or you're doing this offline (like defining loop points for 
sample-playback of notes),
you want to be able to slide around the loop points a little and see how well 
the match is and get the best match possible. �that requires either some kinda 
cross-correlation or AMDF or ASDF to make this the most glitch-free. �is that 
something you're looking at?
one last thing, long
before Autotune, Antares was called Jupiter Systems and they had some kinda 
looping software product. �you can actually change the samples of the loop in 
the area around the loop points to change them to the samples they would be if 
crossfading to the other loop point was happening and then
save *only* those samples in the record. �that allows the looping to be a hard 
jump from the end of the loop to the beginning of the loop without clicks.
r b-j



 Original Message 

Subject: [music-dsp] glitch free looping

From: "Martin Hermant" 

Date: Fri, February 10, 2017 9:56 am

To: music-dsp@music.columbia.edu

--



> hi guys,

> we are currently developing an audio looper (soon to be released in 
> opensource!)

> Im facing the classical textbook case problem of glitch/pop free 
> looping

>

> Problematic:

> loops have a defined number of sample (cant change as it is bound to 
> tempo)

> looping point need to be glitch free (no pop due to sudden sample variation 
> between end and beginning of loop)

> need to keep simple playback code ,i.e best if the buffer is processed once 
> then read � normally � (with less possible conditional cases handling these 
> pops in audio callback)

>

> fades in / out is a simple solution but create fake transient at loop points 
> on sustained sounds

>

> Solution implemented so far:

> -classic fade in fade out

> - zero pad befor and after first and last zero-crossing -> still got pops if 
> no fade

>

> Solution I can think about :

> fade in beginning of loop before end point (complexifies playback code, 
> different case when loop need to stop at end)

> some sort of stretching ensuring sample continuity

>

>

> any one can point me to some useful ressources on this?

> any advice or neat techniques?

>

>

> Thanks

>

> Martin

>

> ___

> dupswapdrop: music-dsp mailing list

> music-dsp@music.columbia.edu

> https://lists.columbia.edu/mailman/listinfo/music-dsp





--
r b-j � � � � � � � � �r...@audioimagination.com
"Imagination is more important than knowledge."
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] glitch free looping

2017-02-10 Thread Peter P.
* Martin Hermant  [2017-02-10 11:19]:
> Thanks for these insights!
> 
> @Peter :
> I like the two play heads solution (and I’m already using these for handling 
> sudden jumps)
I like to put it like this:
> still It involves some playback logic, i.e you don’t play the end of the 
> buffer the same way if you are looping or stoping, I’m I right?
I think you are right. In case where you stop, you only read with one of
the playback heads until the end. But in cases where you would do a
short fade-out at the end, it would again turn out to be the same way as
when looping but without fading in to the other playhead.
Put in other words: Crossfading between playheads means fading one out,
the other in. The other one reads a bit ahead of the first, so you need
to have access to a bit more audio date in buffer than your actual loop
length. 
> 
> I‘m in search of a ‘static method’ where buffer is processed once to ensure 
> seamless looping ,
> may be there no such thing? may be it’s not worth it? 
This works easily, but you can not add (overdub) material later, or
change the loop length. 
An example how to do this can be found in the following sox script:
http://plessas.mur.at/devel/musger/mg_seemless

> though, this solution means having an extra zone added to the end or 
> beginning to be able to keep sync (can’t start fade from sample 0 before the 
> last sample is played)
Yes, see comment above.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] glitch free looping

2017-02-10 Thread Martin Hermant
Thanks for these insights!

@Peter :
I like the two play heads solution (and I’m already using these for handling 
sudden jumps)
still It involves some playback logic, i.e you don’t play the end of the buffer 
the same way if you are looping or stoping, I’m I right?

I‘m in search of a ‘static method’ where buffer is processed once to ensure 
seamless looping ,
may be there no such thing? may be it’s not worth it? 

though, this solution means having an extra zone added to the end or beginning 
to be able to keep sync (can’t start fade from sample 0 before the last sample 
is played)


@bjorn :
if i use some fading i think leaning toward crossfading to avoid audio silences 
part
these 1/60th of second « gap » is audible right?



given these advices may be one solution would be to copy fade in/out tails 
directly in the buffer does it sound too harsh?

Thanks again!

Martin
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] glitch free looping

2017-02-10 Thread Bjorn Roche
I've done this before. I can't recall for sure how I solved it, but,
off the top of my head, this is what worked:

Zero crossing for start points and fade-outs for the end points using
a cosine or s-curve works well. There are small problems: finding the
exact right fade-out time without user interaction may be tricky, but
I recall it being shorter than expected (perhaps 1/60th of a second?).
I don't recall ever having to program any sort of "intelligence" into
that. To ensure the zero crossing always works, you may want to
high-pass the incoming audio in case there's a strong DC-offset.

I'm sure other techniques work, like fade-in instead of zero-crossing
for the start-point, but then you have to deal with making sure you
don't weaken the initial transient, which is very important in a loop,
or get too much of the sound before the initial transient.


On Fri, Feb 10, 2017 at 9:56 AM, Martin Hermant
 wrote:
> hi guys,
> we are currently developing an audio looper (soon to be released in 
> opensource!)
> I’m facing the classical textbook case problem of glitch/pop free looping
>
> Problematic:
> loops have a defined number of sample (can’t change as it is bound to tempo)
> looping point need to be glitch free (no pop due to sudden sample variation 
> between end and beginning of loop)
> need to keep simple playback code ,i.e best if the buffer is processed once 
> then read « normally » (with less possible conditional cases handling these 
> pops in audio callback)
>
> fades in / out is a simple solution but create fake transient at loop points 
> on sustained sounds
>
> Solution implemented so far:
> -classic fade in fade out
> - zero pad befor and after first and last zero-crossing -> still got pops if 
> no fade
>
> Solution I can think about :
> fade in beginning of loop before end point (complexifies playback code, 
> different case when loop need to stop at end)
> some sort of stretching ensuring sample continuity
>
>
> any one can point me to some useful ressources on this?
> any advice or neat techniques?
>
>
> Thanks
>
> Martin
>
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp



-- 
-
Bjorn Roche
bjornroche.com
@bjornroche
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp