Skip to content


[module] mdal

Output generation

[procedure] (mmod->file MOD FILENAME)

Write the MDAL module MOD to an .mdal file.

[procedure] (mod-compile MOD ORIGIN #!optional (EXTRA-SYMBOLS '()))

Compile a module to an onode tree.

[procedure] (mod->bin MOD ORIGIN #!optional (EXTRA-SYMBOLS '()))

Compile a module into a list of byte values.

[procedure] (mod->asm MOD ORIGIN EXTRA-SYMBOLS)

Compile an module into an assembly source

[procedure] (mod-export-bin FILENAME MOD ORIGIN)

Compile the given module to a binary file.

Additional accessors

[procedure] (mod-get-group-instance-blocks IGROUP-INSTANCE IGROUP-ID MDEF)

Returns the group instance's block nodes, except the order node. The order node can be retrieved with mod-get-group-instance-order instead.

[procedure] (mod-get-block-field-value BLOCK-INSTANCE ROW FIELD-ID MDEF)

Get the value of field FIELD-ID in ROW of BLOCK-INSTANCE.

[procedure] (md-command-info FIELD-ID MDEF)

Set the active MD command info string from the given mdef config-inode FIELD-ID.

[procedure] (mod-get-row-values GROUP-INSTANCE BLOCK-INSTANCE-IDS ROW MDEF)

Returns the values of all field node instances of the given ROW of the given non-order block-instances in the given GROUP-INSTANCE as a flat list. BLOCK-INSTANCE-IDS must be a list containing the requested numerical block instance IDs for each non-order block in the group. Values are returned as strings, except for trigger fields. Empty (unset) instance values will be returned as #f.

[procedure] (mod-get-block-values GROUP-INSTANCE ORDER-POS MDEF)

Returns the values of all field node instances of the non-order block instances in the given group-instance, as a list of row value sets. Effectively calls md-mod-get-row-values on each row of the relevant blocks.

[procedure] (mod-get-group-instance-order IGROUP-INSTANCE IGROUP-ID)

Returns the group instance's order node (instance 0)

[procedure] (mod-get-order-values GROUP-ID GROUP-INSTANCE)

Returns the values of all order fields as a list of row value sets. Values are normalized, ie. empty positions are replaced with repeated values from an earlier row.

[procedure] (get-ordered-group-length GROUP-ID GROUP-INSTANCE)

Returns the total number of all block rows in the given group node instance. The containing group node must be ordered. The result is equal to the length of the block nodes as if they were combined into a single instance after being mapped onto the order node.

Inode mutators


Set one or more INSTANCES of the node with NODE-ID. INSTANCES must be an alist containing the node instance id in car, and the new value in cdr.


Delete one or more INSTANCES from the node with NODE-ID.


Insert one or more INSTANCES into the node with NODE-ID. INSTANCES must be a list of node-instance-id, value pairs.

[procedure] (block-row-insert! PARENT-INSTANCE-PATH BLOCK-ID INSTANCES MOD)

Insert one or more rows into the block instance at BLOCK-INSTANCE-PATH. Rows shall be a list of lists, where each sublist contains a row number in car, and a list of field values in cdr.

[procedure] (block-row-remove! PARENT-INSTANCE-PATH BLOCK-ID INSTANCES MOD)

Remove one or more rows from a block node instance. PARENT-INSTANCE-PATH must be a node path to the parent group node instance. BLOCK-ID must be the ID of the block node, and INSTANCES must be an alist, where the keys are the IDs of the block instances to change, and the values are lists containing a row number in car.


[procedure] (generate-new-mmod MDEF BLOCK-LENGTH)

Generate a new, empty mmod based on the MDAL engine definition MDEF. Block instances are generated with length BLOCK-LENGTH by default, unless other constraints apply from the mdef.

[procedure] (derive-single-row-mmod MOD GROUP-ID ORDER-POS ROW)

Derive a new MDAL module from the module MOD, which contains a single row of block data in the group with GROUP-ID. The row is composed from position ROW in the set of patterns represented by ORDER-POS.

[procedure] (derive-single-pattern-mmod MOD GROUP-ID ORDER-POS)

Derive a new MDAL module from the module MOD, with the order list of group GROUP-ID modified to only contain the step ORDER-POS.

Utility Procedures

[procedure] (transpose-notes FIELD-VALUES COMMAND OFFSET)

Transpose notes in the list of field values by OFFSET.

[procedure] (scale-values FIELD-VALUES AMIN AMAX)