|
gnscript condition expressions syntax
|
Previous Top Next |
| https://www.gnmidi.com/gnscript.htm is a demo script interpreter with many script examples for learning programming. It is easier to learn programming by examples than by syntax.
|
| random(maxvalue) a random value between 0 and maxvalue-1
|
| text.length() number of characters in text
|
| text.index(subtext) first position of subtext inside text or -1 if not found
|
| text.toupper() change all characters a-z to A-Z
|
| text.tolower() change all characters A-Z to a-z
|
| text.mid(pos, len) get part of text beginning at index pos and maximum length len
|
| text.left(len) get part of text from beginning with maximum length len
|
| song.measureatunit(unit) returns 1 for first measure
|
| song.lastunit() returns last used midi unit in song
|
| song.gettrackcount() returns number of tracks
|
| song.getresolution() returns units per beat
|
| ev.eventindex() index of the event inside the song
|
| ev.ischordevent() returns true if event contains a known chord
|
| ev.event2string() returns a text that contains event information
|
|
|
|
|