ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2025-10-13T15:34:26+02:00 https://brainmodular.com/forums/app.php/feed/topic/5434 2025-10-13T15:34:26+02:00 2025-10-13T15:34:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46075#p46075 <![CDATA[Re: SostenutoSustain]]>
i've tested with two midi pedals, sustain and sostenuto together, everything works as expected.

Thank's a lot, a lot, a lot !!

Statistics: Posted by Charlie O. — 13 Oct 2025, 15:34


]]>
2025-10-12T23:57:39+02:00 2025-10-12T23:57:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46074#p46074 <![CDATA[Re: SostenutoSustain]]>
> I am not yet fluent in the Pascal scripting lingo of Usine

Neither am I, for sure. That's extremely kind of you to try !
I fixed the code, and edited my previous post. It compiled alright but need some testing with MIDI.

Can you test it and tell us how it goes ?

Olivar

Statistics: Posted by oli_lab — 12 Oct 2025, 23:57


]]>
2025-10-12T17:46:42+02:00 2025-10-12T17:46:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46073#p46073 <![CDATA[Re: SostenutoSustain]]>
Neither am I, for sure. That's extremely kind of you to try !

Statistics: Posted by Charlie O. — 12 Oct 2025, 17:46


]]>
2025-10-12T16:26:57+02:00 2025-10-12T16:26:57+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46072#p46072 <![CDATA[Re: SostenutoSustain]]> I'll try my best soonish

Olivar

Statistics: Posted by oli_lab — 12 Oct 2025, 16:26


]]>
2025-10-12T14:38:55+02:00 2025-10-12T14:38:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46071#p46071 <![CDATA[Re: SostenutoSustain]]> var KeyPressed : array [0..127] of single; // reflects keyboard state

procedure init;
var i : integer;

for i := 0 to 127 do KeyPressed := 0;

et là ça bloque : "Can't assign "Int64" to array [0..127] of Single" at line 84

Statistics: Posted by Charlie O. — 12 Oct 2025, 14:38


]]>
2025-10-12T02:59:31+02:00 2025-10-12T02:59:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46070#p46070 <![CDATA[Re: SostenutoSustain]]>
I will try it asap.

Statistics: Posted by Charlie O. — 12 Oct 2025, 02:59


]]>
2025-10-13T08:14:31+02:00 2025-10-06T21:10:48+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46056#p46056 <![CDATA[Re: SostenutoSustain]]> Found it in my archives !

CODE:

// SostenutoSustain//// This script provides true Sostenuto & Sustain and their// corresponding interactions with each other. The goal is// to make them behave like true grand piano middle &// right pedals.//// Sostenuto: Basically holds notes whose dampers were up// at the time the Sostenuto pedal was pressed. They will// sustain until the Sostenuto pedal is released. (CC66)// Other notes will release normally. I.e., some notes hold// and some don't...//// Sustain: All notes are held & dampers are up until the// pedal is released.(CC64)//// In both cases, if keys are being pressed at the time the// pedal is released, they will not be affected - their// dampers are still up.//// CC64 & CC66 are not passed downstream so they wont get// confused with any VSTi logic.//// Parameters:// Channel - Only works on the channel specified here// BlockIfHeld - If a held note is repeated,// this will prevent retrigger of the note//// 6/2016, by shawnb////////////////////////////////////////////////////////// Parameters//////////////////////////////////////////////////////var pMidiIn : Tparameter;var pMidiOut : Tparameter;var pChannel : Tparameter;var pBlockIfHeld : Tparameter;//////////////////////////////////////////////////////// Global Variables//////////////////////////////////////////////////////var iSostPedalPressed : single; // sostenuto pedal statevar iSustPedalPressed : single; // sustain pedal statevar inputIX : integer; // always current record just readvar outputIX : integer; // always current record about to be writtenvar iChannel : single; // holds parameter valuevar iBlockIfHeld : single; // holds parameter valuevar KeyPressed : array [0..127] of Integer; // reflects keyboard statevar MonkeyBar : array [0..127] of integer; // reflects dampers held by sostenuto barvar NoteHeld : array [0..127] of integer; // reflects if note is being heldvar MidiTmp : TMidi; // current midi message buffer//////////////////////////////////////////////////////// initialization procedure//////////////////////////////////////////////////////procedure init;var i : integer;beginpMidiIn := CreateParam('MidiIn',ptMidi);SetIsOutput(pMidiIn,false);pMidiOut := CreateParam('MidiOut',ptMidi);SetIsInput(pMidiOut,false);pChannel := CreateParam('Channel',ptDataField);SetIsOutput(pChannel,false);SetMin(pChannel,1);SetMax(pChannel,16);SetDefaultValue(pChannel,1);pBlockIfHeld := CreateParam('BlockIfHeld',ptDataField);SetIsOutput(pBlockIfHeld,false);SetMin(pBlockIfHeld,0);SetMax(pBlockIfHeld,1);SetDefaultValue(pBlockIfHeld,0);iSostPedalPressed := 0;iSustPedalPressed := 0;inputIX := 0;outputIX := 0;iChannel := 1;iBlockIfHeld := 0;for i := 0 to 127 do KeyPressed[i]  := 0;for i := 0 to 127 do MonkeyBar[i] := 0;for i := 0 to 127 do NoteHeld[i] := 0;end;//////////////////////////////////////////////////////// Send_Msg// Just write what's in the buffer...//////////////////////////////////////////////////////procedure Send_Msg;beginSetMidiArrayValue(pMidiOut,outputIX,MidiTmp);outputIX := outputIX + 1;end;//////////////////////////////////////////////////////// Send_Note_Off//////////////////////////////////////////////////////procedure Send_Note_Off(note:integer);beginMidiTmp.Channel := trunc(iChannel);MIdiTmp.Msg := 128;MIdiTmp.Data1 := note;MIdiTmp.Data2 := 0;SetMidiArrayValue(pMidiOut,outputIX,MidiTmp);outputIX := outputIX + 1;end;//////////////////////////////////////////////////////// Sost_Press//////////////////////////////////////////////////////procedure Sost_Press;var i : integer;beginfor i := 0 to 127 do beginif (KeyPressed[i]= 1) or (iSustPedalPressed = 1) thenMonkeyBar[i]:= 1;end;end;//////////////////////////////////////////////////////// Sost_Release//////////////////////////////////////////////////////procedure Sost_Release;var i,j : integer;beginfor i := 0 to 127 do beginif (KeyPressed [i]= 0) and (iSustPedalPressed = 0) and (NoteHeld [i]= 1) then beginSend_Note_Off(i);NoteHeld[i] := 0;end;MonkeyBar [i]:= 0;end;end;//////////////////////////////////////////////////////// Sost_Pedal// Trigger pressed or released logic when CC values change// Note no Send_Msg, as we eat all CC64 & CC66 Msgs// so downstream VSTis don't get confused...//////////////////////////////////////////////////////procedure Sost_Pedal;beginif iSostPedalPressed = 0 then beginif MidiTmp.Data2 > 63 then beginSost_Press;iSostPedalPressed := 1;end;endelse beginif MidiTmp.Data2 <= 63 then beginSost_Release;iSostPedalPressed := 0;end;end;end;//////////////////////////////////////////////////////// Sust_Release// Release held notes//////////////////////////////////////////////////////procedure Sust_Release;var i : integer;beginfor i := 0 to 127 do beginif (KeyPressed[i] = 0) and (MonkeyBar[i] = 0) and (NoteHeld[i] = 1) then beginSend_Note_Off(i);NoteHeld[i] := 0;end;end;end;//////////////////////////////////////////////////////// Sust_Pedal// Trigger pressed or released logic when CC values change// Note no Send_Msg, as we eat all CC64 & CC66 Msgs// so downstream VSTis don't get confused...//////////////////////////////////////////////////////procedure Sust_Pedal;beginif iSustPedalPressed = 0 then beginif MidiTmp.Data2 > 63 then beginiSustPedalPressed := 1;end;endelse beginif MidiTmp.Data2 <= 63 then beginSust_Release;iSustPedalPressed := 0;end;end;end;//////////////////////////////////////////////////////// Note_On//////////////////////////////////////////////////////procedure Note_On;begin// Maintain picture of actual keyboard...KeyPressed[MidiTmp.Data1] := 1;// Honor iBlockIfHeld... Only pass note on if appropriateif (iBlockIfHeld = 0) or (NoteHeld[MidiTmp.Data1] = 0) thenSend_Msg;end;//////////////////////////////////////////////////////// Note_Off//////////////////////////////////////////////////////procedure Note_Off;begin// Maintain picture of actual keyboard...KeyPressed[MidiTmp.Data1] := 0;// Pass note off Msg if note is not sustained...if (MonkeyBar[MidiTmp.Data1] = 0) and (iSustPedalPressed = 0) then beginSend_Msg;endelse begin// Note is being sustained, flag in NoteHeld.// Note that you've eaten the 'Note Off'// by not doing a Send_MsgNoteHeld[MidiTmp.Data1] := 1;end;end;//////////////////////////////////////////////////////// Do_My_Channel//////////////////////////////////////////////////////procedure Do_My_Channel;beginif MidiTmp.Msg = 144 then Note_Onelse if MidiTmp.Msg = 128 then Note_Offelse if (MidiTmp.Msg = 176) and (MidiTmp.Data1 = 64) then Sust_Pedalelse if (MidiTmp.Msg = 176) and (MidiTmp.Data1 = 66) then Sost_Pedalelse Send_Msg; // pass everything elseend;//////////////////////////////////////////////////////// DoMidiProc//////////////////////////////////////////////////////procedure DoMidiProc;var len : integer;beginoutputIX := 0;len := GetLength(pMidiIn);if len > 0 then beginfor inputIX := 0 to len-1 do beginGetMidiArrayValue(pMidiIn, inputIX, MidiTmp);// Only work on selected channel, pass everything else thruif MidiTmp.Channel = iChannel thenDo_My_ChannelelseSend_Msg;end;end;// Always properly close out the midi output stream...SetLength(pMidiOut,outputIX);end;//////////////////////////////////////////////////////// Main procedure//////////////////////////////////////////////////////procedure Process;begin//Do it all in the Callback...end;//////////////////////////////////////////////////////// Callback//////////////////////////////////////////////////////Procedure Callback(n:integer);begincase n ofpMidiIn : DoMidiProc;pChannel : iChannel := GetValue(n);pBlockIfHeld : iBlockIfHeld := GetValue(n);end;end

Statistics: Posted by oli_lab — 06 Oct 2025, 21:10


]]>
2025-10-05T14:18:54+02:00 2025-10-05T14:18:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46055#p46055 <![CDATA[Re: SostenutoSustain]]>
Or even better as a script ?

Thank's a lot !

Statistics: Posted by Charlie O. — 05 Oct 2025, 14:18


]]>
2016-06-18T01:37:11+02:00 2016-06-18T01:37:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35478#p35478 <![CDATA[SostenutoSustain]]>
Hi:
I dropped the SostenutoSustain.fastscript into my patch but I can't get it to work.

Can someone tell me how to set this up?

Thanks.
Basically place this somewhere between your keyboard (or other MIDI controller/source) and your sound module. It is safe to run *all* of your MIDI traffic thru this module, no need to pre-filter or anything like that unless you really want to.

Input is all MIDI traffic, including notes and pedal messages for sostenuto (CC66) & sustain (CC64).

Send the output to your sound module/VSTi.

This module interprets the pedal messages for you, and will sustain notes by eating Note OFF messages. The Note OFFs will be sent when the appropriate pedal is released.

CC64 and CC66 messages are not passed downstream, as this may confuse your VSTi (if it has similar logic).

Make sure to specify your MIDI channel; this is an input parameter which defaults to channel 1.

Hope this helps. Any further questions let me know,

Statistics: Posted by shawnb — 18 Jun 2016, 01:37


]]>
2016-06-09T15:23:12+02:00 2016-06-09T15:23:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35384#p35384 <![CDATA[SostenutoSustain]]> Statistics: Posted by damstraversaz — 09 Jun 2016, 15:23


]]>
2016-06-04T22:15:50+02:00 2016-06-04T22:15:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35367#p35367 <![CDATA[SostenutoSustain]]> & Thanks!

Statistics: Posted by shawnb — 04 Jun 2016, 22:15


]]>
2016-06-04T21:08:27+02:00 2016-06-04T21:08:27+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35366#p35366 <![CDATA[SostenutoSustain]]>
i've edited your page to suit the wiki style

Statistics: Posted by nay-seven — 04 Jun 2016, 21:08


]]>
2016-06-04T19:11:54+02:00 2016-06-04T19:11:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35364#p35364 <![CDATA[SostenutoSustain]]>
Test #1: Without holding any key, press sustain, then sostenuto, then release sustain. The sostenuto pedal now acts like a simple sustain, not sostenuto, since all dampers were up at the time the sostenuto bar was engaged. I've read that folks buying a grand piano use this simple test to confirm the sostenuto bar is working as designed.

Test #2: Two stage sustain... Hold a chord & engage sostenuto. Press the sustain pedal. Hold another chord. Releasing the sustain pedal only releases the 2nd chord - the first chord is still held by the sostenuto pedal.

Test #3: Basic sostenuto... Hold a chord & press the sostenuto pedal. Play other keys... They should NOT be held. I.e., you get a mix of held & non-held notes on a properly implemented sostenuto.

Statistics: Posted by shawnb — 04 Jun 2016, 19:11


]]>
2016-06-04T19:05:25+02:00 2016-06-04T19:05:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35363#p35363 <![CDATA[SostenutoSustain]]>
Sostenuto: Basically holds notes whose dampers were up at the time the Sostenuto pedal was pressed. They will sustain until the Sostenuto pedal is released. (CC66) Other notes will release normally. I.e., some notes hold and some don't...

Sustain: All notes are held & dampers are up until the pedal is released.(CC64).

CC64 & CC66 are not passed downstream so they wont get confused with any VSTi logic.

Statistics: Posted by shawnb — 04 Jun 2016, 19:05


]]>
BrainModular BrainModular Users Forum 2025-10-13T15:34:26+02:00 https://brainmodular.com/forums/app.php/feed/topic/5434 2025-10-13T15:34:26+02:00 2025-10-13T15:34:26+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46075#p46075 <![CDATA[Re: SostenutoSustain]]>
i've tested with two midi pedals, sustain and sostenuto together, everything works as expected.

Thank's a lot, a lot, a lot !!

Statistics: Posted by Charlie O. — 13 Oct 2025, 15:34


]]>
2025-10-12T23:57:39+02:00 2025-10-12T23:57:39+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46074#p46074 <![CDATA[Re: SostenutoSustain]]>
> I am not yet fluent in the Pascal scripting lingo of Usine

Neither am I, for sure. That's extremely kind of you to try !
I fixed the code, and edited my previous post. It compiled alright but need some testing with MIDI.

Can you test it and tell us how it goes ?

Olivar

Statistics: Posted by oli_lab — 12 Oct 2025, 23:57


]]>
2025-10-12T17:46:42+02:00 2025-10-12T17:46:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46073#p46073 <![CDATA[Re: SostenutoSustain]]>
Neither am I, for sure. That's extremely kind of you to try !

Statistics: Posted by Charlie O. — 12 Oct 2025, 17:46


]]>
2025-10-12T16:26:57+02:00 2025-10-12T16:26:57+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46072#p46072 <![CDATA[Re: SostenutoSustain]]> I'll try my best soonish

Olivar

Statistics: Posted by oli_lab — 12 Oct 2025, 16:26


]]>
2025-10-12T14:38:55+02:00 2025-10-12T14:38:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46071#p46071 <![CDATA[Re: SostenutoSustain]]> var KeyPressed : array [0..127] of single; // reflects keyboard state

procedure init;
var i : integer;

for i := 0 to 127 do KeyPressed := 0;

et là ça bloque : "Can't assign "Int64" to array [0..127] of Single" at line 84

Statistics: Posted by Charlie O. — 12 Oct 2025, 14:38


]]>
2025-10-12T02:59:31+02:00 2025-10-12T02:59:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46070#p46070 <![CDATA[Re: SostenutoSustain]]>
I will try it asap.

