Old 06-23-2021, 04:32 AM   #1
DrFrankencopter
Human being with feelings
 
Join Date: Jan 2011
Location: Ottawa, Canada
Posts: 293
Default Reaper - Hue light control idea

Hey folks,

I'm looking into writing a Reaper CS extension to control the Phillips HUE lights in my studio (and if it works I'll put the code up on the Reaper Stash).

What I'd like to do is:
1. Have the light groups briefly flash red when the transport is in record+play...'on air' lamp. I've seen examples of this already, and it seems pretty straightforward
2. Have light groups respond to the signal level present on different busses. For example, when the drums play, shift the light colour towards red, and vary brightness as a function of level.
3. Have the light group intensity vary as a function of beat division...a little like a visual metronome.

It's function (2 + 3) that I'm really interested in. Basically, looking to help inspire live playing into Reaper by adding some dynamic lights.

I figure a CS extension will be needed to gain access to the transport functions as well as the level meters. But I also imagine that I will need a companion VST plugin that would sit on the busses, and communicate with the main program. The VST companion would set the parameters such as the colour bias for the instrument as well as the 'sensitivity', as well as what light group its being applied towards.

Here's what I'm thinking for an extension concept:
1. Link against the functions in the Hue plus library -> https://github.com/enwi/hueplusplus
2. On project load, parse the list of Track FX for instances of the VST companion plugin. Maybe to make things easier I could limit myself to looking at tracks with a specific naming convention (e.g. HueBuss##). I'm thinking the latter to start.
3. Register the Busses from (2) for level meter polling
4. Read the light control parameters from the VST's into an area of shared memory
5. In the main loop, calculate the desired colour/brightness for each colour group by reading the peak meters (probably will need to do some averaging too), and send the light commands off to the HUE bridge.
6. Have a companion web server that allows for a 'panic button' to either kill the lights, or bring them up to some default state (e.g. bright white). This could be handy when you need to stop and read something, or find something you dropped on the floor

I'll probably get started on this adventure late next week, but in the meantime, if there's any input that folks would like to make, whether that's features, or suggestions about the approach, I'm all ears!

Or, if by some chance some clever person has already coded this sort of thing up, please point me there!!!

Cheers

K
__________________
RME TotalMixFX Actions for Reaper here: https://stash.reaper.fm/v/29339/reape...MixOSC_x64.dll
DrFrankencopter is offline   Reply With Quote
Old 06-23-2021, 04:33 AM   #2
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

There's a few threads here on this FYI...
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 06-23-2021, 04:46 AM   #3
DrFrankencopter
Human being with feelings
 
Join Date: Jan 2011
Location: Ottawa, Canada
Posts: 293
Default

Thnks @karbonmusic, I saw most of those...most of them refer to the "on air" function. That should be pretty straightforward.

It doesn't seem that anyone has made progress in making the lights level sensitive. It doesn't seem like too big of a challenge, but I think it needs to be done as a control surface extension. Fortunately I've coded at least 3 of those already.

I suppose the control parameters could be done with JS plugins instead of VST...but I haven't programmed a JS plugin before. It's worth a look; might be easier. It's been 10 years since I coded a VST.

Cheers
__________________
RME TotalMixFX Actions for Reaper here: https://stash.reaper.fm/v/29339/reape...MixOSC_x64.dll
DrFrankencopter is offline   Reply With Quote
Old 06-23-2021, 07:28 AM   #4
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Sorry, it was late, I saw hue and didn't read further. My only addition is I'd be mindful of the spew of network packets on your network trying to do metering of sorts in real time will create. It doesn't necessarily look like you want real-time metering but wanted to mention.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 06-23-2021, 07:53 AM   #5
DrFrankencopter
Human being with feelings
 
Join Date: Jan 2011
Location: Ottawa, Canada
Posts: 293
Default

Quote:
Originally Posted by karbomusic View Post
Sorry, it was late, I saw hue and didn't read further. My only addition is I'd be mindful of the spew of network packets on your network trying to do metering of sorts in real time will create. It doesn't necessarily look like you want real-time metering but wanted to mention.
No worries!

From what I read the Hue bridge can only respond to something like 10-20 messages per second, so I won't be firing out too many packets. Actually, this is going to be the big limitation on the approach, and I might need to get creative with 'transitions'.

For the metering itself I was going to use Reaper's built in functions from the API. I'll just poll the meter for its level, and then do my calculations to turn that into a colour/brightness map. I figure if I poll the meter at 30 Hz, and aim to send messages at around 10Hz I'll be ok. I'll probably need to filter the meter data a bit so I can have a fast rise time, and slower release. But I need to get experimenting first before I get too fancy with control options.
__________________
RME TotalMixFX Actions for Reaper here: https://stash.reaper.fm/v/29339/reape...MixOSC_x64.dll
DrFrankencopter is offline   Reply With Quote
Old 06-23-2021, 08:05 AM   #6
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by DrFrankencopter View Post
No worries!
Actually, this is going to be the big limitation on the approach, and I might need to get creative with 'transitions'.
You could go RGB LEDs, ESP8266 and Web Sockets. That would give you real, real time FYI. They would be on their own network too. This guys has it pretty well figured out.


https://www.youtube.com/watch?v=qE3zEM8qM00

https://www.youtube.com/watch?v=s8qWqYTpCN4
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 06-23-2021, 08:28 AM   #7
DrFrankencopter
Human being with feelings
 
Join Date: Jan 2011
Location: Ottawa, Canada
Posts: 293
Default

Quote:
Originally Posted by karbomusic View Post
You could go RGB LEDs, ESP8266 and Web Sockets. That would give you real, real time FYI. They would be on their own network too. This guys has it pretty well figured out.


https://www.youtube.com/watch?v=qE3zEM8qM00

https://www.youtube.com/watch?v=s8qWqYTpCN4
That's pretty awesome! Definitely looking into that. Maybe I'll do slower/predictable mood stuff with the HUE, and faster stuff with the RGB LED/Colour Chord approach.

Ugh...add another project to the list
__________________
RME TotalMixFX Actions for Reaper here: https://stash.reaper.fm/v/29339/reape...MixOSC_x64.dll
DrFrankencopter is offline   Reply With Quote
Old 06-23-2021, 09:27 AM   #8
siniarch
Human being with feelings
 
siniarch's Avatar
 
Join Date: Jun 2018
Posts: 705
Default

Awesome Project.
I would be super interested in a simple easy way to do the record light. Green when playing, blinking red when armed, maybe orange when paused and full red when recording. I haven't seen an easy simple way to do this with a cheap Light such as HUE lights.

As for lights that play with color, you can look at something like this:
https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

Here is a video from a person who bought them and installed them:
https://images-na.ssl-images-amazon....10Z3J+fy3S.mp4

Perhaps there is a way to tap into the mic, or if the mic is coming from the phone app, perhaps you can get a cheap phone and dedicated it to the lights by feeding it audio to the 1/8" jack. You could then decide which tracks get sent to that phone? Just a suggestion if you didn't want to program it yourself.
__________________
www.SiniCon.io .......... Digital Audio Controllers
www.AcousticalGarden.com ........ Los Angeles Boutique Sound Studio
siniarch is offline   Reply With Quote
Old 06-23-2021, 10:45 AM   #9
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by siniarch View Post
Awesome Project.
I would be super interested in a simple easy way to do the record light. Green when playing, blinking red when armed, maybe orange when paused and full red when recording. I haven't seen an easy simple way to do this with a cheap Light such as HUE lights.
It's pretty easy other than the blinking, that was the first project I did way back in 2012 maybe. I did it in an extension I already used but a couple other users ended up doing it an reaper script.

https://forum.cockos.com/showthread.php?t=203449

Edit: You are in that other thread FYI.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 06-23-2021 at 10:52 AM.
karbomusic is offline   Reply With Quote
Old 06-23-2021, 03:04 PM   #10
siniarch
Human being with feelings
 
siniarch's Avatar
 
Join Date: Jun 2018
Posts: 705
Default

Quote:
Originally Posted by karbomusic View Post
It's pretty easy other than the blinking, that was the first project I did way back in 2012 maybe. I did it in an extension I already used but a couple other users ended up doing it an reaper script.

https://forum.cockos.com/showthread.php?t=203449

Edit: You are in that other thread FYI.
I just re-read the post. I guess it's not as complicated as I remember it to be. Perhaps Today it is less complicated than when I first read it. hahahah.

I'll have to get some Hue bulbs and give this a try. It would be awesome to have a record light.

Thanks Karbomusic.
__________________
www.SiniCon.io .......... Digital Audio Controllers
www.AcousticalGarden.com ........ Los Angeles Boutique Sound Studio
siniarch 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 03:03 PM.


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