Jump to content

Sustain pedal hold when going to another track in arrangement


Go to solution Solved by Jordi Torres,

Recommended Posts

So, it's been awhile since I have posted 🙂

But I have a Question.

I use logic as a mixingboard/stereo recorder most of the time and recording everything in real time ( I am just a weirdo)

I used to hold a sustain pedal and then by holding that pedal and selecting another track, releasing the sustain pedal and the former track would stay sustained. I could then sustain the new track with the pedal, hold and select another track and release. And so on.

It's like opening a VCA on an analog synth to build drones and stuff like that.

I think since 10.6 (logic) the functionality disappeared, meaning that when holding sustain pedal and going to another track, it is instantly released on the former selected track. Bit of a downer for me personally, since I used it alot quite frankly.

 

Any way to get the old behaviour back? I tried chase settings and stuff like that, but I cannot get it to work again like it did in the older versions.

Other suggestions?

Cheers.

 

 

 

 

Link to comment
Share on other sites

Not at the studio to verify same:

Have you tried setting the tracks to different MIDI channels / ports?

Or perhaps using the environment to somehow connect the different elements differently between the Physical Input object and the channelstrips.

(admittedly shooting blank here)

Edited by Atlas007
Link to comment
Share on other sites

  • Solution

Hi @Septic Underground,

 

On 2/9/2024 at 3:54 PM, Septic Underground said:

I used to hold a sustain pedal and then by holding that pedal and selecting another track, releasing the sustain pedal and the former track would stay sustained. I could then sustain the new track with the pedal, hold and select another track and release. And so on

You can use the following Scripter MIDI FX script to toggle sustain on or off on a track without the sustained notes being turned off when selecting another track. Since it toggles sustain, with this script you don't need to hold down the pedal, you just tap it with your foot to turn sustain On on a track, tap it again to turn sustain Off on that track.

var PluginParameters = [
  {
    name: 'Sustain Status',
    type: 'menu',
    valueStrings: ['Off', 'On'],
    defaultValue: 0,
  },
];

const isSustainOn = (e, value) =>
  e instanceof ControlChange && e.number === 64 && e.value === value;

const toggleSustain = (() => {
  let toggleStatus = 0;

  return function () {
    // Toggle between 1 and 0
    toggleStatus = 1 - toggleStatus; 
    
	// Send Sustain On/Off based on toggleStatus
    const cc = new ControlChange();
    cc.number = 64;
    cc.value = toggleStatus ? 127 : 0;
    cc.send(); 
	
	// Sets Sustain Status in UI
    SetParameter(0, toggleStatus); 
  };
})();

function HandleMIDI(e) {
  if (isSustainOn(e, 0)) {
    return; // Ignore Sustain Off
  }

  if (isSustainOn(e, 127)) {
    toggleSustain(); // Toggle Sustain
    return;
  }
  // Let non-matching events pass through
  e.send();
}

J.

Edited by Jordi Torres
Refactored script
  • Like 3
Link to comment
Share on other sites

1 hour ago, Jordi Torres said:

Hi @Septic Underground,

You can use the following Scripter MIDI FX script to toggle sustain on or off on a track without the sustained notes being turned off when selecting another track. Since it toggles sustain, with this script you don't need to hold down the pedal, you just tap it with your foot to turn sustain On on a track, tap it again to turn sustain Off on that track.

var PluginParameters = [
  {
    name: 'Sustain Status',
    type: 'menu',
    valueStrings: ['Off', 'On'],
    defaultValue: 0,
  },
];

function isSustainOn(e, value) {
  return e instanceof ControlChange && e.number === 64 && e.value === value;
}

function sustainToggler() {
  let toggleStatus = 0;

  return function () {
    toggleStatus = 1 - toggleStatus; // Toggle between 1 and 0

    const cc = new ControlChange();
    cc.number = 64;
    cc.value = toggleStatus ? 127 : 0;
    cc.send(); // Send Sustain On/Off based on toggleStatus

    SetParameter(0, toggleStatus); // Sets Sustain Status in UI
  };
}

const toggleSustain = sustainToggler();

function HandleMIDI(e) {
  if (isSustainOn(e, 0)) {
    return; // Ignore Sustain Off
  }

  if (isSustainOn(e, 127)) {
    toggleSustain(); // Toggle Sustain
    return;
  }

  e.send(); // Let non-matching events pass through
}

J.

Thanks for responding, this looks very promising.

I copy/pasted this script into logic scripter and ran the script.

I can see that my sustainpedal is toggling the [sustain status] checkbox on/off

It does work now again when setting the sustain env part to infinitive etc (for eg DiscoDsp Discovery Pro) and toggling the sustainpedal.

I must hold the sustain down and then select another track (how it worked before). I expected in this script that I could remove my foot and the sustain will hold. That is not the case, that would be cool as well to have.

 

Many thanks, much appreciated!

 

 

  • Like 1
Link to comment
Share on other sites

Hi @Septic Underground,

37 minutes ago, Septic Underground said:

I must hold the sustain down and then select another track (how it worked before). I expected in this script that I could remove my foot and the sustain will hold. That is not the case, that would be cool as well to have.

If your pedal sends CC64 127 when pressing it, there is no need to keep your foot on the pedal with this script. In fact, what the script is doing is alternating between programatically sending CC64 127 and CC64 0 upon receiving CC64 127. Incoming CC64 0 is ignored.

I just retested it and that's indeed how it works. 

J.

 

 

 

 

 

Edited by Jordi Torres
Link to comment
Share on other sites

Yeah it sends CC64 alternating 0-127 as value

But it stops sustaining, with checkbox on and removing foot from pedal. It works just as a standard sustain pedal, but now I can hold foot down, move to another track, remove foot and it is sustained. That's what I used before and works now again due to this script, so it is okay by me  🙂

 

 

 

 

Link to comment
Share on other sites

3 hours ago, Septic Underground said:

But it stops sustaining, with checkbox on and removing foot from pedal. It works just as a standard sustain pedal

Although I'm glad it's working for you, the way you describe it does not match how it works: A standard sustain pedal works like a momentary switch, and this script works like a toggle switch.

Here you see how it behaves, first without it, then with it:

SustainScript.thumb.gif.b62c38d0b96596137aad98e9d22b54aa.gif

However, if you are sustaining notes with this script in Stop mode, and you go into Playback or Record mode, the sustained notes will stop sounding (and this won't be reflected in the Scripter's UI).

J. 

  • Like 2
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...