Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Live Use

Reply
 
Thread Tools Display Modes
Old 02-13-2018, 03:18 PM   #121
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Well then, I think the ability to not send the mute CC when the volume turns up would probably work
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 03:31 PM   #122
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Version 3.0
-Michael

Code:
// Author: Michael Schnell, based on a work of Time Waster (M. Smith)
// License: LGPL - http://www.gnu.org/licenses/lgpl.html
//
// 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).
// Another slider defines the maximum 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)
// A graph shows as well the curve (Amplification vs CC steps), as the dynamic movement of the amplification level.



desc:Midi Volume Control
version:3.0

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(dB)
//slider5:0<0,1,0.01>Factor (Test)
slider6: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 Notofication CC
slider7: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          = 1 / s1;
  f1          = f(1);
  outcc       = slider6-1;
  sendcc      = slider7;
  
@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 ? (
            outlevel < f1 ? outlevel = f1;
          );  
          modlevel = f(modval);
//        slider5 = modlevel;                        // test
        );
      );
    );
    midisend(offset, msg1, msg2, msg3); // pass through
  );    
  
  modval ? (
    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 <= f1 ? (
      outval ? (
        outval = 0;
        midisend(offset, inChannel+$xB0, outcc, outval); // pass through
      );  
     ) : outlevel == 1 ? ( 
      !outval ? (
        sendcc == 2 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval); // pass through      
        );  
      )  
     ) : (
      !outval ? (
        sendcc == 1 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval); // pass through
        );  
      );  
    );  
  ); 
  
@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 = 1; gfx_b = 0;
    gfx_x = 0;
    gfx_y = 0;
    gfx_rectto(gfx_w, gfx_h/2);  
  );
);

q1 = gfx_w / maxCCvalue;
q2 = gfx_h;


//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_y = 0;
gfx_x = modval*q1;
gfx_lineto(gfx_x, gfx_h);
gfx_x = 0;
gfx_y = gfx_h-outlevel*q2;   
gfx_lineto(gfx_w, gfx_y);
mschnell is online now   Reply With Quote
Old 02-13-2018, 03:40 PM   #123
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Trying it now! Thank you!
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 03:53 PM   #124
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Ok, if I set it to never, then it never sends a value on that cc, whether 0 or 127

If I set it to send at -127, it works every other time, sort of. I think whats happening is upon channel activate, it sends the 127 muting the track again, let me try one more trick to see if I can get this working. Curses on these midi learn actions, if we had regular control over them, this would be duck soup
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 09:26 PM   #125
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Lets see if we can get a script for this, it might be the best move.

If you have any ideas how to make it work with the plugin I'm all ears, I think that if it sends ANYTHING on the mute CC when it is called upon to ramp up, the way reaper's midi works sends it a damn mute. I'll see if I can't find some sort of midi filter to check that for sure though
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 09:57 PM   #126
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

If I use piz's midiConverter 3 plugin to block value 127, it seems to be working!

Is there a way to mod the JS to send value 127 never but send value 0 with the same choices send 127 has at the moment?
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 11:00 PM   #127
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
Ok, if I set it to never...,
Right you are. There was as bug.
Here's Version 3.1.
-Michael
Code:
// Author: Michael Schnell, based on a work of Time Waster (M. Smith)
// License: LGPL - http://www.gnu.org/licenses/lgpl.html
//
// 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).
// Another slider defines the maximum 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)
// A graph shows as well the curve (Amplification vs CC steps), as the dynamic movement of the amplification level.



desc:Midi Volume Control
version:3.1

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(dB)
//slider5:0<0,1,0.01>Factor (Test)
slider6: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 Notofication CC
slider7: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          = 1 / s1;
  f1          = f(1);
  outcc       = slider6-1;
  sendcc      = slider7;
  
@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 ? (
            outlevel < f1 ? outlevel = f1;
          );  
          modlevel = f(modval);
//        slider5 = modlevel;                        // test
        );
      );
    );
    midisend(offset, msg1, msg2, msg3); // pass through
  );    
  
  modval ? (
    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 <= f1 ? (
      outval ? (
        outval = 0;
        midisend(offset, inChannel+$xB0, outcc, outval); // pass through
      );  
     ) : outlevel == 1 ? ( 
      !outval ? (
        sendcc == 2 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval); // pass through      
        );  
      )  
     ) : (
      !outval ? (
        sendcc != 2 ? (
          outval = 127;
          sendcc ? (
            midisend(offset, inChannel+$xB0, outcc, outval); // pass through
          );  
        );  
      );  
    );  
  ); 
  
@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 = 1; gfx_b = 0;
    gfx_x = 0;
    gfx_y = 0;
    gfx_rectto(gfx_w, gfx_h/2);  
  );
);

q1 = gfx_w / maxCCvalue;
q2 = gfx_h;


//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_y = 0;
gfx_x = modval*q1;
gfx_lineto(gfx_x, gfx_h);
gfx_x = 0;
gfx_y = gfx_h-outlevel*q2;   
gfx_lineto(gfx_w, gfx_y);
mschnell is online now   Reply With Quote
Old 02-13-2018, 11:08 PM   #128
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
Lets see if we can get a script for this, it might be the best move.
I seriously doubt this, as it will make the information flow much more confusing. That is why I'm trying to do as little as possible in the realm of the "Control Path", leaving all native Reaper features available for use in the normal way for "naive" users to tweak their setup.

I'd like to provide a toolbox for non-programmers that is supposed to work as well for audio-input (Guitar) as for Midi-input (keyboard) players, using a wide range of patch selecting controllers.

This is supposed to be crafted in the least confusing way possible:
- the most obvious information flow possible
- predefined sufficiently versatile JSFXes to do the realtime work
- some ReaScripts (e.g. using track templates or whatever) to help with the setup.

It would be sad to loose you with this task, as I'll nebver be able to decently test a "Guitarist's" setup.
I hope you'll be patient with trying to create your setup in this way.

-Michael

Last edited by mschnell; 02-13-2018 at 11:20 PM.
mschnell is online now   Reply With Quote
Old 02-13-2018, 11:13 PM   #129
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
If I use piz's midiConverter 3 plugin to block value 127, it seems to be working!
Of course it does.
Of course I do have (and use) JSFXes that do exactly this (blocking certain Midi messages.
But I'd like to do the JSFX in a way it is usable as much "out of the box" as possible for this task, so please test the new version.

Thanks,
-Michael
mschnell is online now   Reply With Quote
Old 02-13-2018, 11:30 PM   #130
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

AWESOME!!!! GOing to grab the new version now, but here is a test with the piz blocker....MIDI VOlume 3.0 with both faders set to the full right

Holy crap man!!!!!!!!!!!!!

Seriously!

https://www.instagram.com/p/BfKruzgh...=pipelineaudio
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 11:32 PM   #131
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

I'm thinking with that script loader I mocked up, scripts would be even easier than JSFX's. Really, this functionality should be built into SWS Live Configs. Really the only thing I'm using live configs for at this point is a script loader. Everything else is handled by your plugs
pipelineaudio is offline   Reply With Quote
Old 02-13-2018, 11:51 PM   #132
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

OK, MIDI VOlume Control 3.1 works perfect with no piz VST needed! Gonna make a few templates now, but I have some issues

Lots of custom commands involved, not sure how to just send those.

Mapping the CC to fire the action is a MASSIVE MASSIVE pain, hopefully that will be exported with the keystrokes, but I'm not sure it will. SOmething seriously has to be done about REAPER's MIDI learn

Naming JSFX....I never know how to do this properly so the right name comes up, I dont want someone to grab the template and not be able to use it because the plugin was named wrong by me and all the settings are gone
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 12:06 AM   #133
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

the visuals still make it look like it fades out long before the other way is finished fading in, is that right?

For some reason this has less dropout running before the guitar fx than after, and I swear it should be the other way
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 07:39 AM   #134
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
Mapping the CC to fire the action is a MASSIVE MASSIVE pain,
I perfectly understand this.

In fact I suppose LiveConfigs has been created just to avoid this.

We should develop some ideas how to make LiveConfigs drive the switches without needing additional actions.

If you have any idea, please let me know.

If not, please try to describe what exactly you are doing right now. Maybe some workalike implementations comes in my mind. As you know, I can easily do JSFXes that do close to everything (but make a cup of coffee for you).

Maybe we even could replace LiveConfigs by an appropriate "Master" JSFX (that send Midi messages to the audio threads that each feature a "Midi To Volume" instance to perform the patch switching.

Maybe a single simple ReaScript can be made, that mutes/unmutes tracks as commanded by the "Master" JSFX and/or "Midi To Volume".

(For this, I would need to know how to send parameters - such as Midi CC # and value - to a ReaScript. )

-Michael

Last edited by mschnell; 02-14-2018 at 07:45 AM.
mschnell is online now   Reply With Quote
Old 02-14-2018, 07:45 AM   #135
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
Naming JSFX....
In the end we will push the JSFXes /(and scripts) to ReaPack. Then then naming is obvious, and installation is a glimpse.

-Michael
mschnell is online now   Reply With Quote
Old 02-14-2018, 07:46 AM   #136
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
the visuals still make it look like it fades out long before the other way is finished fading in, is that right?

For some reason this has less dropout running before the guitar fx than after, and I swear it should be the other way
Do you think you need a delay before fading out ?

This of course is no problem at all.

-Michael
mschnell is online now   Reply With Quote
Old 02-14-2018, 10:43 AM   #137
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

I just wrote a chapter on Midi Routing in Reaper to be included in the LiveConfigs User Guide. It's not ready to be included, yet, but maybe it helps developing some ideas.

-> http://www.bschnell.de/routing.pdf

-Michael
mschnell is online now   Reply With Quote
Old 02-14-2018, 04:59 PM   #138
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

I have tons of exciting news and I am super excited to go check out your PDF. But I have to make sure my Valentine's Day stuff is set right so the rest of my life is not in perilous doubt

But holy crap man this is all super awesome!
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 09:56 PM   #139
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

scratch that, pilot error

I wonder if the dwell time should only apply to turning the effect on rather than turning it off

Last edited by pipelineaudio; 02-14-2018 at 10:08 PM.
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 10:04 PM   #140
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

REAPER Users Group FB Page member Daniel Perry made a script for adjusting the track fades and muting. It seems to be working super good for switching between distorted sounds, while the MIDI volume control seems to be working better for things that are sending to spillover tracks and clean sounds

https://www.instagram.com/p/BfLIck_B...=pipelineaudio
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 10:27 PM   #141
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
I wonder if the dwell time should only apply to turning the effect on rather than turning it off
That might be a good idea.

So if we finally do a decently dedicated JSFX (not just an enhanced "Volume" baby) we will implement asymmetric behavior regarding dwell time and gain slope.

(For obvious reasons I will not touch the track faders. For other obvious reasons I ignore FaceBook.)

-Michael
mschnell is online now   Reply With Quote
Old 02-14-2018, 10:44 PM   #142
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Alright, here's a working template https://www.dropbox.com/s/urfm8l5ztv...lover.zip?dl=0


I'll strip it further later for a real template, but this is working on both computers here
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 10:53 PM   #143
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Quote:
Originally Posted by mschnell View Post
(For obvious reasons I will not touch the track faders. For other obvious reasons I ignore FaceBook.)

-Michael
I'd love it if the fader script did the recieves as an option instead of the track faders, but seriously, the track fader thing really sounds good for some of the switching. I thought' I'd get more zipper noise, but nope. I'm wondering if the very original SWS Mute and Solo Groups thing would have worked better given a really long mute fade time in prefs...I thought I tried it, but I'm not sure
pipelineaudio is offline   Reply With Quote
Old 02-14-2018, 11:46 PM   #144
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
I'd get more zipper noise,
The final JSFX will feature different settings for the fade in and fade out slope. As the zipper noise needed to be tweaked against the switching delay, I suppose you will be able to set the optimal fade speed for the application.

-Michael
mschnell is online now   Reply With Quote
Old 02-15-2018, 09:37 AM   #145
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Here is the asymmetric version of "Midi Volume", now renamed to "Midi Fade X", as it is supposed to do fade-ins and fade-outs in a nice way.

Please test, as I would like to add "about" text and provide it via ReaPack.

Regarding the "Pipe Filter", same is asymmetric, anyway. The Threshold is defined as the point to switch "on". The Hysteresis and the dwell time just hold off the switching "off". The invert setting just toggles the 0 and 127 output values.

I understood that this is the behavior, you wanted to see. If you need a modification or enhancement, please let me know. (I could imagine by "invert" you meant input invert rather then output invert).

-Michael

Code:
// Author: Michael Schnell, based on "Midi Volume"
// License: LGPL - http://www.gnu.org/licenses/lgpl.html
//
// 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).
// Another slider defines the maximum 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)
// A graph shows as well the curve (Amplification vs CC steps), as the dynamic movement of the amplification level.



desc:Midi Fade X
version:1.0

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:0<0,1,0.01>Factor (Test)
slider7: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 Notofication CC
slider8: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;
  f1          = f(1);
  f01         = f(0.1);
  outcc       = slider7-1;
  sendcc      = slider8;
  
  str = sprintf(#, " %.0f dB -> off", 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 ? (
            outlevel < f1 ? outlevel = f1;
          );  
          modlevel = f(modval);
//        slider5 = modlevel;                        // test
        );
      );
    );
    midisend(offset, msg1, msg2, msg3); // pass through
  );    
  
  modval ? (
    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, outval); // pass through
      );  
     ) : outlevel == 1 ? ( 
      !outval ? (
        sendcc == 2 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval); // pass through      
        );  
      )  
     ) : (
      !outval ? (
        sendcc != 2 ? (
          outval = 127;
          sendcc ? (
            midisend(offset, inChannel+$xB0, outcc, outval); // pass through
          );  
        );  
      );  
    );  
  ); 
  
