What little time I have had for SP lately I spent working on a model. It is inspired by this video:
http://www.youtube.com/watch?v=hyCIpKAIFyo
In order to make it work I had to add a few new features to SP (hey its good to be the author).
First I tried using the new sound embedding to make a set of instruments. I soon realized that to make it work it would take a huge amount of .wav samples (one for each note or drum) and that made the file way too big. So I started to look at Midi.
Turns out Win and Mac both support Midi instrument playback and there are huge number of built in instruments samples plus a nice collection of sound effects.
http://www.perfessorbill.com/lyrics/gsinst.htm
And because the midi notes are on/off and velocity based it suites itself well to SP physics ontouch/onuntouch events.
After I got it working (with a lot of help from Kevin) I did the attached drum set.
It works. But depending on your setup it probably sounds like the drummer is on speed or ludes and drunk in the bargain. The beat of the drums is totally dependent on the frame rate.
After some thought I decided to try a piano next. After some work I managed to fix most of the timing problems. Check out the piano example. I its really cool! And I think I know how to make the percussion instruments work now.
It would be easy to fake it and play a note then move a finger. But its done right and the note plays only when a finger touches a key. That involves calculating the delay in the servo and adjusting the score accordingly.
If this version and the demos work for everyone I will clean up the interfaces and a proper 3.2 release.
Chris
http://sketchyphysics.googlecode.com/fi ... 2-Nov1.exe
Here are the changes since the last version:
Changes in version 3.2
- Added midi note support.
- New user events system. Script commands "on" and "signal"
- Wacovs hud code. script commands draw,draw2d,draw3d and view accessor.
- joint.controllerValue now works with motors and gyros
- New script command setFrameRate overrides physics settings framerate.
- Added script command setSoundPosition(sound,position,volume=5.0) Allows 3d audio when called once per tick.
Bugs fixed:
- Fixed a Mac SDL sound crash (thanks Kevin!)
- Fixed sounds not stopping at end of simulation
- Fixed bug where solids would drop into floor first time you run.
- Bug fix. Scripted flag wasnt being observed at runtime.
Other:
Removed a lot of debug spam. Added a little.

