Old 02-24-2020, 12:05 PM   #1
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default custom action - wait 5ms?

Hey all;

Is there a way to add an action to the action list? Ideally, I'd like to have a macro to do this:

1. Decrease master track volume to -inf
2. Move to marker x
3. Increase master track volume to 0 dB gradually over a period of 5-10 ms

I may be able to get away with:

1. Mute master track
2. Move to marker x
3. Wait 5-10ms
4. Unmute master track

There is currently a wait for 100ms action, but that is far too long for my purposes.

Any help is much appreciated.

Thanks
moribund is offline   Reply With Quote
Old 02-24-2020, 12:25 PM   #2
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

What's the purpose of the 5 ms fade/wait? To prevent a pop?
ErBird is offline   Reply With Quote
Old 02-24-2020, 01:09 PM   #3
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

Yes - moving from marker to marker activates/bypasses different effects, so I'm hoping to avoid the audible turn on pop by having it occur within the mute/volume ramp up.
moribund is offline   Reply With Quote
Old 02-24-2020, 03:10 PM   #4
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

Ok, I see. This is doable with a script. You can't do volume fades or wait times that small with custom actions.
ErBird is offline   Reply With Quote
Old 02-24-2020, 03:33 PM   #5
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

I'm not finding that muting/unmuting causes any pops. I don't think you'll need the volume fade, just a wait-then-unmute.

What's causing your fx to change bypass between markers? Do you have the fx on items or is the bypass automated?
ErBird is offline   Reply With Quote
Old 02-24-2020, 04:31 PM   #6
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

Thanks ErBird for all your help.

I'm using this for my live guitar setup, so each marker is a different patch. E.g., marker 1 is a high gain with compressor sound, marker 2 is a medium gain with chorus, marker 3 is a clean tone, etc. I have all the FX on 1 track, and I just automate them by activating or bypassing them as needed at each marker on the timeline.
moribund is offline   Reply With Quote
Old 02-24-2020, 04:45 PM   #7
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

Ok. Very interesting. Not what I expected at all.

I was about to post a script you could add to a custom action...but my laptop battery just died. Will post later.

I'm wondering if there's a better way to switch between tones. Have you tried automating the wet/dry knob instead of bypass? Or having each tone on a separate track?

Reaper is so flexible, there are probably a thousand different ways you could do this. Are you happy with the current setup?
ErBird is offline   Reply With Quote
Old 02-24-2020, 06:23 PM   #8
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

I have tried automating the wet/dry, to no effect (unintended clever pun there...). I thought that would solve the problem too, but I think the cursor moves across the timeline so quickly that the gradual wet/dry crossfading essentially amounts to activating/bypasssing.

Each tone on a separate track would also be tricky, as I have most of my effects after the Ampsim but before the cabinet IRs, although some are before the ampsim. I suppose I could set up a number of different tracks with sends to them from the ampsim track and automate the sends, then create custom actions to mute all tracks then unmute the ampsim and effect track... it starts to get hair-raisingly complex quickly if I go that route. I think putting the ampsim/speaker combo on every track would gobble up too much memory (I have 15 or 20 different patches).

So there are different things I could try. This setup is fairly easy to follow, and I do have a fair amount of time invested into it, so I thought I'd check here first before trying something more drastic (especially since I have no idea if the options I've mentioned above would even be successful in getting rid of the pops).
moribund is offline   Reply With Quote
Old 02-24-2020, 07:27 PM   #9
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

See if this solves anything. I made it as simple as possible to avoid problems live.

Set the wait time in ms and put the script in a custom action before the marker change action.

Lua Script:
Code:
--Desc: Master Track: Mute then Unmute after Delay

t_wait = 100 --(Wait time in ms)--Only change this-----------------
t_init = reaper.time_precise()
t_end = t_init + t_wait/1000
tr = reaper.GetMasterTrack(0)
exit = 0
reaper.SetMediaTrackInfo_Value(tr,"B_MUTE",1)  

function main()
  for i = 1,100,1 do
    t = reaper.time_precise()
    if t_end < t then
      reaper.SetMediaTrackInfo_Value(tr,"B_MUTE",0)
      exit = 1
    end
  end
  if exit == 0 then
    reaper.defer(main)
  end
end

main()
ErBird is offline   Reply With Quote
Old 02-24-2020, 09:05 PM   #10
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

Thanks for this ErBird. I appreciate your hard work helping me out here.

I'm not sure this will work though - you said put it before the marker change? I think that all that happen is that it will mute, wait x ms, then unmute, then switch to the marker, and I'll still get the pop. Wouldn't the marker change have to be in the middle:

1. Mute
2. Marker change (this is where the pops will happen)
3. Wait x ms (so pops happen but we are still muted)
4. Unmute

?

Thanks again
moribund is offline   Reply With Quote
Old 02-24-2020, 09:27 PM   #11
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

