Hi guys,
Really this is all cfillion's code example from
this thread, but I decided to make 4 scripts -- 1 for each preset. I find it tedious to mouse around on the Peak Display Setting window while editing... so I made 4 presets with varying degrees of vertical waveform zoom. This is the actual control that is being changed behind the scene... and it doesn't need to even be open:
Here I have a toolbar to change the settings to demonstrate... as well as binding them to key commands (7, 8, 9, and 0 in this case). Of course you can change the values of the
gainfactor variables to suit your preferences.
Should this be in ReaPack?
The code is crazy simple... except I would have never found the correct function or variable name without cfillion's help.
Set Peaks Display 1 (0dB)
Code:
function Set_Peak_Display_to_0 ()
local gainFactor = 1 -- 0dB You can substitue your own value here (prefereably between 0-64)
dB = reaper.SNM_SetDoubleConfigVar('projpeaksgain', gainFactor)
reaper.UpdateArrange()
end
Set_Peak_Display_to_0 ()
Set Peaks Display 2 (9dB)
Code:
function Set_Peak_Display_to_9dB ()
local gainFactor = 2.83 -- 9dB You can substitue your own value here (prefereably between 0-64)
dB = reaper.SNM_SetDoubleConfigVar('projpeaksgain', gainFactor)
reaper.UpdateArrange()
end
Set_Peak_Display_to_9dB ()
Set Peaks Display 3 (22dB)
Code:
function Set_Peak_Display_to_22dB ()
local gainFactor = 12.6 -- 22dB You can substitue your own value here (prefereably between 0-64)
dB = reaper.SNM_SetDoubleConfigVar('projpeaksgain', gainFactor)
reaper.UpdateArrange()
end
Set_Peak_Display_to_22dB ()
Set Peaks Display 4 (36dB)
Code:
function Set_Peak_Display_to_36dB ()
local gainFactor = 63.4 -- 36dB You can substitue your own value here (prefereably between 0-64)
dB = reaper.SNM_SetDoubleConfigVar('projpeaksgain', gainFactor)
reaper.UpdateArrange()
end
Set_Peak_Display_to_36dB ()