What's new

How to add data to exported midi file??

You didn't look very well. There's a whole section in KSP reference about MIDI object commands.
yes i read it many time all the commands about open and save the midi file and buffer
but adding an event to the empty midi object before saving the file via scripting is not included.
 
Yes it is. mf_insert_event(). Now don't say you didn't see that one. :)
yes i realized it but i think it is for another purpose
the manual has no example about that point
i saw in some script that the $MIDI_COMMAND_NOTE_ON can be replaced with number 144
is there any table for the other commands???
 
All the possible MIDI commands are listed in the multiscript section of KSP reference and they apply to the MIDI object as well.

And no, there's no other purpose to mf_insert_event, it's there to insert events. Plain and simple.
 
All the possible MIDI commands are listed in the multiscript section of KSP reference and they apply to the MIDI object as well.

And no, there's no other purpose to mf_insert_event, it's there to insert events. Plain and simple.
my question now about the numbers which replace the commands
MIDI_COMMAND_NOTE_ON =>144
what is the numbers of the other commands?
 
you mean this?
Command Name Status Byte Data Byte 1 Data Byte 2
Note Off 128 + Channel 0-127 Pitch 0-127 Velocity
Note On 144 + Channel 0-127 Pitch 0-127 Velocity
Poly Pressure 160 + Channel 0-127 Pitch 0-127 Pressure
Control Change 176 + Channel 0 Undefined 0-127 MSB
Control Change 176 + Channel 1 Modulation Wheel 0-127 MSB
Control Change 176 + Channel 2 Breath Controller 0-127 MSB
Control Change 176 + Channel 3 After Touch 0-127 MSB
Control Change 176 + Channel 4 Foot Controller 0-127 MSB
Control Change 176 + Channel 5 Portamento Time 0-127 MSB
Control Change 176 + Channel 6 Data Entry 0-127 MSB
Control Change 176 + Channel 7 Main Volume 0-127 MSB
Control Change 176 + Channel 8-31 Undefined 0-127 MSB
Control Change 176 + Channel 32-63 LSB of 0-31 0-127 MSB
Control Change 176 + Channel 64 Damper Pedal 0:off 127:on
Control Change 176 + Channel 65 Portamento 0:off 127:on
Control Change 176 + Channel 66 Sostenuto 0:off 127:on
Control Change 176 + Channel 67 Soft Pedal 0:off 127:on
Control Change 176 + Channel 68-92 Undefined 0:off 127:on
Control Change 176 + Channel 93 Chorus 0:off 127:on
Control Change 176 + Channel 94 Celeste 0:off 127:on
Control Change 176 + Channel 95 Phaser 0:off 127:on
Control Change 176 + Channel 96 Data Entry + 1 0:off 127:on
Control Change 176 + Channel 97 Data Entry - 1 0:off 127:on
Control Change 176 + Channel 98-121 Undefined 0:off 127:on
Control Change 176 + Channel 122 Local Control 0-127
Control Change 176 + Channel 123 All Notes Off 0
Control Change 176 + Channel 124 Omni Mode off 0-15
Control Change 176 + Channel 125 Omni Mode on 0
Control Change 176 + Channel 126 Mono on/Poly off 0
Control Change 176 + Channel 127 Poly on/Mono off 0
Program Change 192 + Channel 0-127 Program Not used
Channel Pressure 208 + Channel 0-127 Pressure Not used
Pitch Wheel 224 + Channel 0-127 LSB 0-127 MSB
System Exclusive 240 0-127 Id Code Any number of bytes
Undefined 241 Not used Not used
Song Position 242 0-127 LSB 0-127 MSB
Song Select 243 0-127 Song Not used
Undefined 244 Not used Not used
Undefined 245 Not used Not used
Tune Request 246 Not used Not used
End of Exclusive 247 Not used Not used
Timing Clock 248 Not used Not used
Undefined 249 Not used Not used
Start 250 Not used Not used
Continue 251 Not used Not used
Stop 252 Not used Not used
Undefined 253 Not used Not used
Active Sensing 254 Not used Not used
System Reset 255 Not used Not used
 
you mean this?
Command Name Status Byte Data Byte 1 Data Byte 2
Note Off 128 + Channel 0-127 Pitch 0-127 Velocity
Note On 144 + Channel 0-127 Pitch 0-127 Velocity
Poly Pressure 160 + Channel 0-127 Pitch 0-127 Pressure
Control Change 176 + Channel 0 Undefined 0-127 MSB
Control Change 176 + Channel 1 Modulation Wheel 0-127 MSB
Control Change 176 + Channel 2 Breath Controller 0-127 MSB
Control Change 176 + Channel 3 After Touch 0-127 MSB
Control Change 176 + Channel 4 Foot Controller 0-127 MSB
Control Change 176 + Channel 5 Portamento Time 0-127 MSB
Control Change 176 + Channel 6 Data Entry 0-127 MSB
Control Change 176 + Channel 7 Main Volume 0-127 MSB
Control Change 176 + Channel 8-31 Undefined 0-127 MSB
Control Change 176 + Channel 32-63 LSB of 0-31 0-127 MSB
Control Change 176 + Channel 64 Damper Pedal 0:off 127:on
Control Change 176 + Channel 65 Portamento 0:off 127:on
Control Change 176 + Channel 66 Sostenuto 0:off 127:on
Control Change 176 + Channel 67 Soft Pedal 0:off 127:on
Control Change 176 + Channel 68-92 Undefined 0:off 127:on
Control Change 176 + Channel 93 Chorus 0:off 127:on
Control Change 176 + Channel 94 Celeste 0:off 127:on
Control Change 176 + Channel 95 Phaser 0:off 127:on
Control Change 176 + Channel 96 Data Entry + 1 0:off 127:on
Control Change 176 + Channel 97 Data Entry - 1 0:off 127:on
Control Change 176 + Channel 98-121 Undefined 0:off 127:on
Control Change 176 + Channel 122 Local Control 0-127
Control Change 176 + Channel 123 All Notes Off 0
Control Change 176 + Channel 124 Omni Mode off 0-15
Control Change 176 + Channel 125 Omni Mode on 0
Control Change 176 + Channel 126 Mono on/Poly off 0
Control Change 176 + Channel 127 Poly on/Mono off 0
Program Change 192 + Channel 0-127 Program Not used
Channel Pressure 208 + Channel 0-127 Pressure Not used
Pitch Wheel 224 + Channel 0-127 LSB 0-127 MSB
System Exclusive 240 0-127 Id Code Any number of bytes
Undefined 241 Not used Not used
Song Position 242 0-127 LSB 0-127 MSB
Song Select 243 0-127 Song Not used
Undefined 244 Not used Not used
Undefined 245 Not used Not used
Tune Request 246 Not used Not used
End of Exclusive 247 Not used Not used
Timing Clock 248 Not used Not used
Undefined 249 Not used Not used
Start 250 Not used Not used
Continue 251 Not used Not used
Stop 252 Not used Not used
Undefined 253 Not used Not used
Active Sensing 254 Not used Not used
System Reset 255 Not used Not used
doctor Marji you are very kind , thx alot
 
Top Bottom