Old 09-23-2016, 01:10 PM   #1
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default Clip indicator

I want a clip indicator for master channel embeded to my toolbar. Who can write a script for that please?
ertugrulgul is offline   Reply With Quote
Old 09-24-2016, 12:16 AM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Quote:
Originally Posted by ertugrulgul View Post
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 don't suppose a script can detect this.

-Michael
mschnell is online now   Reply With Quote
Old 09-24-2016, 01:05 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

I made Script: Detect Tracks Clips - Peak Over 0db.
Maybe it can help !
X-Raym is offline   Reply With Quote
Old 09-24-2016, 04:17 AM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by mschnell View Post
I don't suppose a script can detect this.

-Michael
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.

Last edited by nofish; 09-24-2016 at 04:24 AM.
nofish is offline   Reply With Quote
Old 09-24-2016, 05:39 AM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Quote:
Originally Posted by nofish View Post
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

-Michael

Last edited by mschnell; 09-24-2016 at 06:52 AM.
mschnell is online now   Reply With Quote
Old 09-25-2016, 06:56 AM   #6
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Nofish mentioned exactly what I want. If anybody can do this I'll be grateful.
ertugrulgul is offline   Reply With Quote
Old 09-25-2016, 12:17 PM   #7
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

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).

nofish is offline   Reply With Quote
Old 09-25-2016, 01:33 PM   #8
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by nofish View Post
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.
ertugrulgul is offline   Reply With Quote
Old 09-25-2016, 02:36 PM   #9
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by ertugrulgul View Post
But if this had a sticky red light which turns off when clicking on it, would be excatly what I asked for.
Agreed, this would be better.
So we'll have to wait if someone turns up knowing if this is possible (and how).

I can post what I have currently (rather simple, in Eel):

Code:
lstate = -1;

