MIDI control for animation

MarkAH

New member
I've just recently ventured into Python scripting for LW.
Have the LW Python Docs, in html format, which are providing the info needed.
It's all arranged in a curious way, with info classes seperate from command classes.
That's OK though, after getting used to it.

I once modeled a grand piano. Not a very new idea, but it's completely rigged in a scene named 'Player Piano'.
The lids, all the keys, all the dampers and the pedals have bones.

So what I wrote with Python is a 'script' that reads MIDI files, and converts the MIDI events into keyframes for the keys and pedals.
The dampers are controlled by the keys, and the sustain pedal.
Might take it further and make the sostenuto pedal work too. Couldn't be all that hard to do.

It was a lot of fun and works great. I will probably post it all somewhere.
Have my own website which is not set up just now.
It did have drupal all set up and then I took it all down.
So I might start over with a new drupal and put up my LW stuff. Free of course.
But just now I'm having too much fun with Python.

Is there a free stuff thread here somewhere?

In the mean time maybe I would put up the model, scene, images, and script for the Player Piano.
People will have to get there own MIDI files though, and the best type to use is 0.
Those are single track.
With multi track MIDI files notes for multiple instruments could create keyframes on top of each other's notes and mess it all up.
 
I've just recently ventured into Python scripting for LW.
Have the LW Python Docs, in html format, which are providing the info needed.
It's all arranged in a curious way, with info classes seperate from command classes.
That's OK though, after getting used to it.

I once modeled a grand piano. Not a very new idea, but it's completely rigged in a scene named 'Player Piano'.
The lids, all the keys, all the dampers and the pedals have bones.

So what I wrote with Python is a 'script' that reads MIDI files, and converts the MIDI events into keyframes for the keys and pedals.
The dampers are controlled by the keys, and the sustain pedal.
Might take it further and make the sostenuto pedal work too. Couldn't be all that hard to do.

It was a lot of fun and works great. I will probably post it all somewhere.
Have my own website which is not set up just now.
It did have drupal all set up and then I took it all down.
So I might start over with a new drupal and put up my LW stuff. Free of course.
But just now I'm having too much fun with Python.

Is there a free stuff thread here somewhere?

In the mean time maybe I would put up the model, scene, images, and script for the Player Piano.
People will have to get there own MIDI files though, and the best type to use is 0.
Those are single track.
With multi track MIDI files notes for multiple instruments could create keyframes on top of each other's notes and mess it all up.

Hey that sounds pretty cool actually. I am also just venturing into Python, but I started in Modeler as I thought that would be easier. Turns out its seen as 'an advanced topic' according to the Python scripting course at Liberty3D - Doh! But I'm stubmbling my way through. Would be great to try out your plugin though...I've got Logic Pro, which is pretty good at turning out midi files ;)
 

darn cool :) hope to see this in the near future.  
tJGL61i.png
 
Further Research

Further adventures in adapting MIDI have lead to some curious situations.
Direct musical notation control of a model is pretty mechanical, and not very useful in general since it is so specific.
I did post the model and script in this thread: https://forums.newtek.com/showthread.php?159547-Concept-Sound-in-Animation

An approach that would open MIDI to more creative use is needed.
The most promising seems to me to be the MIDI Show Control Specification since it does not need to be used real time.
That is it can contain SMPTE time code for the various directives, and some of the more basic ones, such as 'GO' can contain variable length messages.

Seems like the best approach would be to make it possible to use Show Control messages that are contained in the MIDI song, to place Markers in the DopeTrack.
There is a Dopetrack proxy available in the SDK and a command for placing a Marker, but there doesn't seem to be a way to write the Marker comment, without which the Marker is useless.

Also there is little support for Show Control in MIDI software.

So using Program changes and notes would be the most universal approach, but then the MIDI plug-in would turn out to be very proprietary.
One other approach could be to create Custom objects, which seems possible to do with a Layout command, and apparently even without a null.
The custom object could be named to represent a specific cue.
But how to make that clearly represent a keyframe is somewhat problematic.

That might work out. Some testing could ultimately resolve the problem.
 
MIDI Marker Tool

I've built a simple tool that extracts the Marker data from a MIDI file and writes it to a csv list.
The list can then be saved to a file.
The app style script will need wxPython to be installed.
The other script just contains the classes that do the work so they can be incorporated in another tool.

View attachment 144639
 

Attachments

  • MIDI Marker Tool.zip
    4.1 KB · Views: 373
Back
Top