Old 07-28-2020, 06:10 PM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default Help needed for Parameter-Modulations in Ultraschall-API

Note: Monitoring-Demo-Script and information about it in posts:
https://forum.cockos.com/showpost.ph...72&postcount=5 and
https://forum.cockos.com/showpost.ph...73&postcount=6




After some time, I finally started working on functions for programming parameter-modulation and I just finished a get function.
Now here's the thing: I never use parameter-modulation. You probably do. So you can help me getting the stuff right.

So, if you code and would like to program ParmModulation, please test the following function, which returns a table with all settings available from a certain Parameter-Modulation. Please test if they work properly, look for nil-error-bugs or for constellations, where the function doesn't return valid values, even though it should according to its documentation.

And have a first look, if the table, as it is, is handy, the names of the table-entries are properly named, etc etc. Any feedback is welcome.
If the get-function works, I can add Add/Set/Count/Delete as well into Ultraschall-API.

IMPORTANT: This is code in progress, so you shouldn't use it in productive code, yet.

See the docs for more information: https://mespotin.uber.space/Ultrasch...tionTable.html

And here's the function to test:
Code:
function ultraschall.GetParmModulationTable(FXStateChunk, index)
  if ultraschall.type(FXStateChunk)~="string" then ultraschall.AddErrorMessage("GetParmModulationTable", "FXStateChunk", "must be a string", -1) return nil end
  if ultraschall.IsValidFXStateChunk(FXStateChunk)==false then ultraschall.AddErrorMessage("GetParmModulationTable", "FXStateChunk", "must be a valid FXStateChunk", -2) return nil end
  if ultraschall.type(index)~="number: integer" then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "must be an integer", -3) return nil end
  if index<1 then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "must be bigger than 0", -4) return nil end
  local count=0
  local found=""
  ParmModTable={}
  for k in string.gmatch(FXStateChunk, "\n    <PROGRAMENV.-\n    >") do
    count=count+1
    if count==index then found=k break end
  end
  if found=="" then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "no such index", -5) return nil end
  found=string.gsub(found, "\n", " \n")
  
