Old 03-05-2018, 11:26 AM   #81
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Here are the tiny scripts that allow for Midi CC Table to mute and unmute tracks.

Simply learn the two scripts to two different CC # s and have Midi CC Table send out either of them for muting and unmuting with the CC val = the track number (beware that internally Reaper numbers the tracks as 0, 1, 2, 3, ...)

mute_track_X.eel :
Code:
  mute = 1;
  get_action_context(#filename,sectionID,cmdID,mode,resolution,val);
  tr = GetTrack(0,val);
  SetMediaTrackInfo_Value(tr, "B_MUTE", mute);
unmute_track_X.eel :
Code:
  mute = 0;
  get_action_context(#filename,sectionID,cmdID,mode,resolution,val);
  tr = GetTrack(0,val);
  SetMediaTrackInfo_Value(tr, "B_MUTE", mute);
I suppose for Pipe's project no other scripts should be necessary.

Have fun !
-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-05-2018 at 11:31 AM.
mschnell is online now   Reply With Quote
Old 03-05-2018, 11:29 AM   #82
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by spk77 View Post
get_action_context example:
Thanks a lot. I already had been able to find out how to do and hook ReaScripts and even found the API calls necessary here.

Thanks again !
-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-05-2018, 05:34 PM   #83
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Here's my MIDI CC Table



3:1 2:1=127 < 3:11 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:2 2:2=127 < 3:12 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:3 2:3=127 < 3:13 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:4 2:4=127 < 3:14 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
// 5 tap tempo
3:6 2:6=127 < 3:16 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:7 2:7=127 < 3:17 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:8 2:8=127 < 3:18 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:9 2:9=127 < 3:19 1:27=0 // macro-Select and unmute group, Fade in MIDI FadeX. fade out/ mute MIDI fade x, bypass wah
3:10 < 3:20 1:27=0 //

If I put ReaControl right after MIDI CC table, I can see that 2x=127 gets sent for every time its supposed to, but putting ReaControl log on the particular channel shows it only getting sent every other time its supposed to
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-05-2018, 10:40 PM   #84
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

You mean, Midi CC map does not send the stuff it should, but instead it sometimes sends certain messages twice and others not at all?

I can't imagine how that should happen.

Are you sure that the track Midi CC Map resides in is not muted ever ?

OTOH, I don't understand how you never send a 0 and a 127 to the same channel / CC# combination, as this is what (in your case) Midi Fader X is supposed to receive. And this is what Midi CC Map has been created for to begin with: Do the mute/unmute functionality (sauf CPU saving) in combination with Midi Fader X, similar as LibveConfigs, but without needing any Reaper Control Path activity. (Advanced functionality that needs the Control Path can be done on top of that using especially simple - not project specific - Actions and ReaScripts. )

My request to you is: please set up a new workalike project, consisting of one track holding Midi CC Map and multiple Audio tracks, that does not (yet) mute/unmute any tracks and does not use any Reaper Actions, macros or ReaScripts, but distributes the Midi messages from Midi CC Map simply via standard Reaper routing to the appropriate Audio tracks, to control Kidi Fader X instances and your other plugins.

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-05-2018 at 10:57 PM.
mschnell is online now   Reply With Quote
Old 03-06-2018, 03:32 AM   #85
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Quote:
Originally Posted by mschnell View Post
My request to you is: please set up a new workalike project, consisting of one track holding Midi CC Map and multiple Audio tracks, that does not (yet) mute/unmute any tracks and does not use any Reaper Actions, macros or ReaScripts, but distributes the Midi messages from Midi CC Map simply via standard Reaper routing to the appropriate Audio tracks, to control Kidi Fader X instances and your other plugins.

-Michael
OK, I got one like this working. https://www.dropbox.com/s/x996ml5s3l...Table.rpp?dl=0

Seems to be doing ok, would work great for a stompbox style setup too I bet. I'd need muting for a more complex setup
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-06-2018, 07:01 AM   #86
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
I'd need muting for a more complex setup
That is absolutely obvious.

For this purpose I did the two tiny ReaScripts "mute_track_X.eel" and "unmute_track_X.eel" described above that with the help of two appropriate actions (and MidiToReaControlPath) will receive Midi messages either from Midi CC Map (usually unmuting) or from Midi Fade X (usually muting) and mute or unmute the track given as appropriate.

Do you over mute/unmute think you will need yet some other necessarily Control-Path residing stuff that a script or action is necessary for ?

(As said I would like to have the thing done as straight-forward as possible. )

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-06-2018, 01:26 PM   #87
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

I can try those scripts, I need the syntax for the variables I need to change them with, hopefully an example for say track 1 and 3
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-06-2018, 02:28 PM   #88
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

I already did post the mute_track_X.eel and unmute_track_X.eel scripts some mails above (-> https://forum.cockos.com/showpost.ph...6&postcount=81). I did test that they work as expected What do you want to change ?

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-06-2018, 02:44 PM   #89
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

I dont understand what to put in there to have it get the specific track
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-06-2018, 03:14 PM   #90
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
I dont understand what to put in there to have it get the specific track
I got it from the documentation of the API functions.

"get_action_context(#filename,sectionID,cmdID,mode ,resolution,val);"

In val gives the CC value when the script has been fired by "it's" action, and this action is called by a Midi message with the Midi Channel and the CC , the action had been learned to. (Beware: I found that scripts are not fired by actions as long as the Script-IDE editor is open for that script.)

then
tr = GetTrack(0,val);
provides the ID of the track that features the track number val (which is the one that is labeled as No "val+1" in the GUI, as here tracks are counted 1, 2, 3, ... instead of "technically" 0, 1, 2 ...)

With this set up, you simply make Midi CC Map send a message with the Midi Channel and CC # you learned the message to and the CC val according to the Track No (subtract one) of the track you want to mute or unmute.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-06-2018, 03:24 PM   #91
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

So do I need ten of these scripts for ten patches? I'm still trying to understand
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-06-2018, 10:58 PM   #92
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

I again totally fail to understand what causes the confusion.

With "10" patches" do you mean 10 tracks ? If yes, here the way it works:

To unmute 1 .. 10 tracks you need to install the unmute_track_X.eel script and set up an action that fires it and learn that action to - say - midi channel 12, CC # 13. From now on the script will be executed when the Control Path sees a CC message #13 on Channel 12, independent of the CC value it carries. Hence that value can be used to tell the script which channel it is to unmute.

Now you do a Midi CC Map configuration file that (among other stuff) contains the definitions (supposedly in multiple lines, together with midi messages sent to other plugins) :

12:13=0
12:13=1
12:13=2
12:13=3
12:13=4
12:13=5
12:13=6
12:13=7
12:13=8
12:13=9

Now (by example) according to the third line in the file when activating row 2, Midi CC Map will send out the Midi CC message #13 on channel 12 with value 2. Same is routed "down" through MidiToReaControlPath and will trigger the action you set up and hence the unmute_track_X script will be executed.

Same calls the get_action_context() Reaper API function and in the "val" variable is provided with the value of 2 that Midi CC Map sent out. So it knows that it is to unmute the track number 2 (seen in the GUI as track "3"). So it uses the appropriate two Reaper API calls to do that.



It with "10 patches" you mean "10 buttens to press on the pedal", this has close to nothing to do with this issue, the "10 Buttons" will activate 10 different rows in Midi CC Map and each of them can be set to do whatever is can be done via Midi CCs, including (but not necessarily) mute or unmute any of the audio tracks.

To avoid confusion keep in mind that I (since the beginning of all discussion) strongly suggest to deactivate the "control" checkbox of any Midi device, so that a script or action never is accessed directly but always via Midi CC Map, and hence in the control file you can define / see what is going on for each "patch", including any track muting/unmuting. Of course the midi events from the pedal buttons also should not be routed to the audio tracks, but only drive Midi CC Mapper.


-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-07-2018 at 07:19 AM.
mschnell is online now   Reply With Quote
Old 03-07-2018, 01:25 PM   #93
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

So it looks like for ten tracks' mute/unmte control, I don't need ten of these scripts, just one on the MIDI input channel after MIDI CC table right?
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-07-2018, 01:36 PM   #94
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

OK, so like the other action i tried, it only works every other time we press a pedal. The same actions in live configs work every time. Maybe you were right about it needing some wait time.

I can't get midi fade x to respond after having its track unmuted, so it goes like this

press pedal 1: track unmutes, but midi fade x stays faded out
press pedal 2: track unmutes, but midi fade x stays faded out
press pedal 1 again: midi fade x fades in properly
press pedal 2 again: midi fade x fades in properly
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-07-2018, 01:39 PM   #95
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

If this ends up working, I MUCH MUCH MUCH prefer doing it this way, on the main midi channel, VERY convenient!

Is it possible that MIDI Fade X could be made into a script? It could even include these two mute scripts possibly!
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-07-2018, 02:59 PM   #96
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
So it looks like for ten tracks' mute/unmte control, I don't need ten of these scripts, just one on the MIDI input channel after MIDI CC table right?
While I don't understand what you mean by "MIDI input channel after MIDI CC table", Yep. you only need a single script and a single Action for unmuting (and another pair of those for muting).

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-07-2018, 03:12 PM   #97
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
If this ends up working, I MUCH MUCH MUCH prefer doing it this way, on the main midi channel, VERY convenient!
GREAT ! (How did you manage to get rid of the nasty "every other time" effect ??? )

This is what I was up to with all this discussion (and thanks for your support): do the most convenient example of a Live setup just as yours to allow Reaper to be be easily used as an extremely versatile virtual effect rack.

Hopefully we some day get a "Reaper Live" subforum so that we can provide such solutions publicly in a prominent location.

Quote:
Originally Posted by pipelineaudio View Post
Is it possible that MIDI Fade X could be made into a script? It could even include these two mute scripts possibly!
MIDI Fade X is a script. Do you mean a ReaScript ? No ! ReaScripts reside in the Reaper Control Path and there is no Audio but just control signals. It would be possible to do a VST that is done similar to MidiToReaControlPath and instead of forwarding the Midi signals, directly would do the muting/unmuting. While this would be perfect (IMHO: getting rid of needing to do anything "obvious" in the Control Path at all), I don't (yet) have the really advanced art of doing combined VSTs / Reaper extensions in C++.

While we stay with scripts, more stuff in ReaScripts: this is exactly what I don't want.

As close to everything necessary for such a setup is doable not in the control path, for maximum clearness, I want to keep the stuff in the Control Path (i.e. ReaScripts) as simple and "standard" (i.e. not project specific) as possible. Hence just two very small scripts and two actions is close to the most I would admit. (I even try to reduce this to just a single ReaScript and a single action, but did not yet find a perfect way to do so, see other thread in this forum.)

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-07-2018 at 03:26 PM.
mschnell is online now   Reply With Quote
Old 03-07-2018, 04:47 PM   #98
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

I havent got rid of the every other time thing yet, but I'm trying different ways to do the muting/unmuting

Its weird that the same custom actions will work in the Live configs version but not this one...I swear I remember having the same issue with Live Configs, trying to remember how I fixed it
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-07-2018, 08:51 PM   #99
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

So it looks like The mute notifications from MIDI Fade X will always be value 0, not sure how to mute by using the mute script. I should be able to mute with an action, but I don't think that's what we want
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-07-2018, 11:09 PM   #100
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
So it looks like The mute notifications from MIDI Fade X will always be value 0, not sure how to mute by using the mute script
You are perfectly right. Silly me did not think that Midi Fader X has this limitation, and hence is not directly usable with the mute_track_X.eel script. I'll of course will do add a slider for the CC value ASAP. This is really easy, but I'll have time to do this only later this day

Thanks for pointing this out !

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-07-2018, 11:13 PM   #101
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Its crazy how many possibilities there are.

It can be any sort of pedalboard, from patch style to stomp style to a hybrid like digitech could do
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-08-2018, 02:18 PM   #102
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Here the Midi Fader X code with additional Muting Notification CC Value slider.
Please test and have fun !

-Michael

Code:
desc:Midi Fade X
author: Michael Schnell (mschnell@bschnell.de)
version: 2.1
changelog: Added Muting Notification CC value slider
donation: United Nations Foundation http://www.unfoundation.org/
about:
  ## Description

  The midi CC values 0 ... 127 are mapped to an "amplifier" curve that consists of a linear and an exponential part
  in a way, that with CC = 0 the amplification is 0 (-inf dB) and with CC = 127 the amplification is 1 (0db).

  A slider defines the amount (in dB), the amplification is reduced with each CC step.

  According to that, the breakpoint between the exponential and the linear part is set so that 
  at this point the value and the slope of the curves match.

  Below the breakpoint, a linear curve is used so that with CC = 0 the amplification is Zero (-infinity dB).

  Two sliders defines the maximum fade-in (up) and fade-out (down) speed the amplification is modulated. This is set in dB per modulation step. Moreover the maximum speed used is reaching a new defined level in as many steps a samples in a block.
  
  The slider "start fade in" defines the starting point of the upwards move of the amplification. Same is given as the equivalent of an input CC value (1 ... 31)
  
  The "Muting Notification" sets a CC # which is sent out with a value of "Muting Notification CC value", when the amplification drops below the mute level (equivalent to an input CC value of one tenth of that defined for "start fade in").
  
  The "send CC = 127" setting defines whether this CC is sent with value 127, when the amplification rises above the mute level or when it reaches 0 dB.
  
  A graph shows as well the curve (linear, Amplification vs. CC steps), as the dynamic movement of the input CC and the amplification level.
  
  Moreover, the fade in start and - if appropriate - the mute level is shown.
  
  If the "Muting Notification CC" is set, the mute state is visualized by a green rectangle.

  ## Limitations

  As  due the the description above, the modulation speed is limited to reaching the target level in a timespan at least 
  as the duration of a sample block, the current version of this plugin is not suitable for synth-like application that
  intend to implement a VCA.

// License: LGPL - http://www.gnu.org/licenses/lgpl.html

slider1:0<0,15,1{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>MIDI Input Channel
slider2:1<0,127,1{0 Bank Sel M,1 Mod Wheel M,2 Breath M,3,4 Foot P M,5 Porta M,6 Data Entry M,7 Vol M,8 Balance M,9,10 Pan M,11 Expression M,12 Ctrl 1 M,13 Ctrl 2 M,14,15,16 GP Slider 1,17 GP Slider 2,18 GP Slider 3,19 GP Slider 4,20,21,22,23,24,25,26,27,28,29,30,31,32 Bank Sel L,33 Mod Wheel L,34 Breath L,35,36 Foot P L,37 Porta L,38 Data Entry L,39 Vol L,40 Balance L,41,42 Pan L,43 Expression L,44 Ctrl 1 L,45 Ctrl 2 L,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64 Hold P sw,65 Porta sw,66 Sustenuto sw,67 Soft P sw,68 Legato P sw,69 Hold 2 P sw,70 S.Variation,71 S.Timbre,72 S.Release,73 S.Attack,74 S.Brightness,75 S.Ctrl 6,76 S.Ctrl 7,77 S.Ctrl 8,78 S.Ctrl 9,79 S.Ctrl 10,80 GP B.1 sw,81 GP B.2 sw,82 GP B.3 sw,83 GP B.4 sw,84,85,86,87,88,89,90,91 Effects Lv,92 Trem Lv,93 Chorus Lv,94 Celeste Lv,95 Phaser Lv,96 Data B. Inc,97 Data B. Dec,98 NRP L,99 NRP M,100 RP L,101 RP M,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127}>CC Input
slider3:-0.3<-0.6,-0.08,0.01>Attenuation per CC step
slider4:0.003<0.0005, 0.01, 0.0001>max step fade in(dB)
slider5:0.003<0.0005, 0.01, 0.0001>max step fade out(dB)
slider6:1<1,31,1>start fade-in (CC Value)
//slider7:0<0,1,0.01>Factor (Test)
slider8:0<0,127,1{None,0 Bank Sel M,1 Mod Wheel M,2 Breath M,3,4 Foot P M,5 Porta M,6 Data Entry M,7 Vol M,8 Balance M,9,10 Pan M,11 Expression M,12 Ctrl 1 M,13 Ctrl 2 M,14,15,16 GP Slider 1,17 GP Slider 2,18 GP Slider 3,19 GP Slider 4,20,21,22,23,24,25,26,27,28,29,30,31,32 Bank Sel L,33 Mod Wheel L,34 Breath L,35,36 Foot P L,37 Porta L,38 Data Entry L,39 Vol L,40 Balance L,41,42 Pan L,43 Expression L,44 Ctrl 1 L,45 Ctrl 2 L,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64 Hold P sw,65 Porta sw,66 Sustenuto sw,67 Soft P sw,68 Legato P sw,69 Hold 2 P sw,70 S.Variation,71 S.Timbre,72 S.Release,73 S.Attack,74 S.Brightness,75 S.Ctrl 6,76 S.Ctrl 7,77 S.Ctrl 8,78 S.Ctrl 9,79 S.Ctrl 10,80 GP B.1 sw,81 GP B.2 sw,82 GP B.3 sw,83 GP B.4 sw,84,85,86,87,88,89,90,91 Effects Lv,92 Trem Lv,93 Chorus Lv,94 Celeste Lv,95 Phaser Lv,96 Data B. Inc,97 Data B. Dec,98 NRP L,99 NRP M,100 RP L,101 RP M,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127}>Muting Notification CC #
slider9:0<0,127,1)>Muting Notification CC value
slider10:0<0,2,1{Never,-inf db,0 dB}>send CC = 127

@init
  modval      = 0;
//  prelevel    = 0;
  maxCCvalue  = 127;
  r4          = log(10)/20;
  outval      = 0;
  
  function f (x) (
    x < limit  ? (
      x*r3;
     ) : (
      exp((maxCCvalue-x) * r5);
    );
  )

@slider
  inChannel   = slider1;
  modcc       = slider2; 
  dbperstep   = slider3;
  db20perstep = dbperstep/20;
  p1          = 1 / log(10) / db20perstep;
  p2          = 1 / maxCCvalue;
  p3          = p1 + p2;
  limit       = (-p3+0.5) |0; 
  r1          = (maxCCvalue-limit) * dbperstep;
  r2          = exp(log(10)*r1/20);
  r3          = r2 / limit;  
  r5          = dbperstep*r4;
  s1          = exp(log(10)*slider4/20);
  s2          = exp(log(10)*slider5/20);
  s2          = 1 / s2;
  finstart    = slider6;
  f1          = f(finstart);
  f01         = f(finstart/10);
  outcc       = slider8-1;
  outccval    = slider9;
  sendcc      = slider10;
  
  str1  = sprintf(#, "fade in start -> %.0f dB", log(f1)/r4);;
  str01 = sprintf(#, "mute level    -> %.0f dB", log(f01)/r4);;

@block
  while (midirecv(offset, msg1, msg2, msg3)) (
    status = msg1 & $xF0;      // Extract message type
    channel = msg1 & $x0F;
    channel == inChannel ? (   // Is it on our channel?
      status == $xB0 ? (       // Is it a controller event?
        msg2 == modcc ? (      // Is it the right CC?
          modval = msg3;
          modval ? (
            low ? (
              outlevel < f1 ? outlevel = f1;
            );  
           ) : ( 
            low = 1;
          );  
          modval >= finstart ? (
            low = 0;;
          ); 
          modlevel = f(modval);
//        slider7 = modlevel;                        // test
        );
      );
    );
    midisend(offset, msg1, msg2, msg3); // pass through
  );    
  
  modval ? (
    low ? (
      modstep = 1;
     ) : (  
      modstep = exp( log(modlevel / outlevel) / samplesblock);
    );  
    modstep == 1 ? (
      stepping = 0;
     ) : (
      modstep > s1 ? (
        modstep = s1;
       ) : modstep < s2 ? ( 
        modstep = s2;
      );  
      stepping = 1;
    );  
   ) : ( 
    modstep = s2;
  );    
 
  outcc >= 0 ? (
    outlevel <= f01 ? (
      outval ? (
        outval = 0;
        midisend(offset, inChannel+$xB0, outcc, outccval); 
      );  
     ) : outlevel == 1 ? ( 
      !outval ? (
        sendcc == 2 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval);
        );  
      )  
     ) : (
      !outval ? (
        sendcc != 2 ? (
          outval = 127;
          sendcc ? (
            midisend(offset, inChannel+$xB0, outcc, outval);
          );  
        );  
      );  
    );  
  ); 
  
@sample
  outlevel *= modstep;
  spl0*=outlevel;
  spl1*=outlevel;  
  
  
@gfx 640 400

gfx_r=gfx_g=gfx_b=0; gfx_a=1;
gfx_x=gfx_y=0;
gfx_rectto(gfx_w,gfx_h);

outcc >= 0 ? (
  outval ? (
    gfx_r = 0; gfx_g = 0.5; gfx_b = 0;
    gfx_x = 0;
    gfx_y = 0;
    gfx_rectto(gfx_w, gfx_h/2);  
  );
);

q1 = (gfx_w-3) / maxCCvalue;
q2 = gfx_h-2;


//gfx_line();
gfx_r=gfx_g=gfx_b=1;
gfx_y = 0;
gfx_x = 0;
x = 0;
while (x<=maxCCvalue) (
  a = x*q1;
  b = gfx_h - f(x)*q2;
  gfx_lineto(a, b, 1);
  x = x+1;
);
gfx_x = 0;
gfx_y = gfx_h -f(finstart)*q2;
gfx_lineto(gfx_w, gfx_y);
findisplay = gfx_y;

gfx_y = 0;
gfx_x = modval*q1 + 1;
gfx_r=1; gfx_g=1; gfx_b=0;
gfx_rectto(gfx_x+3, gfx_h);
gfx_x = 0;
gfx_y = gfx_h-outlevel*q2-2;   
gfx_r=1; gfx_g=1; gfx_b=0;
gfx_rectto(gfx_w, gfx_y+3);

gfx_x = 10;
gfx_r=1; gfx_g=0; gfx_b=0;
gfx_y = findisplay-20;
gfx_drawstr(str1);
outcc >= 0 ? (
  gfx_x = 10;
  gfx_y = gfx_h-12;
  gfx_drawstr(str01);
);
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-08-2018, 07:23 PM   #103
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Awesome! GOing to try it in a second. I've been in and out sick, but I did get a chance to test MIDI CC Table with Daniel Perry's track mute and fade script, and it seriously works REALLY REALLY simply well with MIDI CC table! incredible even...Gonna try the new MIDI Fade X now
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-08-2018, 07:30 PM   #104
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

New mute is working as it should! Still getting the every other time thing, but I'm convinced that's down to the unmuting part and I'm still working out how to handle that
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-08-2018, 07:32 PM   #105
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Justin was saying that instead of muting tracks, I should be bypassing plugins, it seems like a script or action could do this as well, but I want to be a lot more sure of why and exactly what he means, as right now, muting is working so well for this
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-08-2018, 10:53 PM   #106
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
...I'm still working out how to handle that
Let me know if I can help in any way...
Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-08-2018, 11:00 PM   #107
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
Justin was saying that instead of muting tracks, I should be bypassing plugins, it seems like a script or action could do this as well, but I want to be a lot more sure of why and exactly what he means, as right now, muting is working so well for this
The muting/unmtting idea was stolen from LiveConfigs.

I don't see that there is a great difference between muting a track (with the "save CPU" option set) and bypassing all plugins in that track. And of course Midi Fader X would need to stay active, so that the audio is muted.

I suppose a ReaScript can be done that gets the track number and then cycles through all plugins that are loaded in that track and mutes them. But to do this would need some advanced Rea-Scripting skills.

When I do experimenting with my sounds I often try out plugins and bypass them when I (maybe temporarily) don't want them. This obviously gets in the way with automatic muting, but of course I could deactivate them instead of bypassing them.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-09-2018, 01:01 AM   #108
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

So my simple test text looks like this:

"12:13=0 12:1=127 < 12:1=0
12:13=1 12:2=127 < 12:2=0"

12:13 is the unmute script you made

12:1=127 fades in MIDI Fade X

12:1=0 fades out MIDI Fade X. Midi Fade X sends out Channel 12 CC 14 for mute_track_x.eel

I'm going to run some more tests to see which messages get where on every and every other press
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-09-2018, 01:10 AM   #109
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Ok, for sure, every other press, coming when the track is muted, no midi at all is reaching the track. I wonder why its different using SWS Live configs for the same actions, for some reason, the actions still run on that.

I wonder if MIDI Fade X could be run on the sends, or better yet on the audio input track, and have it run on the sends on that. Not really sure where to go from here
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-09-2018, 07:41 AM   #110
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
I wonder if MIDI Fade X could be run on the sends, or better yet on the audio input track, and have it run on the sends on that.
I don't understand

My "default" intention was:

Use one track for Midi input and Midi CC Map.

Use one track for Audio input, holding commonly used plugins such as a Noise Gate.

Use multiple other tracks for different sounds, each holding Midi Fade X in the end to smoothly mute them.

Route Midi from the Midi CC Map track to the effect tracks and with MidiToreaControlPath to the Control Path.

Route audio from the audio input track to all other audio tracks,

Have Midi CC Map control effect plugins, all Midi Fader X plugins and track unmuting.

Have the Midi Fader X plugins control muting of their respective track (either via MidiToReaControlPath in any Effect track or by routing the Midi to some central track).


This written, I suppose the the "every other press" problem might be the following:

Midi Fader X mutes its own track and hence is not able to react to a Midi message it then receives.

Later, Midi CC Map sends a track activate message and a Fader message at the same time. Supposedly the Fader message arrives too early at Midi Fader X and is discarded while the track i still muted.

Hence I suppose I need to enhance Midi CC Map in a way that it can delay some messages in a row, so the track activation happens first and the controlling of Midi Fader X (and other plugins that might reside in that track) a short time later.

I suppose LiveConfigs does handle this problem automatically, by first doing the activation and after a short delay any other stiff that is denoted in that row.

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-09-2018 at 07:47 AM.
mschnell is online now   Reply With Quote
Old 03-09-2018, 02:16 PM   #111
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

My setup is about exactly the way you describe.

I wonder if something similar to MIDI Fade X could bemade for the audio input track and work on the sends. I guess it would have to be some crazy multi channel JSFX, but JSFX can indeed do that, not sure what else might be in the way
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-09-2018, 03:26 PM   #112
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

You can use multiple instances of Midi Fade X and send their outputs to different channels via pin routing. Now you can route the channels to other tracks with standard Reaper means.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-09-2018, 06:00 PM   #113
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Quote:
Originally Posted by mschnell View Post
You can use multiple instances of Midi Fade X and send their outputs to different channels via pin routing. Now you can route the channels to other tracks with standard Reaper means.

-Michael
Big huge DUH on me! You are exactly right! About to make an octopus frankestein audio input track and test it!
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-10-2018, 01:15 AM   #114
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

Ok, this is showing some promise.
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-10-2018, 01:34 AM   #115
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Quote:
Originally Posted by pipelineaudio View Post
Big huge DUH on me!
?? -> https://en.wikipedia.org/wiki/Duh

-Michael (NANS = "Not A Native Speaker")
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-10-2018, 01:52 AM   #116
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

It means I should have seen that option.

This is working really really well, just trying to get the crossfades right now, since now this fade is at the input instead of the output of the track and that can make some strangeness on the nonlinear fx like distortion
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-10-2018, 04:00 AM   #117
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

If you want to install the input fading just for avoiding the "Midi message arrives to Midi Fader X when track is still muted" - problem, this of course can be done in the output, as well, avoiding FX spilling problems.

Either do a multi-channel output track with multiple Midi Fader X plugins and route the audio effect tracks to dedicated channel.

Or do a second never-muted track for any Audio FX track just holding Midi Fader FX.

But anyway, in the end I'd like to see something that is easily configured even for "newbies". And this does not seem to apply for a multi-channel Octopus nor for duplicating the tracks.

Sp I think, I'll do a Midi CC Map version that sends all messages that are no track-unmutes after some delay.

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-10-2018 at 05:11 AM.
mschnell is online now   Reply With Quote
Old 03-10-2018, 04:32 AM   #118
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 12,428
Default

I got a pretty good one working right now, and about to try a multichannel master output track that I could put 10 MIDI Fade X's on so that it would be the output getting faded out.
__________________
REAPER Shirts are Back! - https://shop.spreadshirt.com/pipelineaudio/
pipelineaudio is online now   Reply With Quote
Old 03-10-2018, 05:11 AM   #119
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,721
Default

Happy experimenting !
-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-10-2018, 02:25 PM   #120
BenK-msx
Human being with feelings
 
BenK-msx's Avatar
 
Join Date: Jun 2008
Location: uk
Posts: 4,431
Default

Once settled please shows results from this torture of learning so that we all may benefit!
BenK-msx 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 10:13 PM.


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