const int buzzerPin = 9; // Replace with the pin connected to your buzzer
// Define the notes identified from the sound effect
const int noteGSharp = 415;
const int noteFSharp = 370;
const int noteDSharp = 311;
// Define the durations for each note in milliseconds
const int durations[] = {30, 10, 5}; // Adjusted for a faster tempo
void setup() {
pinMode(buzzerPin, OUTPUT); // Set buzzer pin as output
playGTAIntroSound();
}
void loop() {
// Play the GTA intro sound
}
void playGTAIntroSound() {
// Define the notes to play
int notes[] = {noteGSharp, noteFSharp, noteDSharp};
// Loop through each note and play it
for (int i = 0; i < sizeof(notes) / sizeof(notes[0]); i++) {
tone(buzzerPin, notes[i]);
delay(durations[i]);
noTone(buzzerPin); // Stop the sound after each note
delay(10); // Add a slight pause between notes
}
}