--  print_update(found)

  -- <PROGRAMENV
  ParmModTable["PARAM_NR"], ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"]=found:match("<PROGRAMENV (.-) (.-) ")
  if tonumber(ParmModTable["PARAM_NR"])~=nil then
    ParmModTable["PARAM_NR"]=tonumber(ParmModTable["PARAM_NR"])
    ParmModTable["PARAM_TYPE"]=""
  else
    ParmModTable["PARAM_TYPE"]=ParmModTable["PARAM_NR"]:match(":(.*)")
    ParmModTable["PARAM_NR"]=tonumber(ParmModTable["PARAM_NR"]:match("(.-):"))
  end
  ParmModTable["PARAM_NR"]=ParmModTable["PARAM_NR"]+1
  ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"]=tonumber(ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"])==0

  -- PARAMBASE
  ParmModTable["PARAMOD_BASELINE"]=tonumber(found:match("PARAMBASE (.-) "))
  
  ParmModTable["LFO"]=tonumber(found:match("LFO (.-) "))==1

  -- LFOWT  
  ParmModTable["LFO_STRENGTH"], 
  ParmModTable["LFO_DIRECTION"]=found:match("LFOWT (.-) (.-) ")
  ParmModTable["LFO_STRENGTH"]=tonumber(ParmModTable["LFO_STRENGTH"])
  ParmModTable["LFO_DIRECTION"]=tonumber(ParmModTable["LFO_DIRECTION"])

  -- AUDIOCTL
  ParmModTable["AUDIOCONTROL"]=tonumber(found:match("AUDIOCTL (.-) "))==1
  
  -- AUDIOCTLWT
  ParmModTable["AUDIOCONTROL_STRENGTH"], 
  ParmModTable["AUDIOCONTROL_DIRECTION"]=found:match("AUDIOCTLWT (.-) (.-) ")
  ParmModTable["AUDIOCONTROL_STRENGTH"]=tonumber(ParmModTable["AUDIOCONTROL_STRENGTH"])
  ParmModTable["AUDIOCONTROL_DIRECTION"]=tonumber(ParmModTable["AUDIOCONTROL_DIRECTION"])
  
  -- PLINK
  ParmModTable["PARMLINK_SCALE"], 
  ParmModTable["PARMLINK_LINKEDPLUGIN"],
  ParmModTable["PARMLINK_LINKEDPARMIDX"],
  ParmModTable["PARMLINK_OFFSET"]
  =found:match(" PLINK (.-) (.-) (.-) (.-) ")
  
  ParmModTable["PARMLINK_SCALE"]=tonumber(ParmModTable["PARMLINK_SCALE"])
  if ParmModTable["PARMLINK_LINKEDPLUGIN"]~=nil then
    if ParmModTable["PARMLINK_LINKEDPLUGIN"]:match(":")~=nil then 
      ParmModTable["PARMLINK_LINKEDPLUGIN"]=tonumber(ParmModTable["PARMLINK_LINKEDPLUGIN"]:match("(.-):"))+1
    else
      ParmModTable["PARMLINK_LINKEDPLUGIN"]=tonumber(ParmModTable["PARMLINK_LINKEDPLUGIN"])
    end
  end
  ParmModTable["PARMLINK_LINKEDPARMIDX"]=tonumber(ParmModTable["PARMLINK_LINKEDPARMIDX"])
  if ParmModTable["PARMLINK_LINKEDPARMIDX"]~=nil and ParmModTable["PARMLINK_LINKEDPARMIDX"]>-1 then ParmModTable["PARMLINK_LINKEDPARMIDX"]=ParmModTable["PARMLINK_LINKEDPARMIDX"]+1 end
  ParmModTable["PARMLINK_OFFSET"]=tonumber(ParmModTable["PARMLINK_OFFSET"])

  ParmModTable["PARMLINK"]=ParmModTable["PARMLINK_SCALE"]~=nil

  -- MIDIPLINK
  ParmModTable["MIDIPLINK_BUS"], 
  ParmModTable["MIDIPLINK_CHANNEL"],
  ParmModTable["MIDIPLINK_MIDICATEGORY"],
  ParmModTable["MIDIPLINK_MIDINOTE"]
  =found:match("MIDIPLINK (.-) (.-) (.-) (.-) ")
  ParmModTable["MIDIPLINK_BUS"]=tonumber(ParmModTable["MIDIPLINK_BUS"])
  ParmModTable["MIDIPLINK_CHANNEL"]=tonumber(ParmModTable["MIDIPLINK_CHANNEL"])
  ParmModTable["MIDIPLINK_MIDICATEGORY"]=tonumber(ParmModTable["MIDIPLINK_MIDICATEGORY"])
  ParmModTable["MIDIPLINK_MIDINOTE"]=tonumber(ParmModTable["MIDIPLINK_MIDINOTE"])

  ParmModTable["MIDIPLINK"]=ParmModTable["MIDIPLINK_MIDINOTE"]~=nil
  
  -- LFOSHAPE
  ParmModTable["LFO_SHAPE"]=tonumber(found:match("LFOSHAPE (.-) "))
  
  -- LFOSYNC
  ParmModTable["LFO_TEMPOSYNC"], 
  ParmModTable["LFO_SHAPEOLD"],
  ParmModTable["LFO_PHASERESET"]
  =found:match("LFOSYNC (.-) (.-) (.-) ")
  ParmModTable["LFO_TEMPOSYNC"] = tonumber(ParmModTable["LFO_TEMPOSYNC"])==1
  ParmModTable["LFO_SHAPEOLD"]  = tonumber(ParmModTable["LFO_SHAPEOLD"])
  ParmModTable["LFO_PHASERESET"]= tonumber(ParmModTable["LFO_PHASERESET"])
  
  -- LFOSPEED
  ParmModTable["LFO_SPEED"], 
  ParmModTable["LFO_PHASE"]
  =found:match("LFOSPEED (.-) (.-) ")
  ParmModTable["LFO_SPEED"]=tonumber(ParmModTable["LFO_SPEED"])
  ParmModTable["LFO_PHASE"]=tonumber(ParmModTable["LFO_PHASE"])
  
  if found:match("CHAN (.-) ")~=nil then
    ParmModTable["AUDIOCONTROL_CHAN"]  =tonumber(found:match("CHAN (.-) "))+1
  end
  ParmModTable["AUDIOCONTROL_STEREO"]=tonumber(found:match("STEREO (.-) "))

  -- RMS
  ParmModTable["AUDIOCONTROL_ATTACK"], 
  ParmModTable["AUDIOCONTROL_RELEASE"]
  =found:match("RMS (.-) (.-) ")
  ParmModTable["AUDIOCONTROL_ATTACK"]=tonumber(ParmModTable["AUDIOCONTROL_ATTACK"])
  ParmModTable["AUDIOCONTROL_RELEASE"]=tonumber(ParmModTable["AUDIOCONTROL_RELEASE"])
  
  --DBLO and DBHI
  ParmModTable["AUDIOCONTROL_MINVOLUME"]=tonumber(found:match("DBLO (.-) "))
  ParmModTable["AUDIOCONTROL_MAXVOLUME"]=tonumber(found:match("DBHI (.-) "))
  
  -- X2, Y2
  ParmModTable["X2"]=tonumber(found:match("X2 (.-) "))
  ParmModTable["Y2"]=tonumber(found:match("Y2 (.-) "))

  -- MODHWND
  ParmModTable["WINDOW_ALTEREDOPEN"], 
  ParmModTable["WINDOW_XPOS"],
  ParmModTable["WINDOW_YPOS"],
  ParmModTable["WINDOW_RIGHT_READONLY"],
  ParmModTable["WINDOW_BOTTOM_READONLY"]
  =found:match("MODWND (.-) (.-) (.-) (.-) (.-) ")
  ParmModTable["WINDOW_OPENED"]=tonumber(ParmModTable["WINDOW_OPENED"])==1
  ParmModTable["WINDOW_XPOS"]  =tonumber(ParmModTable["WINDOW_XPOS"])
  ParmModTable["WINDOW_YPOS"]  =tonumber(ParmModTable["WINDOW_YPOS"])
  ParmModTable["WINDOW_RIGHT"] =tonumber(ParmModTable["WINDOW_RIGHT"])
  ParmModTable["WINDOW_BOTTOM"]=tonumber(ParmModTable["WINDOW_BOTTOM"])
  
  return ParmModTable
end
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish

Last edited by Meo-Ada Mespotine; 08-01-2020 at 06:25 AM.
Meo-Ada Mespotine is online now   Reply With Quote
Old 07-28-2020, 11:29 PM   #2
guidofazzito
Human being with feelings
 
Join Date: Mar 2019
Posts: 3
Default

Hi there! Iīve tried the script, but thereīs something Iīm doing wrong. Also I donīt understand very much the function of the ParmModulation and the FXStateChunk, if you can help me
Hereīs the error window in Reaper
Attached Images
File Type: png Parmodulation.png (59.2 KB, 16 views)
guidofazzito is offline   Reply With Quote
Old 07-29-2020, 12:50 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default

You need to install and use Ultraschall-Api for it and you probably should have some experience working with it for these tests.

But thanks for trying anyway. When the stuff is finished, I'll write a proper documentation for it so it's easier to grasp, how to do it.

Oh and did I get it right, that you don't have experience with parameter modulation or rather have no clue, what the function does?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 07-31-2020, 10:25 PM   #4
guidofazzito
Human being with feelings
 
Join Date: Mar 2019
Posts: 3
Default

I did a bit of research on the ultrashall web page. Congrats for the work! Itīs for podcasts and itīs not my style, but Iīll dig in the scripts so I can get some functions to use.
Iīm having a bit of trouble understanding it, so a documentation would be great. About the modulation, I didnīt understand itīs functioning, but it was because I didnīt install the ultrashall.
Thanks and keep improving!
guidofazzito is offline   Reply With Quote
Old 08-01-2020, 06:22 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default

Ok, I wrote a monitoring script, which you could use. You need to have Ultraschall-API installed(more information at api.mespotine.de)

This opens a new tab, adds a track with a simple 3 band eq-effect.
It adds ParameterModulation to it and opens the parameter-modulation-window together with a window, which shows any changes you make in the parameter-modulation-window.
So if you drag a slider, it will show the value highlighted in purple.


