POV-Ray : Newsgroups : povray.binaries.animations : Animate a MIDI file : Re: Animate a MIDI file Server Time
8 Jul 2024 09:01:13 EDT (-0400)
  Re: Animate a MIDI file  
From: dan B hentschel
Date: 7 Jan 2005 10:40:00
Message: <web.41deac40e38e401da3fcf12a0@news.povray.org>
"Paolo Gibellini" <p.g### [at] teinoscom> wrote:
> Cool!
> How does your perl script work?
> ;-)
> Paolo

Well, the best way to see that would be to look at the script, itself, now
located on my web page. Here's a quick rundown:

1) Make use of code someone else wrote, in this case, the MIDI Perl module
written by Sean M. Burke, and available from CPAN.
2) Calculate note on-off events in terms of seconds, rather than the "ticks"
unit used in MIDI files.
3) Add enough bugs such that the calculation in step 2 is frustratingly
close to correct, but very slightly off.
4) Output note on-off events to a large POVRay include file with multiple
arrays, and arrays of arrays.
5) Write a handful of macros to parse these arrays to glean meaningful
information.
6) Fudge with the framerate/duration of the resulting animation such that
the bugs mentioned in step 3 are not a problem any more.

There you go. :-) Obviously, I don't really like steps 3/6, so if anyone
wants to take a look at it and recommend a fix for me, that would be great.
I may revisit it agian in the future if I get the motivation, but for now
I'm itching for a new project.

 - dan B hentschel


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.