Statistics: Posted by Charlie O. — 12 Oct 2025, 02:59


]]>
2025-10-13T08:14:31+02:00 2025-10-06T21:10:48+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46056#p46056 <![CDATA[Re: SostenutoSustain]]> Found it in my archives !

CODE:

// SostenutoSustain//// This script provides true Sostenuto & Sustain and their// corresponding interactions with each other. The goal is// to make them behave like true grand piano middle &// right pedals.//// Sostenuto: Basically holds notes whose dampers were up// at the time the Sostenuto pedal was pressed. They will// sustain until the Sostenuto pedal is released. (CC66)// Other notes will release normally. I.e., some notes hold// and some don't...//// Sustain: All notes are held & dampers are up until the// pedal is released.(CC64)//// In both cases, if keys are being pressed at the time the// pedal is released, they will not be affected - their// dampers are still up.//// CC64 & CC66 are not passed downstream so they wont get// confused with any VSTi logic.//// Parameters:// Channel - Only works on the channel specified here// BlockIfHeld - If a held note is repeated,// this will prevent retrigger of the note//// 6/2016, by shawnb////////////////////////////////////////////////////////// Parameters//////////////////////////////////////////////////////var pMidiIn : Tparameter;var pMidiOut : Tparameter;var pChannel : Tparameter;var pBlockIfHeld : Tparameter;//////////////////////////////////////////////////////// Global Variables//////////////////////////////////////////////////////var iSostPedalPressed : single; // sostenuto pedal statevar iSustPedalPressed : single; // sustain pedal statevar inputIX : integer; // always current record just readvar outputIX : integer; // always current record about to be writtenvar iChannel : single; // holds parameter valuevar iBlockIfHeld : single; // holds parameter valuevar KeyPressed : array [0..127] of Integer; // reflects keyboard statevar MonkeyBar : array [0..127] of integer; // reflects dampers held by sostenuto barvar NoteHeld : array [0..127] of integer; // reflects if note is being heldvar MidiTmp : TMidi; // current midi message buffer//////////////////////////////////////////////////////// initialization procedure//////////////////////////////////////////////////////procedure init;var i : integer;beginpMidiIn := CreateParam('MidiIn',ptMidi);SetIsOutput(pMidiIn,false);pMidiOut := CreateParam('MidiOut',ptMidi);SetIsInput(pMidiOut,false);pChannel := CreateParam('Channel',ptDataField);SetIsOutput(pChannel,false);SetMin(pChannel,1);SetMax(pChannel,16);SetDefaultValue(pChannel,1);pBlockIfHeld := CreateParam('BlockIfHeld',ptDataField);SetIsOutput(pBlockIfHeld,false);SetMin(pBlockIfHeld,0);SetMax(pBlockIfHeld,1);SetDefaultValue(pBlockIfHeld,0);iSostPedalPressed := 0;iSustPedalPressed := 0;inputIX := 0;outputIX := 0;iChannel := 1;iBlockIfHeld := 0;for i := 0 to 127 do KeyPressed[i]  := 0;for i := 0 to 127 do MonkeyBar[i] := 0;for i := 0 to 127 do NoteHeld[i] := 0;end;//////////////////////////////////////////////////////// Send_Msg// Just write what's in the buffer...//////////////////////////////////////////////////////procedure Send_Msg;beginSetMidiArrayValue(pMidiOut,outputIX,MidiTmp);outputIX := outputIX + 1;end;//////////////////////////////////////////////////////// Send_Note_Off//////////////////////////////////////////////////////procedure Send_Note_Off(note:integer);beginMidiTmp.Channel := trunc(iChannel);MIdiTmp.Msg := 128;MIdiTmp.Data1 := note;MIdiTmp.Data2 := 0;SetMidiArrayValue(pMidiOut,outputIX,MidiTmp);outputIX := outputIX + 1;end;//////////////////////////////////////////////////////// Sost_Press//////////////////////////////////////////////////////procedure Sost_Press;var i : integer;beginfor i := 0 to 127 do beginif (KeyPressed[i]= 1) or (iSustPedalPressed = 1) thenMonkeyBar[i]:= 1;end;end;//////////////////////////////////////////////////////// Sost_Release//////////////////////////////////////////////////////procedure Sost_Release;var i,j : integer;beginfor i := 0 to 127 do beginif (KeyPressed [i]= 0) and (iSustPedalPressed = 0) and (NoteHeld [i]= 1) then beginSend_Note_Off(i);NoteHeld[i] := 0;end;MonkeyBar [i]:= 0;end;end;//////////////////////////////////////////////////////// Sost_Pedal// Trigger pressed or released logic when CC values change// Note no Send_Msg, as we eat all CC64 & CC66 Msgs// so downstream VSTis don't get confused...//////////////////////////////////////////////////////procedure Sost_Pedal;beginif iSostPedalPressed = 0 then beginif MidiTmp.Data2 > 63 then beginSost_Press;iSostPedalPressed := 1;end;endelse beginif MidiTmp.Data2 <= 63 then beginSost_Release;iSostPedalPressed := 0;end;end;end;//////////////////////////////////////////////////////// Sust_Release// Release held notes//////////////////////////////////////////////////////procedure Sust_Release;var i : integer;beginfor i := 0 to 127 do beginif (KeyPressed[i] = 0) and (MonkeyBar[i] = 0) and (NoteHeld[i] = 1) then beginSend_Note_Off(i);NoteHeld[i] := 0;end;end;end;//////////////////////////////////////////////////////// Sust_Pedal// Trigger pressed or released logic when CC values change// Note no Send_Msg, as we eat all CC64 & CC66 Msgs// so downstream VSTis don't get confused...//////////////////////////////////////////////////////procedure Sust_Pedal;beginif iSustPedalPressed = 0 then beginif MidiTmp.Data2 > 63 then beginiSustPedalPressed := 1;end;endelse beginif MidiTmp.Data2 <= 63 then beginSust_Release;iSustPedalPressed := 0;end;end;end;//////////////////////////////////////////////////////// Note_On//////////////////////////////////////////////////////procedure Note_On;begin// Maintain picture of actual keyboard...KeyPressed[MidiTmp.Data1] := 1;// Honor iBlockIfHeld... Only pass note on if appropriateif (iBlockIfHeld = 0) or (NoteHeld[MidiTmp.Data1] = 0) thenSend_Msg;end;//////////////////////////////////////////////////////// Note_Off//////////////////////////////////////////////////////procedure Note_Off;begin// Maintain picture of actual keyboard...KeyPressed[MidiTmp.Data1] := 0;// Pass note off Msg if note is not sustained...if (MonkeyBar[MidiTmp.Data1] = 0) and (iSustPedalPressed = 0) then beginSend_Msg;endelse begin// Note is being sustained, flag in NoteHeld.// Note that you've eaten the 'Note Off'// by not doing a Send_MsgNoteHeld[MidiTmp.Data1] := 1;end;end;//////////////////////////////////////////////////////// Do_My_Channel//////////////////////////////////////////////////////procedure Do_My_Channel;beginif MidiTmp.Msg = 144 then Note_Onelse if MidiTmp.Msg = 128 then Note_Offelse if (MidiTmp.Msg = 176) and (MidiTmp.Data1 = 64) then Sust_Pedalelse if (MidiTmp.Msg = 176) and (MidiTmp.Data1 = 66) then Sost_Pedalelse Send_Msg; // pass everything elseend;//////////////////////////////////////////////////////// DoMidiProc//////////////////////////////////////////////////////procedure DoMidiProc;var len : integer;beginoutputIX := 0;len := GetLength(pMidiIn);if len > 0 then beginfor inputIX := 0 to len-1 do beginGetMidiArrayValue(pMidiIn, inputIX, MidiTmp);// Only work on selected channel, pass everything else thruif MidiTmp.Channel = iChannel thenDo_My_ChannelelseSend_Msg;end;end;// Always properly close out the midi output stream...SetLength(pMidiOut,outputIX);end;//////////////////////////////////////////////////////// Main procedure//////////////////////////////////////////////////////procedure Process;begin//Do it all in the Callback...end;//////////////////////////////////////////////////////// Callback//////////////////////////////////////////////////////Procedure Callback(n:integer);begincase n ofpMidiIn : DoMidiProc;pChannel : iChannel := GetValue(n);pBlockIfHeld : iBlockIfHeld := GetValue(n);end;end