Your task is now to find settings, that cause the script to end with an error or clicks/drags/etc, who show no changes in the monitoring-window at all.
If one of them happens, I made a mistake and I need a description, what you tried. Maybe even with a screenshot of the current settings of the ParmModulation-window, so I can toy around with it.

Thank you for keeping on trying. I really appreciate it

(script is in the next post: )
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-01-2020, 06:22 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default

Code:
-- Meo-Ada Mespotine - GetParmModulation - demomonitoringsccript
-- licensed under MIT-license
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
ParmTable={
"AUDIOCONTROL",
"AUDIOCONTROL_ATTACK",
"AUDIOCONTROL_CHAN",
"AUDIOCONTROL_DIRECTION",
"AUDIOCONTROL_MAXVOLUME",
"AUDIOCONTROL_MINVOLUME",
"AUDIOCONTROL_RELEASE",
"AUDIOCONTROL_STEREO",
"AUDIOCONTROL_STRENGTH",
"LFO",
"LFO_DIRECTION",
"LFO_PHASE",
"LFO_PHASERESET",
"LFO_SHAPE",
"LFO_SHAPEOLD",
"LFO_SPEED",
"LFO_STRENGTH",
"LFO_TEMPOSYNC",
"MIDIPLINK",
"PARAM_NR",
"PARAM_TYPE",
"PARAMOD_BASELINE",
"PARAMOD_ENABLE_PARAMETER_MODULATION",
"PARMLINK",
"PARMLINK_LINKEDPARMIDX",
"PARMLINK_LINKEDPLUGIN",
"PARMLINK_OFFSET",
"PARMLINK_SCALE",
"WINDOW_ALTEREDOPEN",
"WINDOW_BOTTOM_READONLY",
"WINDOW_RIGHT_READONLY",
"WINDOW_XPOS",
"WINDOW_YPOS",
"X2",
"Y2"}


InitStateChunk=[[
<TRACK
NAME ""
PEAKCOL 33530462
BEAT -1
AUTOMODE 0
VOLPAN 1 0 -1 -1 1
MUTESOLO 0 0 0
IPHASE 0
PLAYOFFS 0 1
ISBUS 0 0
BUSCOMP 0 0 0 0 0
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
FREEMODE 0
REC 0 0 1 0 0 0 0
VU 2
TRACKHEIGHT 134 0 0
INQ 0 0 0 0.5 100 0 0 100
NCHAN 2
FX 1
TRACKID {4BFA8B9B-8321-4076-953E-F1BAFF093F9C}
PERF 0
MIDIOUT -1
MAINSEND 1 0
<FXCHAIN
WNDRECT 28 56 647 392
SHOW 0
LASTSEL 0
DOCKED 1
BYPASS 0 0 0
<JS loser/3BandEQ ""
24.000000 200.000000 0.000000 2000.000000 0.000000 0.000000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
>
FLOATPOS 0 0 0 0
FXID {DE7B479A-54F2-43CB-994E-E0F1D8C2D246}
<PROGRAMENV 0 0
PARAMBASE 0
LFO 1
LFOWT 1 1
AUDIOCTL 1
AUDIOCTLWT 1 1
PLINK 1 -1 -1 0
LFOSHAPE 0
LFOSYNC 0 0 0
LFOSPEED 0.124573 0
CHAN -1
STEREO 0
RMS 300 300
DBLO -24
DBHI 0
X2 0.5
Y2 0.5
MODWND 1 358 36 654 1274
>
WAK 0 0
>
>
]]

function ultraschall.GetParmModulationTable(FXStateChunk, index)
  if ultraschall.type(FXStateChunk)~="string" then ultraschall.AddErrorMessage("GetParmModulationTable", "FXStateChunk", "must be a string", -1) return nil end
  if ultraschall.IsValidFXStateChunk(FXStateChunk)==false then ultraschall.AddErrorMessage("GetParmModulationTable", "FXStateChunk", "must be a valid FXStateChunk", -2) return nil end
  if ultraschall.type(index)~="number: integer" then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "must be an integer", -3) return nil end
  if index<1 then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "must be bigger than 0", -4) return nil end
  local count=0
  local found=""
  local ParmModTable={}
  for k in string.gmatch(FXStateChunk, "\n    <PROGRAMENV.-\n    >") do
    count=count+1
    if count==index then found=k break end
  end
  if found=="" then ultraschall.AddErrorMessage("GetParmModulationTable", "index", "no such index", -5) return nil end
  
  
  found=string.gsub(found, "\n", " \n")
  
