[etoys-dev] Etoys: Sound-kfr.16.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jul 17 10:19:04 EDT 2011


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!



More information about the etoys-dev mailing list