Pre-release SP 3.2 (test of midi support)
-
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=hyCIpKAIFyoIn 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/files/SetupSketchyPhysics3.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.
-
Hello!
I installed the SP3.2, it works really good.
And the "Piano-JukeBox7" is awesome, its not slow in frame-rate.
I had seen the Animusic Movies before and think thats great done.The piano works great, and I add a little stuff to it, when it press the key you the key "lights up" red.
Cause when I see at the cool simulation its a little bit hard to see which key thats playing.
It's done with a simple on/un-touch that you use, and works great.Fun that you fixed the bug
Fixed bug where solids would drop into floor first time you run..
It was a bit boring, but now it works great that to.
/hpnisse -
Good idea. I though of doing that but then forgot.
-
I'm not sure if this is the right place to ask but here goes. Is it possible to open text files from within a simulation. All those midi hashes in the piano would seem to be screaming for such an input and the animations I am trying (with limited) success in regular ol' ruby script are using a list of coordinates read from a data file. Any insights as to if/when this might be possible would be great.
-
I am not exactly what you are asking for. Did you know that at any point in the simulation you can pause it then save the model. That will capture that frame in time. Is that what you need?
@unknownuser said:
Chris (or anybody else that might have a clue!), what do you think of some sort of way to snapshot the current state of the simulation - objects, camera, etc - much like you can do with scenes, except aware of where SP thinks everything is at the moment?
I don't mind poking around in the code, but if you've got a suggestion that might move me along in the right direction while reducing code poking, I'd be grateful.
The goal is to be able to make smoother transitions between animation sections. Usually my objects need to undergo pretty complex movements that I have a hard time setting up in a single scene and one set of hinges/rules. So I break the movements into more reasonably code-able sections and then stitch them together later.
The awkward part, then, is remembering where we were at the very end of the previous segment.
Jay
-
@unknownuser said:
I've seen mention of a recent addition - that of being able to follow a path. Could someone point me to where to look for some examples, documentation, etc, for this?
Jay
I downloaded all the important models for SP 3.1 and added them to the 3D warehouse some time ago.
http://sketchup.google.com/3dwarehouse/cldetails?mid=74935b1dd67b7cd7192c214610ae5bb8Curves Test and Curves Controllers are very good examples of path following.
-
Ya SU is a little rusty on curves so the setup is a little different.
SU itself only creates curves with the circle and arc tools, and the add_curve function in Ruby, which is all very limiting.
So the best thing to do is getting the Weld plugin for SU, or any of the various spline plugins that let you make curves with alot more precision and ease.
When you have a curve, right-click it and go to SketchyPhysics -> Make physics curve, this will give you a prompt for a new name, write it and hit OK, and you got your curve set up.Now a couple of extra tips:
- closed curves don't have a predefined start point (so every time you open your model the starting point will be different, sometimes it even switches between simulations)
- curve orientation sometimes changes (it may move in one direction once created, and then switch after opening the model again, I'm sure there is a reason for this, but I haven't yet found it)
Advertisement