function run(finishup)
( 
  masterTrack = GetMasterTrack(0);
  peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
  peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
  peakInfo_L > 1 || peakInfo_R > 1 ? (clipped = 1;) : (clipped = 0);    
   
  // toolbar toggle state example by Jeffos
  get_action_context(#fn,sec,cmd);
  state=finishup ? -1 : (clipped);
  state != lstate ? 
  ( 
    SetToggleCommandState(sec, cmd, state);  
    RefreshToolbar2(sec, cmd);  
    lstate=state;
  );
  !finishup ? defer("run(0);"); 
);

defer("run(0);");
atexit("run(1);");
nofish is offline   Reply With Quote
Old 09-29-2016, 06:02 AM   #10
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Please help guys
ertugrulgul is offline   Reply With Quote
Old 09-29-2016, 08:51 AM   #11
eugen2777
Human being with feelings
 
eugen2777's Avatar
 
Join Date: Aug 2012
Posts: 271
Default

On the basis of nofish code, you can make a simple indicator.


Code:
function Indicator()
  local(masterTrack, peakInfo_L, peakInfo_R, lbl_w, lbl_h)
( 
  masterTrack = GetMasterTrack(0);
  peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
  peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
  peakInfo_L > 1 ? clip_L = 1;
  peakInfo_R > 1 ? clip_R = 1;   
  
  gfx_set(clip_L, 0, 0, 1);
  gfx_rect(0,0, gfx_w/2, gfx_h, 1);
  
  gfx_set(clip_R, 0, 0, 1);
  gfx_rect(gfx_w/2, 0, gfx_w/2, gfx_h, 1);
  
  gfx_set(1,1,1,1);
  gfx_line(gfx_w/2,0,gfx_w/2,gfx_h);
  
  gfx_measurestr("L", lbl_w, lbl_h);
  gfx_x = (gfx_w/2-lbl_w)/2; 
  gfx_y = (gfx_h-lbl_h)/2;
  gfx_drawstr("L");

  gfx_set(1,1,1,1);
  gfx_measurestr("R", lbl_w, lbl_h);
  gfx_x = gfx_w/2+(gfx_w/2-lbl_w)/2; 
  gfx_y = (gfx_h-lbl_h)/2;
  gfx_drawstr("R");

);


//-- mainloop ------------------
function mainloop()
( 
  play_state = GetPlayState();
  (mouse_cap&1==1 && last_mouse_cap&1==0) || 
  (play_state&1==1 && last_play_state&1==0)  ? 
  clip_L=clip_R=0;
  
  Indicator(); 
  //------------------------
  last_mouse_cap = mouse_cap;
  last_play_state = play_state; 
  char = gfx_getchar();
  char==32 ? Main_OnCommand(40044, 0); //-- play
  char >= 0 ? defer("mainloop();");    //-- defer
  gfx_update();
);

//-- init ----------------------
function Init()
(
  gfx_init("Clip Indicator",300,130,0,500,500);
  gfx_clear = 0;
  gfx_set(0,0,0,1);
  gfx_setfont(1, "Arial", 100);
  last_mouse_cap = 0;
);


Init();
mainloop();
__________________
ReaScripts

Last edited by eugen2777; 09-29-2016 at 09:32 AM.
eugen2777 is offline   Reply With Quote
Old 09-29-2016, 10:31 AM   #12
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by eugen2777 View Post
On the basis of nofish code, you can make a simple indicator.


Code:
function Indicator()
  local(masterTrack, peakInfo_L, peakInfo_R, lbl_w, lbl_h)
( 
  masterTrack = GetMasterTrack(0);
  peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
  peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
  peakInfo_L > 1 ? clip_L = 1;
  peakInfo_R > 1 ? clip_R = 1;   
  
  gfx_set(clip_L, 0, 0, 1);
  gfx_rect(0,0, gfx_w/2, gfx_h, 1);
  
  gfx_set(clip_R, 0, 0, 1);
  gfx_rect(gfx_w/2, 0, gfx_w/2, gfx_h, 1);
  
  gfx_set(1,1,1,1);
  gfx_line(gfx_w/2,0,gfx_w/2,gfx_h);
  
  gfx_measurestr("L", lbl_w, lbl_h);
  gfx_x = (gfx_w/2-lbl_w)/2; 
  gfx_y = (gfx_h-lbl_h)/2;
  gfx_drawstr("L");

  gfx_set(1,1,1,1);
  gfx_measurestr("R", lbl_w, lbl_h);
  gfx_x = gfx_w/2+(gfx_w/2-lbl_w)/2; 
  gfx_y = (gfx_h-lbl_h)/2;
  gfx_drawstr("R");

);


//-- mainloop ------------------
function mainloop()
( 
  play_state = GetPlayState();
  (mouse_cap&1==1 && last_mouse_cap&1==0) || 
  (play_state&1==1 && last_play_state&1==0)  ? 
  clip_L=clip_R=0;
  
  Indicator(); 
  //------------------------
  last_mouse_cap = mouse_cap;
  last_play_state = play_state; 
  char = gfx_getchar();
  char==32 ? Main_OnCommand(40044, 0); //-- play
  char >= 0 ? defer("mainloop();");    //-- defer
  gfx_update();
);

//-- init ----------------------
function Init()
(
  gfx_init("Clip Indicator",300,130,0,500,500);
  gfx_clear = 0;
  gfx_set(0,0,0,1);
  gfx_setfont(1, "Arial", 100);
  last_mouse_cap = 0;
);


Init();
mainloop();
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?
ertugrulgul is offline   Reply With Quote
Old 10-08-2016, 08:46 AM   #13
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

bump!
ertugrulgul is offline   Reply With Quote
Old 10-08-2016, 12:32 PM   #14
ericzang
Human being with feelings
 
ericzang's Avatar
 
Join Date: Mar 2014
Location: Phoenix, AZ
Posts: 488
Default

Merhaba ertugrulgul, this is a little closer to what you are asking.

I don't know how to put it in the toolbar. Docking is similar.

Thank you eugen and nofish!
Attached Images
File Type: jpg clip.JPG (47.7 KB, 272 views)
Attached Files
File Type: zip Clip Indicator Master Sum.zip (724 Bytes, 166 views)

Last edited by ericzang; 10-08-2016 at 01:32 PM.
ericzang is offline   Reply With Quote
Old 11-03-2016, 01:21 PM   #15
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by ericzang View Post
Merhaba ertugrulgul, this is a little closer to what you are asking.

I don't know how to put it in the toolbar. Docking is similar.

Thank you eugen and nofish!
Although it's not quite what I wanted, thank you.
ertugrulgul is offline   Reply With Quote
Old 05-24-2017, 04:22 PM   #16
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by nofish View Post
Agreed, this would be better.
So we'll have to wait if someone turns up knowing if this is possible (and how).

I can post what I have currently (rather simple, in Eel):

Code:
lstate = -1;

function run(finishup)
( 
  masterTrack = GetMasterTrack(0);
  peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
  peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
  peakInfo_L > 1 || peakInfo_R > 1 ? (clipped = 1;) : (clipped = 0);    
   
  // toolbar toggle state example by Jeffos
  get_action_context(#fn,sec,cmd);
  state=finishup ? -1 : (clipped);
  state != lstate ? 
  ( 
    SetToggleCommandState(sec, cmd, state);  
    RefreshToolbar2(sec, cmd);  
    lstate=state;
  );
  !finishup ? defer("run(0);"); 
);

defer("run(0);");
atexit("run(1);");
can you or someone make this start the script automatically when reaper starts?
ertugrulgul is offline   Reply With Quote
Old 05-24-2017, 04:47 PM   #17
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by ertugrulgul View Post
can you or someone make this start the script automatically when reaper starts?
If you haven't already, install SWS extensions.

http://www.sws-extension.org/

Then in Action List search for "SWS/S&M: Set global startup action" and assign this script to it.
nofish is offline   Reply With Quote
Old 05-24-2017, 05:49 PM   #18
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by nofish View Post
If you haven't already, install SWS extensions.

http://www.sws-extension.org/

Then in Action List search for "SWS/S&M: Set global startup action" and assign this script to it.
Thank you man! I wish someone turn this into a sticky one, it would be excatly what I want.
ertugrulgul is offline   Reply With Quote
Old 05-24-2017, 07:57 PM   #19
junh1024
Human being with feelings
 
Join Date: Feb 2014
Posts: 240
Default

http://www.stillwellaudio.com/plugins/bitter/ Does this fit the bill?
junh1024 is offline   Reply With Quote
Old 05-25-2017, 06:11 AM   #20
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by junh1024 View Post
no
ertugrulgul is offline   Reply With Quote
Old 05-25-2017, 06:00 PM   #21
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by nofish View Post

Code:
lstate = -1;

function run(finishup)
( 
  masterTrack = GetMasterTrack(0);
  peakInfo_L = Track_GetPeakInfo(masterTrack, 0);
  peakInfo_R = Track_GetPeakInfo(masterTrack, 1);
  peakInfo_L > 1 || peakInfo_R > 1 ? (clipped = 1;) : (clipped = 0);    
   
  // toolbar toggle state example by Jeffos
  get_action_context(#fn,sec,cmd);
  state=finishup ? -1 : (clipped);
  state != lstate ? 
  ( 
    SetToggleCommandState(sec, cmd, state);  
    RefreshToolbar2(sec, cmd);  
    lstate=state;
  );
  !finishup ? defer("run(0);"); 
);

defer("run(0);");
atexit("run(1);");
Who can turn this into a sticky toolbar button?
ertugrulgul is offline   Reply With Quote
Old 05-29-2017, 03:00 PM   #22
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Anyone?
ertugrulgul is offline   Reply With Quote
Old 05-29-2017, 09:59 PM   #23
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

I don't suppose a JSFX can access the Toolbar (of Reaper or that provided by the OS).

You would need a VST that does an appropriate Reaper or OS API call.

-Michael
mschnell is online now   Reply With Quote
Old 05-29-2017, 10:54 PM   #24
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Edit:

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).

-Michael

Last edited by mschnell; 05-30-2017 at 09:26 AM.
mschnell is online now   Reply With Quote
Old 05-30-2017, 04:28 PM   #25
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

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
ertugrulgul is offline   Reply With Quote
Old 05-30-2017, 10:15 PM   #26
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

So why did you ask for "Toolbar" twice ?

-Michael
mschnell is online now   Reply With Quote
Old 05-31-2017, 05:09 AM   #27
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

I revisited this and managed to make it sticky.



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.
nofish is offline   Reply With Quote
Old 05-15-2021, 04:40 PM   #28
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by nofish View Post
I revisited this and managed to make it sticky.



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?
ertugrulgul is offline   Reply With Quote
Old 05-15-2021, 10:23 PM   #29
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,687
Default

Quote:
Originally Posted by ertugrulgul View Post
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
mschnell is online now   Reply With Quote
Old 05-17-2021, 10:03 AM   #30
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by mschnell View Post
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
Yeah I know that.
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 08:34 AM   #31
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

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.
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 08:46 AM   #32
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

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.


Last edited by benmrx; 05-18-2021 at 08:56 AM.
benmrx is offline   Reply With Quote
Old 05-18-2021, 09:08 AM   #33
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by benmrx View Post
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.
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 09:13 AM   #34
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

The idea is to implement this on reaper:
https://imgur.com/AzLbwE5
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 09:21 AM   #35
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Quote:
Originally Posted by ertugrulgul View Post
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.

Quote:
Originally Posted by ertugrulgul View Post
The idea is to implement this on reaper:
https://imgur.com/AzLbwE5
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.
benmrx is offline   Reply With Quote
Old 05-18-2021, 02:03 PM   #36
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by benmrx View Post
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.
Can you post the script for me to try?
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 03:45 PM   #37
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Quote:
Originally Posted by ertugrulgul View Post
Can you post the script for me to try?
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.
Attached Files
File Type: lua Revilo_PeakIndicator.lua (5.2 KB, 68 views)
File Type: lua Revilo_PeakIndicator_Button.lua (688 Bytes, 58 views)
benmrx is offline   Reply With Quote
Old 05-18-2021, 04:24 PM   #38
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by benmrx View Post
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.
ertugrulgul is offline   Reply With Quote
Old 05-18-2021, 05:01 PM   #39
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

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.
Attached Files
File Type: lua Revilo_PeakIndicator.lua (5.7 KB, 59 views)
benmrx is offline   Reply With Quote
Old 05-18-2021, 05:25 PM   #40
ertugrulgul
Human being with feelings
 
Join Date: Jul 2014
Location: Turkey
Posts: 233
Default

Quote:
Originally Posted by benmrx View Post
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.
ertugrulgul 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 01:37 PM.


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