ArrayArrayArrayArray BrainModular BrainModular Users Forum 2008-11-04T10:15:26+02:00 https://brainmodular.fr/forums/app.php/feed/topic/1124 2008-11-04T10:15:26+02:00 2008-11-04T10:15:26+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6083#p6083 <![CDATA[my script is sending undesired noteoffs]]>
Hi, I have had a quick look, and haven't found anything particular about the expression error as such, but you have made an error with the length of the output array. As long as you're not sending out the same number of messages as you get in, you can't use the length of the input array but have to create a counter to increment with 1 for each new message you add to the output, and then set the length of the MIDI array at the end with that variable.

Another small thing: Shouldn't the processExpression use midi.data2/127 instead of 128? With 128 you'll never get the max value 1.
Should it be 127?? Okay! I didn't realize that.

I see what you mean about the output array (sort of--it's all a bit unclear how it actually works) so I will keep an independent counter.

I'm sending out expression as a data out, not a midi out.....

I'll see if this helps...

Statistics: Posted by woodslanding — 04 Nov 2008, 09:15


]]>
2008-11-04T09:28:35+02:00 2008-11-04T09:28:35+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6078#p6078 <![CDATA[my script is sending undesired noteoffs]]> about the note offs I dont know. make sure the noteOffs are not already in the input (maybe uncheck NoteOff = noteOn AND velocity=0)

Statistics: Posted by amiga909 — 04 Nov 2008, 08:28


]]>
2008-11-04T09:20:12+02:00 2008-11-04T09:20:12+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6077#p6077 <![CDATA[my script is sending undesired noteoffs]]>
Another small thing: Shouldn't the processExpression use midi.data2/127 instead of 128? With 128 you'll never get the max value 1.

Statistics: Posted by bsork — 04 Nov 2008, 08:20


]]>
2008-11-04T03:59:25+02:00 2008-11-04T03:59:25+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6076#p6076 <![CDATA[my script is sending undesired noteoffs]]>

CODE:

