ArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2018-09-27T13:02:32+02:00 https://brainmodular.com/forums/app.php/feed/topic/2151 2018-09-27T13:02:32+02:00 2018-09-27T13:02:32+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40194#p40194 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
With some filtering and merging I solve the key range split.

I created a new thread were I will share my advances.

Statistics: Posted by Ander — 27 Sep 2018, 13:02


]]>
2018-09-27T08:41:51+02:00 2018-09-27T08:41:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40191#p40191 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> Statistics: Posted by nay-seven — 27 Sep 2018, 08:41


]]>
2018-09-25T11:29:43+02:00 2018-09-25T11:29:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40185#p40185 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> Statistics: Posted by x.iso — 25 Sep 2018, 11:29


]]>
2018-09-25T02:11:04+02:00 2018-09-25T02:11:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40184#p40184 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I rearranged procedures order to avoid compiler errors but finally an assignation error crashes the compiler.

I looked on addons but the Midi Channel Strip is not included.

I studied Pascal language about 15 years ago, but I don't remember enough to modify or rewrite the script now.

Anyone have a fast way to filter midi IN and route only a range of notes to a VSTi?

Statistics: Posted by Ander — 25 Sep 2018, 02:11


]]>
2010-04-19T01:50:06+02:00 2010-04-19T01:50:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13488#p13488 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
-e

Statistics: Posted by woodslanding — 19 Apr 2010, 01:50


]]>
2010-04-19T00:16:22+02:00 2010-04-19T00:16:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13485#p13485 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>

CODE:

