Etoys: Sound-kfr.16.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Etoys: Sound-kfr.16.mcz

commits-2
Karl Ramberg uploaded a new version of Sound to project Etoys:
http://source.squeak.org/etoys/Sound-kfr.16.mcz

==================== Summary ====================

Name: Sound-kfr.16
Author: kfr
Time: 17 July 2011, 4:18:35 pm
UUID: d1b75986-4b3e-ac4c-9efb-0518e57177c7
Ancestors: Sound-kfr.15

Refactoring of change to make sounds play different pitches

=============== Diff against Sound-kfr.15 ===============

Item was removed:
- ----- Method: Player>>playInstrument: (in category '*sound') -----
- playInstrument: frequency
- | sound soundName |
-
-
- soundName := self costume valueOfProperty: #instrument.
-      sound := SoundService default soundNamed: soundName.
- sound pitch: frequency .
- self costume setProperty: #playingSound toValue: sound.
- SoundPlayer resumePlaying: sound quickStart: true!

Item was added:
+ ----- Method: Player>>playSound: (in category '*sound') -----
+ playSound: frequency
+ | newSound soundName |
+ self stopSound.
+ (soundName := self costume valueOfProperty: #sound)
+ ifNotNil: [newSound := SoundService default soundNamed: soundName.
+ newSound pitch: frequency].
+ (soundName isNil
+ or: [soundName = 'silence'])
+ ifTrue: [newSound := FMSound new
+ soundForPitch: frequency
+ dur: 100.0
+ loudness: 0.3].
+ self costume setProperty: #playingSound toValue: newSound.
+ SoundPlayer resumePlaying: newSound quickStart: true!

Item was removed:
- ----- Method: Player>>setInstrument: (in category '*sound') -----
- setInstrument: aSound
- self costume setProperty: #instrument toValue: aSound.
- !

Item was added:
+ ----- Method: Player>>setSound: (in category '*sound') -----
+ setSound: aSound
+ self costume setProperty: #sound toValue: aSound!

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev