Jump to content

Logic Sampler - adding sustain pedal noises to sampled piano


PSV

Recommended Posts

HI all,

 

I'm trying to add sustain pedal noise samples to my sampled piano. I have the noise recorded for pedal on as well as pedal off.

I want the appropriate noise to be played when I press the sustain pedal on and off.

I have set the Group "enabled by controller" to CC#64 and set to On.

The samples are in the Zone area, but they only want to play when I strike a key in that zone.

I just want them to play when I press the pedal...and I can't figure out how to do this. Hmmm...

 

Thanks in advance and for your patience...

Link to comment
Share on other sites

Pressing or releasing the pedal will not trigger samples in Sampler. However, you could write a short script to put into a Scripter MIDI FX which converts CC64 127 and CC64 0 into two separate, short notes which then can trigger the correct noise samples in Sampler. You could do the same with a Transformer in the Environment, although Scripter lends itself better to storing the entire Patch (Scripter MIDI FX and Sampler Instrument)
Link to comment
Share on other sites

Thanks, Christian...and I found a script that Eric Cardenas wrote here that does just that, however the sustain pedal stops acting as a proper sustain pedal. It will only generate a note on event...

 

I'd like it to generate a note on sample, note off sample and continue to act as a sustain pedal.

Link to comment
Share on other sites

Thanks, Christian...and I found a script that Eric Cardenas wrote here that does just that, however the sustain pedal stops acting as a proper sustain pedal.

I suppose you're referring to that script: Sustain pedal transform to note on AND note off?

 

I'm sure someone knowledgeable in scripting could easily modify it so that it duplicates the sustain data before transforming it?

Link to comment
Share on other sites

Try this:

 

//------------------------------------------------------------------------------
// Auth: Eric Cardenas
// dCre: 2016-10-13 11:38
// dMod: 2016-10-13 11:58
// Appl: Logic Pro X
// Task: Converts Sustain Pedal to Note.
// Tags: JavaScript, Logic
//------------------------------------------------------------------------------
const TITLE = "ECFF - Sustain to Note v 2.0";
const AUTHOR = "Script by Eric Cardenas & Fuzzfilth";
const NOTES = MIDI._noteNames;
//------------------------------------------------------------------------------

function HandleMIDI(e) {
  if (e instanceof ControlChange && e.number == 64 && e.value > 63) {
  
     PedNote(GetParameter("PedOn"),GetParameter("VelocityOn"));   
     
       if (GetParameter("Sustain")==0) {
         e.send();
       }      
     } else {
     
      if (e instanceof ControlChange && e.number == 64 && e.value < 64) {
     
        PedNote(GetParameter("PedOff"),GetParameter("VelocityOff"));
        
          if (GetParameter("Sustain")==0) {
            e.send();
          }
        } else {
        
         e.send();  
         
        }
     }
  }
  
  
function PedNote(pitch, velocity){

var PNote = new NoteOn;
   PNote.pitch = pitch;
   PNote.velocity = velocity;
   PNote.send();
   PNote.velocity = 0;
   PNote.sendAfterMilliseconds(200);
};



function ParameterChanged(p, v) {
  if (p == 1 ) {
     MIDI.allNotesOff();
   }
}

var PluginParameters = [{
   name: TITLE,
   type: "text"
}, {
   name: "PedOn",
   type: "menu",
   valueStrings: NOTES,
   defaultValue: 36
}, {
   name: "VelocityOn",
   type: "lin",
   numberOfSteps: 127,
   minValue: 0,
   maxValue: 127,
   defaultValue: 90
}, {
   name: "PedOff",
   type: "menu",
   valueStrings: NOTES,
   defaultValue: 36
}, {
   name: "VelocityOff",
   type: "lin",
   numberOfSteps: 127,
   minValue: 0,
   maxValue: 127,
   defaultValue: 90
}, {
   name: "Sustain",
   type: "menu",
   valueStrings:["pass", "block"],
   numberOfSteps: 2,
   defaultValue: 0
}, {
   name: AUTHOR,
   type: "text"
}];

 

I've added a separate note for the release of the pedal and the option to block or pass Sustain events.

 

Now you can play the bass to "Turn It On" with your foot...

  • Like 1
Link to comment
Share on other sites

You fellas are awesome...I'm going to try it.

I don't know JavaScript, but I can kind of see what's happening...

Thanks fuzzfilth and David!

 

To fisherking...thanks but I want to build this for myself to see my little project through.

I already have Keyscapes...but thanks for turning me on to Pianoteq...they sound amazing as well!

Link to comment
Share on other sites

  • 2 years later...

Great program fuzzfilth! If anyone had the same feedback as myself- To avoid double-triggering the "pedal on" noise if your expression/sustain pedal can do more values than 0 or 127 (i.e. when you press and release the pedal you get something like 127, 38, then 0 which would double trigger), just change these lines to tighten the range: 

function HandleMIDI(e) {
  // Change the value at the end of this line to tighten the tolerance
  if (e instanceof ControlChange && e.number == 64 && e.value > 126) {
  
     PedNote(GetParameter("PedOn"),GetParameter("VelocityOn"));   
     
       if (GetParameter("Sustain")==0) {
         e.send();
       }      
     } else {
     // Change the value at the end of this line to tighten the tolerance
      if (e instanceof ControlChange && e.number == 64 && e.value < 1) {
     
        PedNote(GetParameter("PedOff"),GetParameter("VelocityOff"));
        
          if (GetParameter("Sustain")==0) {
            e.send();
          }
        } else {
        
         e.send();  
         
        }
     }
  }

I just made it >126 and less <1 so it will only fire on 127 and 0! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...