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

Vibed - Issues exporting at 192 kHz #7221

Open
zonkmachine opened this issue Apr 23, 2024 · 7 comments
Open

Vibed - Issues exporting at 192 kHz #7221

zonkmachine opened this issue Apr 23, 2024 · 7 comments
Labels

Comments

@zonkmachine
Copy link
Member

zonkmachine commented Apr 23, 2024

System Information

Ubuntu 22.04

LMMS Version(s)

1.2.2, master at bda042e

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

@Rossmaxx
Copy link
Contributor

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

@zonkmachine
Copy link
Member Author

zonkmachine commented Apr 23, 2024

If you are talking about oversampling,

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

@zonkmachine
Copy link
Member Author

...Sampling rate.

@Rossmaxx
Copy link
Contributor

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.

@michaelgregorius
Copy link
Contributor

This is caused in the constructor of VibratingString.cpp. Line 46 seems to be the relevant line:

int stringLength = static_cast<int>(m_oversample * sampleRate / pitch) + 1;

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:

m_oversample{2 * oversample / static_cast<int>(sampleRate / Engine::audioEngine()->baseSampleRate())},

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.

@softrabbit
Copy link
Member

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?

@michaelgregorius
Copy link
Contributor

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.

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

No branches or pull requests

4 participants