Jump to content

Using MIOS to control Christmas/Holiday Lights via MIDI?


m00dawg
 Share

Recommended Posts

One of the things on my to-do list is to, at some point, setup one of those Christmas/Holiday light setups that are orchestrated to music (ie

). There's already stuff out there to do this fairly easily, but the problem is that, at least the ones I have seen, are not very music friendly - you have to manually take a WAV file and choreograph your lights to that. That seems ugly and complex.

Seems to me that MIDI might be a great answer to this, at least in situations where the music itself was already in MIDI, or at least being timed via a real sequencer. For songs I create myself, this would be awesome, since all my timings are already available to me and the whole thing is already sequenced perfectly.

The mapping would be fairly easy to do too - MIDI channels could be devoted to light strands or groups or an entire control box. Each note could also correspond to a light strand, and velocity, after-touch, etc. could be used to modulate the light in various ways (brightness, twinkle, etc.). Heck that means you could even "play" your lights via a MIDI keyboard. Seems like the MIOS platform should also make this reasonably easy to do, minus figuring out how to actually control the lights themselves (hence trying to figure out

I'm a long way off from figuring out the specifics, such as if existing equipment can be used (such as the D-Light boards) or if a new solution needs to be designed. On top of that, I already need to finish my MB-SID and then start on my MB-64 mixer. So I may not be able to get to this by this year, but seems like a good idea.

Has anyone else tried this before?

Link to comment
Share on other sites

In your quest, you should also check into DMX and Dimmer packs.

Briefly: DMX allows for the access of 512 channels per 'universe.' Each channel can be faded from 0 to 255.

The hardware is essentially RS485.

You might elect to build a protocol converter using MB/MIOS. MIDI in, DMX out -> DMX dimmer/relay packs.

There are several PIC projects for straight PC (RS232) to DMX control. They usually run into some limitations due to framing of the DMX packet.

You might have some of the same difficulties. However, if I remember right, most of those projects were F84 based, and thus suffered from speed limitations, as well as having to bit bang two serial ports (DMX is a serial protocol, but very regimented). An 877 running at 20Mhz must surely be able to cope, with a lot of headroom to spare.

Link to comment
Share on other sites

Here a MIOS32 based MIDI file player, which plays .mid files from a SD card:

http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fexamples%2Fsequencer%2Fmid_player_sd%2F

All you need to do is to add a Tx Callback, parse for the relevant events (e.g. Notes and CCs) and forward them to the lights:


/////////////////////////////////////////////////////////////////////////////
// Installed via MIDI Tx Notificaton hook, called when a MIDI event should be sent
/////////////////////////////////////////////////////////////////////////////
s32 MyMIDIOutSniffer(mios32_midi_port_t port, mios32_midi_package_t package)
{
  if( port == USB0 && (package.event == NoteOn || package.event == NoteOff) ) {
    int light_on = package.event == NoteOn && package.velocity > 0;

    // filter here channel and note number to select a light...
  }

  return 0;
}
[/code]

I've no tips for the best solution to control the lights...

Best Regards, Thorsten.

Link to comment
Share on other sites

I have most of the DMX stuff working at the moment using a modified IIC_MIDI

http://www.midibox.org/dokuwiki/doku.php?id=midiboxdmx

I am currently working on a MIOS32 based version. With the extra performance of the STM32 I plan to replace one of the 'on board' MIDI ports with my simple RS485 circuit rather than using IIC.

Cheers

Phil

Link to comment
Share on other sites

Wow this is all good stuff! I know that the D-Light stuff is planning on DMX support themselves, but it seems like, once built, this thing would be super easy to use for lights. I'll have to look at going it the DMX way as well. As for converting protocols, I could convert between MIDI and D-Light too (their protocol isn't open, but is easy to reverse engineer apparently). I guess it depends on which one is easier to implement and/or cheaper :)

Being able to control lights via MIDI is an exciting idea though and would hopefully get me into finally remixing Carol of the Bells (my favorite holiday tune). I'm going to have to spend some time digesting all this stuff but this shows some good promise!

Link to comment
Share on other sites

So, what hoops do I have to jump through to use this code?  Is hardware available?  I'm slogging through the ATMEGA168 MIDI file player project and I'd much rather use something MB based.

I've got time at the moment (between jobs in our crap economy) so could really use another MB project!  :)

Link to comment
Share on other sites

Helps to search for the right things eh? I tried searching before posting this but failed miserably :) Here's some links for good information:

http://www.midibox.org/forum/index.php/topic,12738.0.html

http://www.midibox.org/forum/index.php/topic,12442.0.html

http://www.midibox.org/forum/index.php/topic,12433.0.html

BAM!

That first one seems close enough to what I want to do, except doing fades can't be done using DOUT but a good start nonetheless and seems fairly simple to do as well.

Link to comment
Share on other sites

Id stick with the midi to DMX512... Its been around for ages, its open, its robust, and it is the standard in the lighting industry (not counting the newer ethernet systems).

If you start working with other protocols, you might get 'locked into' certain hardware and software constraints.

DMX itself has had a hard time gaining traction with their new protocol (DMX2000 or some such) simply because there is already SO MUCH hardware that runs DMX. Why update if we don't have too?

Stick with it and you can run intelligent lights as well. It would open the door for several THOUSAND pieces of old and new hardware.  Don't waste your time reverse engineering a proprietary protocol.

I would also suggest that since the MIOS32 opens the door for several com channels, that you implement a DMX input as well.. This gives you the option of DMX merging your signal onto the back of traditional light board signal. This gives you the choice of "whenever light x goes to %100, trigger midibox sequenced light event y."

It would make it a VERY useful device for theater production, live events/concerts, and nightclubs.

just my thoughts....  not %100 percent reliable ;)

Link to comment
Share on other sites

After doing a bit more digging, it looks like there is quite a bit of information on the forums about how to do this, so yeah, it seems like it might be a good option.

It seems a bit expensive though? I can get a 16 channel light controller from D-Light for $121 which lets me control 16 strands of lights. It's actually PIC-based, so I probably could figure out how they have everything hooked up and try to use a modified MIOS-based PIC, though that seems like it might be more trouble than it's worth. Point is, $121 and I'm basically done :)

I looked around for basically what goes on the other side of the XLR cable and found some DMX relays. They seemed more expensive than I thought it would be though ($100-200 for an 8-channel), or am I missing something here?

Here's some of what I did find:

http://www.lanbox.com/products/LCXDataSheet.html

http://djshop.com/dmx24.html

http://www.bpesolutions.com/dmxproduct.html

The first one might be helpful for people further than myself that might be building it with CORE. It's a one-stop solution and appears to convert MIDI to DMX for you.

Link to comment
Share on other sites

Hi.

There are various cheap dmx dimmers available but I haven't found a kit based one so making your own PCB will be required....

http://www.hoelscher-hi.de/hendrik/english/dimmer.htm

http://www.geocities.com/ph_zone/Digi_Pack/Digi_Pack.html

There is also the DiyLightAnimation website which is probably more relevant for you as it focuses on christmas lights, take a look at:

http://diylightanimation.com/wiki/index.php?title=Main_Page

Cheers

Phil

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...