Pointers

A pointer flow (type POINTER) passes a block of memory from a module to another one. The wire carries a reference to the block, not a copy of its content: it is the fastest way to share large data between modules, mainly user modules.

How it works

The block of memory belongs to the outlet which creates it. Each module connected to this outlet reads the same block. When the owner changes the content of the block, it signals the change, so the connected modules are notified as for any other flow.

The pointer flow also carries the size of the block, in bytes, and the type of its content:

Type Value
floats 0
integers 1
strings 2
MIDI codes 3
colors 4
audio data 5
bitwise data 6
chunk data 7

The block exists only as long as the module which owns it. When a module receives a pointer to a block which does not exist anymore, Usine raises the error the pointer does not exist. When the received flow is not a pointer, the error is the pointer flow has a bad format.

Modules and pointers

  • Float Array To Pointer copies a float array into a pointer (4 bytes per element).
  • Pointer To Float Array reads a pointer as a float array.
  • Scripts can declare pointer inlets and outlets with the ptPointer parameter type.
  • User modules declare pointer parameters with the ptPointer parameter type of the SDK and read or write the block with getPointerData, getPointerDataSize, setPointerDataSize and setPointerDataChanged (see the UsinePointers example of the SDK).

See also

version 7.0.250921

Edit All Pages