Statistics: Posted by oli_lab — 06 Oct 2025, 21:10


]]>
2025-10-05T14:18:54+02:00 2025-10-05T14:18:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=46055#p46055 <![CDATA[Re: SostenutoSustain]]>
Or even better as a script ?

Thank's a lot !

Statistics: Posted by Charlie O. — 05 Oct 2025, 14:18


]]>
2016-06-18T01:37:11+02:00 2016-06-18T01:37:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35478#p35478 <![CDATA[SostenutoSustain]]>
Hi:
I dropped the SostenutoSustain.fastscript into my patch but I can't get it to work.

Can someone tell me how to set this up?

Thanks.
Basically place this somewhere between your keyboard (or other MIDI controller/source) and your sound module. It is safe to run *all* of your MIDI traffic thru this module, no need to pre-filter or anything like that unless you really want to.

Input is all MIDI traffic, including notes and pedal messages for sostenuto (CC66) & sustain (CC64).

Send the output to your sound module/VSTi.

This module interprets the pedal messages for you, and will sustain notes by eating Note OFF messages. The Note OFFs will be sent when the appropriate pedal is released.

CC64 and CC66 messages are not passed downstream, as this may confuse your VSTi (if it has similar logic).

Make sure to specify your MIDI channel; this is an input parameter which defaults to channel 1.

