Go Back   Cockos Incorporated Forums > REAPER Forums > MIDI Hardware, Control Surfaces, and OSC

Reply
 
Thread Tools Display Modes
Old 07-19-2020, 11:21 PM   #1
NielsChristian
Human being with feelings
 
NielsChristian's Avatar
 
Join Date: Jul 2020
Location: Fürth in Southern Germany
Posts: 4
Default Recording Light controlled via USB connected Arduino?

So, I would like to use an Arduino to control several tasks, while a recording in Reaper is running - first thing coming to mind, of course, to switch a recording light on and off.

I noticed this pre-assembled product that seems to make use of a Java library to seal the deal
https://www.punchlight.com/recording_lamp_usb

But I am wondering if there is a way to do it in DIY style?
Preferably without a MIDI interface.

My dream would be a permanent recording signal, while Reaper is recording, so that I can check continously if Reaper is still running and recording - not just a one-time signal when the recording is switched on and another one-time signal when a recording is being switched off. Nothing is more annoying than a burning "Recording"-light, while the computer has just been switched off and Reaper had no chance to send the "recording-stopped"-flag.

Any ideas? Maybe even libraries I can use?
NielsChristian is offline   Reply With Quote
Old 07-20-2020, 05:35 AM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

AFAIK, Reaper can be set to send out OSC messages when starting and stopping record. Hence your device needs to use a network interface and wait for the OSC commands.

OSC messages are simply text strings sent as UDP blocks. Any language / Network library should support opening an UDP port and waiting for blocks.

-Michael
mschnell is offline   Reply With Quote
Old 07-20-2020, 05:49 AM   #3
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

There are several threads here that accomplish this but with Philips Hue lights. Maybe some usable info there.

https://forum.cockos.com/showthread.php?t=203449
https://forum.cockos.com/showthread.php?t=212727
https://forum.cockos.com/showthread.php?t=202644
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 07-20-2020, 07:04 AM   #4
NielsChristian
Human being with feelings
 
NielsChristian's Avatar
 
Join Date: Jul 2020
Location: Fürth in Southern Germany
Posts: 4
Default Just the right guy

Pulled from one of said threads:

Quote:
Originally Posted by karbomusic View Post
I've been doing this since maybe 2013 and it's wonderful since my "on the air light" turns red with record, green with play and white with stop.
Looks like I raised the attention of just the right guy. Thank you so much - I will dig into those threads and see what I can make of it :-)
NielsChristian is offline   Reply With Quote
Old 07-20-2020, 07:24 AM   #5
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