&#40;*/////////////////////////////////////////////////////// CHANNEL  // Version 2010-03-28; author&#58; eric moon//// based on work by Bsork and amiga909//////////////////////////////////////////////////////*&#41;//  MIDI Channel Strip&#58;//  it is designed to function as part of a mixer channel strip, running between several keyboards and a vsti.//   takes a number of midi inputs &#40;on separate cables, for visual clarity&#41;//  and performs the following operations on each.//  enable, disable--per input//  strip CCs and send them out a separate output//  limit to minimum and maximum notes--one range affects all inputs//  transpose--again, one range for all inputs.//  output rechannelizing--all outs are a single channel.  Use multiple strips to control multi-timbral modules.//  bypass output for turning off unused instruments.  waits for all notes to be released....//  Drone switch that keeps current notes sounding, but discards all note input as long as it is held//  Midi learn for note range&#58;//  When learn is turned on, midi note output is suspended//   the first noteNumber sets the low end of the range, the second noteNumber sets the upper limit.//   once both notes are sent, notes go to main output  as usual.//   support for inverse range, if low note is above high noteCONST INPUT_COUNT = 2;  // could handle any number, I think!CONST NOTEON        = Byte&#40;144&#41;;CONST NOTEOFF       = Byte&#40;128&#41;;CONST CONTROL       = Byte&#40;176&#41;;CONST PITCHBEND     = Byte&#40;224&#41;;CONST AFTERTOUCH    = Byte&#40;208&#41;;VAR   heldNotes                    &#58; ARRAY OF boolean;VAR   transList                    &#58; ARRAY OF integer; VAR   isEnabled                    &#58; Array of boolean;VAR   pMidiINS,pEnableINS          &#58; ARRAY OF TParameter;VAR   midiInCounts                 &#58; ARRAY OF integer;VAR   pTransposeIN, pDroneIN,pOutChanIN, pLearnIN, pLowNoteIn, pHiNoteIn        &#58; TParameter;       VAR   pPassOut,pRejectOut,pBypassOut, pLowNoteOut, pHiNoteOut                   &#58; Tparameter;       VAR   transpose, hiVal, lowVal                                                  &#58; integer; VAR   passCount, rejectCount, learnCount, minKey, maxKey, outChan               &#58; integer;VAR   isLearning, isDroning, doRelease, bypassReady               &#58; boolean;///////////////////////////      INITIALIZE        /////////////////////////////////////PROCEDURE init; VAR i &#58; integer;   BEGIN      transpose &#58;= 0; hiVal&#58;= 120; lowVal &#58;= 12;    passCount &#58;= 0; rejectCount &#58;= 0; learnCount &#58;= 0; minKey &#58;= 128; maxKey &#58;= 0; outChan &#58;= 1;    isLearning &#58;= FALSE; isDroning &#58;= FALSE; doRelease &#58;= FALSE; bypassReady &#58;= FALSE;        setArrayLength&#40;pMidiINS, INPUT_COUNT&#41;;    setArrayLength&#40;pEnableINS, INPUT_COUNT&#41;;    setArrayLength&#40;isEnabled, INPUT_COUNT&#41;;    setArrayLength&#40;midiInCounts, INPUT_COUNT&#41;;   FOR i&#58;=0 TO INPUT_COUNT   DO midiInCounts&#91;i&#93;&#58;=0;    setArrayLength&#40;heldNotes, 128&#41;;               FOR i&#58;=0 TO 127           DO heldNotes&#91;i&#93;&#58;=FALSE;    SetArrayLength&#40;transList, 128&#41;;              FOR i&#58;=0 TO 127           DO transList&#91;i&#93;&#58;=0;        FOR i &#58;= 0 TO INPUT_COUNT - 1 DO  BEGIN        pEnableINS&#91;i&#93;  &#58;= CreateParam&#40;'enable ' + intToStr&#40;i + 1&#41;,ptSwitch&#41;;                SetIsOutPut&#40;pEnableINS&#91;i&#93;,false&#41;;            END;        pBypassOut       &#58;= CreateParam&#40;'inst bypass', ptSwitch&#41;;       SetIsInput&#40;pBypassOut,false&#41;;        pTransposeIN     &#58;= CreateParam&#40;'Transpose',ptDataFader&#41;;       SetIsOutPut&#40;pTransposeIN,false&#41;;    pOutChanIN       &#58;= CreateParam&#40;'out ch',ptMidiNoteFader&#41;;      SetIsOutPut&#40;pOutChanIN,false&#41;;    pLearnIN         &#58;= CreateParam&#40;'learn',ptButton&#41;;              SetIsOutPut&#40;pLearnIN,false&#41;;    pHiNoteIN        &#58;= CreateParam&#40;'high note',ptMidiNoteFader&#41;;   SetIsOutPut&#40;pHiNoteIN,false&#41;;    pHiNoteOUT        &#58;= CreateParam&#40;'hi note', ptDataField&#41;;         SetIsInPut&#40;pHiNoteOut,false&#41;;     pLowNoteIN       &#58;= CreateParam&#40;'low note',ptMidiNoteFader&#41;;    SetIsOutPut&#40;pLowNoteIN,false&#41;;    pLowNoteOUT       &#58;= CreateParam&#40;'low note',ptDataField&#41;;         SetIsInPut&#40;pLowNoteOut,false&#41;;    pDroneIN         &#58;= CreateParam&#40;'drone', ptSwitch&#41;;             SetIsOutput&#40;pDroneIN,false&#41;;           SetFormat&#40;pTransposeIN,'%.0f'&#41;;    SetMin&#40;pTransposeIN,-48&#41;;  SetMax&#40;pTransposeIN,48&#41;;    SetFormat&#40;pOutChanIN,'%.0f'&#41;;   SetMin&#40;pOutChanIN,1&#41;;  SetMax&#40;pOutChanIN,16&#41;;           FOR i &#58;= 0 TO INPUT_COUNT - 1 DO  BEGIN        pMidiINS&#91;i&#93;  &#58;= CreateParam&#40;'MIDIin ' + intToStr&#40;i + 1&#41; ,ptMidi&#41;;               SetIsOutPut&#40;pMidiINS&#91;i&#93;,false&#41;;    END;        pPassOut          &#58;= CreateParam&#40;'passed MIDI',ptMidi&#41;;           SetIsInput&#40;pPassOut,false&#41;;      pRejectOut        &#58;= CreateParam&#40;'rejected MIDI',ptMidi&#41;;         SetIsInput&#40;pRejectOut,false&#41;;END;   ///////////////////////////  MIDI OUTPUT METHODS   ////////////////////////////////////PROCEDURE PassOut&#40;midi &#58; tMidi&#41;;BEGIN   midi.channel &#58;= BYTE&#40;outChan&#41;;   SetMidiArrayValue&#40;pPassOut, passCount, midi&#41;;   passCount &#58;= passCount + 1;END;PROCEDURE RejectOut&#40;midi &#58; tMidi&#41;;BEGIN   midi.channel &#58;= BYTE&#40;outChan&#41;;   SetMidiArrayValue&#40;pRejectOut, rejectCount, midi&#41;;   rejectCount &#58;= rejectCount + 1;END;/////////////////////////   MIDI MESSAGE TESTS  ///////////////////////////////////////FUNCTION IsNote &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNote &#58;= &#40;&#40;midi.msg = NOTEON&#41; OR &#40;midi.msg = NOTEOFF&#41;&#41;;END;FUNCTION IsNoteOn &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNoteOn &#58;= &#40;&#40;midi.msg = NOTEON&#41; AND &#40;midi.data2 > 0&#41;&#41;;END;FUNCTION IsNoteOff &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNoteOff &#58;= &#40;midi.msg = NOTEOFF&#41; OR &#40;&#40;midi.msg = NOTEON&#41; AND &#40;midi.data2 = 0&#41;&#41;;END;//////////////////////////      OTHER TESTS     ////////////////////////////////////////FUNCTION UpdateBypass&#40;&#41;  &#58;  INTEGER;VAR i  &#58; integer;BEGIN     bypassReady &#58;= TRUE;      FOR i &#58;= 0 to &#40;INPUT_COUNT - 1&#41; DO BEGIN        if isEnabled&#91;i&#93; THEN BEGIN            bypassReady &#58;= FALSE;            setValue&#40;pBypassOut, 0&#41;;        END;    END;    IF bypassReady AND isClear&#40;&#41; THEN setValue&#40;pBypassOUT, 1&#41;;       END; FUNCTION isInRange&#40;noteNumber &#58; integer &#41; &#58; Boolean;VAR inRange &#58; Boolean;VAR reversed &#58; Boolean;BEGIN    reversed &#58;= &#40;lowVal >= hiVal&#41;;    IF reversed THEN isInRange &#58;= &#40;noteNumber < hiVal&#41;  OR  &#40;noteNumber > lowVal&#41;                ELSE isInRange &#58;= &#40;noteNumber <= hiVal&#41; AND &#40;noteNumber >= lowVal&#41;; END;////////////////////////       SETTERS       ////////////////////////////////////////////PROCEDURE SetLowVal&#40;n &#58; integer&#41;;BEGIN    setValue&#40;pLowNoteOut, n&#41;;    lowVal &#58;= n;END;PROCEDURE SetHiVal&#40;n &#58; integer&#41;;BEGIN    setValue&#40;pHiNoteOut, n&#41;;    hiVal &#58;= n;END;////////////////////////     PROCESS MIDI    ////////////////////////////////////////////FUNCTION bstr&#40;b &#58; boolean&#41; &#58; string;BEGIN if b THEN bstr &#58;= 'TRUE' else bstr &#58;= 'FALSE'; END;PROCEDURE ProcessMidi&#40;midi &#58; tMidi; enabled &#58; boolean&#41;;BEGIN    IF isLearning THEN processLearn&#40;midi&#41;     ELSE IF not&#40;isDroning&#41; THEN BEGIN                  // pass PB and AT with notes        IF &#40;midi.msg = PITCHBEND&#41; OR &#40;midi.msg = AFTERTOUCH&#41; THEN passOut&#40;midi&#41;        ELSE IF NOT&#40;IsNote&#40;midi&#41;&#41; THEN rejectOut&#40;midi&#41;        // everything else deals with note data....        ELSE IF IsInRange&#40;midi.data1&#41;and enabled THEN BEGIN            IF isNoteOn&#40;midi&#41; THEN BEGIN                ProcessNoteOn&#40;midi, enabled&#41;;            END ELSE BEGIN                       ProcessNoteOff&#40;midi&#41;            END;        END ELSE rejectOut&#40;midi&#41;; //notes that are out of range        IF doRelease THEN sendNoteOffs&#40;false&#41;;    END;  END;PROCEDURE ProcessLearn&#40;midi &#58; tMidi&#41;;BEGIN    IF &#40;isNoteOn&#40;midi&#41;&#41; and &#40;learnCount = 0&#41; THEN BEGIN        lowVal &#58;= midi.data1;        setValue&#40;pLowNoteOUT, lowVal&#41;;        learnCount &#58;= 1;                       END     ELSE IF &#40;isNoteOn&#40;midi&#41;&#41; and &#40;learnCount = 1&#41;  THEN BEGIN        hiVal &#58;= midi.data1;        setValue&#40;pHiNoteOUT, hiVal&#41;;        learnCount &#58;= 0;        isLearning &#58;= FALSE;  // we've set our outs....    END;END;PROCEDURE ProcessNoteOn&#40;midi &#58; tMidi; enabled &#58; boolean&#41;;BEGIN    IF enabled THEN BEGIN        transList&#91;midi.data1&#93; &#58;= transpose;         midi.data1 &#58;= midi.data1 + transpose;        PassOut&#40;midi&#41;;        heldNotes&#91;midi.data1&#93; &#58;= TRUE;        IF &#40;midi.data1 > maxKey&#41; THEN maxKey &#58;= midi.data1;        IF &#40;midi.data1 < minKey&#41; THEN minKey &#58;= midi.data1;    END;END;PROCEDURE ProcessNoteOff&#40;midi &#58; Tmidi&#41;;BEGIN    midi.data1 &#58;= midi.data1 + transList&#91;midi.data1&#93;;    heldNotes&#91;midi.data1&#93; &#58;= FALSE;    PassOut&#40;midi&#41;;    IF bypassReady AND isClear&#40;&#41; THEN  BEGIN        setValue&#40;pBypassOut, 1&#41;;        isDroning &#58;= FALSE;        bypassReady &#58;= FALSE;    END;END;PROCEDURE ProcessDrone&#40;n &#58; integer&#41;;BEGIN    IF n = 0 THEN SendNoteOffs&#40;TRUE&#41;;    isDroning &#58;= n > 0;   END;FUNCTION isClear&#40;&#41; &#58; boolean;VAR key &#58; integer; VAR clear &#58; boolean;BEGIN    clear &#58;= TRUE;    FOR key&#58;= minKey TO maxKey DO IF heldNotes&#91;key&#93; = TRUE THEN clear &#58;= FALSE;    isClear &#58;= clear;END;PROCEDURE SendNoteOffs&#40;closeAll &#58; boolean&#41;;VAR key &#58; integer;VAR midi &#58; tMidi;BEGIN    FOR key&#58;= minKey TO maxKey DO BEGIN            IF &#40;heldNotes&#91;key&#93; = FALSE&#41; OR closeAll THEN BEGIN             midi.msg &#58;= NOTEOFF;            midi.channel &#58;= Byte&#40;outChan&#41;;            midi.data1 &#58;= key;            midi.data2 &#58;= 0;            passOut&#40;midi&#41;;            heldNotes&#91;key&#93; &#58;= FALSE;        END;                                                              END;     doRelease &#58;= FALSE;END;////////////////////////       CALLBACK      /////////////////////////////////////////////PROCEDURE Callback&#40;n&#58; integer&#41;;VAR i &#58; integer;BEGIN    FOR i &#58;= 0 to INPUT_COUNT - 1 DO BEGIN        CASE n OF             pEnableINS&#91;i&#93; &#58;  BEGIN                                 isEnabled&#91;i&#93; &#58;= getValue&#40;n&#41; > 0;                                 UpdateBypass&#40;&#41;;                             END;               pMidiINS&#91;i&#93;   &#58;  midiInCounts&#91;i&#93; &#58;= GetLength&#40;n&#41;;        END;    END;        CASE n OF        pLearnIN      &#58;     isLearning     &#58;= TRUE;                pOutChanIN    &#58;     outChan        &#58;= Byte&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;        pTransposeIN  &#58;     transpose      &#58;= &#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;         pHiNoteIN     &#58;     setHiVal&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;        pLowNoteIN    &#58;     setLowVal&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;                pDroneIN      &#58;     ProcessDrone&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;                END;END;/////////////////////////      PROCESS        //////////////////////////////////////////PROCEDURE Process;VAR i, inputNum &#58; Integer;VAR currMsg     &#58; tMidi;BEGIN    FOR inputNum &#58;= 0 TO &#40;INPUT_COUNT - 1&#41; DO BEGIN            FOR i &#58;= 0 TO &#40;midiInCounts&#91;inputNum&#93; - 1&#41; DO BEGIN                GetMidiArrayValue&#40;pMidiINS&#91;inputNum&#93;, i, currMsg&#41;;                ProcessMidi&#40;currMsg, isEnabled&#91;inputNum&#93;&#41;;            END;    END;    SetLength&#40;pPassOut, passCount&#41;;    SetLength&#40;pRejectOut, rejectCount&#41;;    passCount   &#58;= 0;    rejectCount &#58;= 0;END;

