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

Looking for help making sound of a train horn #65

Open
otiv-willem-vanhulle opened this issue Dec 14, 2024 · 1 comment
Open

Looking for help making sound of a train horn #65

otiv-willem-vanhulle opened this issue Dec 14, 2024 · 1 comment

Comments

@otiv-willem-vanhulle
Copy link

Hi, thanks for making this library publicly available.

I am recreating the sound of a train using your library but looking for help.

I have written the following code to reproduce the main frequencies:

    let train_frequences = (organ_hz(452.20) >> delay(0.1)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(602.93) >> delay(0.2)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(624.46) >> delay(0.1)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(646.00) >> delay(0.05)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(689.06) >> delay(0.1)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(710.60) >> delay(0.2)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(882.86) >> delay(0.3)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(904.39) >> delay(0.4)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(925.93) >> delay(0.4)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(947.46) >> delay(0.4)) * lfo(|t| downarc(0.5 * t))
        + (organ_hz(1076.66) >> delay(0.4)) * lfo(|t| downarc(0.5 * t));

However, I am afraid that I am doing something wrong.

The sound that I would like to recreate can be found on https://www.youtube.com/watch?v=9Ptcd5O1i7E

I have computed a spectrogram as well.

spectrogram

From this spectogram I found the main frequencies and I could kind of reproduce them. I have adjusted the delays a bit, so that it sounds more like the sample.

However, it still sounds far from the sample. Am I doing something wrong here? On the spectrogram I see a lot of frequencies in between the loudest ones. Should I add some kind of noise to make it more realistic?

@andrew-otiv
Copy link

(Colleague of Willem) This is more precisely the sound we're mimicking:
https://www.youtube.com/watch?v=f8acEMFSZvI

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

No branches or pull requests

2 participants