MIDI-MT - Debugging while writing ChaiScript scenarios

MIDI-MT Documentation in English

“ChaiScript” - Debugging and scripting

     The scripting core of MIDI-MT is ChaiScript
     ChaiScript is a typed declarative language with syntax similar to C++, TypeScript and JavaScript.

Debugging while writing ChaiScript scenarios

To develop and test scripts, the distribution kit includes the MMTScriptTester.exe utility.
You can use it for debugging when writing your own scripts. Tracking changes to the script directory also works. Scripts are reloaded automatically if changed. If changes occur during the execution of any script, then the changes are postponed until the end of its execution.

The last modification time of the script file displayed in the list corresponds to the time it was last loaded. This is not the actual modified date of the file on disk.

The management of MMTScript Tester is intuitive and is based on the concept of minimizing the number of commands to the required size, so as not to overload the interface and reduce the entry barrier for those using it.

To semantically differentiate the displayed texts, different colors are used, which makes it easier to perceive when there is a large flow of debugging information when running the script.

The program is designed to work in parallel with any editor convenient for you, in which you can edit scripts.

Controls MMTScript Tester

MMTScript Tester has three types of controls: - at startup you can set the configuration using keys on the command line, - using single keys, default mode, - using the command line, which is called by double-clicking Enter.

Command line switches when launching MMTScript Tester
  Usage: MMTScriptTester.exe [options...]
  Options:
    -d, --directory        Set scripts directory, full path
    -r, --run              Run script by number, valid 1-9
    -o, --open             Run script by name, require full path
    -w, --watch            Set scripts watcher enable
    -b, --debug            Set script debugging output to a special program
    -s, --no-string-lib    Disable using string libraries
    -u, --no-wstring-lib   Disable using wide string libraries
    -m, --no-math-lib      Disable using math libraries
    -h, --help             this help page..       
MMTScript Tester control key commands
    '?'          call this help..
    '1-9'        run a script by number, valid numbers are from 1 to 9
    's'          scan script directory
    'l'          show loaded scripts list
    'r'          show running scripts list
    'c'          show configuration
    'b'          show the source code of the last running script
    'd'          set script debugging output to a special program
    't'          terminate all running scripts
    'x' or 'q'   stop and exit
    'show help'  calling help for full string commands

In this mode, only the first nine scripts can be called, with numbers from 1 to 9.
If there is a need to call higher numbers for execution, you must use the command line mode.

MMTScript Tester command line control
    'help'                                                call this help..
    'sh|show|print' '[list|scripts]'                      show loaded scripts list
    'sh|show|print' '[run|running|launch]'                show running scripts list
    'sh|show|print' '[conf|config|configuration]'         show configuration
    'sh|show|print' '[dir|directory]'                     show current script directory
    'sh|show|print' '[src|code|source]' '[number|string]' show script source code by number or name
    'run|call|start [number|string]'                      calling a script by number or name
    'stop|end [number|string]'                            stop script execution by number or name
    'scan|rescan|reload'                                  scan script directory
    'debug|debugging'                                     set script debugging output to a special program
    'terminate|term'                                      terminate all running scripts

Advanced control mode allows you to call scripts from 1 to 27 numbers.
It is also possible to call a script by name without specifying the extension. Has a number of additional commands.

ChaiScript documentation and examples

  1. Find out more in documentation and examples on the ChaiScript website.
  2. View more code examples ChaiScript.
  3. ChaiScript language reference.
  4. Getting started with ChaiScript:
  5. Specific MIDI-MT API objects in scripts.
  6. Example MIDI-MT API.
  7. Examples of RGB LED controls:
  8. Other examples:
  9. Useful additions: