Jump to content

PC Based DMX Control development


wodp

Recommended Posts

The midiOutOpen function opens a MIDI output device for playback.

 

VB4-32,5,6

Declare Function midiOutOpen Lib "winmm.dll" (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long

Most of what you need to do midi under VB is in winmm.dll. If you do a google on 'midi winmm vb' you will find loads of examples.

Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Bit of a divergence, but here goes:

 

I'm trying to design a bit of kit which receives DMX and outputs a multiplexed analogue data stream to drive a Furse FMX regal dimmer rack.

It is based on a Z8 encore! development kit and a DAC to create the analogue output. I can do the hardware, but the software is more problematic.

 

Does anyone have any software (preferably in C or C++) that receives DMX data from a UART and puts it in an array? I only need 36 channels (I'll ignore the rest if the desk sends them)

 

Thanks

 

(I'm not a softy!)

Link to comment
Share on other sites

  • 1 month later...

DOH!

I am so sorry guys, I forgot I had posted on this topic, it was just before the phone call..... :P

Anyway will look at winmm.dll now, thanks Brian! I am using a Midisport USB to 2 MIDI in/outs.

Recently found a program somewhere called MIDITRANSLATER and it gets me part way there - I can now play the notes of a keyboard (sadly not my velocity sensing D-10 yet but still) and after a lot of code entering, can get my Strand MX to flash channels, DBO, select chases and run them.

I still want to run code on inputs and then get a level out not just one in one out, but its better than a slap in the face for missing those replies! :(

Link to comment
Share on other sites

Does anyone have any software (preferably in C or C++) that receives DMX data from a UART and puts it in an array?  I only need 36 channels (I'll ignore the rest if the desk sends them)

Didn't realise Zilog still existed!

Can't help though, as I never messed about with the Z80 for my BBC in that way.

 

However, if it helps, the program flow is relatively simple:

 

Wait for Hi-Low transition in DMX line

Measure the time period until next Low-Hi transition

If smaller than 88uS, then start over (It wasn't the "break", so we'll try again)

Wait for "Start" bit (Hi-Low transition), and receive 37 bytes of RS232-equiv serial data at 250kbps, no parity, placing these bytes into your array as you receive them.

If the first byte is NOT zero, then an error occured and the data is not valid.

Re-run the fun! (Thus ignoring everything that comes after the 36th channel)

 

It's not a pretty solution, but it's simple.

A better method is to use the interrupts, but C and C++ don't handle that natively so I can't explain how the Z8 Encore! cross-compiler implements them.

Link to comment
Share on other sites

Break down how much power you want in a chase (eg if controlling movers, do you want to specify whether a chase or memory affects pan/tilt, colour, gobo etc) and what you want to store at each stage. Then we can try and give more useful help.

 

 

Dave

Link to comment
Share on other sites

you talking to me? I have got the interface I want at the moment in VB.. I am currently trying to write the code for it... but I need some help with saving the show to a file/opening it. working with patches and how to setup the memory part...

 

I'll post some pictures later...

Link to comment
Share on other sites

Yep I was talking to you. Some basics about how stuff is stored within the program would help as well as a couple of screen grabs - if its arrays you can just loop through them and write the stuff to a file in essence.

 

 

Dave

Link to comment
Share on other sites

Okay,

 

Well the basic layout looks like that so far. I haven't got any stuff for scanners becuase I don't have any at the moment! I am about to get 3 4channel DMX dimmers soon, which means I can have upto double that at a later point.

I am not sure much on the coding side. I wrote the code to move the bars up and down, but thats mainly just mathematics and algebra type stuff.

There are Preset A and Preset B, which can have crossfade if the button is pressed (and light is black) so one is always opposite of the other, or uncrossfade, so they are independant (so the highest takes precedence).

There are a flash button for each preset, although I might delete the seconds set of flash buttons. There are also off buttons which kill a channels slider when you press it.

The bits at the top show the amount each channel is really output at, and the number is the % output.

The presets box top-right is for setting up to 14 presets. IE, you setup the configuration you want on the left, then click the P button on under the preset button to associate that with the settings on the left (ie, you could make a preshow, or working lights, etc).

The memory record/cue box is for making scenes and playing them back. Current cue number with + and - for deleting and adding cues. The autocue will mean that the next cue will automatically go when the current one has finished crossfading in, and after the specified optional hold time has elapsed.

The CF time slider is for how long to take to crossfade between the cue. If you are using this, it will automatically set the current cue at the top, and the next cue at the bottom, and will then switch between them (so next cue is live at the bottom, when the cue after that is at the Preset A).... Save cue saves that state into a cue. Step forward/back is self explainary, as is the run next cue. Edit Cue window brings up a listbox with the cues, and lets you manage them easier.

You can also name a cue.

 

The chase is pretty self-explaniary. You can setup multiple chases. Select the chase number, or add a new one if your at the end, or delete the current cue.

The step is the current step that you are in in the current chase.

Program step will save the current step from the live preset into the chase. Slope is whether it fades to black between each step, or just jumps from step to step... obviously in the middle is crossfade style.

The fader on the right of the chase box is the chase level. priority is key on this software, the highest signal is the one that is live. Grand master on the right, with a blackout button above.

 

There is also a mode select at the menu which is either Run or Program - Program is like this, Run locks off all the programming related buttons to stop you messing it up (although you can still do manual control) it just stops you from accidentally deleting a cue or something.

 

There is also the option for a DMX Software patch, and a setup menu to set refresh rate and port.

 

Hope this makes sense, although its prettyy complex and probably sounds impossible in VB. Although I have seen it done before...

 

Thanks,

computer

Edit: Added link to picture

Desk

Link to comment
Share on other sites

PS: How do you upload a picture, or can someone host it for me?

It needs to be uploaded to a web server somewhere first (it's not possible to upload an image directly to the Blue Room's servers as an integral part of the post).

 

Then use either the IMG tag (to display the image in-line with the post) or the HTTP:// tag (to simply add a hyperlink to the external image). For the benefit of those of our members who are using slower dial-up connections, the former option is only recommended if the image is small. For larger images, please use the latter option, therefore giving members the option of whether or not to download a larger image.

Link to comment
Share on other sites

Okay, what I *think* you are asking is how to save a set of data.

 

It's a while since I last used VB, but this should do it:

 

Open [filename] for Output as #1

Print #1, [Variable]

...

Close #1

 

You can put as many Print statements as you like between the Open and Close statements, and you can loop to write the contents of an entire array as well.

 

To read, use "Input" instead of output, and Input instead of Print.

This will stuff the saved values into the variables - make sure read and write are in the same order though, or the wrong data will end up in each variable!

 

This is all from years-old memory though, so I could be wrong in detail - I'd suggest that you look up the "Open" and "Close" statements in the help file to confirm the exact syntax.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.