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

Commit 02d952c

Browse files
author
Resethel
committed
v0.2 - Final Iteration
~ 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
1 parent 4e4a373 commit 02d952c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Kubot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void Kubot::_tone(float frequency, long noteDuration, long silenceDuration)
254254

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

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

264264
if (ascending) // Si la frequence final est supérieure
265265
{
266-
for (int i(0) ; i <= 100 ; i += step);
266+
for (int i(0) ; i <= 100 ; i += _step)
267267
_tone(initFrequency + slope*i, 15);
268268
}
269269
else
270270
{
271-
(int i(100) ; i >= 0 ; i -= slope);
271+
for (int i(100) ; i >= 0 ; i -= _step)
272272
_tone(initFrequency + slope*i, 15);
273273
}
274274

Kubot.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Kubot
6262

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

6767

6868

0 commit comments

Comments
 (0)