NP at all. I like doing this stuff.

I understand your concern, but the script is triggered then waits in the background until the unmute time. The marker change is triggered right after the script is, not after the delay.

Try this first. If there are still pops we'll try something else.
ErBird is offline   Reply With Quote
Old 02-25-2020, 08:01 AM   #12
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

Again, I appreciate all your help and efforts. I've run into a bit of a snag though; I am running v4.78, which does not appear to support lua scripts...

Is it difficult to do the same thing in EEL, or should I look at upgrading?
moribund is offline   Reply With Quote
Old 02-25-2020, 03:25 PM   #13
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

You should probably upgrade at some point. A lot has changed in 5 years.

Try this script instead. You set the wait times and the destination marker number. Instead of using a custom action, you'll have to copy the script for each marker number you use.

Beware that there is some slop in the timing because of the way Reaper handles background scripts and the way it handles the mute/unmute commands. The actual wait time might be a few milliseconds longer.

EEL:
Code:
//Desc: Mute Master Track and Go To Marker #

//User-Defined------------------------------------------------
t_wait1 = 20; //Time between mute and marker change (ms)
t_wait2 = 20; //Time between marker change and unmute (ms)
marker = 1;  //Marker Number
//------------------------------------------------------------

//Get action_ID from Marker Number----------------------------
1 <= marker && marker <= 9 ?
(
  action_ID = 40160 + marker;
);
marker == 10 ?
(
  action_ID = 40160;
);
11 <= marker && marker <= 30 ?
(
  action_ID = 41250 + marker - 10;
);
//------------------------------------------------------------

//Init--------------------------------------------------------
t_init = time_precise();
t_wait1 = max(t_wait1,1);
t_wait2 = max(t_wait2,1);
t_end1 = t_init + t_wait1/1000;
t_end2 = 0;
exit1 = 0;
exit2 = 0;
tr = GetMasterTrack(0);
SetMediaTrackInfo_Value(tr,"B_MUTE",1); 
//------------------------------------------------------------

function main()
(

  loop(10,
    t = time_precise();
    0 < t_end1 && t_end1 < t && exit1 == 0 ?
    (
      Main_OnCommand(action_ID, 0);
      t_end2 = time_precise() + t_wait2/1000;
      exit1 = 1;
    );
    0 < t_end2 && t_end2 < t && exit2 == 0 ?
    (
      SetMediaTrackInfo_Value(tr,"B_MUTE",0);
      exit2 = 1;
    );
  );
  
  exit2 == 0 ?
  (
    defer("main();");
  );
  
);

main();

Last edited by ErBird; 02-25-2020 at 03:40 PM.
ErBird is offline   Reply With Quote
Old 02-25-2020, 03:42 PM   #14
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

You are awesome.

I can't wait to give this a try (won't be able to get to it for an hour or 2). I'll post back here and let you know how it works.

Thanks again
moribund is offline   Reply With Quote
Old 02-25-2020, 04:47 PM   #15
maczook
Human being with feelings
 
Join Date: May 2019
Posts: 59
Default

Hey there!

So I don't know if this will fix your issue, but it may be worth looking into!

In your global prefs, under (/audio/"mute/solo"), there is an option for "Track Mute Fade", and maybe messing with this could help?

Alternatively, under (/audio) in your global preferences, there are 2 tick-boxes for "Tiny fade out on playback stop" and "Tiny fade in on playback start", maybe try checking those?

It sounds like also, the reason this may be happening to you, is because of some VST/Plugin preference issues, and maybe also your overall computer performance? I would look into the (/plugins) and (/audio) tab in the global preferences and try messing with some of that stuff as well.

Hope this helps!

Best Wishes,

-Mac

p.s. I would also highly recommend upgrading as well
maczook is offline   Reply With Quote
Old 02-25-2020, 07:56 PM   #16
moribund
Human being with feelings
 
Join Date: Dec 2006
Posts: 462
Default

Thank you maczook, I will look into those as well.

ErBird - thanks so much for the eel script you wrote me. It works perfectly, and the ability to adjust the mute wait times is an added bonus.

I thank you again for your help and hard work; people like you make the world a better place.
moribund is offline   Reply With Quote
Old 02-25-2020, 09:24 PM   #17
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

Quote:
Originally Posted by moribund View Post
ErBird - thanks so much for the eel script you wrote me. It works perfectly
Awesome! I'm so glad if it winds up helping you. You've got me thinking now about making myself a VST "pedalboard" in Reaper. My problem in the past was always the pops when switching effects and how to manage tails on delays and such. I'll post here if I find any good solutions.

Quote:
Originally Posted by moribund View Post
I thank you again for your help and hard work; people like you make the world a better place.
That's very kind. I try really hard to not make the world worse. We have enough people doing that right now.

Take care
ErBird 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 02:00 AM.


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