TYPE tTransp = ARRAY OF integer;VAR transpositions &#58; ARRAY OF tTransp;// parameters declarationvar input    &#58; Tparameter;   // midi inputvar output   &#58; Tparameter;   // midi outputvar key1     &#58; Tparameter;   // output notes from keyboard 1var key2     &#58; Tparameter;   // output notes from keyboard 2var exp      &#58; Tparameter;   // send out a volume control signalvar out1on   &#58; Tparameter;   // enable output 1var out2on   &#58; Tparameter;   // enable output 2var disable  &#58; Tparameter;   // boolean control out for disabling VST if no keyboard is controlling itvar semi     &#58; TParameter;   // transpose by semi-tonevar octave   &#58; TParameter;   // transpose by octavevar split    &#58; Tparameter;   // pitch below or above which notes are not sentvar upper    &#58; Tparameter;   // send pitches above the split if on.  otherwise send pitches below.var outCH    &#58; Tparameter;   // rechannelize input.  Value of 0 leaves input channel unchangedvar exp1ch        &#58; integer;var exp1cc        &#58; integer;var exp2ch        &#58; integer;var exp2cc        &#58; integer;var exp1val      &#58; single;var exp2val      &#58; single;var outputCH     &#58; integer;var bytecount    &#58; integer;var midiLen      &#58; integer;var midi         &#58; TMidi;var transpose    &#58; integer;var splitVal     &#58; integer;var upperVal     &#58; integer;var key1Val      &#58; integer;var key2Val      &#58; integer;var key1ch       &#58; integer;var key2ch       &#58; integer;var i            &#58; integer;var channel      &#58; integer;var noteCount    &#58; integer;var disabled     &#58; boolean;// initialisation PROCEDURE init;BEGIN       output &#58;= CreateParam&#40;'MIDIout',ptMidi&#41;;           SetIsInput&#40;Output,false&#41;;     key1 &#58;= CreateParam&#40;'key1', ptSwitch&#41;;             SetIsOutput&#40;key1,false&#41;;    key2 &#58;= CreateParam&#40;'key2', ptSwitch&#41;;             SetIsOutput&#40;key2,false&#41;;    split &#58;= CreateParam&#40;'split',ptMidiNoteFader&#41;;     SetIsOutput&#40;split,false&#41;;    upper &#58;= CreateParam&#40;'upper',ptSwitch&#41;;            SetIsOutput&#40;upper,false&#41;;        exp &#58;= CreateParam&#40;'expression',ptDataField&#41;;       SetIsInput&#40;exp,false&#41;;    out1on &#58;= CreateParam&#40;'out1 enable',ptDataField&#41;;       SetIsInput&#40;out1on,false&#41;;    out2on &#58;= CreateParam&#40;'out2 enable',ptDataField&#41;;       SetIsInput&#40;out2on,false&#41;;        disable &#58;= CreateParam&#40;'vstBypass',ptDataField&#41;;   SetIsInput&#40;disable,false&#41;;    input &#58;= CreateParam&#40;'MIDIin',ptMidi&#41;;             SetIsOutput&#40;Input,false&#41;;    semi &#58;= CreateParam&#40;'semi',ptDataField&#41;;           SetIsOutput&#40;semi,false&#41;;    octave &#58;= CreateParam&#40;'8va',ptDataField&#41;;          SetIsOutput&#40;octave,false&#41;;      outCH &#58;= CreateParam&#40;'outCH', ptDataField&#41;;        SetIsOutput&#40;outCH,false&#41;; key1ch &#58;= 1;    key2ch &#58;= 2; exp1ch &#58;= 1; exp1cc &#58;= 4; exp2ch &#58;= 2; exp2cc &#58;= 3;  noteCount &#58;= 0;  SetArrayLength&#40;transpositions, 2&#41;; FOR i &#58;= 0 TO 1 DO // we are going to ignore midi data on any but the 2 keyboard channels...    SetArrayLength&#40;transpositions&#91;i&#93;, 128&#41;;  //default values and formats SetDefaultValue&#40;upper,1&#41;; SetDefaultValue&#40;key1,1&#41;; SetDefaultValue&#40;key2,1&#41;; SetFormat&#40;split,'%.0f'&#41;; SetMin&#40;split,1&#41;; SetMax&#40;split,127&#41;; SetDefaultValue&#40;split,1&#41;; SetFormat&#40;semi,'%.0f'&#41;; SetMin&#40;semi,-7&#41;; SetMax&#40;semi,7&#41;; SetDefaultValue&#40;semi,0&#41;; SetFormat&#40;octave,'%.0f'&#41;; SetMin&#40;octave,-4&#41;; SetMax&#40;octave,4&#41;; SetDefaultValue&#40;octave,0&#41;; SetDefaultValue&#40;outCH,1&#41;;end;PROCEDURE CreateOut&#40;ch, msg, data1, data2 &#58; integer&#41;;BEGIN   midi.msg &#58;= byte&#40;msg&#41;;   midi.data1 &#58;= byte&#40;data1&#41;;   midi.data2 &#58;= byte&#40;data2&#41;;   midi.channel &#58;= byte&#40;ch&#41;;   SetMidiArrayValue&#40;output, bytecount, midi&#41;;   END; // CreateOutPROCEDURE processNoteOns;BEGIN    //writeln&#40;'in noteon loop'&#41;;    IF &#40;&#40;&#40;channel = key1ch&#41; AND &#40;key1Val = 1&#41;&#41; OR &#40;&#40;channel = key2ch&#41; AND &#40;key2Val = 1&#41;&#41;&#41;        AND &#40;&#40;&#40;midi.data1 >= splitVal&#41; AND &#40;upperVal = 1&#41;&#41; OR &#40;&#40;midi.data1 < splitVal&#41; AND &#40;upperVal = 0&#41;&#41;&#41;    THEN BEGIN                transpositions&#91;channel - 1&#93;&#91;midi.data1&#93; &#58;= transpose;              // only works if keyboard ch's are 1 and 2....        midi.data1 &#58;= midi.data1 + transpose;        midi.channel &#58;= outputCH;        SetMidiArrayValue&#40;output, bytecount, midi&#41;;        //noteCount &#58;= noteCount + 1;  // increase count of held notes            END;          END;   //process NoteonsPROCEDURE processNoteOffs;BEGIN    midi.data1 &#58;= midi.data1 + transpositions&#91;channel - 1&#93;&#91;midi.data1&#93;; // Retrieve stored transpose and add to NoteOff    midi.channel &#58;= outputCH;     SetMidiArrayValue&#40;output, bytecount, midi&#41;;    //noteCount &#58;= noteCount - 1;      // decrease count of held notes    writeln&#40;'in notes off = ' + intToStr&#40;noteCount&#41;&#41;;END;  //processNoteoffsPROCEDURE processSustain;BEGIN    IF &#40;midi.data2 < 64&#41; THEN   //send sus up on all instruments, selected or not...        BEGIN            midi.channel &#58;= outputCH;            SetMidiArrayValue&#40;output, bytecount, midi&#41;;        END    ELSE IF &#40;&#40;&#40;channel = 1&#41; AND &#40;key1Val = 1&#41;&#41; OR &#40;&#40;channel = 2&#41; AND &#40;key2Val = 1&#41;&#41;&#41; THEN    BEGIN        IF &#40;midi.data2 >= 64&#41;  THEN  //send sus down only on selected instruments        BEGIN             midi.channel &#58;= outputCH;               SetMidiArrayValue&#40;output, bytecount, midi&#41;;        END;    END;END;   // process sustainPROCEDURE disableVST;  // not used yetBEGIN   disabled &#58;= &#40; &#40;key1val = 0&#41; AND &#40;key2val = 0&#41;&#41;;//   IF &#40;disabled&#41; THEN      // wait until all notes are off before doing this--how??      // and don't undo it when notes are back on!//      IF &#40;noteCount = 0&#41; THEN//      BEGIN//          CreateOut&#40;outputCH, 208, 0, 0&#41;;   //reset aftertouch//          CreateOut&#40;outputCH, 224, 0, 64&#41;;  //reset pitchbend//          CreateOut&#40;outputCH, 176, 1, 0&#41;;   //reset mod wheel  //          setValue&#40;disable, 1&#41;;//          setValue&#40;out1on, 0&#41;;//          setValue&#40;out2on, 0&#41;; //      END//      ELSE BEGIN//          setValue&#40;disable, 0&#41;;//      END//   ELSE        setValue&#40;disable, 0&#41;;  END;  // disable vstPROCEDURE processExpression1;BEGIN    exp1val &#58;= &#40;midi.data2&#41;/128;    setValue&#40;exp, exp1val&#41;;     END;PROCEDURE processExpression2;BEGIN    exp2val &#58;= &#40;midi.data2&#41;/128;    setValue&#40;exp, exp2Val&#41;;     END;PROCEDURE processControllers;BEGIN    SetMidiArrayValue&#40;output, bytecount, midi&#41;;     END;        // mainBEGIN      // set variables from inputs   transpose &#58;= trunc&#40;GetValue&#40;semi&#41; + &#40;&#40;getValue&#40;octave&#41; * 12&#41;&#41;&#41;;   splitVal  &#58;= trunc&#40;getValue&#40;split&#41;&#41;;   upperVal  &#58;= trunc&#40;getValue&#40;upper&#41;&#41;;   key1Val   &#58;= trunc&#40;getValue&#40;key1&#41;&#41;;   key2Val   &#58;= trunc&#40;getValue&#40;key2&#41;&#41;;   outputCh  &#58;= trunc&#40;getValue&#40;outCH&#41;&#41;;   // disable the VST if nothing is controlling it   disableVST;   setValue&#40;out1on, key1val&#41;;   setValue&#40;out2on, key2val&#41;;           midiLen &#58;= GetLength&#40;input&#41;;   IF &#40;midiLen > 0&#41;  THEN   BEGIN        SetLength&#40;output, midiLen&#41;;               // process midi                FOR bytecount &#58;= 0 TO &#40;midiLen - 1&#41; DO         BEGIN            GetMidiArrayValue&#40;input, bytecount, midi&#41;;            channel &#58;= midi.channel;            IF &#40;&#40;midi.msg = 144&#41; AND &#40;midi.data2 > 0&#41;&#41;             THEN BEGIN           // Noteon                processNoteons;                   END            ELSE IF &#40;&#40;midi.msg = 128&#41;                OR  &#40;&#40;midi.msg = 144&#41; AND &#40;midi.data2 = 0&#41;&#41;&#41; THEN            BEGIN      // NoteOff                processNoteoffs;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.data1 = 64&#41; THEN            BEGIN                processSustain;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.channel = exp1ch&#41; AND &#40;midi.data1 = exp1cc&#41; THEN            BEGIN                processExpression1;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.channel = exp2ch&#41; AND &#40;midi.data1 = exp2cc&#41; THEN            BEGIN                processExpression2;            END             ELSE IF &#40;midi.msg = 176&#41; THEN            BEGIN                processControllers;            END;                                END;          END            // no midi in this block....    ELSE BEGIN        SetLength&#40;output, 0&#41;;    END;END.
thanks as ever for any help!!

