POV-Ray : Newsgroups : povray.binaries.animations : Music/Audio sync Server Time
19 Jul 2024 09:31:54 EDT (-0400)
  Music/Audio sync (Message 1 to 9 of 9)  
From: Chris Johnson
Subject: Music/Audio sync
Date: 2 Jun 2003 07:48:31
Message: <3edb398f@news.povray.org>
Nothing special about the render itself, but the synchronisation between
video and audio is done with a quick program I wrote to convert a MIDI file
into ascii data, which is converted by pov-ray macros into smooth splines
for the movement. A slightly different approach from Pov-3DMiDi
(http://kern.srcf.ucam.org/~mpc33/povdoc.htm), which generates a new .pov
file for every frame.

Next thing I'd like to try is a program which looks at all the movement
macros for e.g. a robot arm, and produces robot movement sounds that
synchronise exactly with all the movement...


Post a reply to this message

From: Chris Johnson
Subject: Re: Music/Audio sync
Date: 2 Jun 2003 07:49:34
Message: <3edb39ce@news.povray.org>
Whoops... and the animation itself is at:

http://homepage.ntlworld.com/thegablehouse/chris-j/xyl3.avi


Post a reply to this message

From: Rune
Subject: Re: Music/Audio sync
Date: 2 Jun 2003 18:45:50
Message: <3edbd39e$1@news.povray.org>
This is pretty cool! However, the illsuion doesn't quite work for me. It
deosn't look like the sound actually comes from the xylophone. I think
it's because the movement of the sticks is not quite right. They should
impack with much higher speed, and bounce back quite a bit further to
produce those clear tones. Another thing to try is to make the image be
just a tad ahead of the sound, because that's far better than having the
image be even the slightest bit behind the sound. Our eyes/ears are far
more forgiving to the former, perhaps because it happens in real life
too, when the source of the sound is at some distance (so the speed of
sound comes into play).

Anyway, this feedback is all about your video. It doesn't say anything
about your program, which seem to work very well!

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated Oct 19)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Flu
Subject: Re: Music/Audio sync
Date: 2 Jun 2003 18:51:11
Message: <3edbd4df$1@news.povray.org>
Check out Animusic (http://www.animusic.com/). I have the first DVD and it
is fantastic. 3D generated music videos created from MIDI files. I've been
wanting to try this myself with POV, but haven't completely decoded MIDI
files yet. Looks like you've beat me to it... :)


Post a reply to this message

From: Chris Johnson
Subject: Re: Music/Audio sync
Date: 3 Jun 2003 13:07:54
Message: <3edcd5ea$1@news.povray.org>
Rune:
You're right, the illusion isn't as good as it could be. The vertical
movement of the sticks is controlled by the equation e^-abs(time-timeofhit),
which is a fairly rough-and-ready approximation to the movement of human
playing. One reason I kept things fairly slow was that I feared that without
motion blur, it might look as though the beaters never hit the bars at all.
Another thing which might improve it is a slight movement of the bars when
each beater hits.

Flu:
Animusic was my inspiration for this :) - see the thread in
povray.animations. I've only seen "Pipe Dream" in full, where its quite
clear what's being hit because everything moves with fairly exaggerated
motions when hit. The only place where the effect falls down slightly, in my
opinion, is with the bongos on the stringed instruments and the snare drum.
Both of these have a very 'tight' sound, yet the balls fall on them quite
slowly. This comes back to Rune's point about the timbre of the sounds not
quite matching the animation.

If you'd like, I'll send you my MIDI reading code - not a very elegant
implementation, but if you, like I, can only find cryptic file format
descriptions on the web it might be of use?


Post a reply to this message

From: BillyB
Subject: Re: Music/Audio sync
Date: 3 Jun 2003 20:12:06
Message: <3edd3956@news.povray.org>
> If you'd like, I'll send you my MIDI reading code - not a very elegant
> implementation, but if you, like I, can only find cryptic file format
> descriptions on the web it might be of use?

