Close

~sunday 15th december~

A project log for PouleShootClapPool

A new different version of the well-know game, Dance Dance Revolution (DDR)

manglegounounMangèleGOUNOUN 12/15/2024 at 22:230 Comments

~sunday 15th december~ ~Cymballs  Claps~

Today I did finalise the researchs about how to reproduce the cymballs noise on Arduino, I did found it without using an MP3 Arduino's reader however it is not perfect, cymables noise is specifc and very large at the same time.

I did conclude on this code:

const int buzzerPin = 9; // Pin du buzzer 

void setup() {
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  playCymbals();
  delay(2000); // Pause entre les sons
}

void playCymbals() {
  // Durée totale du son des cymbales
  unsigned long totalDuration = 200; // en millisecondes 
  unsigned long startTime = millis();

  // Génération de fréquences aléatoires pour simuler le son des cymbales
  while (millis() - startTime < totalDuration) {
    int freq = random(3000, 8000);       // Fréquences aiguës (3 kHz à 8 kHz)
    int noteDuration = random(10, 50);  // Durées courtes (10 à 50 ms)
    tone(buzzerPin, freq, noteDuration);
    delay(noteDuration); // Attente avant le prochain son
  }

  // Stopper le son après la durée totale
  noTone(buzzerPin);
}

 It will produces random acute notes of random duration to be as close as the one of cymballs. 

Manon finished the instruction about how to recreate our projet, we'll just change some small things.

Moreover I  finally did the other cymballs for our project it has been over 3 weeks that we needed to do this last touch and so now id good.

Tomorrow is the eve of our final presentation, we will upload some photos of our finals project and maybe a video. + maybe we add another small detail as a bonus who knows... 

Discussions