I want a clip indicator for master channel embeded to my toolbar. Who can write a script for that please?
What do you mean by "Clip" ?
Reaper does not clip as it uses floating point sample format. The clipping will only be introduced when Reaper sends data (usually in 24 bit fixed point format) to the (usually ASIO) driver or when saving such format to a file.
I assume he means when master goes over 0 db.
That's possible to detect in a script as X-Raym's shows (using GetPeakHoldDB()).
Light a toolbar button when this happens is also possible.
I wouldn't have time to do this script currently though, maybe at some later point if noone jumps in till then.
Or maybe OP is fine with X-Raym's version.
I assume he means when master goes over 0 db.
That's possible to detect in a script as X-Raym's shows (using GetPeakHoldDB()).
Light a toolbar button when this happens is also possible.
Hm I understand that the standard meter already does this nicely.
Of course you could do a JSFX that creates a midi event when the audio is > 0dB, then route the Midi out of the PC and have some Hardware light up huge red lamp
I could offer this, but I wouldn't know how to make it a 'sticky' indicator (= at first clip it lights, click on it to turn off again).
Are you ok with this version, if not no problem, hope for someone else to jump in (or try to learn scripting yourself).
Unfortunately I don't understand anything about scripting. But if this had a sticky red light which turns off when clicking on it, would be excatly what I asked for.
Thank you. But is there a way to delete the L and R letters I want to see sum of both. And I want to embed it to the toolbar. I added to toolbar but it shows the indicator when clicking on it. How can I do that?
A possible way might be like this:
1) have the JSFX send out a Midi signal (e.g. a CC)
2) use MidiToReaControlPath to route it back into the guts of Reaper
3) here have the CC trigger an event that
4) starts a ReaScript that
5) uses a Reaper API to access the ToolBar Button.
I already did stuff like (1) and (2). I am not sure how (3) can be done without using SWS LiveConfigs, and no idea at all about (4) and (5).
No need for that complicated stuff I think. That code I mentioned above, it's constantly lights on and off when clipping occures. It lights when the meter is above 0 and it turns off when it's below 0. If that was stays on when clipping occures and goes off when clicking on it, it would be what I wanted. Also current version lights on at +0.1 db, it should be at exactly 0.0 db
Thing is, it's far from ideal or even good useable this way in my opinion, because:
When it's lit you must always press twice (1. to unsticky it, 2. to re-start the script). If you'd forget this and only press once the script is stopped but there's no way to see it because the toolbar on / off state (which commonly is used to indicate if a script is running) is 'abused' here as a clip indicator. I couldn't do any better than this though.
Quote:
Also current version lights on at +0.1 db, it should be at exactly 0.0 db
Using a script for clip indication is not very accurate anyway because of the low frequency scripts are running (approx. 30 times / sec. afaik), so it's very far from being sample accurate (it would need a JSFX or VST to make it sample accurate).
So given all the above - I don't know what you want to use it for exactly, but I'd like to suggest a better alternative would be to read up and get into the habbit of proper gain staging which imo (almost) eliminates the need for clip indication.
If you want to use the version above nevertheless just tell me and I can post the code.
Thing is, it's far from ideal or even good useable this way in my opinion, because:
When it's lit you must always press twice (1. to unsticky it, 2. to re-start the script). If you'd forget this and only press once the script is stopped but there's no way to see it because the toolbar on / off state (which commonly is used to indicate if a script is running) is 'abused' here as a clip indicator. I couldn't do any better than this though.
Using a script for clip indication is not very accurate anyway because of the low frequency scripts are running (approx. 30 times / sec. afaik), so it's very far from being sample accurate (it would need a JSFX or VST to make it sample accurate).
So given all the above - I don't know what you want to use it for exactly, but I'd like to suggest a better alternative would be to read up and get into the habbit of proper gain staging which imo (almost) eliminates the need for clip indication.
If you want to use the version above nevertheless just tell me and I can post the code.
I talked with nofish and he doesn't have the script anymore, If somebody can make this script but more accurate in terms of reading the clipping?
I talked with nofish and he doesn't have the script anymore, If somebody can make this script but more accurate in terms of reading the clipping?
Please note that actually nothing is clipping at 0.0 dB, as Reaper works with floating point format that does not clip. A signal > 0dB does not do any harm at all.
Hence such a script should simply state ">=0dB" instead of using the misleading term "cliped".
-Michael
Please note that actually nothing is clipping at 0.0 dB, as Reaper works with floating point format that does not clip. A signal > 0dB does not do any harm at all.
Hence such a script should simply state ">=0dB" instead of using the misleading term "cliped".
-Michael
X-Raym_Detect selected and master tracks clips - peaks over 0dB - position.lua script is accurate at detecting peaks over 0db, maybe someone can combine nofish script and xraym's. That way I can use it on the toolbar as a lighting icon whenever clipping occurs at master channel.
I've been working on an 'info panel' of sorts and wanted to have some kind of visual feedback for the master.
Let me know if this would work for you. Note that there are two scripts going on here. One to handle the window that contains the peak indicator, and another to clear the peak (and actually a 3rd to stop playback and seek to the last peak, but that's just because I wanted that feature. The 'seek to peak' button will also optionally restart playback with a predefined pre-roll).
Also, note that I'm 'lerping' the color and alpha values here so the values don't snap (unless it's peaked, then it snaps to red with an alpha of 1). This behavior can also be changed. The frame rate of the licecap makes it look more choppy than it really is.
It's still a little rough around the edges, but it's getting there.
I've been working on an 'info panel' of sorts and wanted to have some kind of visual feedback for the master.
Let me know if this would work for you. Note that there are two scripts going on here. One to handle the window that contains the peak indicator, and another to clear the peak (and actually a 3rd to stop playback and seek to the last peak, but that's just because I wanted that feature. The 'seek to peak' button will also optionally restart playback with a predefined pre-roll).
Also, note that I'm 'lerping' the color and alpha values here so the values don't snap (unless it's peaked, then it snaps to red with an alpha of 1). This behavior can also be changed. The frame rate of the licecap makes it look more choppy than it really is.
It's still a little rough around the edges, but it's getting there.
This looks good man, can this be embeded to toolbar? (I couldn't tell from the gif if it's on a toolbar) I only need the indicator though, no need for other things.
Also it would be awesome if it resets by clicking the red, without the clear peak button.
This looks good man, can this be embeded to toolbar? (I couldn't tell from the gif if it's on a toolbar) I only need the indicator though, no need for other things.
Also it would be awesome if it resets by clicking the red, without the clear peak button.
Yes, the peak indicator is in a docked GFX window. I would also like it to reset by clicking the red I'm still very new to the Reaper API and lua so I still need to figure out how to make that happen. I 'think' I know how to make the 'click on the red' happen in a window that's not docked. So, got some homework to do on that front.
This info panel is my take on a hybrid between Pro Tools and Nuendo. It mainly started because I just wanted to get a 'selection length' read-out for razor areas (that followed the 'timebase' settings for the main ruler)... and then I just kinda kept going with it.lol.
Yes, the peak indicator is in a docked GFX window. I would also like it to reset by clicking the red I'm still very new to the Reaper API and lua so I still need to figure out how to make that happen. I 'think' I know how to make the 'click on the red' happen in a window that's not docked. So, got some homework to do on that front.
This info panel is my take on a hybrid between Pro Tools and Nuendo. It mainly started because I just wanted to get a 'selection length' read-out for razor areas (that followed the 'timebase' settings for the main ruler)... and then I just kinda kept going with it.lol.
I quickly ripped the code from my info panel script. Hopefully I didn't miss anything. I'm still new to the Reaper API and lua in general so I'm still not exactly sure how the docking works. It will currently open in a floating window, but there is a variable you change to dock it. I'm not sure where it will show up though and/or if it will alter other things in your dock. Just a heads up.
Remember, you need both scripts attached here. I'm hoping to look into this more over the weekend to see if I can just click the window and not need the button.
Here's a quick licecap showing this 'stand-alone' version.
Here's quick snippet to show you the user adjustable variables:
Code:
local IsDocked = false -- Set to true to dock the window. I'm new to the dock regarding scripts, so keep that in mind :)
local Width = 200 -- Window width when not docked
local Height = 100 -- Window height when not docked
local IsMasterTrack = true -- Set to false to monitor the first selected track.
local PeakLevel = 0 -- Adjust this value if you want to monitor for peaks at a value other than 0db.
I quickly ripped the code from my info panel script. Hopefully I didn't miss anything. I'm still new to the Reaper API and lua in general so I'm still not exactly sure how the docking works. It will currently open in a floating window, but there is a variable you change to dock it. I'm not sure where it will show up though and/or if it will alter other things in your dock. Just a heads up.
Remember, you need both scripts attached here. I'm hoping to look into this more over the weekend to see if I can just click the window and not need the button.
Here's a quick licecap showing this 'stand-alone' version.
Here's quick snippet to show you the user adjustable variables:
Code:
local IsDocked = false -- Set to true to dock the window. I'm new to the dock regarding scripts, so keep that in mind :)
local Width = 200 -- Window width when not docked
local Height = 100 -- Window height when not docked
local IsMasterTrack = true -- Set to false to monitor the first selected track.
local PeakLevel = 0 -- Adjust this value if you want to monitor for peaks at a value other than 0db.
I tried it but unfortunately it reacts the same as the nofish's script (sometimes doesn't catch peaks)
He said: using a script for clip indication is not very accurate anyway because of the low frequency scripts are running (approx. 30 times / sec. afaik), so it's very far from being sample accurate (it would need a JSFX or VST to make it sample accurate). So does that mean no matter what all scripts will behave like that? But in X-raym's script it detects the overs immediately, I don't understand.
Last edited by ertugrulgul; 05-18-2021 at 04:30 PM.
Yeah, I was wondering about the speed of the defer loop, and missing peaks.
I took a quick look at X-raym's script. He's using 'Track_GetPeakHoldDB', I was using 'Track_GetPeakInfo'. Here's a version using PeakHoldDB. I just swapped it out and checked for script errors, so I can't say whether this is any better. I did notice the window doesn't light up much at all unless it detects a peak. So visually different feedback than the previous version.
Yeah, I was wondering about the speed of the defer loop, and missing peaks.
I took a quick look at X-raym's script. He's using 'Track_GetPeakHoldDB', I was using 'Track_GetPeakInfo'. Here's a version using PeakHoldDB. I just swapped it out and checked for script errors, so I can't say whether this is any better. I did notice the window doesn't light up much at all unless it detects a peak. So visually different feedback than the previous version.
This is more accurate I guess, thanks. Nofish's script is looks more like what I need but this works better. I know nothing about scripting, if you can combine yours with the nofish's so it works like that it would be awesome.