Statistics: Posted by woodslanding — 19 Apr 2010, 00:16


]]>
2010-04-18T07:06:48+02:00 2010-04-18T07:06:48+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13479#p13479 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I'm well on my way to creating my perfect live template.

Statistics: Posted by Ben J — 18 Apr 2010, 07:06


]]>
2010-04-17T11:10:27+02:00 2010-04-17T11:10:27+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13475#p13475 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> There are many ways to accomplish what you are looking to do but I would have to say this is the absolute simplest example.
The preset manager will store and recall the states of the VST's, so you do not necessarily even need a way to change VST patches, and the preset manager will also store and recall rge bypass buttons for each VST.
All you have to do here is select which VST you want active, edit or load the VST patch as desired and then store a preset.
When you recall the preset manager preset via the combobox, you are ready to play!

Image

Statistics: Posted by gurulogic — 17 Apr 2010, 11:10


]]>
2010-04-17T10:58:45+02:00 2010-04-17T10:58:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13474#p13474 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> the low part let you dispatch the midi flow to different midi bus
the hight part, in the same time, active or not your different patches ( each vsti can be in different tracks or on the same ( mode all )
the right part show you the patch for each vsti
Image

Statistics: Posted by nay-seven — 17 Apr 2010, 10:58


]]>
2010-04-17T09:36:19+02:00 2010-04-17T09:36:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13473#p13473 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I play keyboards in a band (so I have no need for real-time recording or sampling stuff), I just need to be able to switch between VST instruments and occasionally select various presets within those VSTi. Basically, I want the functionality of pressing a single interface button to call up the [pre-loaded] VST.

