Page 1 of 1

Posted: 21 Jul 2011, 14:15
by Floego
for example, I have been working on a patch using the pianoroll's array: a huge amount of 5 different values (position, duration, note value, data1, data2).

I'm planning to create an event list, something like this:
Image

that list is editable, I can change any displayed value.

but, once I change, for example, the position of a note, it gets out of place:
Image

how can I automatically reorder the array and put the 5 set values in place? :)

Posted: 21 Jul 2011, 22:06
by 23fx23
it reminds me something we did already in another thread, it was about 'sorting slaves', i think ive lost the script but it's somewhere on the forum, try to have a look, ill try too, but i must go now.. basically it sort a master array, and several slaves will follow.

Posted: 21 Jul 2011, 22:16
by nay-seven

Posted: 22 Jul 2011, 05:04
by Floego
Thanks 23fx23 and nay!
Right now I`m reading that topic and looks really useful for me!

Btw the above midi event list panel should be a nice example to the use of sorting a masters array :)

It will take many days but probably at the end of next week I will have a basic patch ready. The more delicate part is related to the fact that this patch directly writes to the pianoroll array, so if done wrongly , then the pianoroll module will behave like crazy until cleared. And the resulting saved midi file will be unusable without warning.

Posted: 23 Jul 2011, 04:49
by Floego
ok, I have readed the thread and downloaded the examples. and...it really works! :)
For now I´m just trying to modify parts of the code to make use of an array larger than 511 values and the use of non-integer values.

Posted: 23 Jul 2011, 12:57
by 23fx23
Well done nay, thats the one indeed ;)
To extend length, it can be done via the command
Setlength(arrayname,1023);
But normally the output size is defined by input array length, and it should work if you extend it externally no? Or maybe some variable in the script as been maxed to 511, track this nb and extend as you wish.

For the non integer, its probably to replace an integer declared variable as 'single' instead of integer, and check and remove any 'trunc' or 'round' being used.