<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Folks -<div><br></div><div>I just tweaked the PluckedSound timbre so it sounds better (*).  Also now if you have a keyboard (ie synthesizer) in your world, you can evaluate</div><div><span class="Apple-tab-span" style="white-space:pre">     </span><span style="color: rgb(0, 128, 0); font-family: Monaco, courier; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(243, 243, 243); display: inline !important; float: none; ">AbstractSound.bachFugueOn(PluckedSound.default()).play()</span></div><div>to play a 4- part Bach fugue in stereo.</div><div><br></div><div>  - Dan</div><div><br></div><div>(*) The PluckedSound algorithm is incredibly simple:  It just fills a buffer with random numbers (ie white noise) and then, while it plays the buffer it also repeatedly averages adjacent samples.  This has the effect of a low-pass filter, so the white noise quickly settles down to the lower harmonics, and eventually settles down to just the fundamental note.  The problem, which you might have heard if you played around with it, is that the higher notes damp out too quickly and sound less like a plucked string and more like tapping on a tin can.</div><div><br></div><div>This morning i woke up with the realization that at higher frequencies we should not just average adjacent samples (makes the note die down too quickly), but instead should do something more like a 10-to-1 blend.  It did in fact make the higher notes sound better, so I now have added a factor (this.damp) that is scaled to the pitch of the note for frequencies above 400 Hz.  Check it out.</div><div>-------------</div><div><div>On Feb 17, 2012, at 3:36 PM, Daniel Ingalls wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yayy!  I think I'm done for a while.  Stereo separation works now, and the sounds are much better.<div><br></div><div>The PluckedString algorithm is inherently noisy so now we can move on to FM.</div><div><br></div><div>But, hey, check out the sounds now, still at...</div><div><br></div><div>   <a href="http://lively-kernel.org/repository/webwerkstatt/users/Dan/SoundTest3.xhtml">http://lively-kernel.org/repository/webwerkstatt/users/Dan/SoundTest3.xhtml</a></div><div><br></div><div>   - Dan</div><div><br></div><div>PS Alan: The lower voices are given higher volume in the score, so that is explained as well.</div></div></blockquote></div><br></body></html>