Old 02-13-2020, 11:36 AM   #1
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default script for show/ hide peaks in items ? interest ?

Would it be possible to write a script to toggle peak view in items ?
permeke is offline   Reply With Quote
Old 02-13-2020, 12:08 PM   #2
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

No script needed here. You can use Cycle action from SWS
Then through "step" put two action:

Peaks: Remove all peak cache files
----- Step -----
Peaks: Rebuild all peaks

This will work for all items.
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 12:17 PM   #3
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default

well yes it works but much slower than prefs >"display peaks for media items" which is logical as they need to be rebuild. Besides the midi notes in items are still visible.

So a script that toggles that pref would be needed I guess.
permeke is offline   Reply With Quote
Old 02-13-2020, 12:51 PM   #4
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Here try
PHP Code:
if reaper.SNM_GetIntConfigVar('showpeaks',0) == 19 then
  reaper
.SNM_SetIntConfigVar('showpeaks'18)
else
  
reaper.SNM_SetIntConfigVar('showpeaks'19)
end

  
reaper
.UpdateArrange() 
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 12:59 PM   #5
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

hmm, the default configuration does not have the numbers that I have. It is probably more difficult here.
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 01:01 PM   #6
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Another option
PHP Code:
if reaper.SNM_GetIntConfigVar('showpeaks'0) == 3 then
  reaper
.SNM_SetIntConfigVar('showpeaks'0)
else
  
reaper.SNM_SetIntConfigVar('showpeaks'3)
end

  
reaper
.UpdateArrange() 
__________________
My scripts for rendering

Last edited by Yanick; 02-13-2020 at 01:08 PM.
Yanick is online now   Reply With Quote
Old 02-13-2020, 01:16 PM   #7
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

"showpeaks" seems to be a bitmasked value (I have values >= 512)...maybe this would work:
Code:
local showpeaks = reaper.SNM_GetIntConfigVar("showpeaks", -1)
local display_peaks = showpeaks&1 == 1
if display_peaks then
  reaper.SNM_SetIntConfigVar("showpeaks", showpeaks-1)
else
  reaper.SNM_SetIntConfigVar("showpeaks", showpeaks+1)
end
reaper.UpdateArrange()
spk77 is offline   Reply With Quote
Old 02-13-2020, 01:20 PM   #8
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Here the number in reaper.ini depends on the type of peaks. The spectrogram, normal, etc. Now I look more closely
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 01:24 PM   #9
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Quote:
Originally Posted by spk77 View Post
"showpeaks" seems to be a bitmask (I have values >= 512)...maybe this would work:
Code:
local showpeaks = reaper.SNM_GetIntConfigVar("showpeaks", -1)
local display_peaks = showpeaks&1 == 1
if display_peaks then
  reaper.SNM_SetIntConfigVar("showpeaks", showpeaks-1)
else
  reaper.SNM_SetIntConfigVar("showpeaks", showpeaks+1)
end
reaper.UpdateArrange()
Oh, hi! I want to ask about your script
Script: spk77_Copy stretch markers from selected item to other items in group.eel
There you need to add the GetTakeStretchMarkerSlope function. But I do not really understand eel
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 01:31 PM   #10
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Quote:
Originally Posted by spk77 View Post
"showpeaks" seems to be a bitmasked value (I have values >= 512)...maybe this would work
Yes, right! You are ahead of me
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 01:34 PM   #11
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Yanick View Post
Oh, hi! I want to ask about your script
Script: spk77_Copy stretch markers from selected item to other items in group.eel
There you need to add the GetTakeStretchMarkerSlope function. But I do not really understand eel
Hi!
That's a really old script...I haven't done anything with EEL for a while, but I can take a look. (GetTakeStretchMarkerSlope is also new for me )
spk77 is offline   Reply With Quote
Old 02-13-2020, 01:39 PM   #12
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Quote:
Originally Posted by spk77 View Post
Hi!
That's a really old script...I haven't done anything with EEL for a while, but I can take a look. (GetTakeStretchMarkerSlope is also new for me )
I would be grateful It can be more accurately copy stretch markers
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 02:05 PM   #13
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default

Quote:
Originally Posted by Yanick View Post
Another option
PHP Code:
if reaper.SNM_GetIntConfigVar('showpeaks'0) == 3 then
  reaper
