Cockos Incorporated Forums Reascript: GetPeakInfo and GetPeakHoldDB returning dubious values
 Register Track Bugs/Feature Requests Search Today's Posts Mark Forums Read

 02-07-2020, 11:32 AM #1 Cedrik0s Human being with feelings   Join Date: Oct 2014 Posts: 62 Reascript: GetPeakInfo and GetPeakHoldDB returning dubious values Using Reascript Python on Windows (but Lua does the same), the 2 functions have a weird behaviour, or at least not the one I'd expect. Sending a steady signal on a track (be it a tone or a DC), and polling repeatedly the Peak value with GetPeakInfo does not return a constant value as I would expect. Just try that: Code: def Loop(): tr = RPR_GetTrack(0, 0) msg(RPR_Track_GetPeakInfo(tr, 0)) time.sleep(0.5) RPR_defer("Loop()") Loop() You'll get values like these for an sine at -12dB (so I'd expect peaks at 0.25): 0.25 0.0001699551212368533 0.001268418156541884 0.25 1.0375602869316936e-05 0.001502196304500103 0.0014873228501528502 0.0014873228501528502 0.0017440064111724496 0.0014873228501528502 0.25 0.25 0.25 8.937004167819396e-06 0.25 What are those small values between the 0.25s? The other function, GetPeakHoldDB is weird too: If you use this code: Code: def Loop(): tr = RPR_GetTrack(0, 0) msg(RPR_Track_GetPeakHoldDB(tr, 0, False)) RPR_Track_GetPeakHoldDB(tr, 0, True) # clear the peak hold time.sleep(0.5) RPR_defer("Loop()") Loop() You get values like these: -120.0 -0.121 -120.0 -0.121 -0.121 -0.121 -0.121 -0.121 -0.121 -120.0 -0.121 -120.0 -0.121 -120.0 -120.0 -120.0 -0.121 -120.0 -0.121 -120.0 Here the correct value is the -0.121. The fact that the function has DB in its name but returns cents of DBs seems like a first inconsistency. The fact that it returns -120 many times doesn't really make sense (that would be -12000dB!!) and this looks like a bug too. Also by calling RPR_Track_GetPeakHoldDB(tr, 0, True), I would expect it to return the peak value and then clear the hold. Instead it will only return -120, always... I think both function misbehave (and must be punished). Thanks. C Last edited by Cedrik0s; 02-08-2020 at 08:12 AM. Reason: Make title clearer

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home REAPER Forums     REAPER General Discussion Forum     newbieland     REAPER Q&A, Tips, Tricks and Howto     Recording Technologies and Techniques     REAPER Compatibility     REAPER Color Themes and Icon Sets     MIDI Hardware, Control Surfaces, and OSC     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     REAPER Bug Reports     REAPER Feature Requests     Dstruct's Casa De Nitpicks     REAPER for Live Use     REAPER for Video Editing/Mangling     REAPER for Ambisonic and 3D positional audio uses     ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum     REAPER for macOS X     REAPER for Linux     REAPER Pre-Release Discussion     REAPER Music/Collaboration Discussion NINJAM Discussion     NINJAM User Discussion     NINJAM Developer Discussion Other Software Discussion     WDL users forum     LICEcap Discussion     OSCII-bot forum     Old Cockos Products Forum

All times are GMT -7. The time now is 01:35 AM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top