Posted: 20 Aug 2017, 07:43
Hi,
I had a try at midi out.
I found out that the output array should be resized before sending a message and closed afterwards
If the array size is set to zero just after the array is filled with the midicode, the message is not send
if I wait few ticks before emptying the output array (a whole blocksize), the message is sent but during that time, the message is sent many times (roughly once every 5 clock ticks).
What is the proper way to send midi message out of a module ?
thanx
Olivar
...
else if (m_mode == 1) {
onTime = clock();
midiCode.Msg = MIDI_CONTROLCHANGE;
midiCode.Data1 = 123;
midiCode.Data2 = 0;
sdkSetEvtSize(midiOut, 1);
sdkSetEvtArrayMidi(midiOut, 0, midiCode);
m_create = 0;
}
...
int passed = clock() - onTime;
if (passed > sdkGetBlocSize() && token == 1) {
sdkSetEvtSize(midiOut, 0);
token = 0;
}
I had a try at midi out.
I found out that the output array should be resized before sending a message and closed afterwards
If the array size is set to zero just after the array is filled with the midicode, the message is not send
if I wait few ticks before emptying the output array (a whole blocksize), the message is sent but during that time, the message is sent many times (roughly once every 5 clock ticks).
What is the proper way to send midi message out of a module ?
thanx
Olivar
...
else if (m_mode == 1) {
onTime = clock();
midiCode.Msg = MIDI_CONTROLCHANGE;
midiCode.Data1 = 123;
midiCode.Data2 = 0;
sdkSetEvtSize(midiOut, 1);
sdkSetEvtArrayMidi(midiOut, 0, midiCode);
m_create = 0;
}
...
int passed = clock() - onTime;
if (passed > sdkGetBlocSize() && token == 1) {
sdkSetEvtSize(midiOut, 0);
token = 0;
}