@@ -69,11 +69,11 @@ def play_pause(self, duration):
69
69
# @param note: name of the note in the following format "A2"
70
70
# @para alteration: if it is a diesis or a bemolle
71
71
# @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 ):
73
73
print (note )
74
74
tfm = sox .Transformer ()
75
75
76
- time = float (time )
76
+ duration = float (duration )
77
77
78
78
alt = 0.0
79
79
if alteration == 'bmolle' :
@@ -87,16 +87,16 @@ def play_note(self, note, instrument='piano', alteration='none', time=1.0):
87
87
print ('note not exist' )
88
88
89
89
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 )
91
91
if self .managerPackage .isPackageAvailable (instrument ):
92
- tfm .preview ('./sounds/notes/' + instrument + '/audio.wav' )
92
+ tfm .preview ('./sounds/notes/' + instrument + '/audio.wav' )
93
93
else :
94
94
print ("no instrument:" + str (instrument )+ " present in this coderbot!" )
95
95
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 ):
97
97
tfm = sox .Transformer ()
98
98
99
- time = float (time )
99
+ duration = float (duration )
100
100
101
101
alt = 0.0
102
102
if alteration == 'bmolle' :
@@ -133,6 +133,6 @@ def play_animal(self, instrument, note='G2', alteration='none', time=1.0):
133
133
elif note == 'G3' :
134
134
shift = 12.0 + alt
135
135
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 )
137
137
#tfm.stretch(time, window=20)
138
138
tfm .preview ('./sounds/notes/' + instrument + '/audio.wav' )
0 commit comments