--  print_update(found)

  -- <PROGRAMENV
  ParmModTable["PARAM_NR"], ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"]=found:match("<PROGRAMENV (.-) (.-) ")
  if tonumber(ParmModTable["PARAM_NR"])~=nil then
    ParmModTable["PARAM_NR"]=tonumber(ParmModTable["PARAM_NR"])
    ParmModTable["PARAM_TYPE"]=""
  else
    ParmModTable["PARAM_TYPE"]=ParmModTable["PARAM_NR"]:match(":(.*)")
    ParmModTable["PARAM_NR"]=tonumber(ParmModTable["PARAM_NR"]:match("(.-):"))
  end
  ParmModTable["PARAM_NR"]=ParmModTable["PARAM_NR"]+1
  ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"]=tonumber(ParmModTable["PARAMOD_ENABLE_PARAMETER_MODULATION"])==0

  -- PARAMBASE
  ParmModTable["PARAMOD_BASELINE"]=tonumber(found:match("PARAMBASE (.-) "))
  
  ParmModTable["LFO"]=tonumber(found:match("LFO (.-) "))==1

  -- LFOWT  
  ParmModTable["LFO_STRENGTH"], 
  ParmModTable["LFO_DIRECTION"]=found:match("LFOWT (.-) (.-) ")
  ParmModTable["LFO_STRENGTH"]=tonumber(ParmModTable["LFO_STRENGTH"])
  ParmModTable["LFO_DIRECTION"]=tonumber(ParmModTable["LFO_DIRECTION"])

  -- AUDIOCTL
  ParmModTable["AUDIOCONTROL"]=tonumber(found:match("AUDIOCTL (.-) "))==1
  
  -- AUDIOCTLWT
  ParmModTable["AUDIOCONTROL_STRENGTH"], 
  ParmModTable["AUDIOCONTROL_DIRECTION"]=found:match("AUDIOCTLWT (.-) (.-) ")
  ParmModTable["AUDIOCONTROL_STRENGTH"]=tonumber(ParmModTable["AUDIOCONTROL_STRENGTH"])
  ParmModTable["AUDIOCONTROL_DIRECTION"]=tonumber(ParmModTable["AUDIOCONTROL_DIRECTION"])
  
  -- PLINK
  ParmModTable["PARMLINK_SCALE"], 
  ParmModTable["PARMLINK_LINKEDPLUGIN"],
  ParmModTable["PARMLINK_LINKEDPARMIDX"],
  ParmModTable["PARMLINK_OFFSET"]
  =found:match(" PLINK (.-) (.-) (.-) (.-) ")
  
  ParmModTable["PARMLINK_SCALE"]=tonumber(ParmModTable["PARMLINK_SCALE"])
  if ParmModTable["PARMLINK_LINKEDPLUGIN"]~=nil then
    if ParmModTable["PARMLINK_LINKEDPLUGIN"]:match(":")~=nil then 
      ParmModTable["PARMLINK_LINKEDPLUGIN"]=tonumber(ParmModTable["PARMLINK_LINKEDPLUGIN"]:match("(.-):"))+1
    else
      ParmModTable["PARMLINK_LINKEDPLUGIN"]=tonumber(ParmModTable["PARMLINK_LINKEDPLUGIN"])
    end
  end
  ParmModTable["PARMLINK_LINKEDPARMIDX"]=tonumber(ParmModTable["PARMLINK_LINKEDPARMIDX"])
  if ParmModTable["PARMLINK_LINKEDPARMIDX"]~=nil and ParmModTable["PARMLINK_LINKEDPARMIDX"]>-1 then ParmModTable["PARMLINK_LINKEDPARMIDX"]=ParmModTable["PARMLINK_LINKEDPARMIDX"]+1 end
  ParmModTable["PARMLINK_OFFSET"]=tonumber(ParmModTable["PARMLINK_OFFSET"])

  ParmModTable["PARMLINK"]=ParmModTable["PARMLINK_SCALE"]~=nil

  -- MIDIPLINK
  ParmModTable["MIDIPLINK_BUS"], 
  ParmModTable["MIDIPLINK_CHANNEL"],
  ParmModTable["MIDIPLINK_MIDICATEGORY"],
  ParmModTable["MIDIPLINK_MIDINOTE"]
  =found:match("MIDIPLINK (.-) (.-) (.-) (.-) ")
  ParmModTable["MIDIPLINK_BUS"]=tonumber(ParmModTable["MIDIPLINK_BUS"])
  ParmModTable["MIDIPLINK_CHANNEL"]=tonumber(ParmModTable["MIDIPLINK_CHANNEL"])
  ParmModTable["MIDIPLINK_MIDICATEGORY"]=tonumber(ParmModTable["MIDIPLINK_MIDICATEGORY"])
  ParmModTable["MIDIPLINK_MIDINOTE"]=tonumber(ParmModTable["MIDIPLINK_MIDINOTE"])

  ParmModTable["MIDIPLINK"]=ParmModTable["MIDIPLINK_MIDINOTE"]~=nil
  
  -- LFOSHAPE
  ParmModTable["LFO_SHAPE"]=tonumber(found:match("LFOSHAPE (.-) "))
  
  -- LFOSYNC
  ParmModTable["LFO_TEMPOSYNC"], 
  ParmModTable["LFO_SHAPEOLD"],
  ParmModTable["LFO_PHASERESET"]
  =found:match("LFOSYNC (.-) (.-) (.-) ")
  ParmModTable["LFO_TEMPOSYNC"] = tonumber(ParmModTable["LFO_TEMPOSYNC"])==1
  ParmModTable["LFO_SHAPEOLD"]  = tonumber(ParmModTable["LFO_SHAPEOLD"])
  ParmModTable["LFO_PHASERESET"]= tonumber(ParmModTable["LFO_PHASERESET"])
  
  -- LFOSPEED
  ParmModTable["LFO_SPEED"], 
  ParmModTable["LFO_PHASE"]
  =found:match("LFOSPEED (.-) (.-) ")
  ParmModTable["LFO_SPEED"]=tonumber(ParmModTable["LFO_SPEED"])
  ParmModTable["LFO_PHASE"]=tonumber(ParmModTable["LFO_PHASE"])
  
  if found:match("CHAN (.-) ")~=nil then
    ParmModTable["AUDIOCONTROL_CHAN"]  =tonumber(found:match("CHAN (.-) "))+1
  end
  ParmModTable["AUDIOCONTROL_STEREO"]=tonumber(found:match("STEREO (.-) "))

  -- RMS
  ParmModTable["AUDIOCONTROL_ATTACK"], 
  ParmModTable["AUDIOCONTROL_RELEASE"]
  =found:match("RMS (.-) (.-) ")
  ParmModTable["AUDIOCONTROL_ATTACK"]=tonumber(ParmModTable["AUDIOCONTROL_ATTACK"])
  ParmModTable["AUDIOCONTROL_RELEASE"]=tonumber(ParmModTable["AUDIOCONTROL_RELEASE"])
  
  --DBLO and DBHI
  ParmModTable["AUDIOCONTROL_MINVOLUME"]=tonumber(found:match("DBLO (.-) "))
  ParmModTable["AUDIOCONTROL_MAXVOLUME"]=tonumber(found:match("DBHI (.-) "))
  
  -- X2, Y2
  ParmModTable["X2"]=tonumber(found:match("X2 (.-) "))
  ParmModTable["Y2"]=tonumber(found:match("Y2 (.-) "))

  -- MODHWND
  ParmModTable["WINDOW_ALTEREDOPEN"], 
  ParmModTable["WINDOW_XPOS"],
  ParmModTable["WINDOW_YPOS"],
  ParmModTable["WINDOW_RIGHT_READONLY"],
  ParmModTable["WINDOW_BOTTOM_READONLY"]
  =found:match("MODWND (.-) (.-) (.-) (.-) (.-) ")
  ParmModTable["WINDOW_ALTEREDOPEN"]=tonumber(ParmModTable["WINDOW_ALTEREDOPEN"])==1
  ParmModTable["WINDOW_XPOS"]  =tonumber(ParmModTable["WINDOW_XPOS"])
  ParmModTable["WINDOW_YPOS"]  =tonumber(ParmModTable["WINDOW_YPOS"])
  ParmModTable["WINDOW_RIGHT"] =tonumber(ParmModTable["WINDOW_RIGHT"])
  ParmModTable["WINDOW_BOTTOM"]=tonumber(ParmModTable["WINDOW_BOTTOM"])
  
  return ParmModTable
