Skip to content

Commit 2c9eff4

Browse files
MicheleCarboneraMicheleCarbonera
authored andcommitted
rename params music class
1 parent 37efde2 commit 2c9eff4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

music.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def play_pause(self, duration):
6969
# @param note: name of the note in the following format "A2"
7070
# @para alteration: if it is a diesis or a bemolle
7171
# @param time: duration of the note in seconds
72-
def play_note(self, note, instrument='piano', alteration='none', time=1.0):
72+
def play_note(self, note, instrument='piano', alteration='none', duration=1.0):
7373
print(note)
7474
tfm = sox.Transformer()
7575

76-
time = float(time)
76+
duration = float(duration)
7777

7878
alt = 0.0
7979
if alteration == 'bmolle':
@@ -87,16 +87,16 @@ def play_note(self, note, instrument='piano', alteration='none', time=1.0):
8787
print('note not exist')
8888

8989
tfm.pitch(shift, quick=False)
90-
tfm.trim(0.0, end_time=0.5*time)
90+
tfm.trim(0.0, end_time=0.5*duration)
9191
if self.managerPackage.isPackageAvailable(instrument):
92-
tfm.preview('./sounds/notes/' + instrument + '/audio.wav')
92+
tfm.preview('./sounds/notes/' + instrument + '/audio.wav')
9393
else:
9494
print("no instrument:"+str(instrument)+" present in this coderbot!")
9595

96-
def play_animal(self, instrument, note='G2', alteration='none', time=1.0):
96+
def play_animal(self, instrument, note='G2', alteration='none', duration=1.0):
9797
tfm = sox.Transformer()
9898

99-
time = float(time)
99+
duration = float(duration)
100100

101101
alt = 0.0
102102
if alteration == 'bmolle':
@@ -133,6 +133,6 @@ def play_animal(self, instrument, note='G2', alteration='none', time=1.0):
133133
elif note == 'G3':
134134
shift = 12.0 + alt
135135
tfm.pitch(shift, quick=False)
136-
tfm.trim(0.0, end_time=0.5*time)
136+
tfm.trim(0.0, end_time=0.5*duration)
137137
#tfm.stretch(time, window=20)
138138
tfm.preview('./sounds/notes/' + instrument + '/audio.wav')

0 commit comments

Comments
 (0)