Controlling a USB relay with max for live

Joe Wignell's icon

Hi there,

I have been coding for about a year now and I was just thinking of fun projects I could try and figure out how to do. I thought I would make a light that came on when I pressed record on ableton live so I bought a cheap usb relay off ebay and set to work. The problem is that I can't find anything about communicating with a HID usb device other than the hi object which only receives messages and wont send anything. I have searched and searched online but I can't find anything except details about using arduino microcontrollers. This seems like overkill to me but is a microcontroller necessary for what I want to do?

Any info just pointing me in the right direction would be much appreciated.

thanks

Source Audio's icon

check if it appears as serial device
or post details about that device.
and yes - one needs some sort of electronic to translate from any kind of
digital message to mechanic switch

Joe Wignell's icon

It does not appear as a serial device it appears as a human interface device.

I can control a light with it using this software https://sourceforge.net/projects/usb-relay-hid/ so I dont think I need a microcontroller I just need to understand how I can send the messages to the device using max. Or maybe im totally missing something. Maybe I am completely over my head here!

Source Audio's icon

I think it was wrong decision to go for that board.
Any kind of arduino in combination with relay board would have been better,in first place if it is for fun, because it would offer many more options then just switching the relay.
As I don't know of any possibility to send data to HID Device from Max 8 on Windows,
I would suggest you try to talk to RelayCmd.exe using shell object.
Just take care to include absolute path to RelayCmd.exe .
Like: "C:/Users/me/my stuff/RelayCmd.exe" On=1

Joe Wignell's icon

Thanks very much! That worked a treat!

I was actually wondering if there was a way to send command line instuctions through max and there it is!

I will definately look into an arduino for the future