end

reaper.Main_OnCommand(40859, 0)
reaper.Main_OnCommand(40001, 0)
ultraschall.SetTrackStateChunk_Tracknumber(1, InitStateChunk)
gfx.init("Testscript", 300, 600)
gfx.setfont(1, "arial", 12,0)

A=ultraschall.IsValidTrackStateChunk(InitStateChunk)

FXStateChunk           = ultraschall.GetFXStateChunk(InitStateChunk)
SLEM()
OldParmModulationTable    = ultraschall.GetParmModulationTable(FXStateChunk, 1)
A=0

function main()
  A=A+1
  if A==15 then
    Reval, TrackStateChunk = ultraschall.GetTrackStateChunk_Tracknumber(1)
    FXStateChunk           = ultraschall.GetFXStateChunk(TrackStateChunk)
    ParmModulationTable    = ultraschall.GetParmModulationTable(FXStateChunk, 1)
--    print_update(FXStateChunk)
    gfx.x=0
    gfx.y=10
    gfx.set(1)
    gfx.drawstr("CURRENT VALUES:\n")
    gfx.y=gfx.y+gfx.texth+3
    for i=1, 35 do
      gfx.x=0
      gfx.y=gfx.y+gfx.texth+3
      if ParmModulationTable~=nil and ParmModulationTable[ParmTable[i]]~=OldParmModulationTable[ParmTable[i]] then
        gfx.set(1,0,1)
      else
        gfx.set(1)
      end
      if ParmModulationTable==nil then CurVal=nil else CurVal=ParmModulationTable[ParmTable[i]] end
      gfx.drawstr(ParmTable[i]..": "..tostring(CurVal))
    end
    if ParmModulationTable~=nil then
      OldParmModulationTable=ParmModulationTable
    end
    A=0
  end  
  P=gfx.getchar()
  if P~=-1 then reaper.defer(main) end
