ArrayArrayArrayArrayArrayArrayArrayArrayArray
CODE: Statistics: Posted by sephult — 23 Sep 2017, 01:18
Question #2
MIDI Array Sizing:
I'm slicing and dicing and found that this was a slightly different method.
I am wondering....is the MIDI Out Size handled as a part of the SDK functions now?
I do see where the stream is clamped off like normal before the input size detection.
Interesting though, if this is the case....is there any way to get rid of the clamp as well?
I assume no that we still have the issue where they cannot co-exist....is this right?1.Read Input Size2.Loop Looking for Size to be Greater than 0. (MIDI Message has Arrived!)3.Enter Processing Loop and copy the MIDI Input to the MIDI Output4.Read the Value of the Fader5.Enter “For" Loop. Process on each of the MIDI Messages Received.6.Get the MIDI Message copied to the MIDI Output earlier and use to modify ‘code’7.Only make changes to MIDI Messages that are Note ON/OFF Messages8.MIDI Messages contain Data1 and Data2, Data2 in this case is velocity.9.Change the velocity equal to the fader value that was placed in ‘velo’10.Set the MIDI Output with the ‘code’ that was just modified.// Processvoid MidiTransposeExampleExample::onProcess () { int sizeMidiIn = sdkGetEvtSize (midiIn); //===============Get size of MIDI place in sizeMidiIn sdkSetEvtSize (midiOut, 0); //=============================Set MIDI Out stream to Off if (sizeMidiIn > 0) //=====================================Only do if sizeMidiIn is active { sdkCopyEvt (midiIn, midiOut); //=====Copy MIDI Input to the MIDI Output int velo = (int)sdkGetEvtData(fdrVelo); //=======Read fader and place in ‘velo’ for (int i = 0; i < sizeMidiIn; i++)//==============Do this while the count is less { //=========than ‘i’. (i.e. Do for all incoming MIDI) UsineMidiCode code = sdkGetEvtArrayMidi (midiOut, i); //======Get MIDI, put in code if (code.Msg == MIDI_NOTEON || code.Msg == MIDI_NOTEOFF) //====Only for Note ON/OFF { code.Data2 = velo; //=======set the Data2(velocity) code equal to the fader value sdkSetEvtArrayMidi (midiOut, i, code); //====== (Send MIDI!) } } }}
]]>
Statistics: Posted by nay-seven — 21 Sep 2017, 14:30
Statistics: Posted by 23fx23 — 21 Sep 2017, 14:23
CODE:
void MidiTransposeExampleExample::onGetModuleInfo (MasterInfo* pMasterInfo, ModuleInfo* pModuleInfo)CODE:
pModuleInfo->NumberOfParams = 4;CODE:
void MidiTransposeExampleExample::onGetParamInfo (int ParamIndex, TParamInfo* pParamInfo)CODE:
case 3: pParamInfo->ParamType = ptDataFader; pParamInfo->Caption = "velo"; pParamInfo->IsInput = TRUE; pParamInfo->IsOutput = FALSE; pParamInfo->MinValue = 0.0f; pParamInfo->MaxValue = 127.0f; pParamInfo->DefaultValue = 85.0f; pParamInfo->Symbol = "v"; pParamInfo->Format = "%.0f"; pParamInfo->IsStoredInPreset = TRUE; pParamInfo->CallBackType = ctImmediate; pParamInfo->EventPtr = &fdrVelo; break;CODE:
SOLVEDStatistics: Posted by sephult — 21 Sep 2017, 13:13
CODE:
void MidiTransposeExampleExample::onGetParamInfo (int ParamIndex, TParamInfo* pParamInfo)CODE:
case 3:pParamInfo->ParamType = ptDataFader;pParamInfo->Caption = "velo";pParamInfo->IsInput = TRUE;pParamInfo->IsOutput = FALSE;pParamInfo->MinValue = 0.0f;pParamInfo->MaxValue = 127.0f;pParamInfo->DefaultValue = 85.0f;pParamInfo->Symbol = "v";pParamInfo->Format = "%.0f";pParamInfo->IsStoredInPreset = TRUE;pParamInfo->CallBackType = ctImmediate;pParamInfo->EventPtr = &fdrVelo;break;CODE:
int velo = (int)sdkGetEvtData(fdrVelo);Statistics: Posted by sephult — 21 Sep 2017, 13:03
CODE:
1.Read Input Size2.Loop Looking for Size to be Greater than 0. (MIDI Message has Arrived!)3.Enter Processing Loop and copy the MIDI Input to the MIDI Output4.Read the Value of the Fader5.Enter “For" Loop. Process on each of the MIDI Messages Received.6.Get the MIDI Message copied to the MIDI Output earlier and use to modify ‘code’7.Only make changes to MIDI Messages that are Note ON/OFF Messages8.MIDI Messages contain Data1 and Data2, Data2 in this case is velocity.9.Change the velocity equal to the fader value that was placed in ‘velo’10.Set the MIDI Output with the ‘code’ that was just modified.// Processvoid MidiTransposeExampleExample::onProcess () { int sizeMidiIn = sdkGetEvtSize (midiIn); //===============Get size of MIDI place in sizeMidiIn sdkSetEvtSize (midiOut, 0); //=============================Set MIDI Out stream to Off if (sizeMidiIn > 0) //=====================================Only do if sizeMidiIn is active { sdkCopyEvt (midiIn, midiOut); //=====Copy MIDI Input to the MIDI Output int velo = (int)sdkGetEvtData(fdrVelo); //=======Read fader and place in ‘velo’ for (int i = 0; i < sizeMidiIn; i++)//==============Do this while the count is less { //=========than ‘i’. (i.e. Do for all incoming MIDI) UsineMidiCode code = sdkGetEvtArrayMidi (midiOut, i); //======Get MIDI, put in code if (code.Msg == MIDI_NOTEON || code.Msg == MIDI_NOTEOFF) //====Only for Note ON/OFF { code.Data2 = velo; //=======set the Data2(velocity) code equal to the fader value sdkSetEvtArrayMidi (midiOut, i, code); //====== (Send MIDI!) } } }}Statistics: Posted by sephult — 23 Sep 2017, 01:18
Statistics: Posted by nay-seven — 21 Sep 2017, 14:30
Statistics: Posted by 23fx23 — 21 Sep 2017, 14:23
CODE:
void MidiTransposeExampleExample::onGetModuleInfo (MasterInfo* pMasterInfo, ModuleInfo* pModuleInfo)CODE:
pModuleInfo->NumberOfParams = 4;CODE:
void MidiTransposeExampleExample::onGetParamInfo (int ParamIndex, TParamInfo* pParamInfo)CODE:
case 3: pParamInfo->ParamType = ptDataFader; pParamInfo->Caption = "velo"; pParamInfo->IsInput = TRUE; pParamInfo->IsOutput = FALSE; pParamInfo->MinValue = 0.0f; pParamInfo->MaxValue = 127.0f; pParamInfo->DefaultValue = 85.0f; pParamInfo->Symbol = "v"; pParamInfo->Format = "%.0f"; pParamInfo->IsStoredInPreset = TRUE; pParamInfo->CallBackType = ctImmediate; pParamInfo->EventPtr = &fdrVelo; break;CODE:
SOLVEDStatistics: Posted by sephult — 21 Sep 2017, 13:13
CODE:
void MidiTransposeExampleExample::onGetParamInfo (int ParamIndex, TParamInfo* pParamInfo)CODE:
case 3:pParamInfo->ParamType = ptDataFader;pParamInfo->Caption = "velo";pParamInfo->IsInput = TRUE;pParamInfo->IsOutput = FALSE;pParamInfo->MinValue = 0.0f;pParamInfo->MaxValue = 127.0f;pParamInfo->DefaultValue = 85.0f;pParamInfo->Symbol = "v";pParamInfo->Format = "%.0f";pParamInfo->IsStoredInPreset = TRUE;pParamInfo->CallBackType = ctImmediate;pParamInfo->EventPtr = &fdrVelo;break;CODE:
int velo = (int)sdkGetEvtData(fdrVelo);Statistics: Posted by sephult — 21 Sep 2017, 13:03