|
|

Linux
| Re: Perl |
Author: Ray Morris
Date: 12-15-08 20:35
This is an old thread, but it's still on the front
page since this forum is so slow. Also for people
who find it via Google I thought I'd add a reply.
To sync the lights with the music via Perl, use
one of the Perl modules which controls an audio
player like xmms, mplayer, or mpg123. I used the
mplayer one. The module will either call your
callback function regularly, passing the current
song position as an argument, and you then process
any lighting commands based on the time provided
by the player. For some modules, such as the one
I used, the module instead allows you to poll for
the current song position. I did that in a tight
loop and then sent the lighting control to the port
based the time time reported by the player. That
should give much better timing than using the wall
clock and comparing it to when you asked the player
to go load the file and start playing it as others
have done or suggested.
As designing the show sequences, I use three tools,
one a Perl program which you might want to hack on if
you come back and read this. I've made a Perl program
that loads up an image of your house, with lights drawn
on it. You play the song at a slow speed and click to
turn lights on and off. That outputs a text file that
you can edit by cutting and pasting to repeat sequences
and that kind of thing. This software is new and is just
to the point where it works, but it's totally unpolished.
I've also hacked the Palace Xmms plugin to automatically
make a show based on the frequencies in the music - a
low bass hit triggers one channel, while a high hat
triggers another. A made converters between the two,
so you can mix and match parts made from my Perl program
with what Palace does.
For fine tuning, the files can be loaded up in Audacity as
labels, so you can look at the waveform of the music and
adjust the lights to go right on the beat. This also gives
a nice viewpoint, with an Audacity channel for each light,
where you can line them up, overlap them, etc. After tweaking
them in Audacity, you can play them back in the Perl program
to see what the changes look like when controlling lights
drawn on the photo of your house.
I did these three things before ever hearing of Vixen, so now
I can go look at Vixen and get ideas.
|
|
| Topics |
Author |
Date |
|
Dave Johnson |
01-07-07 22:52 |
|
Dave Johnson |
01-08-07 02:19 |
|
Joe Kraftchek |
01-08-07 14:24 |
|
Dave Johnson |
01-08-07 03:34 |
|
Matt C |
01-08-07 08:03 |
|
Dave Johnson |
01-09-07 15:27 |
|
Joe Kraftchek |
01-09-07 16:26 |
|
Dave Johnson |
01-09-07 18:09 |
|
Phil Short |
01-09-07 16:43 |
|
Dave Johnson |
01-09-07 18:11 |
|
Phil Short |
01-09-07 19:42 |
|
Joe Kraftchek |
01-09-07 22:15 |
|
Dave Johnson |
02-05-07 01:55 |
|
Ray Morris |
12-15-08 20:35 |
NOTE: You are not currently logged in. If you wish to post any messages to this board, you must be logged in.
You may register here
or login here.
|
|
|