Catching Ghosts
Just a small update. I’ve been busy priming and soldering so there haven’t been many things to share. I added some detail which I’ll post later, but today I want to focus on something I’ve been meaning to do since day one.
I’ve wanted my trap to have the movie capture sound, but I also wanted versions where it sounded like different ghosts were being captured as well. I wanted this to be completely random so there was always a little bit of variation when a ghost is captured.
Thanks to EctoLabs and Countspatula I had a great starting point with the programming. I started asking around and eventually found someone who could help me. The original code does this.
// Play capture SFX
if(sfx==true){
musicPlayer.stopPlaying();
musicPlayer.setVolume(30, 30);
musicPlayer.startPlayingFile("cap1984.mp3");
}
Basically, from what I understand this code basically stops whatever sound is playing, sets the volume and then starts playing the capture sound clip.
What I did was this
<i>
</i>// Audio Track Random
char trackName;
]// Play capture SFX
if(sfx==true){
musicPlayer.stopPlaying();
musicPlayer.setVolume(50, 50);
char trackName[ 13 ];
int group = 4; // can be 1 to 10 for your code
sprintf( trackName, "trk%02d_%02d.mp3", group, random( 8 ) );
Serial.println( trackName );
// output will have the form "trk09_07.mp3", assuming the random number was 7
musicPlayer.startPlayingFile( trackName );
}
What this basically does is, creates an array that builds the track name. It then chooses one at random (between track 00 and 08) and then begins to play it.
The tracks on the SD card are named trk04_00.mp3, trk04_01.mp3 and so on.
Depending on the number it generates it will fill in the “trackName” and play it. So basically what it was doing in the first code snippet, only this one generates a random filename for it to reference.
I ain’t 'fraid!
The next step was to come up with some ghost sounds. I’ll be adding to this as time goes on, but I wanted to start with a variety.
To do this, I took the original sound and then using a multitrack editor found sounds that I could manipulate to sound like ghosts. Some others were a little more special.
Tracks:
-
Capture Sound 1984 - No ghost
-
Tasmanian devils screaming
-
“Slimer” using BBC Sounds of Death and Horror “Mad Gorilla”
-
Cougar (Mountain Lion)
-
Woman Screaming
-
Boogieman: Real Ghostbusters - Season 1 Episode 6
-
SamHain: Real Ghostbusters - Season 1 Episode 8
-
Spongebob
-
Spongebob Screaming
If you would like to use them, you can get them here.
https://drive.google.com/drive/folders/1fySJEYGqWCc9XFHxt3Qe-4AnIQib17_6?usp=sharing
I still have some more ideas for ghosts, but this will get me started. I have some other code tweaks to make as well, but for now I finally have a working trap.