-e

Statistics: Posted by woodslanding — 04 Nov 2008, 02:59


]]>
BrainModular BrainModular Users Forum 2008-11-04T10:15:26+02:00 https://brainmodular.fr/forums/app.php/feed/topic/1124 2008-11-04T10:15:26+02:00 2008-11-04T10:15:26+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6083#p6083 <![CDATA[my script is sending undesired noteoffs]]>
Hi, I have had a quick look, and haven't found anything particular about the expression error as such, but you have made an error with the length of the output array. As long as you're not sending out the same number of messages as you get in, you can't use the length of the input array but have to create a counter to increment with 1 for each new message you add to the output, and then set the length of the MIDI array at the end with that variable.

Another small thing: Shouldn't the processExpression use midi.data2/127 instead of 128? With 128 you'll never get the max value 1.
Should it be 127?? Okay! I didn't realize that.

I see what you mean about the output array (sort of--it's all a bit unclear how it actually works) so I will keep an independent counter.

I'm sending out expression as a data out, not a midi out.....

I'll see if this helps...

Statistics: Posted by woodslanding — 04 Nov 2008, 09:15


]]>
2008-11-04T09:28:35+02:00 2008-11-04T09:28:35+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6078#p6078 <![CDATA[my script is sending undesired noteoffs]]> about the note offs I dont know. make sure the noteOffs are not already in the input (maybe uncheck NoteOff = noteOn AND velocity=0)

