Source:
MoonLiveBuiltins_common.h
moonlive_builtins_common¶
The domain-neutral half of the script vocabulary: arithmetic, waveforms, noise, randomness and print.
None of it is about light, so none of it belongs to the light domain.
Functions¶
| Return | Name | Description |
|---|---|---|
int32_t |
signedArg inline |
A script argument read as signed, which is what every builtin taking a coordinate wants. |
std::atomic< uint32_t > & |
printBudget inline |
The remaining print budget, reset by a binding when it compiles. |
void |
resetPrintBudget inline |
Grant a fresh print burst, called from a binding's prepare alongside the compile. |
uint32_t |
mm_ml_random16 inline |
|
uint32_t |
mm_ml_mod inline |
The signed remainder, which is the wrap a cyclic animation needs; zero divisor answers 0. |
uint32_t |
mm_ml_div inline |
The signed quotient, which the / operator lowers to. |
uint32_t |
mm_ml_fdiv inline |
The Q16.16 quotient, which / lowers to when both sides are fixed. |
uint32_t |
mm_ml_beat inline |
A rising sawtooth at a given BPM, full scale, so scaling it sweeps any fixture size. |
uint32_t |
mm_ml_beatsin inline |
|
uint32_t |
mm_ml_noise inline |
The gradient-noise field at a point, whose high byte picks the cell and low byte interpolates. |
uint32_t |
mm_ml_sin inline |
|
uint32_t |
mm_ml_cos inline |
|
uint32_t |
mm_ml_turn inline |
The angle step dividing one revolution into n parts. |
uint32_t |
mm_ml_scale inline |
|
uint32_t |
mm_ml_print inline |
|
void |
addCommonBuiltins inline |
Register the neutral builtins into whatever table asks. |
signedArg¶
inline
A script argument read as signed, which is what every builtin taking a coordinate wants.
printBudget¶
inline
The remaining print budget, reset by a binding when it compiles.
resetPrintBudget¶
inline
Grant a fresh print burst, called from a binding's prepare alongside the compile.
mm_ml_random16¶
inline
mm_ml_mod¶
inline
The signed remainder, which is the wrap a cyclic animation needs; zero divisor answers 0.
mm_ml_div¶
inline
The signed quotient, which the / operator lowers to.
mm_ml_fdiv¶
inline
The Q16.16 quotient, which / lowers to when both sides are fixed.
mm_ml_beat¶
inline
A rising sawtooth at a given BPM, full scale, so scaling it sweeps any fixture size.
mm_ml_beatsin¶
inline
mm_ml_noise¶
inline
The gradient-noise field at a point, whose high byte picks the cell and low byte interpolates.
mm_ml_sin¶
inline
mm_ml_cos¶
inline
mm_ml_turn¶
inline
The angle step dividing one revolution into n parts.
mm_ml_scale¶
inline
mm_ml_print¶
inline
addCommonBuiltins¶
inline
Register the neutral builtins into whatever table asks.
More info¶
Why it left the light header¶
It lived there because that was the only vocabulary there was. When the service table arrived it had to reach into the light header for print and addControl, which is core depending on a domain. That is the wrong direction, and the reason a service script could not call sin while an effect could, for no reason either could explain.
What stays on the light side¶
Whatever genuinely needs a canvas: the pixel writes, the palette and particle helpers, the audio frame, and the per-light coordinates.