Hope this helps. Any further questions let me know,

Statistics: Posted by shawnb — 18 Jun 2016, 01:37


]]>
2016-06-09T15:23:12+02:00 2016-06-09T15:23:12+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35384#p35384 <![CDATA[SostenutoSustain]]> Statistics: Posted by damstraversaz — 09 Jun 2016, 15:23


]]>
2016-06-04T22:15:50+02:00 2016-06-04T22:15:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35367#p35367 <![CDATA[SostenutoSustain]]> & Thanks!

Statistics: Posted by shawnb — 04 Jun 2016, 22:15


]]>
2016-06-04T21:08:27+02:00 2016-06-04T21:08:27+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35366#p35366 <![CDATA[SostenutoSustain]]>
i've edited your page to suit the wiki style

Statistics: Posted by nay-seven — 04 Jun 2016, 21:08


]]>
2016-06-04T19:11:54+02:00 2016-06-04T19:11:54+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35364#p35364 <![CDATA[SostenutoSustain]]>
Test #1: Without holding any key, press sustain, then sostenuto, then release sustain. The sostenuto pedal now acts like a simple sustain, not sostenuto, since all dampers were up at the time the sostenuto bar was engaged. I've read that folks buying a grand piano use this simple test to confirm the sostenuto bar is working as designed.

Test #2: Two stage sustain... Hold a chord & engage sostenuto. Press the sustain pedal. Hold another chord. Releasing the sustain pedal only releases the 2nd chord - the first chord is still held by the sostenuto pedal.

Test #3: Basic sostenuto... Hold a chord & press the sostenuto pedal. Play other keys... They should NOT be held. I.e., you get a mix of held & non-held notes on a properly implemented sostenuto.

Statistics: Posted by shawnb — 04 Jun 2016, 19:11


]]>
2016-06-04T19:05:25+02:00 2016-06-04T19:05:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=5434&p=35363#p35363 <![CDATA[SostenutoSustain]]>
Sostenuto: Basically holds notes whose dampers were up at the time the Sostenuto pedal was pressed. They will sustain until the Sostenuto pedal is released. (CC66) Other notes will release normally. I.e., some notes hold and some don't...

Sustain: All notes are held & dampers are up until the pedal is released.(CC64).

CC64 & CC66 are not passed downstream so they wont get confused with any VSTi logic.

Statistics: Posted by shawnb — 04 Jun 2016, 19:05


]]>