Eine Kleine WindMusik

Dan Ingalls Dan at SqueakLand.org
Fri Jul 26 17:38:24 UTC 2002


Last night it was breezy, and our wind chimes started to play with my head.   Then my head started to play with the wind chimes.  If you want to play too, paste the following code into FMSound and accept it:
-----------------

chimeTest: nNotes delay: avgDelay duration: dur pitchBase: pitchBase
	pitches: chromaticNumbers loudness: avgLoudness
	"D F A C D E"
	"FMSound chimeTest: 30 delay: 300.0 duration: 4.0
		pitchBase: #d6 pitches: #(1 4 8 11 13 15) loudness: 0.2"
	"FMSound chimeTest: 20 delay: 700.0 duration: 6.0
		pitchBase: #d3 pitches: #(1 4 8 11 13 15) loudness: 0.3"

	"G A B D G G"
	"FMSound chimeTest: 30 delay: 500.0 duration: 6.0
		pitchBase: #g5 pitches: #(1 3 5 8 13 13) loudness: 0.2"

	| snd rnd pitches decay |
	pitches _ (AbstractSound chromaticPitchesFrom: pitchBase) atAll: chromaticNumbers.
	decay _ VolumeEnvelope exponentialDecay: 1.0 - (0.08/dur).
	rnd _ Random new.
	1 to: nNotes do:
		[:i |
		snd _ FMSound new.
		snd addEnvelope: decay copy.
		snd setPitch: pitches atRandom dur: dur loudness: rnd next*avgLoudness*2.0.
		"snd modulation: 1.4 ratio: 0.45."
		snd play.
		(Delay forMilliseconds: (rnd next*avgDelay*2.0) rounded+1) wait]

-----------------
Then try out the various do-its and play around with parameters of your own.  The two notes sets correspond to two sets of wind chimes I happen to have around the house.

Try taking off the comments on the modulation line, and playing around with different parameters there.  If you come up with something especially neat, please send it along.

What I'm looking for is three sets of chimes.  I'd like a high twinkly set similar to the first do-it for light winds, then a middle set (don't have one I really like yet) for significant winds, and then a heavily modulated low set for strong steady winds.  I would strike the low notes less frequently than the high ones.

It occurs to me that some howling woodwinds (gradual attack, significant pitch bend) could be very cool for the big winds.  For that matter strings could be good too, along the lines of an aeolian harp.  If you happen to be into wind chimes, I could use some basic instruction about tried-and-true note sets, etc.

Have fun and let me know if you come up with cool stuff.  Needless to say this is destined for the weather station where I have access to the actual current wind speed and recent statistics.  (Discounts available to all who make cool suggestions ;-).

Enjoy
	- Dan



More information about the Squeak-dev mailing list