end

main()

SLEM()
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish

Last edited by Meo-Ada Mespotine; 08-02-2020 at 09:59 AM.
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-01-2020, 09:52 AM   #7
SNJUK2
Human being with feelings
 
SNJUK2's Avatar
 
Join Date: Feb 2017
Location: Ukraine
Posts: 108
Default

Hi
When Audio control - off
then lfo - off
link - off
have error AppData\Roaming\REAPER\Scripts\GetParmModulation.l ua:271: attempt to index a nil value (global 'ParmModulationTable')


SNJUK2 is offline   Reply With Quote
Old 08-02-2020, 09:59 AM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default

Quote:
Originally Posted by SNJUK2 View Post
Hi
When Audio control - off
then lfo - off
link - off
have error AppData\Roaming\REAPER\Scripts\GetParmModulation.l ua:271: attempt to index a nil value (global 'ParmModulationTable')
Thanks, I fixed the bugs in the post. Can you try the fixed script as well?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-02-2020, 12:06 PM   #9
SNJUK2
Human being with feelings
 
SNJUK2's Avatar
 
Join Date: Feb 2017
Location: Ukraine
Posts: 108
Default

OK script work
SNJUK2 is offline   Reply With Quote
Old 08-03-2020, 12:33 PM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,201
Default

Ok, I guess, I'll wait til the end of the week and if nobody complains, I'll code the actual functions for ParmModulation into Ultraschall-API.

So last call for feature wishes
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   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 11:50 AM.


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