Page 1 of 1

Posted: 19 Sep 2010, 11:17
by 23fx23
is it recommended to have midiout of script only of the size of needed events?

ie in a matrix, instead of sending a tmidi of column size, scan the colum to extract only notes on an make an adapted
variable size array out.

i fail a bit for the process to to that, any existing exemple?
iguess i should scan the array, make the summ to get nb of notes while storing indexs if discovered, but
i fail in the process orders. mmm feel it's related i neead to get tot first, or can it be done in a single bloc?

or it doesn't worth bother and send a bigger array (ie32) in wittch note on are on, note off send noteoff...
mm couldn't that create overloads?

any tips from masterz? how would you deal a column case?

Posted: 19 Sep 2010, 22:00
by bsork
23fx23 wrote:is it recommended to have midiout of script only of the size of needed events?
In short - yes. :) And unless you for some reason want to resend the same message(s) in each block, the MIDI array length should be zeroed within the next block or changed to the length of the new messages.

The good thing is that you can do your things and fill the array from index 0 and up within a block and only when you're finished filling in the data you have to set the length. Typically you set the length within Process, whether it's 0 or something else. Take a look at some of the MIDI scripts in the distro - many of them are done this way.

[edit] BTW, if you have filled the array with a number of messages and you then overwrite from 0 but not with as many messages as the previous number, I'm pretty sure the old messages still exist, but as long as the length is set correctly it doesn't matter.

Posted: 19 Sep 2010, 22:46
by 23fx23
ok that's what i felt.
perfect im gonna test that, i think i failed cause i was setting the size at the same time than computing tot probably.
i already understood the setto 0 size, but my next challenge is getting minimal nb of events, shame on me i didn't look enough
at the midi exemples..
gonna check that.
thanks 'bsork.