Originally I built a workspace to where each VST was on a separate MIDI channel, and I simply changed patches by changing MIDI channels. However, this limited me to only 16 patches.

Most recently, I tried using emoon's MondoCombo, which works great for selecting presets within a single VST, but I can't figure out how to integrate it with several different VSTi.

I suppose another approach would be to solo/mute all other VST, although my understanding is that might have higher CPU usage...

Can any of you programming geniuses help me? Thanks for all your help thus far! :)

Statistics: Posted by Ben J — 17 Apr 2010, 09:36


]]>
BrainModular BrainModular Users Forum 2018-09-27T13:02:32+02:00 https://brainmodular.com/forums/app.php/feed/topic/2151 2018-09-27T13:02:32+02:00 2018-09-27T13:02:32+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40194#p40194 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
With some filtering and merging I solve the key range split.

I created a new thread were I will share my advances.

Statistics: Posted by Ander — 27 Sep 2018, 13:02


]]>
2018-09-27T08:41:51+02:00 2018-09-27T08:41:51+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40191#p40191 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> Statistics: Posted by nay-seven — 27 Sep 2018, 08:41


]]>
2018-09-25T11:29:43+02:00 2018-09-25T11:29:43+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40185#p40185 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> Statistics: Posted by x.iso — 25 Sep 2018, 11:29


]]>
2018-09-25T02:11:04+02:00 2018-09-25T02:11:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=40184#p40184 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I rearranged procedures order to avoid compiler errors but finally an assignation error crashes the compiler.

