-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
last block of analysis is not written #2
Comments
thanks! Could you check the reproducer? Ot doesn't work … |
It should work now. [ok now i could test it and finally it works ... sorry] |
Hm, for me this runs now, but it doesn't find any triggers: (
var fn=Platform.resourceDir +/+ "sounds/a11wlk01.wav";
var f=SoundFile.openRead(fn);
var nf= f.numFrames.debug(\numFrames);
a = SoundFileAnalysis();
a.add(\pn, \trig, { |sig|
var trig = (sig>0) & (Delay1.ar(sig) <= 0);
var count = PulseCount.ar(trig);
var phase = Phasor.ar(0, 1, 0, nf) - nf + 2;
//Poll(phase,count);
[phase, count]
});
x = a.analyzeFile(fn, 0, f.duration, callback: { x.postln });
)
x[\pn] // -> FloatArray[ ] |
exactly. score.add([analysisDuration, buf.writeMsg(path, headerFormat: "AIFF", sampleFormat: "float")]); so one solution would be: score.add([analysisDuration + THAT AMOUNT OF SAMPLES NEEDED TO REACH THE END OF THE BLOCK, buf.writeMsg(path, headerFormat: "AIFF", sampleFormat: "float")]); but i guess that would affect the average value calculations ... |
Probably the duration should be rounded up to the block size. This can be a setting. EDIT: or truncated, then it is more consistent. |
To truncate would be the current situation, right? In my use case I need in addition to a complete analysis of the sound-file a analysis that is one sample longer than the sound-file length.
I like this solution because it avoids unclear settings. But would make the user have to think a lot to find the right solution. I feel like there is no a good naming convention the options
0 or nil for don't trim at all automatically. |
Good idea. The usual way is to use |
Ok will make a pull request
…On 11 May 2020 15:05:33 GMT+08:00, Julian Rohrhuber ***@***.***> wrote:
Good idea. The usual way is to use `nil` for "nothing" (e.g. in
`linlin(clip: nil)`). And because we have integers here, it might be
also possible to use `floor` and `ceil`, which are shorter. But your
suggestion using `roundUp` is also very clear, so it is fine with me.
Do you want to give it a try and fix it?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#2 (comment)
|
I realized that the last block of the analysis is not written to the file.
here a easy reproducer:
the easiest way to overcome the problem is to set the server blockSize to 1.
The text was updated successfully, but these errors were encountered: