Jump to content

MIDI controlled LED helmet


evilxsystems

Recommended Posts

So I want to make a thing to stick on top of my head that is covered with LEDs that I can control via MIDI...the obvious choice for this seems to be the MIDIO128.  Do I need any DIN boards or just 1 DOUT board for every 24 LEDs I want on my head?  Can the DOUTs be configured easily so I can turn on the LEDs with note events?  I'd like to sequence the lights with midi note on/offs, it seems like this would be easiest to implement and debug. ;D

Link to comment
Share on other sites

if you use MIOS.. there is a simple example for doing exactly what you want..

Controlling 128 LEDs via MIDI

We want to set/clear LEDs, which are connected to one or more DOUTX4 modules, with Note Events over MIDI Channel #1

Copy the SDCC skeleton into a new directory, open the main.c file and enhance the hooks like described below. Thereafter type "make" in the command shell, and upload the new project.hex file to the core.

Within the Init() function, you have to specify, how many shift registers are connected to the core:

/////////////////////////////////////////////////////////////////////////////

// This function is called by MIOS after startup to initialize the

// application

/////////////////////////////////////////////////////////////////////////////

void Init(void) __wparam

{

  // set shift register update frequency

  MIOS_SRIO_UpdateFrqSet(1); // ms

  // Up to 4 DOUTX4 modules (=16 shift registers = 128 digital outputs) can be connected

  // set the maximum number here - it doesn't really hurt!

  MIOS_SRIO_NumberSet(16);

}

/////////////////////////////////////////////////////////////////////////////

//  This function is called by MIOS when a complete MIDI event has been received

/////////////////////////////////////////////////////////////////////////////

void MPROC_NotifyReceivedEvnt(

  unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam

{

  // a note event provides 128 different note values (0..127)

  // in this simple example, each note sets an individual pin

  // for DOUT pin numbers, see also this documentation:

  // http://www.ucapps.de/mios/mios_pin_list.txt

  if( evnt0 == 0x80 || evnt0 == 0x90 ) {

    // 90 xx 00 is the same like a note off event!

    // (-> http://www.borg.com/~jglatt/tech/midispec.htm)

    if( evnt0 == 0x80 || evnt2 == 0x00 ) {

      // Note Off

      MIOS_DOUT_PinSet(pin, 0);

    } else {

      // Note On

      MIOS_DOUT_PinSet(pin, 1);

    }

  }

}

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...
×
×
  • Create New...