Page 1 of 1

Posted: 06 Jun 2010, 05:23
by 23fx23
I try to send a midi message from a script, i got all Channel, data1,data2 working, but i can't see the mesage,
if i check my midi out i see " 0 OFF 56 127 c:3"
MidiX.channel := 1
/////// MidiX.msg := round(getdataArrayValue(Midi_Msgs_In, (index*16)+1));
MidiX.msg := 3;
MidiX.data1 := round(getdataArrayValue(Midi_Msgs_In, (index*16)+2));
MidiX.data2 := round(getValue(Xout)*127);
SetMidiArrayValue(Midi_Out, 0, MidiX);
SetLength(Midi_Out, 1);
any clues?

Posted: 06 Jun 2010, 05:42
by 23fx23
AAAAh ok im stupid for a CC msg won't be 3 like the list box, but 176 hehe too simple.
MM so i need to make kind of mapper, any tricks on dealing with the messages? mm canjust make a vaiable table.

also is it possible to directly set sub chanel,msg,data1,data2 of an array of tmidi like other 2d arrays?

something like arrayofTmidi[i,j]:= where j would be ch,msg,ect..?

Posted: 07 Jun 2010, 08:02
by bsork
I have just used constants and /or lookup tables/arrays for handling the messages.

I don't quite get your second question, but I think the answer is no:). You can't access the fields in a record like it was some index - it would have to go by the field name. You could of course split the various fields into separate arrays or dimensions of a single array, but that could easily create unnecessarily complex data structures.

Posted: 07 Jun 2010, 19:17
by 23fx23
yup cool thanks bsork, i finally made a table with according messages.

records seems a powerful function of delphi, i got to experiment...