I looked on addons but the Midi Channel Strip is not included.

I studied Pascal language about 15 years ago, but I don't remember enough to modify or rewrite the script now.

Anyone have a fast way to filter midi IN and route only a range of notes to a VSTi?

Statistics: Posted by Ander — 25 Sep 2018, 02:11


]]>
2010-04-19T01:50:06+02:00 2010-04-19T01:50:06+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13488#p13488 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
-e

Statistics: Posted by woodslanding — 19 Apr 2010, 01:50


]]>
2010-04-19T00:16:22+02:00 2010-04-19T00:16:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13485#p13485 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>

CODE:

&#40;*/////////////////////////////////////////////////////// CHANNEL  // Version 2010-03-28; author&#58; eric moon//// based on work by Bsork and amiga909//////////////////////////////////////////////////////*&#41;//  MIDI Channel Strip&#58;//  it is designed to function as part of a mixer channel strip, running between several keyboards and a vsti.//   takes a number of midi inputs &#40;on separate cables, for visual clarity&#41;//  and performs the following operations on each.//  enable, disable--per input//  strip CCs and send them out a separate output//  limit to minimum and maximum notes--one range affects all inputs//  transpose--again, one range for all inputs.//  output rechannelizing--all outs are a single channel.  Use multiple strips to control multi-timbral modules.//  bypass output for turning off unused instruments.  waits for all notes to be released....//  Drone switch that keeps current notes sounding, but discards all note input as long as it is held//  Midi learn for note range&#58;//  When learn is turned on, midi note output is suspended//   the first noteNumber sets the low end of the range, the second noteNumber sets the upper limit.//   once both notes are sent, notes go to main output  as usual.//   support for inverse range, if low note is above high noteCONST INPUT_COUNT = 2;  // could handle any number, I think!CONST NOTEON        = Byte&#40;144&#41;;CONST NOTEOFF       = Byte&#40;128&#41;;CONST CONTROL       = Byte&#40;176&#41;;CONST PITCHBEND     = Byte&#40;224&#41;;CONST AFTERTOUCH    = Byte&#40;208&#41;;VAR   heldNotes                    &#58; ARRAY OF boolean;VAR   transList                    &#58; ARRAY OF integer; VAR   isEnabled                    &#58; Array of boolean;VAR   pMidiINS,pEnableINS          &#58; ARRAY OF TParameter;VAR   midiInCounts                 &#58; ARRAY OF integer;VAR   pTransposeIN, pDroneIN,pOutChanIN, pLearnIN, pLowNoteIn, pHiNoteIn        &#58; TParameter;       VAR   pPassOut,pRejectOut,pBypassOut, pLowNoteOut, pHiNoteOut                   &#58; Tparameter;       VAR   transpose, hiVal, lowVal                                                  &#58; integer; VAR   passCount, rejectCount, learnCount, minKey, maxKey, outChan               &#58; integer;VAR   isLearning, isDroning, doRelease, bypassReady               &#58; boolean;///////////////////////////      INITIALIZE        /////////////////////////////////////PROCEDURE init; VAR i &#58; integer;   BEGIN      transpose &#58;= 0; hiVal&#58;= 120; lowVal &#58;= 12;    passCount &#58;= 0; rejectCount &#58;= 0; learnCount &#58;= 0; minKey &#58;= 128; maxKey &#58;= 0; outChan &#58;= 1;    isLearning &#58;= FALSE; isDroning &#58;= FALSE; doRelease &#58;= FALSE; bypassReady &#58;= FALSE;        setArrayLength&#40;pMidiINS, INPUT_COUNT&#41;;    setArrayLength&#40;pEnableINS, INPUT_COUNT&#41;;    setArrayLength&#40;isEnabled, INPUT_COUNT&#41;;    setArrayLength&#40;midiInCounts, INPUT_COUNT&#41;;   FOR i&#58;=0 TO INPUT_COUNT   DO midiInCounts&#91;i&#93;&#58;=0;    setArrayLength&#40;heldNotes, 128&#41;;               FOR i&#58;=0 TO 127           DO heldNotes&#91;i&#93;&#58;=FALSE;    SetArrayLength&#40;transList, 128&#41;;              FOR i&#58;=0 TO 127           DO transList&#91;i&#93;&#58;=0;        FOR i &#58;= 0 TO INPUT_COUNT - 1 DO  BEGIN        pEnableINS&#91;i&#93;  &#58;= CreateParam&#40;'enable ' + intToStr&#40;i + 1&#41;,ptSwitch&#41;;                SetIsOutPut&#40;pEnableINS&#91;i&#93;,false&#41;;            END;        pBypassOut       &#58;= CreateParam&#40;'inst bypass', ptSwitch&#41;;       SetIsInput&#40;pBypassOut,false&#41;;        pTransposeIN     &#58;= CreateParam&#40;'Transpose',ptDataFader&#41;;       SetIsOutPut&#40;pTransposeIN,false&#41;;    pOutChanIN       &#58;= CreateParam&#40;'out ch',ptMidiNoteFader&#41;;      SetIsOutPut&#40;pOutChanIN,false&#41;;    pLearnIN         &#58;= CreateParam&#40;'learn',ptButton&#41;;              SetIsOutPut&#40;pLearnIN,false&#41;;    pHiNoteIN        &#58;= CreateParam&#40;'high note',ptMidiNoteFader&#41;;   SetIsOutPut&#40;pHiNoteIN,false&#41;;    pHiNoteOUT        &#58;= CreateParam&#40;'hi note', ptDataField&#41;;         SetIsInPut&#40;pHiNoteOut,false&#41;;     pLowNoteIN       &#58;= CreateParam&#40;'low note',ptMidiNoteFader&#41;;    SetIsOutPut&#40;pLowNoteIN,false&#41;;    pLowNoteOUT       &#58;= CreateParam&#40;'low note',ptDataField&#41;;         SetIsInPut&#40;pLowNoteOut,false&#41;;    pDroneIN         &#58;= CreateParam&#40;'drone', ptSwitch&#41;;             SetIsOutput&#40;pDroneIN,false&#41;;           SetFormat&#40;pTransposeIN,'%.0f'&#41;;    SetMin&#40;pTransposeIN,-48&#41;;  SetMax&#40;pTransposeIN,48&#41;;    SetFormat&#40;pOutChanIN,'%.0f'&#41;;   SetMin&#40;pOutChanIN,1&#41;;  SetMax&#40;pOutChanIN,16&#41;;           FOR i &#58;= 0 TO INPUT_COUNT - 1 DO  BEGIN        pMidiINS&#91;i&#93;  &#58;= CreateParam&#40;'MIDIin ' + intToStr&#40;i + 1&#41; ,ptMidi&#41;;               SetIsOutPut&#40;pMidiINS&#91;i&#93;,false&#41;;    END;        pPassOut          &#58;= CreateParam&#40;'passed MIDI',ptMidi&#41;;           SetIsInput&#40;pPassOut,false&#41;;      pRejectOut        &#58;= CreateParam&#40;'rejected MIDI',ptMidi&#41;;         SetIsInput&#40;pRejectOut,false&#41;;END;   ///////////////////////////  MIDI OUTPUT METHODS   ////////////////////////////////////PROCEDURE PassOut&#40;midi &#58; tMidi&#41;;BEGIN   midi.channel &#58;= BYTE&#40;outChan&#41;;   SetMidiArrayValue&#40;pPassOut, passCount, midi&#41;;   passCount &#58;= passCount + 1;END;PROCEDURE RejectOut&#40;midi &#58; tMidi&#41;;BEGIN   midi.channel &#58;= BYTE&#40;outChan&#41;;   SetMidiArrayValue&#40;pRejectOut, rejectCount, midi&#41;;   rejectCount &#58;= rejectCount + 1;END;/////////////////////////   MIDI MESSAGE TESTS  ///////////////////////////////////////FUNCTION IsNote &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNote &#58;= &#40;&#40;midi.msg = NOTEON&#41; OR &#40;midi.msg = NOTEOFF&#41;&#41;;END;FUNCTION IsNoteOn &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNoteOn &#58;= &#40;&#40;midi.msg = NOTEON&#41; AND &#40;midi.data2 > 0&#41;&#41;;END;FUNCTION IsNoteOff &#40;midi &#58; tMidi&#41; &#58; Boolean;BEGIN   IsNoteOff &#58;= &#40;midi.msg = NOTEOFF&#41; OR &#40;&#40;midi.msg = NOTEON&#41; AND &#40;midi.data2 = 0&#41;&#41;;END;//////////////////////////      OTHER TESTS     ////////////////////////////////////////FUNCTION UpdateBypass&#40;&#41;  &#58;  INTEGER;VAR i  &#58; integer;BEGIN     bypassReady &#58;= TRUE;      FOR i &#58;= 0 to &#40;INPUT_COUNT - 1&#41; DO BEGIN        if isEnabled&#91;i&#93; THEN BEGIN            bypassReady &#58;= FALSE;            setValue&#40;pBypassOut, 0&#41;;        END;    END;    IF bypassReady AND isClear&#40;&#41; THEN setValue&#40;pBypassOUT, 1&#41;;       END; FUNCTION isInRange&#40;noteNumber &#58; integer &#41; &#58; Boolean;VAR inRange &#58; Boolean;VAR reversed &#58; Boolean;BEGIN    reversed &#58;= &#40;lowVal >= hiVal&#41;;    IF reversed THEN isInRange &#58;= &#40;noteNumber < hiVal&#41;  OR  &#40;noteNumber > lowVal&#41;                ELSE isInRange &#58;= &#40;noteNumber <= hiVal&#41; AND &#40;noteNumber >= lowVal&#41;; END;////////////////////////       SETTERS       ////////////////////////////////////////////PROCEDURE SetLowVal&#40;n &#58; integer&#41;;BEGIN    setValue&#40;pLowNoteOut, n&#41;;    lowVal &#58;= n;END;PROCEDURE SetHiVal&#40;n &#58; integer&#41;;BEGIN    setValue&#40;pHiNoteOut, n&#41;;    hiVal &#58;= n;END;////////////////////////     PROCESS MIDI    ////////////////////////////////////////////FUNCTION bstr&#40;b &#58; boolean&#41; &#58; string;BEGIN if b THEN bstr &#58;= 'TRUE' else bstr &#58;= 'FALSE'; END;PROCEDURE ProcessMidi&#40;midi &#58; tMidi; enabled &#58; boolean&#41;;BEGIN    IF isLearning THEN processLearn&#40;midi&#41;     ELSE IF not&#40;isDroning&#41; THEN BEGIN                  // pass PB and AT with notes        IF &#40;midi.msg = PITCHBEND&#41; OR &#40;midi.msg = AFTERTOUCH&#41; THEN passOut&#40;midi&#41;        ELSE IF NOT&#40;IsNote&#40;midi&#41;&#41; THEN rejectOut&#40;midi&#41;        // everything else deals with note data....        ELSE IF IsInRange&#40;midi.data1&#41;and enabled THEN BEGIN            IF isNoteOn&#40;midi&#41; THEN BEGIN                ProcessNoteOn&#40;midi, enabled&#41;;            END ELSE BEGIN                       ProcessNoteOff&#40;midi&#41;            END;        END ELSE rejectOut&#40;midi&#41;; //notes that are out of range        IF doRelease THEN sendNoteOffs&#40;false&#41;;    END;  END;PROCEDURE ProcessLearn&#40;midi &#58; tMidi&#41;;BEGIN    IF &#40;isNoteOn&#40;midi&#41;&#41; and &#40;learnCount = 0&#41; THEN BEGIN        lowVal &#58;= midi.data1;        setValue&#40;pLowNoteOUT, lowVal&#41;;        learnCount &#58;= 1;                       END     ELSE IF &#40;isNoteOn&#40;midi&#41;&#41; and &#40;learnCount = 1&#41;  THEN BEGIN        hiVal &#58;= midi.data1;        setValue&#40;pHiNoteOUT, hiVal&#41;;        learnCount &#58;= 0;        isLearning &#58;= FALSE;  // we've set our outs....    END;END;PROCEDURE ProcessNoteOn&#40;midi &#58; tMidi; enabled &#58; boolean&#41;;BEGIN    IF enabled THEN BEGIN        transList&#91;midi.data1&#93; &#58;= transpose;         midi.data1 &#58;= midi.data1 + transpose;        PassOut&#40;midi&#41;;        heldNotes&#91;midi.data1&#93; &#58;= TRUE;        IF &#40;midi.data1 > maxKey&#41; THEN maxKey &#58;= midi.data1;        IF &#40;midi.data1 < minKey&#41; THEN minKey &#58;= midi.data1;    END;END;PROCEDURE ProcessNoteOff&#40;midi &#58; Tmidi&#41;;BEGIN    midi.data1 &#58;= midi.data1 + transList&#91;midi.data1&#93;;    heldNotes&#91;midi.data1&#93; &#58;= FALSE;    PassOut&#40;midi&#41;;    IF bypassReady AND isClear&#40;&#41; THEN  BEGIN        setValue&#40;pBypassOut, 1&#41;;        isDroning &#58;= FALSE;        bypassReady &#58;= FALSE;    END;END;PROCEDURE ProcessDrone&#40;n &#58; integer&#41;;BEGIN    IF n = 0 THEN SendNoteOffs&#40;TRUE&#41;;    isDroning &#58;= n > 0;   END;FUNCTION isClear&#40;&#41; &#58; boolean;VAR key &#58; integer; VAR clear &#58; boolean;BEGIN    clear &#58;= TRUE;    FOR key&#58;= minKey TO maxKey DO IF heldNotes&#91;key&#93; = TRUE THEN clear &#58;= FALSE;    isClear &#58;= clear;END;PROCEDURE SendNoteOffs&#40;closeAll &#58; boolean&#41;;VAR key &#58; integer;VAR midi &#58; tMidi;BEGIN    FOR key&#58;= minKey TO maxKey DO BEGIN            IF &#40;heldNotes&#91;key&#93; = FALSE&#41; OR closeAll THEN BEGIN             midi.msg &#58;= NOTEOFF;            midi.channel &#58;= Byte&#40;outChan&#41;;            midi.data1 &#58;= key;            midi.data2 &#58;= 0;            passOut&#40;midi&#41;;            heldNotes&#91;key&#93; &#58;= FALSE;        END;                                                              END;     doRelease &#58;= FALSE;END;////////////////////////       CALLBACK      /////////////////////////////////////////////PROCEDURE Callback&#40;n&#58; integer&#41;;VAR i &#58; integer;BEGIN    FOR i &#58;= 0 to INPUT_COUNT - 1 DO BEGIN        CASE n OF             pEnableINS&#91;i&#93; &#58;  BEGIN                                 isEnabled&#91;i&#93; &#58;= getValue&#40;n&#41; > 0;                                 UpdateBypass&#40;&#41;;                             END;               pMidiINS&#91;i&#93;   &#58;  midiInCounts&#91;i&#93; &#58;= GetLength&#40;n&#41;;        END;    END;        CASE n OF        pLearnIN      &#58;     isLearning     &#58;= TRUE;                pOutChanIN    &#58;     outChan        &#58;= Byte&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;        pTransposeIN  &#58;     transpose      &#58;= &#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;         pHiNoteIN     &#58;     setHiVal&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;        pLowNoteIN    &#58;     setLowVal&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;                pDroneIN      &#58;     ProcessDrone&#40;trunc&#40;getValue&#40;n&#41;&#41;&#41;;                END;END;/////////////////////////      PROCESS        //////////////////////////////////////////PROCEDURE Process;VAR i, inputNum &#58; Integer;VAR currMsg     &#58; tMidi;BEGIN    FOR inputNum &#58;= 0 TO &#40;INPUT_COUNT - 1&#41; DO BEGIN            FOR i &#58;= 0 TO &#40;midiInCounts&#91;inputNum&#93; - 1&#41; DO BEGIN                GetMidiArrayValue&#40;pMidiINS&#91;inputNum&#93;, i, currMsg&#41;;                ProcessMidi&#40;currMsg, isEnabled&#91;inputNum&#93;&#41;;            END;    END;    SetLength&#40;pPassOut, passCount&#41;;    SetLength&#40;pRejectOut, rejectCount&#41;;    passCount   &#58;= 0;    rejectCount &#58;= 0;END;

