Skip to content
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

Short audio files don't get played completely #916

Closed
audiofranky opened this issue Jun 6, 2021 · 13 comments · Fixed by #954
Closed

Short audio files don't get played completely #916

audiofranky opened this issue Jun 6, 2021 · 13 comments · Fixed by #954
Milestone

Comments

@audiofranky
Copy link

I am creating a mapping for some drum kit library, and noticed that very short files don't get played out correctly. This happened under Linux, against JACK backend, using sfizz-git, branch "development", commit ID ce2170c.

I have attached a ZIP archive testdata.zip with an example .sfz and 3 short files of pink noise to show the effect.
The 0.2s and 0.1s duration files get played out correctly; the 0.05s file is only played partially.
This is also seen in the enclosed screenshot from a jack_capture run of that session.
truncated_audio

Even though this might look like a "synthetic" test, there are in fact very short (hihat) samples that have roughly the same duration.
I assume this is not some kind of automatic "noise gate" kicking in?
If more info is needed, let me know. Thanks.

@paulfd
Copy link
Member

paulfd commented Jun 6, 2021

There is some form of noise gate but it should not be active here. Thanks for the report !

@jpcima
Copy link
Collaborator

jpcima commented Jun 22, 2021

This is possibly another case of the short sample being interpreted as a wavetable.
Can you try with oscillator=off?

@audiofranky
Copy link
Author

audiofranky commented Jun 22, 2021

Can you try with oscillator=off?

Yes, that seems to be it! I added "oscillator=off" after the tag in several problematic .sfz drumkit files, and in all cases the swallowed or truncated samples now play correctly. So I guess it's an "intelligent" feature that one should be aware of.
The documentation is not very clear about this opcode: https://sfzformat.com/opcodes/oscillator
I wonder whether its default should be off? Anyway, thanks for the hint, most welcome!

@jpcima
Copy link
Collaborator

jpcima commented Jun 22, 2021

It is behavior which imitates cakewalk sfz.
There is a paragraph which mentions this.

Capture d’écran_2021-06-22_23-50-01

@audiofranky
Copy link
Author

Ok, understood..thanks for digging this out.
I still feel like there might be some more drumkit SFZ writers like myself who will find this irritating.
E.g. synthetic Hi-hat samples can be pretty short. Well, whatever, I learnt my lesson :-).

@jpcima
Copy link
Collaborator

jpcima commented Jun 23, 2021

In the end I'm not sure that this feature does us a great service.
It breaks expectations of a user coming from sforzando.
On the other hand sforzando has never implemented the wavetable feature. (not that I know anyway)

@AlexMitchellMus
Copy link
Collaborator

AlexMitchellMus commented Jun 23, 2021

Then again @jpcima sfizz could still support wavetables with oscillator=off as default.

The automatic setting to interpret all short samples as wavetables feels like a drag-n-drop feature anyway. So if a user drags a short sample onto sfizz, the generated sfz could set wavetable to on verbosely.

But even then I think there are better ways to be clear as to the outcome for DnD.

I'm not the biggest fan of magic behaviour, and this has always felt like it.

@jpcima
Copy link
Collaborator

jpcima commented Jun 23, 2021

In cakewalk dropzone, this definitely is a drag-and-drop feature.
Most sound files which are wavetables don't contain a discriminating feature that identifies them with certainty.

But we could use the audio size in frames. Wavetables will extremely likely be a power of 2.
It reduces significantly, although not totally, the probability of error.

@paulfd
Copy link
Member

paulfd commented Jun 24, 2021

In cakewalk dropzone, this definitely is a drag-and-drop feature.
Most sound files which are wavetables don't contain a discriminating feature that identifies them with certainty.

But we could use the audio size in frames. Wavetables will extremely likely be a power of 2.
It reduces significantly, although not totally, the probability of error.

Honestly if this is confusing where < XXX samples, I think a rule that says < XXX samples AND a power of 2 is even more confusing for non-developers.

I'd be more in favor of disabling the auto-detection entirely and let users decide to read the file as a wavetable.

@MTornPDX
Copy link

I'll put in a vote to disable the auto-detection. It caused me a lot of confusion at one point.
Using wavetables is a deliberate and specific choice, so having to enable them manually seems reasonable.

@jpcima
Copy link
Collaborator

jpcima commented Jun 25, 2021

I'd be more in favor of disabling the auto-detection entirely and let users decide to read the file as a wavetable.

Another possibility, it's oscillator=off as default, and oscillator=auto in case of importing audio files.
This preserves the drag-and-drop functionality.

@AlexMitchellMus
Copy link
Collaborator

For DnD function, why do we need auto? Could not the importer set the oscillator mode to on if the sample is heuristicly determined to be a wavetable?

@jpcima
Copy link
Collaborator

jpcima commented Jun 25, 2021

heuristicly determined

it's what oscillator=auto does.

  • size < 3000 frames
  • has wavetable chunks in the audio file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants