GNMIDI

Table of Contents Keyword Index
Modify MIDI events by expression
Previous  Top  Next

[menu modify]
dialog_modifymidievents
Modify selected MIDI events in current MIDI file matching optional channels 0-16 (0=no channel) and a C programming like condition expression by one or more script commands. This operation requires some understanding of programming scripts in any language.

channels
Empty field means ignoring any MIDI event channel (same as 0-16).
Number 0 means events that have no MIDI channel (e.g. text, tempo ...).
Numbers 1-16 are MIDI channel numbers (e.g. notes, controllers, sound programs ...)
The field allows to enter a list of numbers between 0 and 16 and also number ranges (e.g. 1,3,5 11-16).
The separators can be spaces or comma.
Only events matching the numbers will be considered by the condition.
Even if a condition may also check channel numbers (e.g. ev.channel in [1,3,5,11..16]) using this field speeds up the duration



condition expression
This optional field expects a boolean expression in a C like script language. By default all events are matching (that also match given channels).  
If filled then only matching events are modified by the modification expression.  
See more about MIDI event condition expressions written in gnscript syntax in page gnscript condition expressions syntax including examples.  
Hint: Use function Seek MIDI events by conditions (for experts) from menu analyse to test the condition expression.  

modification expression
This field expects one or more expressions that modify current ev. if or switch might be used to conditionally modify events by certain criterias.  
Multiple statements must be separated by semicolon (;).  
See more about MIDI event modifiction expressions written in gnscript syntax in page gnscript event modification expression syntax including examples.  

Modify
Enter optional channel, optional condition and modification expression and use button run to start the modification.  

Syntax errors
errors are displayed in the box below the modification edit box (in English language).  

Results:
If searching and modification is successful then number of matching events and number of modified events will be displayed in the box below the condition.  

OK
closes the dialog and generates a MIDI file opened in GNMIDI which contains the modifications done by the gnscript expressions.  

Syntax help
will show this page (also F1 key). Use also gnscript package at https://www.gnmidi.com to learn from script examples.  

Too difficult
If programming is too difficult for you then we can also offer to program user tools for your special purpose that can be used directly in GNMIDI.  
It can analyse or modify or generate MIDI files.  
In fact in most cases we can use the gnscript language for implementation.