In those threads, the one with the user-created script is likely the best route since my implementation uses a custom extension. The biggest thing is which light and now it can receive commands from reaper... I can think of a number of ways beyond philips hue (some of which I've tested) but depends on your experience DIYing this sort of thing. Hue is the easiest because it's just a matter of configuring the OPs script.

If not Hue, and you are familiar with micro controllers like programming an Arduino - A little device called ESP8266 is up to the task but requires that basic experience in micro controllers. Basically anything that can receive an HTTP request and act on it to change the light. I wouldn't be surprised if there were some way to do this with Alexa, SmartThings or similar products but I know nothing about their APIs.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 07-20-2020, 07:37 AM   #6
NielsChristian
Human being with feelings
 
NielsChristian's Avatar
 
Join Date: Jul 2020
Location: Fürth in Southern Germany
Posts: 4
Default Silly little project

Quote:
Originally Posted by karbomusic View Post
If not Hue, and you are familiar with micro controllers...
Actually that is exactly what I am aiming for. I have found this old motor switch that is probably twice as old as I am (the waterproof isolation was not made of rubber but of twisted thread). And I thought to myself... what if I put an Arduino into it, and put some keyboard commands on two micro-switches I sneak under the big old chunky switches. One to start a recording, one to stop it... or... something else? Just for the fun of it?

Now with the Arduino already on board? I can use that one to control an LED for the red light, too. But I don't want to cut corners here by just trusting the pressing of the button. I want the response of Reaper to switch the light on. Just because it is the principle of the thing and I love doing stuff like that as it teaches me how things actually work.

Attached Images
File Type: jpg switch.jpg (56.0 KB, 427 views)
NielsChristian is offline   Reply With Quote
Old 07-20-2020, 07:55 AM   #7
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by NielsChristian View Post
Actually that is exactly what I am aiming for. I have found this old motor switch that is probably twice as old as I am (the waterproof isolation was not made of rubber but of twisted thread). And I thought to myself... what if I put an Arduino into it, and put some keyboard commands on two micro-switches I sneak under the big old chunky switches. One to start a recording, one to stop it... or... something else? Just for the fun of it?

Now with the Arduino already on board? I can use that one to control an LED for the red light, too. But I don't want to cut corners here by just trusting the pressing of the button. I want the response of Reaper to switch the light on. Just because it is the principle of the thing and I love doing stuff like that as it teaches me how things actually work.
Should be easier if connected to the machine Reaper is running from. If you use an Arduino Pro Micro which can attach as a USB MIDI device then you could probably just send a MIDI CC to that device via script? I'm not entirely clear on how to do that but I know reaper can see the device because I built a "3 big knob" MIDI controller that I use with Reaper:

https://github.com/karbomusic/ThreeKnobMIDI





I love micro controllers but be careful, they are very addicting!
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 07-20-2020, 08:03 AM   #8
NielsChristian
Human being with feelings
 
NielsChristian's Avatar
 
Join Date: Jul 2020
Location: Fürth in Southern Germany
Posts: 4
Default I love silly ideas, did I mention that?

Quote:
Originally Posted by karbomusic View Post
If you use an Arduino Pro Micro which can attach as a USB MIDI device then you could probably just send a MIDI CC to that device via script?
Ooooh... It is that easy to implement it as MIDI device? I thought I would have to open a big can of worms to do that. But that "sounds" reasonably easy. Maybe I should follow this path then.

And by the way... your 3 wheel interface looks pretty awesome.

I am still keeping my eyes open on some old generator control panel with huge wheels. Now turning that into a control center... would probably be unpractical, but sooo stylish...
NielsChristian is offline   Reply With Quote
Old 07-20-2020, 08:35 AM   #9
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by NielsChristian View Post
Ooooh... It is that easy to implement it as MIDI device? I thought I would have to open a big can of worms to do that. But that "sounds" reasonably easy. Maybe I should follow this path then.

And by the way... your 3 wheel interface looks pretty awesome.

I am still keeping my eyes open on some old generator control panel with huge wheels. Now turning that into a control center... would probably be unpractical, but sooo stylish...
If you look at my GitHub project for the MIDI controller, you'll see it's just a matter of including MIDI.h library and using it - when you plug the Arduino into the computer via USB it will show up as a MIDI device. However... I suppose my concern is receiving MIDI on the Arduino from Reaper since that's what you'd be doing and is the opposite of what I was explaining (sending to Reaper)...

Hmmm... thinking out loud, another thing I have actually tested in the past, is that if you have an existing MIDI Out hardware port on your sound card. You can just cut the end off a MIDI cable and hardwire it to the Arduino, which means you don't even need the Arduino to be a USB MIDI device. You just need to parse the incoming serial message, not that hard. Let me see if I can find the instructables link on wiring that up...

https://www.instructables.com/id/Sen...-with-Arduino/

I just tested this a couple months ago but can't remember WTF I was going to use it for LOL. That said, I'm think you can still do that with the MIDI/USB method but you have to write the code to grab the serial input and parse it. A board called Teensy has a lot of MIDI support built in but probably more than you need.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 07-20-2020 at 08:40 AM.
karbomusic is offline   Reply With Quote
Old 07-20-2020, 08:44 AM   #10
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

And lastly... The beloved ESP8266 controller. It can run a relay et al for the light just like the Arduino but it can also attach to your WiFi network AND be a web server. In that setup, you'd use the script from the OP above and point it to the ESP8266 IP Address, then on the ESP8266, when it receives the HTTP request, parse and flip the pin that controls the relay.

I've done a LOT of that from home automation projects - I have a button on my computer desk that turns my tube amp stack on/off from across the room - it uses two 8266s one to send (client) and one to receive (server). But it's a little more fiddly to flash, not hard but fiddly until you are set up to do it. Actually, if you get one of the ones that has all the stuff built in it's simpler:

https://www.amazon.com/HiLetgo-Inter...5259974&sr=8-6

I often use the base model since it's so small but the above is less fiddling to flash/debug...

https://www.amazon.com/DIYmall-ESP82...259951&sr=8-13
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.