@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_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);

outcc >= 0 ? (
  gfx_x = 10;
  gfx_y = gfx_h-20;
  gfx_r=1; gfx_g=0; gfx_b=0;
  gfx_drawstr(str);
);
mschnell is online now   Reply With Quote
Old 02-15-2018, 03:36 PM   #146
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Awesome! I'll check those out now.
This is updated to put the wah on bypass on patch changes and now includes one project file with and one project file without some spillover fx

https://www.dropbox.com/s/u7cs0tdptwbjkuf/REAPER Live Fadescript.zip?dl=0
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 04:12 PM   #147
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Ok, I can get this to be more than acceptable, but I'm still having an issue that the fade in really seems to start so much later than the fade out. I'm watching them both on the screen

I guess my major goal now it to fade them so that there is both no dropout in between patches, but also no volume jump up when they switch. Its a tightrope! I'm so close....trying both before and after the audio plugins

Its probably just a matter of getting these settings right on my part, I'll keep experimenting. For some reason, the track volume fader is able to do this, while the fade in fade out plugs I'm having a harder time with
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 04:20 PM   #148
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

For the cleans if I leave them long, its absolutely awesome. The distortion tracks are the tricky ones
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 05:03 PM   #149
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

So now we're picking nits....I WISH I could figure out how to make the magical no dropout, perfect volume ride across the board fade in and fade out, but this is already so much closer to that goal than any rack system I've ever seen.

I still feel like the fade in starts much later than the fade out, but who knows...maybe its the mute/unmute fade time?

Still, this is more than UBER right now, here's a now setup with Midi Fader X and spillover

About to test it on the craptop

https://www.dropbox.com/s/koyqlzt8o6...-2018.zip?dl=0
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 05:46 PM   #150
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

