Jump to content

MIDI SEQ to DMX 512


macsurfer4
 Share

Recommended Posts

Hey Guys,

I want to use the MidiboxSEQ for DMX Signal Output.

Like this:

Midi Channel 1- DMX Channel 1, Note Number or CC to DMX Value

When you make a Midi sequence you should be able to pick the DMX Modul Output like now the I2C or Aout.

I have only small experience in programming but maybe somebody would like to help this idea go further.

Here are some links about the DMX protocol:

http://de.wikipedia.org/wiki/DMX_%28Lichttechnik%29

http://www.hoelscher-hi.de/hendrik/light/demux.htm

It seems to me that DMX is similar to Midi.

From this website http://www.theater-technisch-lab.nl/dmxdu.htm I have following information:

The DMX 512 signal consists of a repeating Bit-flow

The beginning is marked through a "0" send for 88us, this is called "break"

After the break signal the "startbyte" follows. This startbyte assigns the target for the following bytes. After the startbyte maximal 512 Bytes follow up with information for the control channels.

The potential between the conductors of the cable is +2,5V or -2,5 V. If the potential is positiv for 4 us it is a "1", if the potential is negative for 4 us it is a "0"

Image:

http://www.theater-technisch-lab.nl/dmxsign.gif

or

http://www.soundlight.de/techtips/dmx512/vpdmxti.gif

Is it possible to generate such a signal with the PIC?

Greetings

Micha

Link to comment
Share on other sites

Just did what you said.

Found a building kit on

http://digital-enlightenment.de/mux.htm

You get 64 analog inputs (0-5V) and transform it to DMX Channel 1-64.

I just asked them about readymade boards because I have no experience in etching PCB´s.

Sometimes I think I have really not much experience generally, hoho ;)

But I like electronics.

So thank you guys (any girls here), that you read this post at all.

Enjoy your days

Micha

Link to comment
Share on other sites

  • 3 weeks later...

So here are my new ideas for having DMX Output with the I2C Modul:

I like to programm a few tracks on the SEQ with CC messages which will be converted to a DMX signal.

Because I am a beginner in programming I want to write my idea as text first.

Maybe you could give me a idea how to program this.

Using the I2C Interface the Midi data is forwarded to the I2C Midi modul using the MIOS_MIDI_InterfaceSet(0x10) and

MIOS_MIDI_TxBufferPut(=xb0)

After that a special firmware on the PIC16F88 analyses the I2C Messages.

The possible 128 CC messages will be assigned to DMX Channel 0-127 and the CC Values will be assigned to the DMX Value for the according channel.

Its half the resolution but I dont care.

So these variables are scanned and then "imported" to the DMX-Sending-routine.

This routine creates the DMX compliant signal and begins with a Break Signal and a Mark after Break.(88 us and 8 us).

See here: http://mikrocontroller.cco-ev.de/de/dmx512.php

Then the variables will be set to the according location of the DMX Signal. (Attention, the first Data Byte is always set to a zero value).

The receivers need a sufficient duration to analyse the signal.

So I like to send always 128 DMX channels and values, or so called frames.

Not needed values should be set to zero.

After that the next Break (or Reset) signal is sent again.

:-\

Thorsten mentioned that I need to connect a MAX 485 to the Tx pin of the PIC to create the bipolar potential. Also the output speed must be set to 250 kbit/s.

So I like to know which functions I should use to programm this with MIOS, rather C than Assembler.

Is it right to use the timer function to create the 88 us Break signal and the other signals.

Could it be a problem that the PIC16F88 has "only" a 96 bytes buffer?

Thank you very much so far.

Greetings Micha

Link to comment
Share on other sites

Dear Micha

DMX is a Protocol, which runs over the a physical RS485 cable network. MIDI sequencers are not usually that good at sending DMX command sequences, because their natures are very different, and some things, say a light 'pan', can require a whole list of commands sent at the right intervals to the same device, (I use the term 'device' rather than simply 'Light', because DMX can control a whole slew of things from light dimmers to 'Wobbly Mirror' lights, projectors - and even smoke machines), and the command structure is a bit diffrent. DMX also requires faster transmit speeds than MIDI.

I posted a note on some 'home build' USB <-> DMX systems, and there is a lot of free DMX control software around, usually PC based. A PC is a good host, and the MIDIbox could be used to provide a control surface connectng to the PC through a MIDI or serial port.

Mike

Link to comment
Share on other sites

Hey Mike,

sorry but I don´t like that Laptop based controller software something.

I want to do this:

Change brightness and colour of a spotlight in sync with the 8th HiHats of my song or if you play a long sound, opening cutoff frequency the light show should be in sync to the filter with brightness, colour or maybe movement.

