FFglitch uses the quickjs
engine to provide
native JavaScript
support.
FFglitch also provides extra JavaScript
functionality which can
greatly speed up the glitching process.
Below you will find the technical documentation of these new types and
classes. At least some basic knowledge of JavaScript
is expected.
FFArrays
and FFPtrs
are based on the built-in Typed Arrays
, but
with a lot of functionality and complexity removed to provide a simpler
and faster implementation.
MV
and MVRef
are a simple representation of a
[ horizontal, vertical ]
motion vector.
MVArray
and MVPtr
are similar to FFArrays
and FFPtrs
, but they
contain motion vectors
instead of simple integer values.
There is also a helper MVMask
type.
MV2DArray
and MV2DPtr
are similar to MVArray
and MVPtr
, but
they contain a 2-dimensional array of motion vectors
instead of a
single array of motion vectors
.
There is also a helper MV2DMask
type.
The Math.prototype.lround()
method (a round to nearest integer
method) has been added to the to the Math
prototype.
It is equivalent to:
Math.lround = (x) => Math.sign(x) * Math.round(Math.abs(x));
The reason behind this is that the JavaScript
Math.round()
method
behaves differently from most other programming languages, in that it
rounds half-increments away from zero, and I don’t like that.
For example, I prefer that -3.5
rounds to -4
instead of -3
:
print(Math.round(+3.5)); // 4
print(Math.lround(+3.5)); // 4
print(Math.round(-3.5)); // -3
print(Math.lround(-3.5)); // -4
FFglitch has SDL
support integrated into quickjs
.
This enables fflive
to use keyboard, mouse, and joysticks input devices.
- Go to
SDL
documentation
FFglitch has RtMidi
support integrated into quickjs
.
This enables ffgac
, ffedit
, and fflive
to use MIDI controllers as input devices.
- Go to
RtMidi
documentation
FFglitch has ZeroMQ
support integrated into quickjs
.
This enables ffgac
, ffedit
, and fflive
to do many kinds of network communication and messaging.
- Go to
ZeroMQ
documentation