Tutorial

Core Collection

The DCN corpus is collective: anyone can publish and reuse transformations, conditions, and connectors across the network. Explore the broader live corpus through the Network.

This Core Collection is a practical starter library for immediate hands-on experimentation with baseline elements. Below you can find names, exact Solidity snippets, and short descriptions.

Scope note

The current Core Collection is primarily a curated library of reusable transformations and conditions. Connector coverage is intentionally limited for now; the manifest currently includes a template-level connector entry rather than a broad canonical connector library.

Connector Templates

midi_scalar_endpoints_template

template.midi.scalar_endpoints.v1

Placeholder template targeting scalars pitch,time,duration|durationv2,velocity. Connector publication phase is tracked separately from transformation/condition source curation.

Format hash: not assigned

Transformations

util_identity_v1

util.identity.v1

Pass-through primitive.

return x;

math_add_v1

math.add.v1

Addition primitive.

return x + args[0];

math_subtract_v1

math.subtract.v1

Subtraction primitive (reverts on uint32 underflow).

return x - args[0];

math_multiply_v1

math.multiply.v1

Multiplication primitive.

return x * args[0];

math_divide_v1

math.divide.v1

Integer division.

require(args[0] != 0, "division by zero");
return x / args[0];

math_modulo_v1

math.modulo.v1

Modulo primitive.

require(args[0] != 0, "modulo by zero");
return x % args[0];

math_power_v1

math.power.v1

Exponentiation by repeated multiplication.

uint32 result = 1;
for (uint32 i = 0; i < args[0]; i++) {
    result = result * x;
}
return result;

math_min_v1

math.min.v1

Minimum of x and arg0.

return x < args[0] ? x : args[0];

math_max_v1

math.max.v1

Maximum of x and arg0.

return x > args[0] ? x : args[0];

math_clamp_v1

math.clamp.v1

Clamp x to [min,max].

require(args[0] <= args[1], "invalid clamp bounds");
if (x < args[0]) return args[0];
if (x > args[1]) return args[1];
return x;

math_quantize_step_v1

math.quantize_step.v1

Floor quantization to nearest lower step.

require(args[0] != 0, "step is zero");
return (x / args[0]) * args[0];

Conditions

logic_always_true_v1

logic.always_true.v1

Unconditional allow.

return true;

logic_equals_v1

logic.equals.v1

Equality check.

return args[0] == args[1];

logic_greater_than_v1

logic.greater_than.v1

Strict greater-than check.

return args[0] > args[1];

logic_less_than_v1

logic.less_than.v1

Strict less-than check.

return args[0] < args[1];

logic_between_inclusive_v1

logic.between_inclusive.v1

Inclusive interval check.

return args[0] >= args[1] && args[0] <= args[2];