I think of a small moving head device with 5 DMX channels for colour, brightness, gobo pattern, pan and tilt.

Don´t you think SEQ could reserve 8 channels with CC´s for a little light show?

See you!

Link to comment
Share on other sites

Hi.

Do you have your own lights to control? If not, you could be adding some severe headaches by changing from one venue to another.

I say this because every manufacturer of DMX controlled moving light fixtures uses a different arrangement of channels. EG:

[tt]"High End Systems- TrackSpot" (very old and clunky fixture)

Ch 1 Pan  (8bit)

Ch 2 Tilt  (8bit)

Ch 3 Colour

Ch 4 Gobo

Ch 5 Motor Speed

Ch 6 Shutter/Strobe

Ch 7 Dimmer (Electronic control of incandescent lamp)

"Martin- Mac2000 Profile" (much newer, full-featured unit)

Ch 1  Shutter, Strobe, Lamp control functions (Strike/douse the arc)

Ch 2  Intensity (Motorised mechanical dimmer/douser)

Ch 3  Cyan level    \

Ch 4  Magenta level - For three-field subtractive colour mixing

Ch 5  Yellow level   /

Ch 6  Variable CTO (for colour temperature "matching" with incandescent lamp sources)

Ch 7  Colour Wheel

Ch 8  Gobo

Ch 9  Gobo angle (MSB)

Ch 10 Gobo angle (LSB

...

Ch 24 Effect update speed

[/tt]

This means that if you set (say) a light to change colour and brightness with an 8th note hihat, this could work only if you continued to use the same type of fixture, addressed to the same DMX starting address. The DMX512 interface doesn't know or care what it is controlling. There is no command that says "change colour" or "increase brightness", only a series of 512 8-bit values. If you changed your setup, you'd need to "soft patch" to reference different DMX channels, otherwise your changing colour command could become something else.

You would need to (at least) code a seperate PIC or AVR to do the DMX conversion. Bear in mind that while MIDI sends only the information that changes from one moment to another (note on, cc#x to blah), DMX512 sends a constant data stream, regardless of whether there is a change in state. Some equipment (I stress this, SOME equipment) can handle a temporary loss of data, by simply holding the most recent DMX frame in an on-board buffer. Other gear is less forgiving. Some dimmers will flicker, snap to zero and hold there, or just jump from one value to the next. Colour scrollers usually start shifting between servo points. Some moving lights do a software reset/hardware calibration procedure after even one missed frame!! Remember also, that the transfer speed of MIDI os 31.25kbps, whereas DMX512 is more like 250kbps *8(bits/channel) x 512(channels/frame) x 60(frames/sec). This is a lot of work for a PIC to handle.

A much easier alternative is to find a lighting console which can be slaved to MIDI signals (most can), then just keep a channel of MIDI (ie MIDI channel 16) free for lighting, effects and show control.

I've used a CP-10xt for this, which works very well. You could also use a Strand, a Hog, a GrandMA, the bank is the limit, really.

Link to comment
Share on other sites

Found! Microchips offers an example for DMX Signals with PIC´s.

Just type DMX at www.microchip.com or follow the link:

http://ww1.microchip.com/downloads/en/AppNotes/01076A.pdf

On side 9 you find an assembler code which generates a DMX Signal with a PIC 18F24J10.

Quote: This source code uses the PIC18F24J10 to transmit a DMX-512 packet via the EUSART peripheral.

An external 16Mhz clock input is used.

The DMX transmitter code is written as a polled state machine with 4 states. The state machine is called periodically from the main software loop and a jump tamble dtermines the present state.

Timer0 is used to control the state machine timing, including length of the Break signal and the spacing between transmitted bytes.

The CCP module is configured to start an ADC conversion every 10 msec.

A potentiometer voltage is sampled with the ADC and the result is written to the first data slot in the DMX frame to control a remote device.

Unfortunately I am not able to understand the code on my own.

So please help.

My questions:

Which functions calls the Poti Value in the code?

Could the setup of the serial port (example RC6 for TX on the 18F24J10) be changed?

Also I like to know if the code could be transfered to a PIC18F4620?

Ähm, yes, one more maybe really newbie question :-\: Could this ASM example also programmed with the MIOS C functions in general?

My idea is to change the ASM Code to replace the value of the Poti-Sampling with a Mios Function.

I want to use MIOS_MIDI_TxBufferGet or maybe USER_MIDI_NotifyTx to get the Midi data.

So if the Midi data is like 0xB0 Control Change message the selected channel and value of the Midi data could be transformed to the DMX channel and value.  ::)Just dreaming it could be so eeaasyy!

Thanks for your replies, I learn a lot!

I will be busy the next 5 weeks, so don´t expect a quick answer from me but I wanted to send you this link before I am offline.

Greetings Micha

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...