Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 10-16-2017, 04:18 PM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default GetTakeEnvelopeByName bug 100% reproducible (test code and licecap) (FIXED)

There is a bug in GetTakeEnvelopeByName.

Bug: GetTakeEnvelopeByName keeps returning an envelope even if that envelope does not exist any more!

Test code:
Code:
local function Main()
  reaper.ClearConsole()
  local item = reaper.GetSelectedMediaItem( 0, 0 )
  if item then 
    local take = reaper.GetActiveTake( item )
    if take then
      reaper.ShowConsoleMsg("active take: ".. tostring(take) .. "\n")
      local VolEnv = reaper.GetTakeEnvelopeByName(take,"Volume")
      if VolEnv then
        reaper.ShowConsoleMsg("VolEnv: "..tostring(VolEnv).."\n\n\nENVELOPE CHUNK:\n\n")
        local _, chunk = reaper.GetEnvelopeStateChunk( VolEnv, "", true )
        reaper.ShowConsoleMsg(chunk .. "\n\nITEM CHUNK:\n\n")
        local _, chunk2 = reaper.GetItemStateChunk( item, "", true )
        reaper.ShowConsoleMsg(chunk2)
      else
        reaper.ShowConsoleMsg("No Volume Env exists for this take")
      end
    end
  end
end
Main()
reaper.defer(function () end)
How to Reproduce:

1) Select an item that never had a volume envelope(important!) and run the code. You will get the message:
"No Volume Env exists for this take"

2) Now run action "Take: Toggle take volume envelope" (40693) and then again the code. You will get the envelope chunk and the item chunk. You can clearly see that the envelope chunk exists at the end of the item chunk.

3) Now run again action 40693 and run again the code. BUG:
You still get the envelope chunk although it doesn't exist any more, as can be clearly seen in the item chunk.

__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 10-17-2017, 11:01 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Fixing this!
Justin is offline   Reply With Quote
Old 10-17-2017, 06:43 PM   #3
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Thank you
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma 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:03 PM.


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