Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 11-26-2018, 11:22 PM   #1
mb945
Human being with feelings
 
Join Date: Jan 2017
Posts: 113
Default Script to Control Philips Hue Lights Based on Volume in Reaper

Maybe this is a stretch, maybe not?

Currently I have a Lua script that will turn my Hue lights on (red) and back off depending on if I'm recording.
More on that here: https://forum.cockos.com/showthread.php?t=203449

The new thought is would it be possible to have a script that analyzed the master channel volume in Reaper and adjusts the brightness and/or color of the Hue lights based off of that?
For example, when the level (perhaps the RMS so that it is smoother?) goes up, the lights get brighter and vice/versa.

Any ideas?
Thanks!!
mb945 is offline   Reply With Quote
Old 12-07-2018, 11:32 AM   #2
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by mb945 View Post
Maybe this is a stretch, maybe not?

Currently I have a Lua script that will turn my Hue lights on (red) and back off depending on if I'm recording.
More on that here: https://forum.cockos.com/showthread.php?t=203449

The new thought is would it be possible to have a script that analyzed the master channel volume in Reaper and adjusts the brightness and/or color of the Hue lights based off of that?
For example, when the level (perhaps the RMS so that it is smoother?) goes up, the lights get brighter and vice/versa.

Any ideas?
Thanks!!
Sorry I missed, I would think its remotely possible. My first thought is needing access to the audio stream and I'm totally ignorant if that can be retrieved via lua and I'm as ignorant as to whether you can fire an external script via JSFX. Let's assume that's possible...

The first thing you will care about is not spamming your network with web requests to the hue bridge on your network. Some hue apps do just that which I find annoying and bad design FWIW. IOW, you move a slider from 0-255 and 256 requests hit the wire because they are emulating real time feedback. So it would be smart to throttle that and update with some sane frequency.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 12-08-2018, 06:27 AM   #3
snooks
Banned
 
Join Date: Sep 2015
Posts: 1,650
Default

You can read JS sliders from ReaScript so a JS plugin can set a slider according to current RMS and you can read that.

I had no idea that wscript existed btw, that's an interesting way of doing things.
snooks is offline   Reply With Quote
Old 12-08-2018, 07:11 AM   #4
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by snooks View Post

I had no idea that wscript existed btw, that's an interesting way of doing things.
Ah, it can be handy at times. I used it because I needed to call a javascript file from C++ in the FaderportXT driver.
__________________
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 06:13 AM.


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