Skip to content

md-types

[module] md-types

md-module record types and additional accessors

MMOD: Input Nodes

[procedure] (subnode-ref SUBNODE-ID INODE-INSTANCE)

Returns the subnode with the given SUBNODE-ID.

[procedure] (inode-instance-ref INSTANCE-ID INODE)

Returns the inode instance with the given INSTANCE-ID, or a newly created, empty inode if the referenced inode instance does not exist.

[procedure] (block-field-ref BLOCK-INSTANCE ROW FIELD-INDEX)

Returns the value of the field at FIELD-INDEX in ROW of block-instance. Returns null if the requested ROW does not exist.

MMOD: Module

The internal representation of an MDAL module is a pair containing an MDAL mdef as the first element, and the global module node as the second element, so (mdef . global-node). libmdal provides the accessors mmod-mdef and mmod-global-node for dealing with the elements of a module.

The structure of global-node mirrors that of the MDAL module s-expression, with the following changes:

  • The GLOBAL node is explicit.
  • Each node is represented as an element in an alist, where the key is the node ID, and the value (remainder) is an alist of node instances.
  • Each node instance is represented as an element in an alist, where the key is the instance ID, the first value of the remainder is the node instance name (or #f if none was given), and the rest of the remainder is the actual node instance value, depending on the node type.
  • In block node instances, all rows are expanded to a list containing the values for each block field subnode. Unset (empty) fields are represented by null (the empty list).

[procedure] (mmod-mdef M)

[procedure] (mmod-global-node M)

mod accessor functions

[procedure] (node-path P)

Generate a function that takes an inode as parameter, and returns the subnode or node instance matching the given path P, which must be a string in the form "instance-id/node-id...". For example,

(node-path "0/PATTERNS/0/CH1")

will return a procedure that, when called with the global node as argument, will return the node CH1 in instance 0 of the PATTERN node, assuming that the node exists and is defined in the module's engine definition.

[procedure] (repeat-block-row-values ROWS)

Given the contents of a block instance, return the contents such that empty fields are replaced with the last set value. Helper for mod-get-order-values and derive-single-row-mmod.