Statistics: Posted by woodslanding — 19 Apr 2010, 00:16


]]>
2010-04-18T07:06:48+02:00 2010-04-18T07:06:48+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13479#p13479 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I'm well on my way to creating my perfect live template.

Statistics: Posted by Ben J — 18 Apr 2010, 07:06


]]>
2010-04-17T11:10:27+02:00 2010-04-17T11:10:27+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13475#p13475 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> There are many ways to accomplish what you are looking to do but I would have to say this is the absolute simplest example.
The preset manager will store and recall the states of the VST's, so you do not necessarily even need a way to change VST patches, and the preset manager will also store and recall rge bypass buttons for each VST.
All you have to do here is select which VST you want active, edit or load the VST patch as desired and then store a preset.
When you recall the preset manager preset via the combobox, you are ready to play!

Image

Statistics: Posted by gurulogic — 17 Apr 2010, 11:10


]]>
2010-04-17T10:58:45+02:00 2010-04-17T10:58:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13474#p13474 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]> the low part let you dispatch the midi flow to different midi bus
the hight part, in the same time, active or not your different patches ( each vsti can be in different tracks or on the same ( mode all )
the right part show you the patch for each vsti
Image

Statistics: Posted by nay-seven — 17 Apr 2010, 10:58


]]>
2010-04-17T09:36:19+02:00 2010-04-17T09:36:19+02:00 https://brainmodular.com/forums/viewtopic.php?t=2151&p=13473#p13473 <![CDATA[Selecting from multiple VSTi? (choosing MIDI signal destination)]]>
I play keyboards in a band (so I have no need for real-time recording or sampling stuff), I just need to be able to switch between VST instruments and occasionally select various presets within those VSTi. Basically, I want the functionality of pressing a single interface button to call up the [pre-loaded] VST.

Originally I built a workspace to where each VST was on a separate MIDI channel, and I simply changed patches by changing MIDI channels. However, this limited me to only 16 patches.

Most recently, I tried using emoon's MondoCombo, which works great for selecting presets within a single VST, but I can't figure out how to integrate it with several different VSTi.

I suppose another approach would be to solo/mute all other VST, although my understanding is that might have higher CPU usage...

Can any of you programming geniuses help me? Thanks for all your help thus far! :)

Statistics: Posted by Ben J — 17 Apr 2010, 09:36


]]>