Yes please !
I would be interested in a code base to build on wih all the reading MIDI
stuff done for me.

"Chris Johnson" <chr### [at] chris-jcouk> wrote in message
news:3edcd5ea$1@news.povray.org...
> Rune:
> You're right, the illusion isn't as good as it could be. The vertical
> movement of the sticks is controlled by the equation
e^-abs(time-timeofhit),
> which is a fairly rough-and-ready approximation to the movement of human
> playing. One reason I kept things fairly slow was that I feared that
without
> motion blur, it might look as though the beaters never hit the bars at
all.
> Another thing which might improve it is a slight movement of the bars when
> each beater hits.
>
> Flu:
> Animusic was my inspiration for this :) - see the thread in
> povray.animations. I've only seen "Pipe Dream" in full, where its quite
> clear what's being hit because everything moves with fairly exaggerated
> motions when hit. The only place where the effect falls down slightly, in
my
> opinion, is with the bongos on the stringed instruments and the snare
drum.
> Both of these have a very 'tight' sound, yet the balls fall on them quite
> slowly. This comes back to Rune's point about the timbre of the sounds not
> quite matching the animation.
>
> If you'd like, I'll send you my MIDI reading code - not a very elegant
> implementation, but if you, like I, can only find cryptic file format
> descriptions on the web it might be of use?
>
>
>
>
>
>


Post a reply to this message

From: Chris Johnson
Subject: Re: Music/Audio sync
Date: 4 Jun 2003 07:02:30
Message: <3eddd1c6@news.povray.org>
Here's the code in C++, hopefully fairly platform-independent. With regards
to distribution/usage, the usual stuff applies - acknowledge usage and don't
distribute in a modified form.


Post a reply to this message


Attachments:
Download 'midipov.cpp.txt' (8 KB)

From: Flu
Subject: Re: Music/Audio sync
Date: 4 Jun 2003 16:56:33
Message: <3ede5d01$1@news.povray.org>
Thank you! Unfortunately, I have not coded C++ in years but hopefully enough
of it will come back to me. I've got other programmers I can fall back on as
well. You are right about the "cryptic file format descriptions" on the web.
Can I ask what you finally used to decipher it or was it all just trial and
error? I've had ideas for a while about writing my iwn "Animusic" but it
fell to the side. You may have inspired me to jump back into it again.   :)



"Chris Johnson" <chr### [at] chris-jcouk> wrote in message
news:3eddd1c6@news.povray.org...
> Here's the code in C++, hopefully fairly platform-independent. With
regards
> to distribution/usage, the usual stuff applies - acknowledge usage and
don't
> distribute in a modified form.
>
>
>


Post a reply to this message

From: Chris Johnson
Subject: Re: Music/Audio sync
Date: 5 Jun 2003 06:07:01
Message: <3edf1645$1@news.povray.org>
-[Can I ask what you finally used to decipher it or was it all just trial
and error?]-
The best file format description I could find is at
http://www.opennet.ru/docs/formats/midi.txt

I also had to do quite a lot of looking at simple midi files with a hex
editor to clear up exactly how things are done in practise. One thing I
found that differs most file formats is that the number of 'ticks' per
crotchet varies depending on which program has saved the MIDI file: many
guides suggest that only one value, 96 is ever used here.

-[I've had ideas for a while about writing my own "Animusic"]-
Yes, I'd also like to do something of that sort. One thing which daunted me
slightly is the rendering time: it took 30 minutes to render that 6-second
xylophone animation (320x240 on a 1Ghz PIII), which corresponds to 10 hours
minimum for a 2 minute animation, and probably at least double this because
of the additional complexity of several instruments. I know this sort of
rendering time isn't unusual for Pov-Ray (c.f. Gilles Tran's 6-month render
of Cubicle Workers http://www.oyonale.com/ldc/english/cubicle.htm), but it
does make development quite a time-consuming process.


Post a reply to this message

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