Statistics: Posted by amiga909 — 04 Nov 2008, 08:28


]]>
2008-11-04T09:20:12+02:00 2008-11-04T09:20:12+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6077#p6077 <![CDATA[my script is sending undesired noteoffs]]>
Another small thing: Shouldn't the processExpression use midi.data2/127 instead of 128? With 128 you'll never get the max value 1.

Statistics: Posted by bsork — 04 Nov 2008, 08:20


]]>
2008-11-04T03:59:25+02:00 2008-11-04T03:59:25+02:00 https://brainmodular.fr/forums/viewtopic.php?t=1124&p=6076#p6076 <![CDATA[my script is sending undesired noteoffs]]>

CODE:

TYPE tTransp = ARRAY OF integer;VAR transpositions &#58; ARRAY OF tTransp;// parameters declarationvar input    &#58; Tparameter;   // midi inputvar output   &#58; Tparameter;   // midi outputvar key1     &#58; Tparameter;   // output notes from keyboard 1var key2     &#58; Tparameter;   // output notes from keyboard 2var exp      &#58; Tparameter;   // send out a volume control signalvar out1on   &#58; Tparameter;   // enable output 1var out2on   &#58; Tparameter;   // enable output 2var disable  &#58; Tparameter;   // boolean control out for disabling VST if no keyboard is controlling itvar semi     &#58; TParameter;   // transpose by semi-tonevar octave   &#58; TParameter;   // transpose by octavevar split    &#58; Tparameter;   // pitch below or above which notes are not sentvar upper    &#58; Tparameter;   // send pitches above the split if on.  otherwise send pitches below.var outCH    &#58; Tparameter;   // rechannelize input.  Value of 0 leaves input channel unchangedvar exp1ch        &#58; integer;var exp1cc        &#58; integer;var exp2ch        &#58; integer;var exp2cc        &#58; integer;var exp1val      &#58; single;var exp2val      &#58; single;var outputCH     &#58; integer;var bytecount    &#58; integer;var midiLen      &#58; integer;var midi         &#58; TMidi;var transpose    &#58; integer;var splitVal     &#58; integer;var upperVal     &#58; integer;var key1Val      &#58; integer;var key2Val      &#58; integer;var key1ch       &#58; integer;var key2ch       &#58; integer;var i            &#58; integer;var channel      &#58; integer;var noteCount    &#58; integer;var disabled     &#58; boolean;// initialisation PROCEDURE init;BEGIN       output &#58;= CreateParam&#40;'MIDIout',ptMidi&#41;;           SetIsInput&#40;Output,false&#41;;     key1 &#58;= CreateParam&#40;'key1', ptSwitch&#41;;             SetIsOutput&#40;key1,false&#41;;    key2 &#58;= CreateParam&#40;'key2', ptSwitch&#41;;             SetIsOutput&#40;key2,false&#41;;    split &#58;= CreateParam&#40;'split',ptMidiNoteFader&#41;;     SetIsOutput&#40;split,false&#41;;    upper &#58;= CreateParam&#40;'upper',ptSwitch&#41;;            SetIsOutput&#40;upper,false&#41;;        exp &#58;= CreateParam&#40;'expression',ptDataField&#41;;       SetIsInput&#40;exp,false&#41;;    out1on &#58;= CreateParam&#40;'out1 enable',ptDataField&#41;;       SetIsInput&#40;out1on,false&#41;;    out2on &#58;= CreateParam&#40;'out2 enable',ptDataField&#41;;       SetIsInput&#40;out2on,false&#41;;        disable &#58;= CreateParam&#40;'vstBypass',ptDataField&#41;;   SetIsInput&#40;disable,false&#41;;    input &#58;= CreateParam&#40;'MIDIin',ptMidi&#41;;             SetIsOutput&#40;Input,false&#41;;    semi &#58;= CreateParam&#40;'semi',ptDataField&#41;;           SetIsOutput&#40;semi,false&#41;;    octave &#58;= CreateParam&#40;'8va',ptDataField&#41;;          SetIsOutput&#40;octave,false&#41;;      outCH &#58;= CreateParam&#40;'outCH', ptDataField&#41;;        SetIsOutput&#40;outCH,false&#41;; key1ch &#58;= 1;    key2ch &#58;= 2; exp1ch &#58;= 1; exp1cc &#58;= 4; exp2ch &#58;= 2; exp2cc &#58;= 3;  noteCount &#58;= 0;  SetArrayLength&#40;transpositions, 2&#41;; FOR i &#58;= 0 TO 1 DO // we are going to ignore midi data on any but the 2 keyboard channels...    SetArrayLength&#40;transpositions&#91;i&#93;, 128&#41;;  //default values and formats SetDefaultValue&#40;upper,1&#41;; SetDefaultValue&#40;key1,1&#41;; SetDefaultValue&#40;key2,1&#41;; SetFormat&#40;split,'%.0f'&#41;; SetMin&#40;split,1&#41;; SetMax&#40;split,127&#41;; SetDefaultValue&#40;split,1&#41;; SetFormat&#40;semi,'%.0f'&#41;; SetMin&#40;semi,-7&#41;; SetMax&#40;semi,7&#41;; SetDefaultValue&#40;semi,0&#41;; SetFormat&#40;octave,'%.0f'&#41;; SetMin&#40;octave,-4&#41;; SetMax&#40;octave,4&#41;; SetDefaultValue&#40;octave,0&#41;; SetDefaultValue&#40;outCH,1&#41;;end;PROCEDURE CreateOut&#40;ch, msg, data1, data2 &#58; integer&#41;;BEGIN   midi.msg &#58;= byte&#40;msg&#41;;   midi.data1 &#58;= byte&#40;data1&#41;;   midi.data2 &#58;= byte&#40;data2&#41;;   midi.channel &#58;= byte&#40;ch&#41;;   SetMidiArrayValue&#40;output, bytecount, midi&#41;;   END; // CreateOutPROCEDURE processNoteOns;BEGIN    //writeln&#40;'in noteon loop'&#41;;    IF &#40;&#40;&#40;channel = key1ch&#41; AND &#40;key1Val = 1&#41;&#41; OR &#40;&#40;channel = key2ch&#41; AND &#40;key2Val = 1&#41;&#41;&#41;        AND &#40;&#40;&#40;midi.data1 >= splitVal&#41; AND &#40;upperVal = 1&#41;&#41; OR &#40;&#40;midi.data1 < splitVal&#41; AND &#40;upperVal = 0&#41;&#41;&#41;    THEN BEGIN                transpositions&#91;channel - 1&#93;&#91;midi.data1&#93; &#58;= transpose;              // only works if keyboard ch's are 1 and 2....        midi.data1 &#58;= midi.data1 + transpose;        midi.channel &#58;= outputCH;        SetMidiArrayValue&#40;output, bytecount, midi&#41;;        //noteCount &#58;= noteCount + 1;  // increase count of held notes            END;          END;   //process NoteonsPROCEDURE processNoteOffs;BEGIN    midi.data1 &#58;= midi.data1 + transpositions&#91;channel - 1&#93;&#91;midi.data1&#93;; // Retrieve stored transpose and add to NoteOff    midi.channel &#58;= outputCH;     SetMidiArrayValue&#40;output, bytecount, midi&#41;;    //noteCount &#58;= noteCount - 1;      // decrease count of held notes    writeln&#40;'in notes off = ' + intToStr&#40;noteCount&#41;&#41;;END;  //processNoteoffsPROCEDURE processSustain;BEGIN    IF &#40;midi.data2 < 64&#41; THEN   //send sus up on all instruments, selected or not...        BEGIN            midi.channel &#58;= outputCH;            SetMidiArrayValue&#40;output, bytecount, midi&#41;;        END    ELSE IF &#40;&#40;&#40;channel = 1&#41; AND &#40;key1Val = 1&#41;&#41; OR &#40;&#40;channel = 2&#41; AND &#40;key2Val = 1&#41;&#41;&#41; THEN    BEGIN        IF &#40;midi.data2 >= 64&#41;  THEN  //send sus down only on selected instruments        BEGIN             midi.channel &#58;= outputCH;               SetMidiArrayValue&#40;output, bytecount, midi&#41;;        END;    END;END;   // process sustainPROCEDURE disableVST;  // not used yetBEGIN   disabled &#58;= &#40; &#40;key1val = 0&#41; AND &#40;key2val = 0&#41;&#41;;//   IF &#40;disabled&#41; THEN      // wait until all notes are off before doing this--how??      // and don't undo it when notes are back on!//      IF &#40;noteCount = 0&#41; THEN//      BEGIN//          CreateOut&#40;outputCH, 208, 0, 0&#41;;   //reset aftertouch//          CreateOut&#40;outputCH, 224, 0, 64&#41;;  //reset pitchbend//          CreateOut&#40;outputCH, 176, 1, 0&#41;;   //reset mod wheel  //          setValue&#40;disable, 1&#41;;//          setValue&#40;out1on, 0&#41;;//          setValue&#40;out2on, 0&#41;; //      END//      ELSE BEGIN//          setValue&#40;disable, 0&#41;;//      END//   ELSE        setValue&#40;disable, 0&#41;;  END;  // disable vstPROCEDURE processExpression1;BEGIN    exp1val &#58;= &#40;midi.data2&#41;/128;    setValue&#40;exp, exp1val&#41;;     END;PROCEDURE processExpression2;BEGIN    exp2val &#58;= &#40;midi.data2&#41;/128;    setValue&#40;exp, exp2Val&#41;;     END;PROCEDURE processControllers;BEGIN    SetMidiArrayValue&#40;output, bytecount, midi&#41;;     END;        // mainBEGIN      // set variables from inputs   transpose &#58;= trunc&#40;GetValue&#40;semi&#41; + &#40;&#40;getValue&#40;octave&#41; * 12&#41;&#41;&#41;;   splitVal  &#58;= trunc&#40;getValue&#40;split&#41;&#41;;   upperVal  &#58;= trunc&#40;getValue&#40;upper&#41;&#41;;   key1Val   &#58;= trunc&#40;getValue&#40;key1&#41;&#41;;   key2Val   &#58;= trunc&#40;getValue&#40;key2&#41;&#41;;   outputCh  &#58;= trunc&#40;getValue&#40;outCH&#41;&#41;;   // disable the VST if nothing is controlling it   disableVST;   setValue&#40;out1on, key1val&#41;;   setValue&#40;out2on, key2val&#41;;           midiLen &#58;= GetLength&#40;input&#41;;   IF &#40;midiLen > 0&#41;  THEN   BEGIN        SetLength&#40;output, midiLen&#41;;               // process midi                FOR bytecount &#58;= 0 TO &#40;midiLen - 1&#41; DO         BEGIN            GetMidiArrayValue&#40;input, bytecount, midi&#41;;            channel &#58;= midi.channel;            IF &#40;&#40;midi.msg = 144&#41; AND &#40;midi.data2 > 0&#41;&#41;             THEN BEGIN           // Noteon                processNoteons;                   END            ELSE IF &#40;&#40;midi.msg = 128&#41;                OR  &#40;&#40;midi.msg = 144&#41; AND &#40;midi.data2 = 0&#41;&#41;&#41; THEN            BEGIN      // NoteOff                processNoteoffs;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.data1 = 64&#41; THEN            BEGIN                processSustain;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.channel = exp1ch&#41; AND &#40;midi.data1 = exp1cc&#41; THEN            BEGIN                processExpression1;            END            ELSE IF &#40;midi.msg = 176&#41; AND &#40;midi.channel = exp2ch&#41; AND &#40;midi.data1 = exp2cc&#41; THEN            BEGIN                processExpression2;            END             ELSE IF &#40;midi.msg = 176&#41; THEN            BEGIN                processControllers;            END;                                END;          END            // no midi in this block....    ELSE BEGIN        SetLength&#40;output, 0&#41;;    END;END.
thanks as ever for any help!!

-e

Statistics: Posted by woodslanding — 04 Nov 2008, 02:59


]]>