lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Vibed - Issues exporting at 192 kHz

Open zonkmachine opened this issue 1 year ago • 6 comments

System Information

Ubuntu 22.04

LMMS Version(s)

1.2.2, master at bda042e1e

Bug Summary

Vibed has issues exporting at 192 kHz.

Expected Behaviour

It exports at 192 kHz all the time?

Steps To Reproduce

Export VibedExport.mmp.txt at 192 kHz! (remove .txt) Observe the curve (see image). Export the project again but adjust the knob Length (string length) to 2. The exported soundfile now looks like expected.

The steps above was done with fpe debugging flags set so no floating point errors detected.

Screenshots / Minimum Reproducible Project

vibed

zonkmachine avatar Apr 23 '24 18:04 zonkmachine

If you are talking about oversampling, that is indeed bugged and i remember @LostRobotMusic campaigning for it to be removed.

Rossmaxx avatar Apr 23 '24 18:04 Rossmaxx

If you are talking about oversampling,

I'm not. I'm talking about ~~export frequency~~ sampling rate. Please test the steps above.

zonkmachine avatar Apr 23 '24 18:04 zonkmachine

...Sampling rate.

zonkmachine avatar Apr 23 '24 18:04 zonkmachine

Please test the steps above.

That's my main limitation rn. I don't have my pc with me so can't test anything.+ College sucking up my time and energy.

Rossmaxx avatar Apr 23 '24 19:04 Rossmaxx

This is caused in the constructor of VibratingString.cpp. Line 46 seems to be the relevant line: https://github.com/LMMS/lmms/blob/71dd300f43d6c1e69cbf1362174a8747427ff248/plugins/Vibed/VibratingString.cpp#L46

m_oversample is 0 here which means that stringLength becomes 1.

Why is m_oversample though? That's because of this line in the constructor: https://github.com/LMMS/lmms/blob/71dd300f43d6c1e69cbf1362174a8747427ff248/plugins/Vibed/VibratingString.cpp#L39

oversample is set to 1, sampleRate is set to 192000 and Engine::audioEngine()->baseSampleRate() is 44100.

This gives 2 * 1 / (192000 / 44100) ~ 2 / 4.35 ~ 0.46. This rounds down to 0 for the int.

michaelgregorius avatar Apr 24 '24 20:04 michaelgregorius

I wonder... should the plugins really know about any other sample rates than the one they're supposed to spit out samples at? I mean, is there (and should there be) a difference between e.g. 88200 Hz and 44100 Hz with 2x oversampling?

softrabbit avatar Jun 28 '24 09:06 softrabbit

IMO the plugins should only know about the sample rate that the DAW tells it to process data at. This is the sample rate at which audio is coming in and expected to come out of the plugin. This is how it's implemented in all the plugin standards, e.g. VST, CLAP, etc., as well.

The plugin should not access any other data from the DAW. In fact "regular" plugins cannot even do that because DAWs are different and all they know is the interface of the plugin standard they are implemented in.

michaelgregorius avatar Jun 30 '24 16:06 michaelgregorius