Page 5 of 5

Re: sound freezer

Posted: Sun May 04, 2014 2:33 am
by tester
I'm having a problem with that "mem" thing in FS.

Should I connect the "mem 2 float array" to that mem node, and refresh the output array by flip/floping a selector? And then use "float array section" primitive to extract a lenght of that array compatible with loop size?

//edit:
It looks we wrote in the same time.

Re: sound freezer

Posted: Sun May 04, 2014 2:39 am
by KG_is_back
it is better to use mem-read primitive connected to an analyzer primitive (with respective index ramp calculator connected to read of course).

Re: sound freezer

Posted: Sun May 04, 2014 2:47 am
by tester
Signal analyzer is not blue, is poly.

Re: sound freezer

Posted: Sun May 04, 2014 2:53 am
by KG_is_back
It will not be in the blue line... it will be separate... look here

Re: sound freezer

Posted: Sun May 04, 2014 2:59 am
by tester
Ah, I see. Btw, my alternative thought was this one.
Okay, thanks. Will explore it tomorrow, because right now the morning is coming... :-)

Re: sound freezer

Posted: Sun May 04, 2014 5:01 pm
by tester
KG_is_back wrote:in my schematic in off state the freezer writes data to index [0] and reads from index[0] afterwards. In writing mode it writes to indexes 1,2,3,... until zero crossing is found and looping mode turns on. In looping mode it writes to index [0] and reads indexes [0] to period length.
the memory is fixed size - to save one period from it you have to extract section [0] to [period length].

note that there is a parameter which defines the minimum period length (basically defines how long is the algorithm latent after finding first zero crossing and stating to search for the second one). That should be calculated with from the pitch of your signal and some "tolerance" like:
minimal period length [in samples]=0.99[tolerance of 1%]*2/f[normalized frequency]


So just to clarify few things, because I'm doing final (successful) wiring.

1) Tolerance thing will output amount of samples, yes? That is - if I have 44100Hz sampling rate and 100Hz, then single cycle wave will be 441 samples long, and tolerance values for 1% will be somewhere around 432 samples, after which the algo seeks for zero crossing. Yes?

2) I noticed, there are slight differences in array values between your analyzer based capturing and my rough approach with re-switchable selector. It happens at un-even values (like 101Hz). If I understand correctly - analyzer is doing better smothing job on array values, to give better wave as a result, yes?

3) I noticed in your schematic, you are using in the analyzer some 1-sample limiters. One for reducing amount of samples by 1 (analyzer) and one to "read" primitive (in general), to shift index by one. I'm not sure if I understand the practical meaning of this?

Re: sound freezer

Posted: Sun May 04, 2014 5:44 pm
by KG_is_back
tester wrote:1) Tolerance thing will output amount of samples, yes? That is - if I have 44100Hz sampling rate and 100Hz, then single cycle wave will be 441 samples long, and tolerance values for 1% will be somewhere around 432 samples, after which the algo seeks for zero crossing. Yes?


correct. Or as I've mentioned above you can define it relatively. convert your found pitch to period length in samples and multiply that with the tolerance which is 1-x% (in case you what 1% tolerance multiply period length with 0.99)

tester wrote:2) I noticed, there are slight differences in array values between your analyzer based capturing and my rough approach with re-switchable selector. It happens at un-even values (like 101Hz). If I understand correctly - analyzer is doing better smothing job on array values, to give better wave as a result, yes?


some frequencies do not have integer period in samples, but the captured loop is always integer. For example Nyquist frequency has 2sample period. but frequency Nyquist*4/5 has period of 2,5sample. If you capture that loop with zero crossing method you'll get randomly 2 or 3 sample loop.
I do not exactly know why you have different results - it might be only an offset.

tester wrote:in your schematic, you are using in the analyzer some 1-sample limiters. One for reducing amount of samples by 1 (analyzer) and one to "read" primitive (in general), to shift index by one. I'm not sure if I understand the practical meaning of this?


As I have explained before the actual loop is written from index 1 - the index [0] is a "dummy" index that the write primitive writes when no writing should happen. That means it is not part of the loop. That is why read index starts from 1 and not 0. Actually I've just checked and I've made a mistake. The counter starts from 1, so the green +1 is not needed and also the -1 on analyzer is wrong then :oops: sorry my bad...

Re: sound freezer

Posted: Sun May 04, 2014 7:21 pm
by tester
Thanks for additional explanations. I just need to digest it my way, that's why so many questions. :-)
And also sincere thanks for that little project on capturing and saving single-cycle loops.

Maybe the whole sound freezer - isn't able to provide smooth and naturally sounding, seamless, multicycle loops (yet...), but saving single-cycle waves is very useful to some of my other projects.