Sound engine simulator : how add knocking sound effect

hello, I hope you are always in good health

I'm a beginner at programming aduino, this time I tried to program something that looked simple, namely "sound engine simulator", I found the sketch on YouTube and tried to upload it and it ran smoothly, but there was a drawback, namely there were no sound effects when knocking, I wanted to add The sound of the knocking effect but I don't understand the code that needs to be entered. Hopefully someone here can help me solve this problem...

Thank You

Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in https://forum.arduino.cc/c/using-arduino/uncategorized/184.

Note:
Thanks for using code tags in your first post :+1:

oh I'm sorry I didn't know that

Then you need to actually define, for us, what this sound is and how it might be created. We only know what you tell us and our imagination may not be in sync with yours.

To help you, is the knock from incorrect ignition timing, or from worn out rod bearings or worn out main bearings or is the engine diesel and knock is normal running? They all sound different.

1 Like

It would probably help if you posted a link to anything that you used to get to the point you are at now.

Is it supposed to knock? Or are you trying to add it?

TIA

a7

Most sound effects run from a short exert of an actual sound as a wav file, looped over and over with frequency change for speed simulation.

I think you understand my imagination, what I'm aiming for is the sound at the limit when turning on the full throttle, maybe in a petrol vehicle it's very clear... in the sketch it only knocks during acceleration, I want to complete how it works with a petrol engine

I think you understand my imagination, what I'm aiming for is the sound at the limit when turning on the full throttle, maybe in a petrol vehicle it's very clear... in the sketch it only knocks during acceleration, I want to complete how it works with a petrol engine

yes, you are absolutely right... but I want to complete the sound like the petrol engine, idling, acceleration, and the limit sound when fully open

Lots of words, but you have not said a word about what that knock sounds like! The knock is the motor destroying itself because you are using low quality fuel. Are you wanting to self destruct your device?

maybe the video below can explain, https://youtube.com/shorts/h0wRalD6YYA?si=o-KoLvjWkK-Hantj when the rpm is high and the exhaust sound is choppy

An ancient programming truth says "if you can't explain it you can't code it".

1 Like

Is it possible to turn the sound from idling to revving, sir?

because according to the sketch above it sounds like a cat

There is NO sound of engine knock in that video. I do not think you even know what engine knock sounds like.

1 Like

maybe it will be clear i mentioned a sketch for esp32 which smoothly runs that sound, but my project is for atmega 328 there is a description of lastdieselknock

Well, since you have an operational example on the esp32, you have two options. Rather than continue to spend time on the Arduino forum, option 1 is to change your project to run on the esp32, or option 2 is to port the esp32 code to your atmega 328.

oke sir, thanksyou

Fixed that for ya.

a7

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.