Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Commit

Permalink
v0.2 - Final Iteration
Browse files Browse the repository at this point in the history
~ Corrections de bug et erreurs:
    - Lors d'un son courbé descendant, step est corrigé
    - Correction des boucles for dans la fonction bendTones

~ Refactoring de code
  • Loading branch information
Resethel committed Oct 22, 2017
1 parent 4e4a373 commit 02d952c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Kubot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void Kubot::_tone(float frequency, long noteDuration, long silenceDuration)

// Permet au Kubot de jouer une note courbée
// dans la première itération, le temps par note est fixé à 15ms
void Kubot::bendTones(float initFrequency, float finalFrequency, float step)
void Kubot::bendTones(float initFrequency, float finalFrequency, float _step)
{
bool ascending = (finalFrequency > initFrequency);

Expand All @@ -263,12 +263,12 @@ void Kubot::bendTones(float initFrequency, float finalFrequency, float step)

if (ascending) // Si la frequence final est supérieure
{
for (int i(0) ; i <= 100 ; i += step);
for (int i(0) ; i <= 100 ; i += _step)
_tone(initFrequency + slope*i, 15);
}
else
{
(int i(100) ; i >= 0 ; i -= slope);
for (int i(100) ; i >= 0 ; i -= _step)
_tone(initFrequency + slope*i, 15);
}

Expand Down
2 changes: 1 addition & 1 deletion Kubot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Kubot

//-- Son
void _tone(float frequency, long noteDuration, long silenceDuration = 1);
void bendTones(float initFrequency, float finalFrequency, float step);
void bendTones(float initFrequency, float finalFrequency, float _step);



Expand Down

0 comments on commit 02d952c

Please sign in to comment.