.SNM_SetIntConfigVar('showpeaks'0)
else
  
reaper.SNM_SetIntConfigVar('showpeaks'3)
end

  
reaper
.UpdateArrange() 

hey Yanick. Thanks for that but what now ? I'm a simple musician not a programmer.
Should I make a text file of this ? and what .xt to use ?

thanks
permeke is offline   Reply With Quote
Old 02-13-2020, 02:11 PM   #14
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 171
Default

Take the code from spk77
Then repeat as in the video
https://drive.google.com/file/d/1B7B...ew?usp=sharing
__________________
My scripts for rendering
Yanick is online now   Reply With Quote
Old 02-13-2020, 02:21 PM   #15
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default

hey ! , thank you both for that lightning fast support.
Will try that out .
permeke is offline   Reply With Quote
Old 02-13-2020, 02:56 PM   #16
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default

It works !!!
Nice
permeke is offline   Reply With Quote
Old 02-14-2020, 12:40 AM   #17
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,097
Default

Here's another:

Toggle Display Peaks:
Code:
-- Toggle display peaks
 reaper.SNM_SetIntConfigVar("showpeaks", reaper.SNM_GetIntConfigVar("showpeaks", -666)~1) --Peaks bitwise NOT, flip bit
 
 reaper.UpdateArrange()
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is offline   Reply With Quote
Old 02-14-2020, 08:18 AM   #18
PelF
Human being with feelings
 
Join Date: Mar 2013
Posts: 94
Default

What should I do to apply this script to only one selected item? Thank you very much..
PelF is offline   Reply With Quote
Old 02-14-2020, 09:12 AM   #19
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,097
Default

Quote:
Originally Posted by PelF View Post
What should I do to apply this script to only one selected item? Thank you very much..
I don't think you can. The script is turning ON/OFF a "Display Peaks" checkbox buried in the preferences. It's a global checkbox. I don't know of (or think there is) a way to do it per item.
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is offline   Reply With Quote
Old 02-14-2020, 09:21 AM   #20
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 74
Default

Quote:
Originally Posted by PelF View Post
What should I do to apply this script to only one selected item? Thank you very much..
Why would you want it for just one item may I ask ?
permeke is offline   Reply With Quote
Old 02-14-2020, 10:25 AM   #21
PelF
Human being with feelings
 
Join Date: Mar 2013
Posts: 94
Default

I use the "Set all selected video items to Ignore Audio" script from ReaPack, which turns off the audio in the video file. However, it cannot turn off display peaks. I would like to combine these two actions.
PelF is offline   Reply With Quote
Old 02-15-2020, 10:56 AM   #22
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by Thonex View Post
Here's another:

Toggle Display Peaks:
Code:
-- Toggle display peaks
 reaper.SNM_SetIntConfigVar("showpeaks", reaper.SNM_GetIntConfigVar("showpeaks", -666)~1) --Peaks bitwise NOT, flip bit
 
 reaper.UpdateArrange()
That's a better way to do it! I'm not good at manipulating bits
spk77 is offline   Reply With Quote
Old 02-15-2020, 11:58 AM   #23
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 322
Default

Quote:
Originally Posted by Thonex View Post
Here's another:

Toggle Display Peaks:
Code:
-- Toggle display peaks
 reaper.SNM_SetIntConfigVar("showpeaks", reaper.SNM_GetIntConfigVar("showpeaks", -666)~1) --Peaks bitwise NOT, flip bit
 
 reaper.UpdateArrange()
Is it possible to toggle spectral peaks for selected item ?
__________________
Reaper 6.05 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v0.999 / Ultraschall API: v43006.00
todoublez is offline   Reply With Quote
Old 02-15-2020, 04:16 PM   #24
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,097
Default

Quote:
Originally Posted by todoublez View Post
Is it possible to toggle spectral peaks for selected item ?
I don’t think so. See my post 5 posts above.
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is offline   Reply With Quote
Old 02-16-2020, 08:11 AM   #25
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 322
Default

Quote:
Originally Posted by Thonex View Post
I don’t think so. See my post 5 posts above.
:/ i see, thx for the info !
__________________
Reaper 6.05 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v0.999 / Ultraschall API: v43006.00
todoublez 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 12:51 PM.


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