What's new

Sustain pedal samples in Logic Sampler

I am trying to include sustain pedal down and up samples in a Logic Sampler piano instrument but can't for the life of me work out how to get CC64 to trigger them. I've found an explanation for EXS24 but wondered if someone could walk me through it on Sampler? Many thanks.
 
Check out one of the Factory piano samples. That should show you how.
In particular, see the screen capture attached. Screen Shot 2021-03-28 at 5.52.59 PM.png
 
Last edited:
Check out one of the Factory piano samples. That should show you how.
In particular, see the screen capture attached. Screen Shot 2021-03-28 at 5.52.59 PM.png
Thanks so much for your reply, this is really helpful for learning CC switching.

I realise that I wasn’t at all clear in my original post, what I meant was that I have sampled the actual sound of the pedal and its mechanism being pressed and released and wanted to also include that in the instrument when the pedal is pressed and released. None of the factory instruments seem to do this.
 
Ah. Perhaps others can chime in whether this can be done exclusively within Sampler, but as far as I can tell you may need to use Scripter as well. See the tutorial script, "Convert Events with Parameter" for a close enough idea on how to go about it. If you are really stuck, I can create one fairly quickly (ha ha! sure I can!) for you.

Rob
 
Ah. Perhaps others can chime in whether this can be done exclusively within Sampler, but as far as I can tell you may need to use Scripter as well. See the tutorial script, "Convert Events with Parameter" for a close enough idea on how to go about it. If you are really stuck, I can create one fairly quickly (ha ha! sure I can!) for you.

Rob
Hi Rob, thanks for this. I'm very new to scripting but have had a go at borrowing from others ideas - it kinda works and with the pedal down and up samples in separate groups on the same note (C-2) and one set to release it plays the samples fine - it just stops the sustain pedal from functioning as a sustain.

function HandleMIDI(event)
{
var note = new NoteOn;

if (event instanceof ControlChange && event.number==64) {

note.channel=1;
note.pitch=0;
if (event.value>0) note.velocity=100; else note.velocity=0;
note.send();
} else {

event.trace();
event.send();
}
}

I don't want to cause you a heap of work but if you could help I would be hugely grateful!

Cheers
Phil
 
Code:
function HandleMIDI(event){
    var note = new NoteOn;

    if (event instanceof ControlChange && event.number==64) {
        note.channel=1;
        note.pitch=0;
           if (event.value>0){
            note.velocity=100;
        }else{
            note.velocity=0;
               note.send();
            event.send();
    }else{
    event.send();
    }
}

This should do it. Added an event.send so the pedal cc will pass through.

Rob
 
Code:
function HandleMIDI(event){
    var note = new NoteOn;

    if (event instanceof ControlChange && event.number==64) {
        note.channel=1;
        note.pitch=0;
           if (event.value>0){
            note.velocity=100;
        }else{
            note.velocity=0;
               note.send();
            event.send();
    }else{
    event.send();
    }
}

This should do it. Added an event.send so the pedal cc will pass through.

Rob
Thanks Rob, it doesn't like the last 'else', I get this:

Evaluating MIDI-processing script...
Script failed to evaluate:
[JS Exception] SyntaxError: Unexpected keyword 'else' line:13
>
 
Oops! Forgot a closing bracket after the first event.send.
Code:
function HandleMIDI(event){
    var note = new NoteOn;

    if (event instanceof ControlChange && event.number==64) {
        note.channel=1;
        note.pitch=0;
           if (event.value>0){
            note.velocity=100;
        }else{
            note.velocity=0;
               note.send();
            event.send();
        }
    }else{
    event.send();
    }
}
 
That script runs but sustain isn't passing through and now it is not triggering the pedal down sample. Sorry about this Rob, I appreciate it's not easy guiding a newbie through this.
 
That script runs but sustain isn't passing through and now it is not triggering the pedal down sample. Sorry about this Rob, I appreciate it's not easy guiding a newbie through this.
Ha ha! Silly me. I'm only slightly above noob, as has been revealed. :shocked:
Closing bracket in the wrong place.

Code:
function HandleMIDI(event){
    var note = new NoteOn;

    if (event instanceof ControlChange && event.number==64) {

        note.channel=1;
        note.pitch=0;
           if (event.value>0){
            note.velocity=100;
        }else{
            note.velocity=0;
        }
               note.send();
            event.send();
        
    }else{
    event.send();
    }
}

Next time I'll test it here first instead of assume it'll work. :grin:

Rob
 
Top Bottom