Hola de nuevo.
Hace tiempo Jordi me paso un scripter para dejar sostenido un sonido con el pedal de sustain y que se quedase en ese estado hasta volve a dar al pedal de sostenido. (CC64 on/off).
Tras la actulizacion de logic este scripter ha dejado de funcionar en instrumentos externos.
Os paso el scripter:
function HandleMIDI(event)
{
event.trace();
event.send();
}
var PluginParameters = [
{
name: 'Sustain Status',
type: 'menu',
valueStrings: ,
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();
}
Gracias de antemano
Hace tiempo Jordi me paso un scripter para dejar sostenido un sonido con el pedal de sustain y que se quedase en ese estado hasta volve a dar al pedal de sostenido. (CC64 on/off).
Tras la actulizacion de logic este scripter ha dejado de funcionar en instrumentos externos.
Os paso el scripter:
function HandleMIDI(event)
{
event.trace();
event.send();
}
var PluginParameters = [
{
name: 'Sustain Status',
type: 'menu',
valueStrings: ,
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();
}
Gracias de antemano
Responder
Citar