WOOHOOO!!!! Still not thrilled at the exact crossfade, but its certainly running on the craptop!

https://www.instagram.com/p/BfPOYFoh...=pipelineaudio
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 10:38 PM   #151
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
I'm still having an issue that the fade in really seems to start so much later than the fade out. I'm watching them both on the screen
The audio attenuation is an exponential curve (linear db), while the graph is linear (to be able to show the (white) settable CC Value -> attenuation curve).

Obviously the fade in needs to start at a certain non-zero point (that with any step (sample) is multiplied by a factor). If this level is too high there will be unwanted side-effects. I suppose, it's too low for your application.

I'll take another look...

-Michael
mschnell is online now   Reply With Quote
Old 02-15-2018, 11:05 PM   #152
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

once it starts it happens fast enough, but its just that it waits a long time before it starts...I wonder if its not a different issue, just that SWS Live action doesnt call it till too late

Can you try running a sine wave and see if theres a way you can switch from one row to another really smoothly?

I'm going to see if theres a way to run the fades at the same time by putting the fade out of all tracks on the activate action
pipelineaudio is offline   Reply With Quote
Old 02-15-2018, 11:34 PM   #153
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

I'm sure we'll get this sorted out...
-Michael
mschnell is online now   Reply With Quote
Old 02-15-2018, 11:36 PM   #154
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

I wonder if it has to wait that 5msec for the mute before fading out, in order to get it straight...it doesnt seem like a 5ms drop though
pipelineaudio is offline   Reply With Quote
Old 02-16-2018, 12:03 AM   #155
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

I tried with both of them in the same action call, seemed about the same
pipelineaudio is offline   Reply With Quote
Old 02-16-2018, 05:40 AM   #156
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by pipelineaudio View Post
I wonder if it has to wait that 5msec for the mute before fading out, in order to get it straight...it doesnt seem like a 5ms drop though
??? 5 mSec between which and what ????

It only can react with any sample block, as any audio and midi data is transported in these chunks. So there is a limit.

-Michael
mschnell is online now   Reply With Quote
Old 02-16-2018, 01:57 PM   #157
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Now with shorter audible fade in delay, definable via a "start fade in" slider. (To be tweaked against noise when switching on.)

Also added a small "handbook" at the beginning of the code (in ReaPack format, sorry for bad English ).

Please test !
-Michael

Code:
desc:Midi Fade X
author: Michael Schnell (mschnell@bschnell.de)
version: 1.1
changelog: initial release
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 value 0, 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,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;
  sendcc      = slider9;
  
  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, outval); // pass through
      );  
     ) : outlevel == 1 ? ( 
      !outval ? (
        sendcc == 2 ? (
          outval = 127;
          midisend(offset, inChannel+$xB0, outcc, outval); // pass through      
        );  
      )  
     ) : (
      !outval ? (
        sendcc != 2 ? (
          outval = 127;
          sendcc ? (
            midisend(offset, inChannel+$xB0, outcc, outval); // pass through
          );  
        );  
      );  
    );  
  ); 
  
@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);
);

Last edited by mschnell; 02-16-2018 at 03:36 PM.
mschnell is online now   Reply With Quote
Old 02-16-2018, 02:14 PM   #158
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Awesome!!! GOnna try it now.

I dont know if my logic is broken, but I was thinking that the 5msec fade in time for the mute spelled out in preferences was throwing the whole game off, but who knows.
pipelineaudio is offline   Reply With Quote
Old 02-16-2018, 03:34 PM   #159
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Sorry. No idea what you are talking about

-Michael
mschnell is online now   Reply With Quote
Old 02-16-2018, 03:50 PM   #160
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Quote:
Originally Posted by mschnell View Post
Regarding the "Pipe Filter" ... the dwell time just hold off the switching "off".
That was a lie. the dwell time works in both directions.

Is there anything you want to be modified ?

-Michael
mschnell 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 08:01 AM.


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