Noob here. Apologies for any painfully obvious answers.
I saw a model railroad with a bunch of non-choo choo animations on the layout. Like tiny Hens scratching the earth, an oil derrick, etc. one such animation was a blacksmith shop using LEDs flickering to simulate the fire. There were also audio events to this animation. There were voices/conversations stored as an audio file being played from an Arduino. Somehow, the architect of this scene accidentally made jumper connections on the Arduino to incorrect pins and…. Shazam!! The led flicker was timed to the audio output from the sound file.
I would like to do this on purpose. You see, my idea is to have an audio file of a thunderstorm and sync in the above manner to an array of high output LEDs projecting on a wall to simulate lightning.
Can anyone share the pin outs and any required sketch code?
I did a search and found results using a device with like seven bands of audio frequencies that you can monkey with. Way more than I need.
To get started, take a look at my World's simplest lighting effect. It uses the Arduino's built-in LED and it "flickers" an LED by turning it on when the loudness is above average and off when below average. That means it adjusts automatically and you get a lot of "LED action" with quiet or loud songs. (It was intended for music but of course it doesn't care what the sound is.)
It works with most Arduino "microphone boards" (as long as the board has a biased-analog output) or I show a bias circuit so you can use a direct line-level or headphone-level audio connection.
You want to make the soundfile hearable so there really will be sound which a microphone sensor can detect transform into a elektric voltage and feed this analog voltage into an anlog input of the microcontroller
The other way is to use a an Operational amplifier which is directly connected to the line-output of the MP3-player
What device will play the soundfile of which soundfile-format?
Analysing the digital data will be more complicated than feeding an analog nicrophone signal or a analog line-out signal into an analog input
Except you use an MP3-player whith a special edited soundfile
leftchannel the real sound, right channel from you added "soundpulses" that were feeded into an anlog input of the microcontroller
My idea was to sample the beginning of the sound file, flash on the loud parts, then buffer a (random?) number of seconds and then "pass" the data stream to the DAC for amplification/output. The lighting flashes are timed to the audio file. I've seen random LED flashes followed by the sound file playing, but the flashes are not based on the sound file. Looks fake. With my idea, I guess the whole problem is the buffer. I guess there's not enuf on-board memory to buffer a few seconds of digital audio. To me, this is kinda surprising. I'll keep playing with this. Thanks for your ideas.